[mapserver-users] passing cgi query params to wms layers

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Tue Sep 27 00:01:45 EDT 2011


Hi,

You haven't seen this http://mapserver.org/cgi/runsub.html#runsub or this http://mapserver.org/mapfile/variable_sub.html#variable-sub, have you?

-Jukka Rahkonen-
________________________________________
Lähettäjä: mapserver-users-bounces at lists.osgeo.org [mapserver-users-bounces at lists.osgeo.org] käyttäjän Puneet Kishor [punk.kish at gmail.com] puolesta
Lähetetty: 27. syyskuuta 2011 5:29
Vastaanottaja: mapserver-users at lists.osgeo.org
Aihe: [mapserver-users] passing cgi query params to wms layers

I am using OpenLayers as the front-end, requesting a WMS layer from MapServer that is getting data from Pg. My DATA statement is like so

        DATA "the_geom FROM (SELECT gid, pc, the_geom FROM table) t USING UNIQUE gid USING srid=4326"
        FILTER "pc = 'na'"

The above works fine. However, I would like to send the value of "pc" from OpenLayers (that is another problem that I am experiencing; I have asked on OL list on how to send query params to WMS layers, but if any of you know the solution, I would welcome that). In any case, I thought (naively), that I could change my FILTER statement like so

        FILTER "pc = '[pc]'"

I tried sending a WMS query directly to test the above like so [http://server/cgi-bin/app?.. blah ..&pc=na] but no joy. Forcing a query error showed me that MapServer was executing the following

        select .. from (..) t where the_geom && GeomFromText(..) and (pc = '[pc]')

How can I dynamically supply MapServer a filter value?


--
Puneet Kishor _______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


More information about the mapserver-users mailing list