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

OpenLayers trac-20090302 at openlayers.org
Wed May 16 17:41:47 EDT 2012


#2828: Map Disappears Resizing Google V3 Layer
------------------------------+---------------------------------------------
  Reporter:  atogle           |       Owner:              
      Type:  bug              |      Status:  reopened    
  Priority:  major            |   Milestone:  2.11 Release
 Component:  Layer.Google.v3  |     Version:  2.10        
Resolution:                   |    Keywords:              
     State:  Needs More Work  |  
------------------------------+---------------------------------------------

Comment(by milosh):

 I have one more patch for this ticket, which also solves the issue of this
 ticket, but also solves one another.

 {{{
 Index: Layer/Google/v3.js
 ===================================================================
 --- Layer/Google/v3.js  (revision 8649)
 +++ Layer/Google/v3.js  (working copy)
 @@ -186,7 +186,7 @@
                  var layer = this;
                  google.maps.event.addListenerOnce(this.mapObject,
 "tilesloaded", function() {
                      google.maps.event.trigger(layer.mapObject, "resize");
 -                    layer.moveTo(layer.map.getCenter(),
 layer.map.getZoom());
 +                    //layer.moveTo(layer.map.getCenter(),
 layer.map.getZoom());
                      delete cache.resized;
                  });
              }
 }}}

 In my app I have only 2 Google layers.

 During the startup the app calls several times "updateSize" and
 "zoomToExtent".

 Without this patch the base layer is not displayed.

 When I apply the patch from my previous comment, the issue is resolved,
 but still there is another one:

 - the layer is not blank (white background) - one would say it did not
 disappear - but it is "gray" instead - no imaginery displayed, only gray
 background (not white)

 - looking more deeply in to the DOM I can see the GMap divs with imgs but
 the imgs are all blue

 it looks like call to layer.moveTo in the tilesloaded callback mangles
 somehow the GMap object when there are 2 layers in the map..

 The patch to onMapResize solves above described issues for me.

 Note that this behaviour does not occur when there is only one Google
 layer.

 I can try to find a test case for this and try to test it under OL 2.12,
 but my setup is quite complex..

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


More information about the Trac mailing list