Skip to content
Snippets Groups Projects
Commit 928581e5 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

dev #73084 replace map after popup close

parent 6e236289
Branches
Tags
3 merge requests!2806Master,!2784dev #73084 replace map after popup close,!2783dev #73084 replace map after popup close
Pipeline #4776 passed with stage
in 46 minutes and 47 seconds
- ticket #73084 : Bibliothèques : amélioration du comportement de la carte interactive à la fermeture des popus.
\ No newline at end of file
......@@ -83,13 +83,26 @@
point.lon],
settings
);
marker.bindPopup(point.html);
var marker_popup = L.popup({
className : 'osm-customiz-popup'
})
.setContent(point.html);
marker.bindPopup(marker_popup);
all_markers.push(marker);
});
var bounds = new L.featureGroup(all_markers);
bounds.addTo(map);
map.fitBounds(bounds.getBounds(), {padding: [50, 50]});
var originalPosition = function () {
map.fitBounds(bounds.getBounds(), {padding: [50, 50]});
}
map.on('popupclose', function(event) {
originalPosition();
});
originalPosition();
}
loadMap();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment