- Issue created by @monkk
- Status changed to Fixed
10 months ago 10:23pm 16 August 2024 - 🇮🇹Italy itamair
Take inspiration from this comment of mine, of some time ago, that is still valid:
https://www.drupal.org/project/leaflet/issues/3212148#comment-14092596 →Note that leaflet.drupal.js triggers both 'leafletMapInit' and 'leaflet.map' events once the map is Initialised, through which you are able to get and interact with each leaflet map on the page, and their Markers.
Ref: https://git.drupalcode.org/project/leaflet/-/blob/10.2.x/js/leaflet.drup...
I already took some "inspiration" from you external interactions. Big thanks for making it public.
Ah, I should have scratched my boys harder... If anyone is looking, here is my solution.// React on leaflet.map event. $(document).on('leaflet.map', function (e, settings, lMap, mapid) { let map = lMap; map.on('popupclose', function(ev) { document.querySelector('.leaflet-bar-part.leaflet-bar-part-single').click(); }); }
Automatically closed - issue fixed for 2 weeks with no activity.