[OpenLayers-Users] switching default layer before initial map display

stephane.poirier at usherbrooke.ca stephane.poirier at usherbrooke.ca
Sun Aug 30 21:50:29 EDT 2009


Hi All,

With the following code, I created a few google layers. Google streets gets to be the default. Now, how can I change the default layers to be, say, the google hybrid map?

if(myepsg=="EPSG:900913")
{
    googlestreetsLayer=new OpenLayers.Layer.Google("Google Streets",{"sphericalMercator": true,minZoomLevel: 2});
    googlephysicalLayer=new OpenLayers.Layer.Google("Google Physical",{type: G_PHYSICAL_MAP, "sphericalMercator": true,minZoomLevel: 2});
    googlesatelliteLayer=new OpenLayers.Layer.Google("Google Satellite",{type: G_SATELLITE_MAP, "sphericalMercator": true,minZoomLevel: 2});
    googlehybridLayer = new OpenLayers.Layer.Google("Google Hybrid",{type: G_HYBRID_MAP, "sphericalMercator": true,minZoomLevel: 2});
}


Stephane Poirier, M.Sc. Optic Physics 
Remote Sensing Application Software Developer
Université de Sherbrooke
2500 Bd Université, Sherbrooke, Qc J1K 2R1 Canada
www.usherbrooke.ca/cartel
Stephane.Poirier at Usherbrooke.ca
+1 (514) 509-8833 (actual work site telephone)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090830/571b7302/attachment.html


More information about the Users mailing list