Ticket #1797 (closed bug: fixed)
Google layers won't get resized properly on map.updateSize()
| Reported by: | gregers | Owned by: | tschaub |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.9 Release |
| Component: | Layer.Google | Version: | 2.7 |
| Keywords: | Cc: | openlayers.arealjerk@… | |
| State: | Complete |
Description
We had the same problems as described in ticket #830 before 2.7, but fixed them on our own. The changes in 2.7 broke our fix. http://trac.openlayers.org/ticket/830
Steps to cause the bug: - Start with small map. Fixed size. - Increase map size (more than one tile width). - Run map.updateSize(). - Switch to another google layer - this layer only updates the tiles within the maps original size
After many hours digging through obfuscated Google Maps code, I found out that it requires a coordinate before calling checkResize(). If the layer div and mapObject.getSize() are equal, the resizing is skipped. So if checkResize() is called to early, mapObject.getSize() will get updated to the div size, but the rest is not executed.
The patch overrides EventPane.moveTo and calls checkResize() after the layer has a position.
Reproduced the error in a modified example.

