correction map loaded trigger to display map icons

This commit is contained in:
Valentin 2024-10-01 11:40:10 +02:00
parent 1d7dfe72c2
commit bd07a046de
1 changed files with 38 additions and 36 deletions

View File

@ -29,7 +29,7 @@ import router from './router/router';
// } (Drupal));
(function (Drupal, drupalSettings) {
(function ($, Drupal, drupalSettings) {
const CaravaneTheme = function () {
const _is_front = drupalSettings.path.isFront
console.log('drupalSettings', drupalSettings)
@ -146,9 +146,9 @@ import router from './router/router';
}
function setupEtapeMapPopup(store) {
jQuery(document).bind('leaflet.map', function(event, map, lMap) {
//setTimeout(() => {
Drupal.behaviors.customLeafletInteraction = {
attach: function(context, settings) {
$(context).on('leafletMapInit', function (e, settings, map, mapid, markers) {
const icons = document.querySelectorAll('.leaflet-map-divicon');
for (let icon of icons) {
const colorContainer = icon.querySelector('.couleur');
@ -182,12 +182,14 @@ import router from './router/router';
icon.style.transform = icon.style.transform.split(' ')[0] + icon.style.transform.split(' ')[1] + icon.style.transform.split(' ')[2];
})
}
// }, 500);
});
}
}
}
init()
} // end CaravaneTheme()
CaravaneTheme()
})(Drupal, drupalSettings)
})(jQuery, Drupal, drupalSettings)