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

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

问题描述

有没有办法使用 API v3 从谷歌地图中关闭所有标签(街道名称、州名、国家名称等)?或者这些是直接内置到地图图像中的吗?

解决方案

是的,您可以使用 Google Maps API v3 的样式化地图功能.

具体来说,此样式将禁用所有标签:

<预><代码>[{特征类型:全部",元素类型:标签",造型师:[{可见性:关闭"}]}]

您可以使用以下方法将其应用到当前地图:

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天全站免登陆