[OpenLayers-Users] Switching between a Google/Bing base layer to WMS base layer...

Paul james pauljame at gmail.com
Tue Aug 17 08:26:32 EDT 2010


Hello guys...
I have an application with Bing base layer with some WMS overlay ....
Thats working fine :

 map = new OpenLayers.Map('MapTest', {
         units: "m",
         projection:new OpenLayers.Projection("EPSG:900913"),
         displayProjection: new OpenLayers.Projection("EPSG:4326"),
         tileSize: new OpenLayers.Size(400, 400),
         numZoomLevels: 10,
         maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34,
20037508.34, 20037508.34)
    });

 var bing = new OpenLayers.Layer.VirtualEarth("Aerial", {
        type: VEMapStyle.Aerial, numZoomLevels: 10,sphericalMercator:
true,maxExtent: new
OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34)
  });

var wmsLayer = new OpenLayers.Layer.WMS("TestWmsLayer",
                _mapfile, {
                    "LAYERS": ['Points'],
                    transparent: true,
                    format: "image/png"
                }, {
                    isBaseLayer: false,
                    visibility: true
                });


Now I create another base layer (WMS):

var wmsBaseLayer = new OpenLayers.Layer.WMS("TestWmsBaseLayer",
                _mapfile, {
                    "LAYERS": ['WmsBaseLayer'],
                    transparent: true,
                    format: "image/png"
                }, {
                    isBaseLayer: true,
                    visibility: true
                });


The problem when I switch between bing base layer and wmsBaseLayer, my map
appear in completely other location... How can I fix that?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100817/74f2f497/attachment.html


More information about the Users mailing list