Disable point-of-interest information window using Google Maps API v3

前端 未结 7 799
忘掉有多难
忘掉有多难 2020-12-08 04:43

I have a custom map with an information bubble and custom markers. When I zoom into points of interest such as parks and universities appear and when I click an information

7条回答
  •  感情败类
    2020-12-08 04:55

    Simply style the map to not show Points of Interest. This is simple and does not breach Google's terms of service.

    eg

    mapOpts = {
      styles: [
        {
          featureType: "poi",
          stylers: [
             visibility: "off"
          ]
        }
      ]
    };
    
    $("#my-map").gmap(mapOpts).on("init", function(evt, map){
      // do stuff with the initialised map
    });
    

提交回复
热议问题