Problem with map resize, invalidateSize and Marker.openPopup

2,007 views
Skip to first unread message

Trausti Dagsson

unread,
Jul 27, 2014, 7:11:46 PM7/27/14
to leafl...@googlegroups.com
Hello everyone. Im having some trouble:

I'm making an app with a fullscreen map with markers and markerclusters. When the user clicks a marker, data is fected and a panel opens up which covers half of the screen. While doing that I have to resize the map and call map.invalidateSize(), otherwise, when the user clicks a markercluster, the center which the map will zoom to is still on the center of the screen instead of the visible map. However, this causes a problem, if the marker is close to the top when the panels opens, the marker will disappear.
Here is an example with a simplyfied code, try to pan so that the marker is close to the top and then click it, it disappears above the map: http://jsfiddle.net/traustid/fxCqM/2/

Sorry if this is too complex information, its quite hard to describe but, does anyone have a solution for me? To resize the map but, call invalidateSize but still have the marker visible.

Raymond Brady

unread,
Aug 5, 2014, 9:39:01 AM8/5/14
to leafl...@googlegroups.com
Just fiddling around with your code and found if you do not call invalidatesize it appears to be more usable. Take a look at this:

Reply all
Reply to author
Forward
0 new messages