From 02e12a856d4c48ff2e3862ab48270b69fa1d381c Mon Sep 17 00:00:00 2001 From: Kobe Mertens Date: Sun, 17 Feb 2019 17:23:31 +0100 Subject: [PATCH] moved the popup it doesnt overlap with marker --- src/js/map.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/js/map.js b/src/js/map.js index 7092b93..b698c44 100644 --- a/src/js/map.js +++ b/src/js/map.js @@ -21,7 +21,10 @@ $(document).ready(function() { function onEachFeature(feature, layer) { if (feature.properties) { - layer.bindPopup(popuptemplate(feature.properties)); + var popup = L.popup({ + offset: new L.point(0, -6) //Offset needed, marker and popup can't overlap + }).setContent(popuptemplate(feature.properties)); + layer.bindPopup(popup); } }