Saturday, July 30, 2016

Angular2 - Fire event on Leaflet-Event

Leave a Comment

I am trying to impement Leaflet with Angular 2 TS for my Ionic 2 app. I want to emit my pinClicked-event when a Leaflet-pin was clicked. How to do this? In Angular1 $scope.$apply was the solution...

private refreshMarkers() {     L.marker([40.731253, -73.996139])       .addTo(this.map)       .on('click', function() { alert('JA'); } );   }    private pinWasClicked() {     this.pinClicked.emit('');   } 

0 Answers

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment