google maps api v3 no labels?

后端 未结 2 712
醉梦人生
醉梦人生 2020-12-10 03:54

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?

相关标签:
2条回答
  • 2020-12-10 04:29

    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);
    
    0 讨论(0)
  • 2020-12-10 04:31

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

    or directly using the Styled Maps Wizard website

    0 讨论(0)
提交回复
热议问题