[Trac] [OpenLayers] #366: Error switching between different Google layers

OpenLayers trac at openlayers.org
Sat Oct 21 14:40:18 EDT 2006


#366: Error switching between different Google layers
------------------------------------+---------------------------------------
 Reporter:  jlivni                  |       Owner:     
     Type:  bug                     |      Status:  new
 Priority:  major                   |   Milestone:     
Component:  general                 |     Version:     
 Keywords:  google layer switching  |  
------------------------------------+---------------------------------------
 Switching between two google layers (eg hybrid and normal) results in
 various errors (eg 'originPx has no properties').  I note that if I do a
 couple of zoom functions after the error, switching between layers will
 then work.

 Example code to reproduce:

 function init(){
             var map = new OpenLayers.Map( $('map'));
             var hybrid = new OpenLayers.Layer.Google( "Google Hybrid" ,
 {type: G_HYBRID_MAP} );
             var gnormal = new OpenLayers.Layer.Google( "Google Regular" ,
 {type: G_NORMAL_MAP} );

             map.addLayers([gnormal, hybrid]);

             map.addControl( new OpenLayers.Control.LayerSwitcher() );
             map.setCenter(new OpenLayers.LonLat(-118, 33), 7);
         }

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


More information about the Trac mailing list