ui-leaflet icon indicating copy to clipboard operation
ui-leaflet copied to clipboard

error parameter args for event leafletDirectiveMarker.click

Open nmccready opened this issue 9 years ago • 2 comments

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

nmccready avatar Nov 02 '15 14:11 nmccready

I am having this same issue right now. It seems the leafletDirectiveMarker event listeners are not updating when $scope.markers is changed.

MattSidor avatar Jan 20 '16 22:01 MattSidor

Hi,

I have the same problem, I change $scope.markers and I have a different model.

Someone with the fix? Thanks!

pabloalcaraz avatar Jul 09 '17 13:07 pabloalcaraz