I have some markers bind with popup. I need to give offset for the popup to display on the top of the markers.Now the popup hides the marker. Below is the snapshot of marker and its popup content.
Below is my code and this is not working. Stillth popup hides the marker. :
var popup = new L.Popup({ offset:[0,6]}).setContent(contentString);
markerdata.bindPopup(popup).addTo(m);
could any one help me on this?
Best Answer
I've found it more effective to declare the offset when binding the popup (i.e. making it relative to the marker's position):
Also '6' is a small offset, which might be enough (depending on the size of your marker), but maybe try a larger one to move the popup enough to make the marker clickable/draggable etc (otherwise the popup gets in the way)