On Wed, Mar 11, 2009 at 01:54:55PM +0100, "tschobber tschöbbi" wrote: > Hi, > > I want to project a mapfile via Openlayers, but Openlayers prints the > following error message: > > "msWMSLoadGetMapParams(): WMS server error . Invalid SRS given : SRS must be > valid for all requested layers." > > All my layers have the projection epsg code 31297 and I configured wms like > this:
You didn't specify a projectin anywhere in your OpenLayers code. You need to specify a maxExtent, maxResolution, and projection properties: http://faq.openlayers.org/map/how-do-i-set-a-different-projection-on-my-map/ > WEB > IMAGEPATH "/tmp/ms_tmp/" > IMAGEURL "/ms_tmp/" > MAXSCALE 3e+06 > METADATA > "wms_srs" "epsg:31297" > "wms_onlineresource" > "http://map.gis.univie.ac.at/cgi-bin/mapserv?map=/srv/www/htdocs/isohis/includes/control_mapfile.map&" > "wfs_srs" "epsg:31297" > "wfs_title" "ISOHIS - WFS" > "wfs_onlineresource" > "http://map.gis.univie.ac.at/cgi-bin/mapserv?map=/srv/www/htdocs/isohis/includes/control_mapfile.map&" > "wms_title" "ISOHIS -WMS" > END > MINSCALE 100000 > QUERYFORMAT text/html > LEGENDFORMAT text/html > BROWSEFORMAT text/html > END > > I also found a file named epsg (proj4) and this file contains this code so > I'm a bit confused. I also tried this example with an other code but then the > image has distortions - but it works. Here's the ol_map.htm I'm using: > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> > <head> > <title>Mapnik WMS Test</title> > <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> > <style type="text/css"> > html, body { height: 100%; } > body {margin: 0px;} > #map { > width: 100%; > height: 100%; > } > > </style> > <script src="lib/OpenLayers.js"></script> > <script type="text/javascript"> > var map, world, wms; > function init(){ > > map = new OpenLayers.Map('map'); > var mapserver_agg = new OpenLayers.Layer.WMS("AGG > Mapserver","http://gaia.geo.univie.ac.at/cgi-bin/mapserv?map=/srv/www/cgi-bin/data/oerok_agg2.map",{layers: > ['land_grenzen01','layer_mapany_080305_3ba6226287c1622', > 'bezirk_grenzen_01', 'land_grenzen01','staat01','fluss01', > 'stadt01']},{isBaseLayer:true}); > > > map.addLayers([mapserver_agg]); > map.zoomToMaxExtent(); > } > </script> > </head> > <body onload="init()"> > <h2 style="position:absolute; z-index:10000; left: 100px;">Mapnik WMS > Test</h2> > <div id="map"> > </div> > </body> > </html> > > Hope you can help me. > > best regards! > > -- > Nur bis 16.03.! DSL-Komplettanschluss inkl. WLAN-Modem für nur > 17,95 ¿/mtl. + 1 Monat gratis!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a > _______________________________________________ > Users mailing list > [email protected] > http://openlayers.org/mailman/listinfo/users -- Christopher Schmidt MetaCarta _______________________________________________ Users mailing list [email protected] http://openlayers.org/mailman/listinfo/users
