Merge pull request #27 from ZeusWPI/hoverpopup

moved the popup it doesnt overlap with marker
This commit is contained in:
Wout Schellaert 2019-02-18 08:45:20 +01:00 committed by GitHub
commit 82b84404f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,7 +21,10 @@ $(document).ready(function() {
function onEachFeature(feature, layer) { function onEachFeature(feature, layer) {
if (feature.properties) { 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);
} }
} }