yagajs / leaflet-ng2

Angular.io integration of Leaflet
https://leaflet-ng2.yagajs.org
ISC License
66 stars 26 forks source link

Trigger .popupopen from outside the map #398

Closed ralph089 closed 6 years ago

ralph089 commented 6 years ago

Hello,

i would like to present users a list of shops, but also corresponding markers in a map. Whenever a user clicks on a shop in the list, the .popupopen() from the marker in the map should be triggered.

I'm not sure, how to implement it properly with this plugin. In Leaflet.js i would add a Marker reference in the shop-Array and trigger something like shop.marker.popupopen(). Is there a better way here?

Kind regards Ralph

ralph089 commented 6 years ago

Ok, found it out myself.

Very easy: Just use the opened-Accessor from the PopupDirective.