[OpenLayers-Users] Openlayers does not support the 31297 epsg
code?
Christopher Schmidt
crschmidt at metacarta.com
Thu Mar 12 07:14:46 EDT 2009
On Thu, Mar 12, 2009 at 10:44:04AM +0100, "tschobber tschöbbi" wrote:
> Thanks again - it's working now, but I still have distortions in the map (but the epsg code is all over the same) and when I load the image the first time its extremely zoomed in and I'm not able to zoom out... additionally my firefox browser error console show's me a javascript error that there was an error handling the data for attribute 'filter'... (I translated the error message in english so It's not the original one).
maxresolution: 5 is not what you want. Try setting it to 470.
> I'm new to that stuff and I hope anyone can bring some light to it :) ...
>
> Here's the edited html code 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;
> function init(){
>
> var bbox = new OpenLayers.Bounds(384619.116883103, 467965.222077892, 505102.701298797, 534231.193506524);
>
>
> var map_options = {maxExtent: bbox, projection:"EPSG:31297",units: "meters", numZoomLevels: 27, maxResolution: 5};
>
> map = new OpenLayers.Map('map',map_options);
> 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, reroject: 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>
>
>
> Martin
>
> -------- Original-Nachricht --------
> > Datum: Wed, 11 Mar 2009 09:56:37 -0400
> > Von: Christopher Schmidt <crschmidt at metacarta.com>
> > An: "tschobber tschöbbi" <tschobber at gmx.at>
> > CC: users at openlayers.org
> > Betreff: Re: [OpenLayers-Users] Openlayers does not support the 31297 epsg code?
>
> > On Wed, Mar 11, 2009 at 02:19:52PM +0100, "tschobber tschöbbi" wrote:
> > > Hey Chris,
> >
> > Reply to the list.
> >
> > > thanks for the fast answer, but I guess I'm doing so: Thats the
> > beginning of my mapfile:
> >
> > OpenLayers doesn't read the mapfile. You have to duplicate this
> > information in the OpenLayers Javascript config.
> >
> > -- Chris
> >
> > > MAP
> > > EXTENT 384619.116883103 467965.222077892 505102.701298797
> > 534231.193506524
> > > FONTSET "../../data/fonts/fonts.txt"
> > > IMAGECOLOR 255 255 255
> > > # IMAGETYPE png24
> > > SYMBOLSET "../../includes/sys.sym"
> > > SHAPEPATH "data/"
> > > SIZE 700 385
> > > STATUS ON
> > > UNITS METERS
> > > NAME "Atlas"
> > >
> > > OUTPUTFORMAT
> > > NAME 'AGG'
> > > DRIVER AGG/PNG
> > > IMAGEMODE RGB
> > > END
> > >
> > > PROJECTION
> > > "init=epsg:31297"
> > > END
> > >
> > > ... directly after this there is the wms specification (see last
> > message).
> > >
> > > -------- Original-Nachricht --------
> > > > Datum: Wed, 11 Mar 2009 09:06:07 -0400
> > > > Von: Christopher Schmidt <crschmidt at metacarta.com>
> > > > An: "tschobber tschöbbi" <tschobber at gmx.at>
> > > > CC: users at openlayers.org
> > > > Betreff: Re: [OpenLayers-Users] Openlayers does not support the 31297
> > epsg code?
> > >
> > > > 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
> > > > > Users at openlayers.org
> > > > > http://openlayers.org/mailman/listinfo/users
> > > >
> > > > --
> > > > Christopher Schmidt
> > > > MetaCarta
> > >
> > > --
> > > Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit
> > allen: http://www.gmx.net/de/go/multimessenger01
> >
> > --
> > Christopher Schmidt
> > MetaCarta
>
> --
> Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger01
--
Christopher Schmidt
MetaCarta
More information about the Users
mailing list