[OpenLayers-Users] WMS srs error when adding layers from an array

aparker1969 andrew at source3.com
Wed Dec 4 16:18:00 PST 2013


Folks:

I am updating a WMS layer to obtain USGS Topo maps from
"http://basemap.nationalmap.gov/arcgis/services/USGSTopo/MapServer/WmsServer?". 
When rendering, the WMS layer throws an error - "Parameter 'srs(crs)' has
wrong value".  The problematic map application is at
http://saturn.nmt.edu/national/index.html.  The layer is "Topographic Map".  
The topo map renders fine in my test map
(http://saturn.nmt.edu/national/basic.html) and in another production map at
http://ford.nmt.edu/prrc_MF/index5.html.  [This map is old but still works,
just not in FireFox.]  

I think I have narrowed it down to loading the layers into an array then
trying to render the USGS Topo layer.  But I cannot figure out way.  Any
insight to why this is happening is appreciated. 

The getCapabilities of the USGS Topo layer is located at
http://basemap.nationalmap.gov/arcgis/services/USGSTopo/MapServer/WMSServer?request=GetCapabilities&service=WMS

Server: CentOS 5.x
OpenLayers: 2.10

The following are snippets of my array and select code.
...
...
/*******  CREATE MAP LAYERS  ******/  
    layers = [];
...
...

    layers.push(new OpenLayers.Layer.WMS("Topographic Map",
       
"http://basemap.nationalmap.gov/arcgis/services/USGSTopo/MapServer/WmsServer?", 
        {layers: "0", srs: "EPSG:900913", format: "image/jpeg",
transparent:true},
        {isBaseLayer: true, singleTile: false, opacity:1}
    ));  
...
...
        var options = {
            controls: [],
            projection: new OpenLayers.Projection("EPSG:900913"),
            displayProjection: new OpenLayers.Projection("EPSG:4326"),
            units: "m",
            numZoomLevels: 22,
            maxResolution: 156543.0339,
            // Bounds = Left Bottom Right Top            
            maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
                                         20037508, 20037508.34)
        };
        map1 = new OpenLayers.Map(options);
...
...
/*********  CREATE mapPanel   ******************/    
    mapPanel = new GeoExt.MapPanel({
        //border: true,
        region: "center",
        center: [-11337475, 4090026],
        zoom: 6,
        /**************** DEFINE OpenLayers MAP *************/
        map: map1,
        split:true,
        tbar: [toolbarItems]
    });
    map1.addLayers(layers);
...
...







--
View this message in context: http://osgeo-org.1560.x6.nabble.com/WMS-srs-error-when-adding-layers-from-an-array-tp5092831.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list