Ticket #2758 (closed task: fixed)
Google layer improvements for maps with allOverlays set to true
| Reported by: | ahocevar | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.10 Release |
| Component: | Layer.Google.v3 | Version: | 2.9 |
| Keywords: | Cc: | ||
| State: | Complete |
Description
There are two issues with Google layers used with Map.allOverlays set to true:
- Visibility cannot be set by moveTo, which is e.g. required for proper handling of layer.inRange. The reason is that setGMapVisibility is called by setVisibility instead of display. But to avoid unnecessary dom shuffling, the display method should not call setGMapVisibility when we are dragging a layer.
- When more than one Google layers are visible, setGMapVisibility only sets the visibility of the layer it was called on. But with the shared container approach, setting visibility for non-baselayers has to involve looking at other visible layers. To address this, setGMapVisibility could set the GMap type to the topmost visible Google layer, instead of just turning visibility on or off for the layer it is called with.
With these issues fixed, maps with Google overlays should work reliable, ensuring the correct visibility according to the layer stack and the inRange status of all Google layers.
The attached patch addresses both issues as described, and adds an example showing the improvements in action.
All tests still pass. Thanks for any review.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

