0

I am using leaflet.js to show information about points on a map. The idea is that the points are marked with a marker, and the user can click on that marker to open a popup with the relevant information.

Here is how it should work:

enter image description hereenter image description here

This works fine on desktop when clicking the marker, as well as on Android phones.

When I try it on an iOS system, no matter the version (I tried a few different ones) or the browser (I tried Safari, Chrome and the Telegram built-in browser), it doesn't work. The popup shows up for a split-second and disappears again. This is everything that you see if you tap the marker:

enter image description here

What makes this stranger is that it works as intended if you click slightly to the right of the marker. If you click in the area I marked in the picture, the popup shows up as desired:

enter image description here

To clarify, the marker location is at the bottom tip of the icon. Here's the code for the marker:

var future = L.icon({
        iconUrl: '../images/futuremarker.png',
        iconSize: [62, 92],
        iconAnchor: [31, 92],
        popupAnchor: [0, -70]
    })

and the marker + popup-text are set like this:

L.marker([latitude, longitude], {icon: future}).bindPopup(Popup-Text).addTo(mymap);

(Please note the syntax isn't entirely correct in the snippet since I get lat, long and text through Thymeleaf, but this is unrelated)

It has to be somehow related to an iOS-specific behavior, since it works correctly everywhere else. The page it's on is just plain HTML, CSS, and JS for functions and obviously leaflet. There are no JS-frameworks or anything like that used.

  • The issue didn't seem to be exactly the same since my popups DO appear, but the fix suggested in the second answer does solve my problem. Thank you! Should I delete my question for being too similar to the other one? – TiltedBlock May 23 '21 at 15:19
  • There's no need. See https://stackoverflow.com/help/duplicates – IvanSanchez May 24 '21 at 08:40

0 Answers0