Google Maps Color B& W.

时间:2014-02-05 19:09:01

标签: maps

我可以在iframe页面帖子的iframe中使用此代码来制作我的地图黑白吗?我想要一张如下地图:http://wegrowcherries.com/about/

[ { 
"featureType": "water", 
"stylers": [ { 
"color": "#ffffff" } 
] },

{ 
"featureType": "landscape", 
"elementType": "geometry", 
"stylers": [ { 
"color": "#000000" } 
 ] },

{ 
"featureType": "administrative", 
"elementType": "labels.text.fill", 
"stylers": [ { 
"color": "#ffffff" } 
] },

{ 
"featureType": "administrative", 
"elementType": "labels.text.stroke", 
"stylers": [ { 
"visibility": "simplified" } 
] },

{ 
"featureType": "road", 
"elementType": "geometry", 
"stylers": [ { 
"visibility": "off" } 
] },

{ 
"featureType": "poi", 
"elementType": "geometry.fill", 
"stylers": [ { 
"color": "#000000" }, { 
"visibility": "simplified" } 
]},

{ 
"featureType": "administrative.province", 
"stylers": [ { 
"visibility": "off" } 
]},

{ 
"featureType": "road", 
"elementType": "geometry.stroke", 
"stylers": [ { 
"color": "#ffffff" }, { 
"weight": 2 }, { 
"visibility": "off" } 
]},

{ 
"featureType": "administrative.locality", 
"stylers": [ { "visibility": "off" } 
]},

{ 
"featureType": "road", 
"elementType": "labels", 
"stylers": [ { 
"visibility": "off" } 
] },

{ 
"featureType": "poi", 
"stylers": [ { 
"visibility": "off" } 
] },

{ 
"featureType": "transit", 
"stylers": [ { 
"visibility": "off" } 
]},

{ 
"featureType": "administrative.neighborhood", 
"stylers": [ { 
"visibility": "off" } 
] }]

在wordpress博客中的iframe代码。我可以在这里使用style =“”标签粘贴上面的内容吗?

<iframe style="border: 0; width: 100%" src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d4046390.158269976!2d114.49410816221383!3d-7.941674640018978!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x2dd141d3e8100fa1%3A0x24910fb14b24e690!2sBali%2C+Indonesia!5e0!3m2!1sen!2sus!4v1390525274478" height="250" width="900" frameborder="0"></iframe>

2 个答案:

答案 0 :(得分:0)

正确的(和legal)方式是使用他们的Styled Maps Api

看起来上面的代码正在使用该API。如Styled Maps API页面中所述,您必须创建StyledMapType(如上面的代码)并将其传递给javascript中的构造函数。

创建StyledMapType

  

您可以通过创建一个来创建要应用样式的新地图类型   StyledMapType并将要素和样式器信息传递给   构造函数。此方法不会影响默认样式   地图类型。

答案 1 :(得分:0)

样式化地图允许您自定义或更改标准Google基本地图的样式,更改道路,公园和建筑区等元素的用户界面。

<强> https://coderwall.com/p/vfbing/passing-objects-between-activities-in-android