[mapserver-users] Layer Object Parameter Substitution fromURLusing GIS
Heiko Schröter
schroete at iup.physik.uni-bremen.de
Wed Apr 8 02:02:51 PDT 2009
On Dienstag, 7. April 2009 15:52:10 you wrote:
Hello Steve,
this seem to fail as well. Funny enough i needed to change the Layernames to
uppercase in OpenLayer. But anyway:
<snip>
var kartenstring = "karte,grid,psc";
var somevalue = "FILTER+'orbitnr=4567' ";
layer = new OpenLayers.Layer.WMS( "IUP WMS",
"http://kahlo1/cgi-bin/mapserv",
{map:'/home/schroete/sciadaten/MapServer/country98/heiko1.map',
layers: kartenstring,
"map.layer[PSC]": somevalue},
{singleTile:true});
<snap>
The relevant part of the generated URL:
...&LAYERS=karte%2Cgrid%2CPSC&MAP.LAYER%5BPSC%5D=FILTER%2B%27orbitnr%3D4567%27&...
I've tried various \' inside somevalue, but that won't change a thing.
Backslashing the + sign won't change thing as well.
And mapserver fails. The output from DEBUG 5 is as follows:
[Wed Apr 8 10:52:31 2009].104328 getSymbol(): Symbol definition error. Parsing
error near (+):(line 1)
or
[Wed Apr 8 10:51:24 2009].324130 loadLayer(): General error message. URL-
based FILTER configuration failed pattern validation.
Depending on what you have changed in someval.
Regards
Heiko
> 2) Setting extra vars in OpenLayers is easy. Something like this would
> work:
>
> myLayer = new OpenLayers.Layer.MapServer(
> 'stuff',
> 'http://some.site.com/cgi-bin/mapserv?map=/some/mapfile.map',
> { layers:'stuff', map_transparent: 'true',
> somevar: 'somevalue',
> },
> { ratio:1, singleTile:true, transitionEffect:'resize',
> isBaseLayer:false }
> );
More information about the MapServer-users
mailing list