gmaps4rails 2 + rails 4 + ruby 2.0
<script>
handler = Gmaps.build('Google');
handler.buildMap({ provider: {}, internal: {id: 'map'}}, function(){
markers = handler.addMarkers(<%= raw @geo_hash.to_json %>);
});
handler.map.centerOn({ lat: <%= raw @geo_city[0][:lat] %>, lng: <%=raw @geo_city[0][:lng] %> })
handler.getMap().setZoom(7)
</script>
@geo_hash = [{:lat=>16.9916, :lng=>81.7838, :infowindow=>"火车站", :picture=>{:url=>"/assets/web/ blank_red.png ", :width=> 32, :height=>32}, :title=>"abc Temple"} ]
@geo_city = [{:lat=>15.8273, :lng=>78.047, :infowindow=>"公交车站", :picture=>{:picture=>"/assets/web/**blank.png", :width =>32, :height=>32}, :title=>"AS Peta"}]
我想要谷歌地图上的两个不同的标记,但只有一个标记来了?有什么建议吗?