自谷歌地图的造型为Android [英] Custom Google Maps styling for Android

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

问题描述

这一个是pretty的摆在那里,但我找不到任何职位的任何地方解决这个问题。对于谷歌地图API第3版,您可以添加自定义样式的地图元素:

This one is pretty out there, but I can't find any posts addressing it anywhere. For Google Maps API v3, you can add custom styling to the map elements:

var pinkParksStyles = [
{
 featureType: "all",
 stylers: [
  { saturation: -80 }
 ]
},
{
 featureType: "poi.park",
 stylers: [
  { hue: "#ff0023" },
  { saturation: 40 }
 ]
}
];

map.setOptions({styles: pinkParksStyles});

有谁知道有什么方法可以自定义样式应用到一个Android MapView类?谢谢!

Does anyone know of any way to apply custom styling to an Android MapView?? Thanks!!!

推荐答案

我最初的想法是将继承图形窗口和覆盖的抽奖活动。在使用 Col​​orMatrixColorFilter 的组合的OnDraw事件更换颜色的画布和 AvoidXfermode 。 Thees应该有所帮助:

My initial thoughts would be to subclass MapView and override the on draw event. Have the onDraw event replace the colors in the canvas using a combination of ColorMatrixColorFilter and AvoidXfermode. Thees should help as well:

<一个href="http://stackoverflow.com/questions/2071371/avoidxfermode-to-replace-a-color-on-canvas">avoidxfermode更换颜色在画布上

如何更改Android的一个可绘制的颜色?

这篇关于自谷歌地图的造型为Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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