目前我在我的 android 应用程序中使用 google maps v2,我遇到了 map 配色方案自定义的问题。我在这里看到它可以在 web 中使用 javascript https://developers.google.com/maps/customize和 http://jsfiddle.net/SQvej/ js中的一些例子
var settingsItemsMap = {
zoom: 12,
center: new google.maps.LatLng(40.768516981, -73.96927308),
zoomControlOptions: {
style: google.maps.ZoomControlStyle.LARGE
},
styles:[
{ featureType: "water", stylers: [ { hue: "#F4B741"} ] },
{ featureType: "road", stylers: [ { hue: "#ff0000" } ] }
],
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById('map_canvas'), settingsItemsMap );
但没有找到安卓 map 的解决方案,有什么建议吗?
最佳答案
从这里创建样式
https://mapstyle.withgoogle.com/
然后将该 json 保存在 RAW 文件夹下,然后像这样在您的代码中调用该样式
MapStyleOptions style = MapStyleOptions.loadRawResourceStyle(getActivity(), R.raw.my_map_style);
googleMap.setMapStyle(style);
关于android - 在 android 中自定义 google maps V2 的配色方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16520121/