[OpenLayers-Users] the same ol' 4326/900913 stuff-up

Puneet Kishor punk.kish at gmail.com
Sat Oct 15 16:36:39 EDT 2011


I am confounded by this basic problem, so instead of wasting any more time on it, I ask your help (at the risk it being a stupid question). My data are stored in EPSG:4326, and I am having MapServer pull it out with the following incantations

	MAP
	..
		PROJECTION
			"init=epsg:4326"
			"init=epsg:900913"
		END
		
		WEB
			METADATA
				ows_enable_request "*"
				wms_srs "EPSG:900913 EPSG:4326"
			END
		END
	
		LAYER
		..
			NAME "lyr"
			DATA "the_geom FROM table USING UNIQUE gid USING srid=4326"
			
		
			PROJECTION
				"init=epsg:4326"
				"init=epsg:900913"
			END
			
			METADATA
				ows_enable_request "*"
				wms_srs "EPSG:900913 EPSG:4326"
			END
			
I am adding the layer to my map with 

    map = new OpenLayers.Map("map", {
        projection: new OpenLayers.Projection("EPSG:900913"),
        displayProjection: new OpenLayers.Projection("EPSG:4326"),
        units: "dd",
        maxResolution: 156543.0339,
        maxExtent: new OpenLayers.Bounds(-20037508, -20037508, 20037508, 20037508)
    });

    var lyr = new OpenLayers.Layer.WMS(
        "lyr",
        "http://server/cgi-bin/app",
        {layers: "lyr"},
        {isBaseLayer: false}
    );        
    
    map.addLayers([lyr]);
    
Yet, I get the following error

	<ServiceException code="InvalidSRS">
	msWMSLoadGetMapParams(): WMS server error. Invalid SRS given : SRS must be valid for all requested layers.
	</ServiceException>

What am I doing wrong?


--
Puneet Kishor 


More information about the Users mailing list