开发者

google maps api v3 no labels?

开发者 https://www.devze.com 2023-01-04 19:33 出处:网络
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开发者_Go百科 map images?Yes, you can do th

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开发者_Go百科 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);


Yes, you can change labels visibility property directly in css code using Styled Maps feature

or directly using the Styled Maps Wizard website

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号