How do I make an infowindow automatically display as open with Google-Maps-for-Rails

后端 未结 4 1433
情歌与酒
情歌与酒 2021-01-21 23:46

I want to display a map with the infowindow box automatically displayed for the single marker on the page, much like http://code.google.com/apis/maps/documentation/javascript/ex

4条回答
  •  不知归路
    2021-01-22 00:22

    The callback function that worked for me:

    Gmaps.map.callback = function() {
          function openInfoWindow(){
            var m, marker;
            marker = Gmaps.map.markers[2];
            m = marker.serviceObject;
            marker.infowindow.open(Gmaps.map.map, m);
          }
          openInfoWindow();
    }
    

提交回复
热议问题