How fit map to markers with open pop up ?

78 views
Skip to first unread message

baptiste Metge

unread,
Mar 20, 2015, 10:40:06 AM3/20/15
to leafl...@googlegroups.com
Dear all,

I am trying to do something similar as what is done by the fitBounds
function when you want your map to best fit a set of markers.
My problem when I am doing it with a set of markers with fix open popup.
Then some popup get cuts out as in the picture below :



I tried to pass either markers latlng or popup latlng to fitBounds function
but the problem stay the same.

Any help would be reallly appreciated.

Thank you in advance.

Best regards,

Baptiste.

baptiste Metge

unread,
Mar 23, 2015, 4:47:18 AM3/23/15
to leafl...@googlegroups.com

Here comes a screen shot illustrating the problem.

Thanks.

Baptiste.

Le vendredi 20 mars 2015 15:40:06 UTC+1, baptiste Metge a écrit :
Dear all,

I am trying to do something similar as what is done by the fitBounds function when you want your map to best fit a set of markers.
My problem when I am doing it with a set of markers with fix open popup.
Then some popup get cuts out as in the picture below :

...
$5536388AEC21DC52.bmp

baptiste Metge

unread,
Mar 30, 2015, 11:58:01 AM3/30/15
to leafl...@googlegroups.com
In case someone is facing the same problem :

I found a way to do so by using the padding option of the fitbound function.
http://leafletjs.com/reference.html#map-fitboundsoptions

Cheers


Le vendredi 20 mars 2015 15:40:06 UTC+1, baptiste Metge a écrit :
Dear all,

I am trying to do something similar as what is done by the fitBounds function when you want your map to best fit a set of markers.
My problem when I am doing it with a set of markers with fix open popup.
Then some popup get cuts out as in the picture below :

...
Reply all
Reply to author
Forward
0 new messages