How to disable infowindow from registered places from map?

后端 未结 4 1205
不知归路
不知归路 2020-12-20 02:37

Hi am new to google maps. I have used gmaps jquery plugin for displaying map. In that i have my own markers and polylines for some locations,and displaying the infowindow wh

相关标签:
4条回答
  • 2020-12-20 02:43

    The easiest and most efficient way to prevent this behavior is to call the stop() method on a click event attached to the Map instance.

    map.addListener("click", e => e.stop());
    
    0 讨论(0)
  • 2020-12-20 02:49

    There is a close() function for InfoWindows. Just keep track of the last opened window, and call the close function on it when a new window is created.

    This demo(http://www.lootogo.com/googlemapsapi3/markerPlugin.html) has the functionality you're looking for. I found it in the Maps API V3 demo gallery.

    0 讨论(0)
  • 2020-12-20 02:56

    I think the only way to prevent those infowindows from opening is to turn off the POIs using styled maps, something like:

    [
      {
        "featureType": "poi",
        "stylers": [
          { "visibility": "off" }
        ]
      }
    ]
    
    0 讨论(0)
  • 2020-12-20 03:08
    var stylesArray = [
      {
        featureType: '',
        elementType: '',
        stylers: [
          {hue: ''},
          {saturation: ''},
          {lightness: ''},
          // etc...
        ]
      },
      {
        featureType: '',
        // etc...
      }
    ]
    

    you can change its features like hide the feature completely as below

    stylers: [
      { visibility: "off" }
    ]
    

    you can refer link about the poi as below if you are using the version3

    https://developers.google.com/maps/documentation/javascript/styling

    hope this helps :D

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