谷歌地图api v3没有标签? [英] google maps api v3 no labels?

查看:117
本文介绍了谷歌地图api v3没有标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使用API​​ v3从Google地图中关闭所有标签(街道名称,州名称,国家名称等)?或者这些内容直接构建到地图图像中?

是的,您可以使用风格化地图功能。



具体来说,这种风格会禁用所有标签:

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

您可以通过以下方式将它应用于当前地图:

  var customStyled = []; //(上面显示的数组)
map.set('styles',customStyled);


Is there a way to turn off all labels (street names, state names, country names etc.) from google maps using the API v3? Or are these built directly into the map images?

解决方案

Yes, you can do this using the Styled Maps feature of the Google Maps API v3.

Specifically, this style will disable all labels:

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

You can apply it to a current map by using:

var customStyled = [];//(array shown above)
map.set('styles',customStyled);

这篇关于谷歌地图api v3没有标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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