Closed joshco closed 10 years ago
Sorry I don't understand: there is a marker on your map.
That's not a real marker. If you look at the JSON near the bottom of the image, you'll see that there are two markers passed to gmaps4rails. Neither show up. The map image renders and the marker icon shows up in the middle of the image, no matter where you pan to. (it's not connected to any location) It isn't paying attention to what is coming in with the JSON marker list.
I just came across the same issue.
This behavior happens when the markers-array is generated using the #to_gmaps4rails
action. eg:
@json = Model.all.to_gmaps4rails
The resulting array has the lon
and lat
value encoded as float, not as string, as provided in the example in the wiki: https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Markers
Once you change this manually to string datatype, the markers are positioned correctly and don't reposition every time the map moves.
Code: (this works fine on google) <%= gmaps("markers" => {"data" => @json, "options" => {"list_container" => "markers_list"}},
Screen shot of map and my marker json http://splitatom.com/gmaps4railsbing.png