Android的自定义标记图标 [英] Android Custom marker icon

查看:177
本文介绍了Android的自定义标记图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的应用程序与谷歌地图,所以我想定义自定义标记每个自定义的地方,例如(气站 - 酒店 - 医院..)!我有一个覆盖类许多地方的经度和纬度,我想只是如何给自定义图标!

I'm working on application with Google maps so i want to define a custom marker for each custom place, For example (gas station- Hotel- Hospital.. ) ! i have a overlays class with the latitude and longitude of many places and i want just how to give a custom icon!

推荐答案

随着新的地图API的设置图标的标记与以下code完成的:

With the new Maps Api Setting the Icon for a Marker is done with the following Code:

MarkerOptions markerOptions = new MarkerOptions().icon(BitmapDescriptorFactory.fromResource(R.drawable.icon_location));

创建了标记后,该图标不能被改变。要更改图标删除标记,以崭新的形象重新进行添加的。

The icon can not be changed after a Marker was created. To change an icon remove the marker and readd it with a new image.

这篇关于Android的自定义标记图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆