Closed scottbaggett closed 12 years ago
Thanks for this report, I'm rewriting the js part of the gem and I corrected that.
Fantastic!
Oops, I'm not done yet, I'm working on the objectify_js branch
No problem. I was able to work around it. Looking forward to not having to work around it next time though. Thanks again.
Hello,
I'm currently having this exact same issue with gmaps4rails (1.5.6).
Are you still working on the issue or is it supposed to be fixed ?
scottbaggett > How did you get to work around the issue ?
For anyone still on 1.5.6 who gets this problem, I got around it with the rather ugly:
markers[0].lat = 50;
Gmaps.map.clearMarkers();
delete markers[0]["serviceObject"];
Gmaps.map.addMarkers([markers[0]]);
Gmaps.map.create_markers();
I'm currently working on a small app that uses replaceMarkers to alternate between a few sets of markers. As visitors click between sections I need to update my map with different sets of markers. The problem is that on the first click the markers are replaced with new data properly, but when I try to replace them again with markers that were previously on the map all the markers are removed from the map and I get no errors. I can see that the markers exist within the markers array.
Am I doing something wrong? Should I not be trying to replace markers on markers that were already in the array? It seems like replacemarkers should accept any array of markers even ones that have been previously shown on the map.