Reputation: 2383
I had to change the default size of the marker popup to accommodate the data I wanted to put in it. I changed some map settings so it always bounces back to a max bound when the user drags it out of view. The issue I have is that for markers close to the edge, when its popup opens, it is not fully visible, as in it hides behind the edges of the container for the map.
Q: What would be the fix to this? Can I get the popup to show the full content?
Upvotes: 3
Views: 3429
Reputation: 3442
In this Leaflet tutorial they have an option to offset the popup anchor. You could do an if statement that if true would offset the popup anchor by enough to display properly on the screen.
Pseudo code:
if (latlng of point clicked < rightBounds of map) {
popupOptions = {
offset: (-popupwidth,0)
}
} ...
You could also try experimenting with the various popup options in the API.
Upvotes: 0