Search code examples
javascriptgoogle-maps-api-3

google maps api v3 no labels?


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?


Solution

  • 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);