Ticket #2730 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

Google v3 layer is displayed even if not visible

Reported by: tschaub Owned by:
Priority: minor Milestone: 2.10 Release
Component: Layer.Google.v3 Version: 2.9
Keywords: Cc:
State: Complete

Description

If you create a map with a Google v3 layer that is not initially visible, it is still visible. Additional trouble arises with allOverlays true.

Attachments

2730.patch Download (4.9 KB) - added by tschaub 3 years ago.
make Google layer invisible

Change History

Changed 3 years ago by tschaub

make Google layer invisible

Changed 3 years ago by tschaub

  • owner tschaub deleted
  • state set to Review
  • component changed from Layer.Google to OpenLayers.Layer.Google.v3

This patch has two parts.

The first part adds a call to setGMapVisibility in loadMapObject (Andreas' original patch had this, but it got lost in my reworking).

The second parts moves the map object container off screen instead of setting display to none. This is a trick used elsewhere to allow for element size computation. The Google layer is incorrectly centered if display is set to none when it is not the base layer.

With this patch, the examples work and tests pass in FF 3 and IE 6. Without the lib changes, the newly added example and test demonstrate the problems.

Changed 3 years ago by ahocevar

  • state changed from Review to Commit

Looks good! I totally agree with the negative offset approach. I'd only not be shy and make the offset -9999px instead of just -999px - better safe than sorry. Please commit.

Changed 3 years ago by tschaub

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

(In [10480]) Making it so the Google layer is not visible if used as an overlay with visibility false. Container is offset to allow proper calculation of size. r=ahocevar (closes #2730)

Note: See TracTickets for help on using tickets.