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

后端 未结 4 1431
情歌与酒
情歌与酒 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:28

    I am trying to accomplish the same thing, except to just open the first marker out of a list of markers. So the code is almost the same. I've done what you suggested but it's not showing the info window.

    <%= gmaps4rails(@json) %>
    
    <% content_for :scripts do %>
      
    <% end %>
    

    The map display find but the info window doesn't pop up upon initialisation as expected! Any ideas?

    Will

提交回复
热议问题