[mapserver-users] using &viewparams
Rahkonen Jukka
jukka.rahkonen at mmmtike.fi
Tue Jul 30 04:28:38 PDT 2013
Hi,
I guess that you are mixing two great software by trying to use the Geoserver "viewparams" vendor option with Mapserver. Instead, with Mapserver you will need to use the run-time substitution system. Read for example http://mapserver.org/cgi/runsub.html#runsub and http://linfiniti.com/2011/09/making-the-most-of-umn-mapserver-runtime-variable-substitution/.
You are almost there but you must add validation for your "id" parameter and use &id=1 syntax in the WMS requests.
-Jukka Rahkonen.-
________________________________
Pedro Costa wrote:
> Hi guys,
> I'm trying to generate a lot of maps passing a param in URL request.
In my mapfile I have one layer called streets. The streets are stored in postgis database and in my mapfile I have that:
".... DATA "the_geom from streets using unique id WHERE id = %id% .. "
Next, i have added to the URL GetMap request this:
&viewparams=id:1
But I get all the layer, and not only the feature with id 1...
I'm doing something wrong?
Thanks
More information about the MapServer-users
mailing list