hide local listings from google maps api

前端 未结 1 805
渐次进展
渐次进展 2020-12-01 07:39

When using google maps api to display something google has started adding local restaurants/hotels into the map. How can I hide them from appearing. I checked the same locat

相关标签:
1条回答
  • 2020-12-01 07:45

    you can set them invisible by setting the map style properly. See

    http://code.google.com/apis/maps/documentation/javascript/styling.html

    and

    http://code.google.com/intl/pl/apis/maps/documentation/javascript/reference.html#MapTypeStyleFeatureType

    sth like that should do the trick (though not tested):

    var noPoi = [
    {
        featureType: "poi",
        stylers: [
          { visibility: "off" }
        ]   
      }
    ];
    
    map.setOptions({styles: noPoi});
    
    0 讨论(0)
提交回复
热议问题