[OpenLayers-Trac] [OpenLayers] #2828: Map Disappears Resizing Google V3 Layer

OpenLayers trac-20090302 at openlayers.org
Thu Sep 9 15:06:37 EDT 2010


#2828: Map Disappears Resizing Google V3 Layer
-----------------------------+----------------------------------------------
 Reporter:  atogle           |       Owner:              
     Type:  bug              |      Status:  new         
 Priority:  minor            |   Milestone:  2.11 Release
Component:  Layer.Google.v3  |     Version:  2.10        
 Keywords:                   |       State:              
-----------------------------+----------------------------------------------
 I am using a Google v3 layer within a container that dynamically resizes
 with the browser window. The bug is that my map disappears when my browser
 resizes from a small window to a large window, but never from a large
 window to a small window.

 I tracked the issue down to the setGMapVisibility function in
 OpenLayers.Layer.Google.v3.  In this case, it looks like setGMapVisibility
 is getting called for every Google.v3 layer on the map.  There is a for
 loop that I think is checking "if this layer is not visible, then let's
 loop over the rest of the Google layers and see if one of them is visible.
 If so, then let's show the main map container.  If not, let's hide it by
 setting 'left' to -9999px".  I think the problem is that layer.inRange is
 not true when it should be.

 In my dev environment, I was able to fix this problem by calling
 layer.calculateInRange() instead of layer.inRange.  I don't know if this
 is a proper fix or just treating a symptom of a larger issue (like the
 inRange property not being set properly).  I'm going to attach a new
 version of the google-v3.html example that will demonstrate this bug.

 Tested in the latest versions of FF, Chrome, and IE.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/2828>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list