Ticket #2758 (closed task: fixed)

Opened 3 years ago

Last modified 3 years ago

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

openlayers-2758.patch Download (7.4 KB) - added by ahocevar 3 years ago.

Change History

Changed 3 years ago by ahocevar

Changed 3 years ago by ahocevar

  • state set to Review

Changed 3 years ago by tschaub

  • state changed from Review to Commit

I agree this addresses the inRange issue. Things look good with the example and the tests still pass. Thanks for the work on this. Please commit.

Changed 3 years ago by ahocevar

  • status changed from new to closed
  • state changed from Commit to Complete
  • resolution set to fixed

(In [10550]) Google layer improvements for maps with allOverlays set to true. r=tschaub (closes #2758)

Note: See TracTickets for help on using tickets.