[OpenLayers-Users] Openlayers and Mapnik - Problems generating maps in OL with XML (Mapnik)

"tschobber tschöbbi" tschobber at gmx.at
Thu Mar 19 04:51:29 EDT 2009


Thanks! I tried it already in such manner but I've done anything wrong. Now its working - but you have to add array brackets around the styles. 
I have another question: How am I able to create an own maxExtent attribute for each layer with one map object?

-------- Original-Nachricht --------
> Datum: Wed, 18 Mar 2009 17:55:29 +0100
> Von: Ivan Grcic <igrcic at gmail.com>
> An: "tschobber tschöbbi" <tschobber at gmx.at>
> CC: users at openlayers.org
> Betreff: Re: [OpenLayers-Users] Openlayers and Mapnik - Problems generating 	maps in OL with XML (Mapnik)

> hi,
> 
> var mapnikwms = new OpenLayers.Layer.WMS("MapnikWMS",
>     "http://gaia.geo.at/cgi-bin/mapnikwms.py?",
>     {
>         layers:['staat01','grenzen'],
>         styles:'staat01_style,grenzen_style',
>         format:'image/png'
>     }
> );
> 
> should work,
> 
> cheers
> 
> 2009/3/18 "tschobber tschöbbi" <tschobber at gmx.at>
> >
> > Hi,
> >
> > I'm trying to run a Mapnik XML file with Openlayers. To do so I have a
> python class named XML_Factory.py (see code below). I'm able to make a WMS
> request with just one single layer -> that's working fine, but if I specify
> another layer with another style I get the following exception in
> Openlayers and via Mapnik WMS request:
> >
> > "OGCException: STYLES length does not match LAYERS length."
> >
> > I solved this problem by specifying more than one style to the STYLES
> parameter in the mapnik wms request command line. But how am I able to do so
> in Openlayers? Here's the Mapnik WMS request command line:
> >
> >
> http://localhost/cgi-bin/mapnikwms.py?LAYERS=staat01,grenzen&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=staat01_style,grenzen_style&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=%20384619.116883103,467965.222077892,505102.701298797,534231.193506524&WIDTH=640&HEIGHT=640
> >
> > This is how I request WMS Mapnik in Openlayers script file:
> >
> > var mapnikwms = new
> OpenLayers.Layer.WMS("MapnikWMS","http://gaia.geo.at/cgi-bin/mapnikwms.py?",{layers:['staat01','grenzen'],
> format:'image/png'});
> >
> > Thanks for any help.
> >
> > Martin
> >
> >
> > XML_Factory.py:
> >
> > --------------------------------------------------
> >
> > from mapnik.ogcserver.WMS import BaseWMSFactory
> >
> > class WMSFactory(BaseWMSFactory):
> >  def __init__(self):
> >    BaseWMSFactory.__init__(self)
> >
> >    self.loadXML('world_styles2.xml')
> >    self.finalize()
> >
> > ----------------------------------------------------
> > --
> > Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit
> allen: http://www.gmx.net/de/go/multimessenger01
> > _______________________________________________
> > Users mailing list
> > Users at openlayers.org
> > http://openlayers.org/mailman/listinfo/users
> 
> 
> 
> --
> Ivan Grcic

-- 
Aufgepasst: Sind Ihre Daten beim Online-Banking auch optimal geschützt?
Jetzt absichern: https://homebanking.gmx.net/?mc=mail@footer.hb



More information about the Users mailing list