I am having problems to use the map.query() method to filter attributes.<br>In this method you can send a SQL filter inside the options parameter.<br>But it didn&#39;t works for me...<br><br>I think the query method is ignoring this parameter.<br>
<br>I&#39;ve found the code bellow in the query.php file, and it seems that this file is not using the filter parameter...<br>The code bellow, shows only the queryByShape using the $oSpatialFilter parameter...<br><br><br>
/// ... ... ... &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br><br>if (@$oLayer-&gt;queryByShape($oSpatialFilter) == MS_SUCCESS) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $result-&gt;hasSelection = true;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $layerName = $oLayer-&gt;name;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array_push($result-&gt;layers, $layerName);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $result-&gt;$layerName-&gt;featureCount = $oLayer-&gt;getNumResults();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //TODO: dump out the extents of the selection<br>
&nbsp;&nbsp;&nbsp; }<br><br>/// &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; ... ... ... <br><br><br><br><br>I have a simple widget that uses the following code:<br><br>execute : function() {&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp; &nbsp;var options = {};&nbsp;&nbsp; &nbsp;<br>
&nbsp;&nbsp; &nbsp;options.selectionType = &#39;INTERSECTS&#39;;<br>&nbsp;&nbsp;
&nbsp;options.geometry = &quot;POLYGON((-75.58840579710144 -10.755072463768112,
-61.16086956521739 -10.755072463768112, -61.16086956521739
0.005797101449276809, -75.58840579710144 0.005797101449276809,
-75.58840579710144 -10.755072463768112))&quot;;<br>
&nbsp;&nbsp; &nbsp;options.maxFeatures = 0;<br>&nbsp;&nbsp; &nbsp;options.filter = &quot;gid=1&quot;<br>&nbsp;&nbsp; &nbsp;options.layers = &#39;States&#39;;<br>&nbsp;&nbsp; &nbsp;<br>&nbsp;&nbsp; &nbsp;this.getMap().query(options);<br>}<br><br><br>the polygon intersects with 5 states, but I would like to select just the state with &#39;gid = 1&#39;, using the filter option.<br>

My code select the 5 states that intersect with the polygon and don&#39;t apply the filter.<br><br>What I am doing wrong?<br><br>