Skip to content

Commit

Permalink
fix clicking an item while zoomed out
Browse files Browse the repository at this point in the history
  • Loading branch information
Mart authored and erictheise committed Dec 31, 2023
1 parent 4c4d144 commit 69bdb28
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js/overpass.js
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,9 @@ var overpass = new (function () {
// node-ish features (circles, markers, icons, placeholders)
if (typeof e.target.getLatLng == "function")
latlng = e.target.getLatLng();
// if there is a placeholder on a line, polygon or multipolygon
// then get the center instead of the position of the click
else if(e.target.placeholder) latlng = e.target.getBounds().getCenter();
else latlng = e.latlng; // all other (lines, polygons, multipolygons)
var p = L.popup({maxHeight: 600}, this)
.setLatLng(latlng)
Expand Down

0 comments on commit 69bdb28

Please sign in to comment.