When I display a map using Gmaps4rails through a jQuery call ( $('#id').load(/xyz) ), the map does not appear (an empty area is displayed instead).
$('#id').load(/xyz)
This page: https://groups.google.com/group/Google-Maps-API/browse_thread/thread/02710b15f3d76ec2/67413d33e7fd0e74?hl=en suggests calling map.reloadMap after loading the page, however I do not know the identifier that should be called . The gmaps4rails documentation only mentions the div identifier containing the map, and reading the source did not help.
map.reloadMap
How can this be solved?
Fyi, I updated the source code. I especially commented on the js file.
The map itself is saved in the following js variable:
Gmaps4Rails.map
But I'm glad that you found a solution to your problem;)
Solution: load a blank map into the main frame of the page and dynamically update it using Gmaps4Rails.replace_markers(json) .
Gmaps4Rails.replace_markers(json)