如何更改谷歌地图默认的当前位置标记颜色 [英] How to change google map default Current Location Marker color

查看:122
本文介绍了如何更改谷歌地图默认的当前位置标记颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将默认的当前位置标记颜色蓝色更改为其他.任何人都可以帮助我做到这一点.

I want to change the default current location marker color from blue to other. Any body help me out how to do that.

下面是我要更改的图标颜色:

Below is the icon color which I want to change:

推荐答案

您可以通过将自己的标记添加到地图来使用它们.

You can use your own markers by adding them to the map.

MarkerOptions markerOptions = new MarkerOptions();
markerOptions.position(currentLocationMarker.getPosition());
markerOptions.title(getString(R.string.start));
markerOptions.icon(BitmapDescriptorFactory.fromBitmap(mapPin));
originMarker = map.addMarker(markerOptions);

此外,您可以使用地图样式JSON文件更改地图的主题.

Additionally you can change the theme of the map using map style JSON files.

googleMap.setMapStyle(MapStyleOptions.loadRawResourceStyle(getActivity(), R.raw.map_night_style));

您可以在以下链接中使用Google轻松创建自己的样式:
Google风格.

You can easily create you own style with google at the following link:
Style with google.

这是有关自定义地图的完整文档:
文档

And here is the full documentation on customizing your map:
Documentation

这篇关于如何更改谷歌地图默认的当前位置标记颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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