Afficher un message en cas de clic sur le vector tile

This commit is contained in:
leosw committed 2026-10-20 17:59:03 +02:00
1 parent f67158cf63
commit 6db6090f66
2 files changed
+48

No files matched your search

+29
View File
@@ -128,6 +128,35 @@ $(document).ready(function() {
}
);
var mapZoomHintTimer = null;
function showMapZoomHint() {
if ($('#map-zoom-hint').length === 0) {
$('#mapid').append('<div id="map-zoom-hint">Zoomer pour pouvoir cliquer sur la carte</div>');
}
$('#map-zoom-hint')
.stop(true, true)
.fadeIn(100)
.delay(1500)
.fadeOut(100);
}
mymap.on('click', function(e) {
if (mymap.getZoom() < 10) {
if (mapZoomHintTimer) {
clearTimeout(mapZoomHintTimer);
mapZoomHintTimer = null;
return;
}
mapZoomHintTimer = setTimeout(function() {
showMapZoomHint();
mapZoomHintTimer = null;
}, 300);
}
});
// ---------------------------------------------------------
// Contrôles
// ---------------------------------------------------------