From 25d12420b26cb0f9e84983705046932a93fb7af4 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Fri, 26 Jul 2024 14:34:08 +0200 Subject: [PATCH] wip: fix popup position for markers Not sure what changed during the refactor, but now all popups where opening at click position (plus the popupAnchor for markers). --- umap/static/umap/js/modules/rendering/ui.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/umap/static/umap/js/modules/rendering/ui.js b/umap/static/umap/js/modules/rendering/ui.js index 63043cf3..c4f913c3 100644 --- a/umap/static/umap/js/modules/rendering/ui.js +++ b/umap/static/umap/js/modules/rendering/ui.js @@ -220,6 +220,11 @@ export const LeafletMarker = Marker.extend({ resetHighlight: function () { DomUtil.removeClass(this.options.icon.elements.main, 'umap-icon-active') }, + + openPopup: function () { + // Always open on marker position (vs click position for paths) + this.parentClass.prototype.openPopup.apply(this, this.getCenter()) + }, }) const PathMixin = {