In my Leaflet Application, on some event, I want to zoom to a particular marker, and then show it's popup. I have certain other custom components on top of the map, and the Popup that appears, is hidden behind these components.
This could be resolved, if I could zoom/pan to the map, such that the given point (i.e. location of marker) is not in the center, but slightly lower.
How do I do this?
Best Answer
This has been discussed in this Issue: https://github.com/Leaflet/Leaflet/issues/859
Based on the code given there, I wrote the following two functions:
Now these functions can be called as follows: