Since the last 8.x-1.5 version, Leaflet module implement a better indexing pattern to much more easier the interaction among each Leaflet Map & related Features/Markers with external dom element and events on them.

In particular this enhancement has been implemented trough this issue: https://www.drupal.org/project/leaflet/issues/3046904

More technically it is possibile / necessary to use the 'leafletMapInit' (or the same 'leaflet.map') event, defined here:
https://git.drupalcode.org/project/leaflet/-/blob/10.2.x/js/leaflet.drup...
and available once the Leaflet Map is loaded, to interact with the Leaflet Map itself (data.lMap) and its markers (data.markers) adding your code (and new Leaflet Popup plugin or whatever else) the way you prefer ...

Live Demo

Click on the following link to assess a live demo of this functionalities and related technical notes:
https://www.geodemocracy.com/drupal_geofield_stack_demo/web/geoplaces-ma...
Hint: Hover on each Left Sidebar Block Element to focus correspondent Map Location.

Note: Inspect the leaflet_map_interaction.js file to analize the js code interacting with the Leaflet map and its map markers

Comments

itamair created an issue. See original summary.

itamair’s picture

Issue summary: View changes
itamair’s picture

Issue summary: View changes
itamair’s picture

Issue summary: View changes
orkut murat yılmaz’s picture

It looks beautiful on live demo and if I can find a chance to test it locally, I'll update this issue. :)