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

Francesco Pennica f.pennica at gmail.com
Mon Aug 31 05:58:05 EDT 2009


Hello,

I think you just have to change the order when you add layers to map:

map.addLayers([googlestreetsLayer,googlephysicalLayer,...]);

to:

map.addLayers([googlephysicalLayer,googlestreetsLayer,...]);


2009/8/31 <stephane.poirier at usherbrooke.ca>

>  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)
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090831/ac7f4a6f/attachment.html


More information about the Users mailing list