简体   繁体   English

如何从谷歌地图上删除所有

[英]How to remove all from google map

I need google map to have only street names. 我需要谷歌地图只有街道名称。 I wan't to remove things like marked buss stations, hospitals etc. 我不会删除标有标记的汽车站,医院等东西。
What command can I use to remove this things? 我可以使用什么命令来删除这些东西?

You can style the base map as described here: 您可以按照以下说明设置基本地图的样式:

http://code.google.com/apis/maps/documentation/javascript/styling.html http://code.google.com/apis/maps/documentation/javascript/styling.html

For example, to hide everything but roads: 例如,隐藏道路以外的所有东西:

var styleArray = [
  {
    featureType: "all",
    stylers: [
      { visibility: "off" }
    ]
  },
  {
    featureType: "road",
    stylers: [
      { visibility: "on" }
    ]
  }
];

map.setOptions({styles: styleArray});

The full list of features that can be styled is here: http://code.google.com/apis/maps/documentation/javascript/reference.html#MapTypeStyleFeatureType 可以设置样式的功能的完整列表位于: http : //code.google.com/apis/maps/documentation/javascript/reference.html#MapTypeStyleFeatureType

You may want to turn parks back on, for example. 例如,您可能想重新打开parks

You can used the Styled Maps in v3 of the Google Maps API to remove items on the map you don't want. 您可以使用Google Maps API第3版中的样式化地图来删除不需要的地图项。

Try it out here on the Styled Maps Wizard 在样式地图向导中尝试一下

http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html

Actually you only can use 4 types of maps , Satellite, Hybrid, Terrain and Roadmap. 实际上,您只能使用4种类型的地图 ,卫星图,混合图,地形图和路线图。 I recommend you to use the roapmap, it is the simplest map it has the street names and by default it doesn't has anything else, like the transit overlay. 我建议您使用roapmap,这是最简单的地图,它具有街道名称,默认情况下它没有其他内容,例如公交叠加层。

In other words you can't remove just some items from the maps, you only can add new layers of your own data. 换句话说,您不能仅从地图中删除某些项目,而只能添加自己的数据的新图层。

UPDATE: 更新:

Look at @Mike Jeffrey answer 看看@Mike Jeffrey的答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM