Only pan to markers with popups on second click

This commit is contained in:
James Lyne 2021-12-07 20:42:24 +00:00
parent 935cba1c0f
commit bffcea1642

View File

@ -26,7 +26,9 @@ export const createMarker = (options: LiveAtlasMarker, converter: Function): Mar
const marker = new GenericMarker(converter(options.location), options);
marker.on('click', (e: LeafletMouseEvent) => {
e.target._map.panTo(e.target.getLatLng());
if(!e.target.getPopup() || e.target.isPopupOpen()) {
e.target._map.panTo(e.target.getLatLng());
}
});
if(options.popupContent) {