Positioning a popup bound to a marker

22 views
Skip to first unread message

Jeff Maynard

unread,
Nov 30, 2017, 12:16:47 PM11/30/17
to Leaflet
I have a number of markers each with a popup bound to them - using .bindPopup(content...); - some popups move the map so that they are in view whilst others remain partially hidden (these are the markers near the edges of the displayed map). I'd like some help to add code that will position each popup in the middle of the view (map does not need to move).
Suggestions welcome...
thanks  

Jeff Maynard

unread,
Dec 4, 2017, 5:19:12 AM12/4/17
to Leaflet
Having scoured the Internet there seems to be no way of doing this (a couple of plugins come close but not close enough).
in the end, I solved the problem another way:
the problem was that some popups from markers near the top of the map were scrolling partly out of view and were difficult to drag back to read; the cause was that the map was being scrolled so that its top was at the top of the screen and this dragged the popup out of view.
Solved by adding map coverage at the top... 
Reply all
Reply to author
Forward
0 new messages