Ticket #2055 (closed bug: duplicate)

Opened 4 years ago

Last modified 4 years ago

Vector features and popups misaligned after resizing & switching of google layers

Reported by: vdeparday Owned by: euzuro
Priority: minor Milestone: 2.9 Release
Component: Layer.Google Version: 2.8 RC1
Keywords: Cc:
State: Complete

Description

This ticket is related to the ticket #1797. The patch attached to the ticket #1797 fixes the fact that when switching google layers after resizing the map, the layer only updates the tiles within the maps original size. Now, all the tiles are correctly updated.

However,when having a vector layer on top of the google layer, there are still some issues. My experience is: In firefox (I haven't tried IE) when I switch from one google layer to another, the vector layer is offset until the next map move. Also, this only happens the very first time switching to a new google layer. If you switch to this layer, switch to another one and then back on this one. It works fine.

Another user has a similar issue with the popups: http://openlayers.org/pipermail/users/2009-April/011420.html

Attachments

example_offset.html Download (2.6 KB) - added by vdeparday 4 years ago.
Bug example with the proj definition

Change History

Changed 4 years ago by ahocevar

  • owner set to euzuro
  • state set to Awaiting User Feedback
  • component changed from general to Layer.Google

vdeparday, can you provide an example that shows this behavior? I just tried to reproduce it in the spherical-mercator example, and my vector layer was not offset after switching to a different google layer.

Changed 4 years ago by vdeparday

Did you resize the window first? I forgot to mention that because it was mentionned in the previous ticket. You have to load the map, resize the window and then change a layer. I've uploaded an example with my data. The only thing I can think of that could be different in my example is the fact that the data is reprojected. This is a minor bug when you just use openlayers as you don't resize often the windows. However, when using GeoExt and/or MapFish, it happens every time since the map is resized at the loading.

Changed 4 years ago by vdeparday

Bug example with the proj definition

Changed 4 years ago by ahocevar

I can confirm the issue, and it seems like the fix for #1797 should be reverted. The real issue is that layer.mapObject.checkResize seems to work only when all tiles are loaded. I played around with the GMap load event, but to no avail. I think the best strategy to fix this would be to create a new GMap object when setting the layer to visible, and destroying it when setting it to invisible.

Changed 4 years ago by ahocevar

  • status changed from new to closed
  • resolution set to duplicate

dupe of #1797

Changed 4 years ago by ahocevar

  • state changed from Awaiting User Feedback to Complete
Note: See TracTickets for help on using tickets.