I am trying to add markers to a google map created after an ajax call. I have added the js files directly to my page as noted in other SO posts. My code after the ajax request is as follows
markers = [{lat: '43.1777', lng: '-87.9944'}];
Gmaps.map = new Gmaps4RailsGoogle;
Gmaps.map.markers = markers
Gmaps.map.createServiceMarkersFromMarkers()
Gmaps.map.initialize()
Gmaps.loadMaps()
I understand you have a map on your page and you want to update it.
In this case, simply use:
It’s described here.