[ms4w-users] Help with OpenLayers
Chip Taylor
work at xwb.com
Mon Jun 11 17:21:11 EDT 2007
Looking for some help with OpenLayers and MapServer WMS. I am trying to
implement a test of OpenLayers using MapServer as a WMS layer.
My Mapserver WMS, when accessed outside of OpsnLayers returns a map just
fine. But within OpenLayers I receive an error of "Invalid SRS given: RST
must be valid
My Mapserver map file (named wmstest.map) has a Metadata as follows:
METADATA
"wms_title" "WMS Test Server"
"wms_onlineresource"
"https://devmap.rapidresponder.com/bin/mapserv.exe?map=map_files/wmstest.map
&"
"wms_srs" "epsg:4269"
END
There is one layer with a name of "states" with metadata as follows:
METADATA
"wms_title" "states" ##required
END
My OpenLayers HTML looks like this:
function init(){
map = new OpenLayers.Map( $('map') );
layer = new OpenLayers.Layer.WMS( "Test WMS",
"https://devmap.rapidresponder.com/bin/mapserv.exe?map=map_files/wmstest.map
&", {layers: 'states'} );
map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
map.addControl( new OpenLayers.Control.LayerSwitcher() );
}
What am I doing wrong? Any help appreciated!
Chip Taylor
Prepared Response, Inc
More information about the ms4w-users
mailing list