<br><font size=2 face="sans-serif">added vendorParams:{ SEMCDC:thisCDC,
RSS: thisRSS, ORDRE: thisOrdre}</font>
<br><font size=2 face="sans-serif">in the WMSGetFeatureInfo options</font>
<br>
<br>
<br><font size=2 face="sans-serif"><br>
</font><font size=3> </font>
<p>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Steve.Toutant@inspq.qc.ca@openlayers.org</b>
</font>
<br><font size=1 face="sans-serif">Envoyé par : users-bounces@openlayers.org</font>
<p><font size=1 face="sans-serif">20/11/2009 03:52 PM</font>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">A</font></div>
<td><font size=1 face="sans-serif">users@openlayers.org</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Objet</font></div>
<td><font size=1 face="sans-serif">[OpenLayers-Users] getFeatureInfo and
variable substitution</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br>
<br>
<br><font size=2 face="sans-serif"><br>
Hi,</font><font size=3> </font><font size=2 face="sans-serif"><br>
I got an error when querying a wms layer (mapserver) with a OpenLayers.Control.WMSGetFeatureInfo
request when there is a variables substitution.</font><font size=3> </font><font size=2 face="sans-serif"><br>
I have a WMS layer define like this:</font><font size=3> </font><font size=2 face="sans-serif"><br>
createWmsLayer('ecoles', '.../cgi-bin/mapserv.exe?map=MYMAP',{layers: 'ecoles',
transparent: &quot;true&quot;, format:&quot;image/gif&quot;, SEMCDC:thisCDC,
RSS: thisRSS, ORDRE: thisOrdre},{isBaseLayer: false, visibility: false,singleTile:true,transitionEffect:
'resize'});</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
I have 3 variables: SEMCDC, RSS, ORDRE</font><font size=3> </font><font size=2 face="sans-serif"><br>
In the mapfile I use this statement</font><font size=3> </font><font size=2 face="sans-serif"><br>
FILTER &quot;semcdc in (%SEMCDC%) and rss in (%RSS%) and ordre in (%ORDRE%)&quot;</font><font size=3>
<br>
</font><font size=2 face="sans-serif"><br>
The getMap request is succesfull.</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
Here is the request</font><font size=3> </font><font size=2 face="sans-serif"><br>
/cgi-bin/mapserv.exe?map=MYMAP service=WMS&amp;version=1.1.0&amp;request=GetFeatureInfo&amp;layers=ecoles&amp;query_layers=ecoles&amp;styles=&amp;bbox=-8820221.560815%2C5721770.182129%2C-7587445.168853%2C6361395.234705&amp;srs=EPSG%3A900913&amp;feature_count=3000&amp;x=272&amp;y=457&amp;height=523&amp;width=1008&amp;info_format=text%2Fhtml</font><font size=3>
<br>
</font><font size=2 face="sans-serif"><br>
Here is the response</font><font size=3> </font><font size=2 face="sans-serif"><br>
&lt;?xml version='1.0' encoding=&quot;ISO-8859-1&quot; standalone=&quot;no&quot;
?&gt;</font><font size=3> </font><font size=2 face="sans-serif"><br>
&lt;!DOCTYPE ServiceExceptionReport SYSTEM &quot;http://schemas.opengis.net/wms/1.1.0/exception_1_1_0.dtd&quot;&gt;</font><font size=3>
</font><font size=2 face="sans-serif"><br>
&lt;ServiceExceptionReport version=&quot;1.1.0&quot;&gt;</font><font size=3>
</font><font size=2 face="sans-serif"><br>
&lt;ServiceException&gt;</font><font size=3> </font><font size=2 face="sans-serif"><br>
prepare_database(): Query error. Error declaring cursor: ERROR: &nbsp;syntax
error at or near &amp;quot;%&amp;quot;</font><font size=3> </font><font size=2 face="sans-serif"><br>
LINE 1: ...:text from ecoles WHERE (semcdc in (%SEMCDC%) ...</font><font size=3>
</font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^</font><font size=3>
</font><font size=2 face="sans-serif"><br>
With query string: DECLARE mycursor BINARY CURSOR FOR SELECT &amp;quot;taux_abs&amp;quot;::text,&amp;quot;nouv&amp;quot;::text,asbinary(force_collection(force_2d(geom900913)),&amp;#39;NDR&amp;#39;),id::text
from ecoles WHERE (semcdc in (%SEMCDC%) and rss in (%RSS%) and ordre in
(%ORDRE%)) and (geom900913 &amp;amp;&amp;amp; setSRID( &amp;#39;BOX3D(-8493071.07981319
5795761.22549582,-8480841.15528974 5807991.15001926)&amp;#39;::BOX3D,900913)
)</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
&lt;/ServiceException&gt;</font><font size=3> </font><font size=2 face="sans-serif"><br>
&lt;/ServiceExceptionReport&gt;</font><font size=3> <br>
<br>
</font><font size=2 face="sans-serif"><br>
How should I query the layer?</font><font size=3> </font><font size=2 face="sans-serif"><br>
Thanks</font><font size=3> </font><font size=2 face="sans-serif"><br>
Steve</font><font size=3> </font><font size=2 face="sans-serif"><br>
</font><font size=3 color=#0066ff><i><br>
Steve Toutant, M. Sc.</i></font><font size=3><br>
Analyste en géomatique<br>
Secteur environnement<br>
Direction de la santé environnementale et de la toxicologie<br>
Institut national de santé publique du Québec<br>
945, avenue Wolfe<br>
Québec, Qc G1V 5B3 </font>
<p><font size=3>Tél.: (418) 650-5115 #5281<br>
Fax.: (418) 654-3144</font><font size=3 color=blue><u><br>
</u></font><a href=mailto:steve.toutant@inspq.qc.ca><font size=3 color=blue><u>steve.toutant@inspq.qc.ca</u></font></a><font size=3 color=blue><u><br>
</u></font><a href=http://www.inspq.qc.ca/><font size=3 color=blue><u>http://www.inspq.qc.ca</u></font></a><font size=3>
</font>
<p><font size=3>&nbsp; </font><tt><font size=2>_______________________________________________<br>
Users mailing list<br>
Users@openlayers.org<br>
http://openlayers.org/mailman/listinfo/users<br>
</font></tt>
<br>
<br>
<br>