ui-leaflet
ui-leaflet copied to clipboard
error parameter args for event leafletDirectiveMarker.click
From @dienlh on July 27, 2015 17:16
i had 2 marker with 2 different address. when create map with 1 marker the first, event map return modelName =1 , address: marker1. when i remove marker1 and add marker2 on map, event map return modelName =1 , address:marker 1. i don't know why?? with modelName the same but they don't show the time
$scope.$on("leafletDirectiveMarker.click", function(event, args){ //$scope.selectItem(args.model); console.log("modelName"+args.modelName); console.log("Address"+args.model.item.address[0]); });
click marker 1: modelName7 mapsleftlet.js:100 AddressPhố Lý Thường Kiệt, Quận 10, Hồ Chí Minh
remove marker 1 and add marker 2: $scope.markers=[marker2]
when click marker 2: modelName7 mapsleftlet.js:100 Address Phố Lý Thường Kiệt, Quận 10, Hồ Chí Minh
remember:geocode marker1 # marker 2
Copied from original issue: tombatossals/angular-leaflet-directive#870
I am having this same issue right now. It seems the leafletDirectiveMarker event listeners are not updating when $scope.markers is changed.
Hi,
I have the same problem, I change $scope.markers and I have a different model.
Someone with the fix? Thanks!