Google Maps, open info window after click on a link

后端 未结 3 531
伪装坚强ぢ
伪装坚强ぢ 2020-12-01 03:26

i have this code to display a google map:




        
3条回答
  •  攒了一身酷
    2020-12-01 03:39

    As in my example.

    1. add a global array to save references to the google.maps.Marker objects:

      var gmarkers = [];
      
    2. push the markers onto that array as you create them

      gmarkers.push(marker);
      
    3. trigger the "click" event on the desired marker:

      Open Info Window
      

    jsfiddle

提交回复
热议问题