Change in ng-repeat model should delete existing markers
Instead it adds more markers to the map without deleting existing ones.
I'd love to try to submit a patch for you but I can't work out where the detection of a changed model takes place
Duplicate to #75
I fixed this issue by adding this to marker.js on line 80:
/**
* set event to clean up removed marker
*/
element.bind('$destroy', function() {
var markers = marker.map.markers;
for (var name in markers) {
if (markers[name] == marker) {
delete markers[name];
}
}
marker.setMap(null);
});
I try to create a pull request at the weekend.
wonderful
Please make sure all gulp test is passing. :)
On Sep 11, 2014, at 9:18 AM, Thomas Chille [email protected] wrote:
I fixed this issue by adding this to marker.js on line 80:
/** * set event to clean up removed marker */ element.bind('$destroy', function() { var markers = marker.map.markers; for (var name in markers) { if (markers[name] == marker) { delete markers[name]; } } marker.setMap(null); });I try to create a pull request at the weekend.
— Reply to this email directly or view it on GitHub.
Solved. example here, https://rawgit.com/allenhwkim/angularjs-google-maps/master/build/dynamic_markers_with_ng_repeat.html