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't works for me...<br><br>I think the query method is ignoring this parameter.<br>
<br>I'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>
/// ... ... ... >>>>>>>>>>>>>>>>>>>>>>>>>>><br><br>if (@$oLayer->queryByShape($oSpatialFilter) == MS_SUCCESS) {<br> $result->hasSelection = true;<br>
$layerName = $oLayer->name;<br> array_push($result->layers, $layerName);<br> $result->$layerName->featureCount = $oLayer->getNumResults();<br> //TODO: dump out the extents of the selection<br>
}<br><br>/// >>>>>>>>>>>>>>>>>>>>>>>>>>> ... ... ... <br><br><br><br><br>I have a simple widget that uses the following code:<br><br>execute : function() { <br>
var options = {}; <br>
options.selectionType = 'INTERSECTS';<br>
options.geometry = "POLYGON((-75.58840579710144 -10.755072463768112,
-61.16086956521739 -10.755072463768112, -61.16086956521739
0.005797101449276809, -75.58840579710144 0.005797101449276809,
-75.58840579710144 -10.755072463768112))";<br>
options.maxFeatures = 0;<br> options.filter = "gid=1"<br> options.layers = 'States';<br> <br> this.getMap().query(options);<br>}<br><br><br>the polygon intersects with 5 states, but I would like to select just the state with 'gid = 1', using the filter option.<br>
My code select the 5 states that intersect with the polygon and don't apply the filter.<br><br>What I am doing wrong?<br><br>