[fusion-users] Problems using map.query() method

Vitor Fortunato sapucaiatotal at gmail.com
Thu May 29 06:03:46 EDT 2008


I am having problems to use the map.query() method to filter attributes.
In this method you can send a SQL filter inside the options parameter.
But it didn't works for me...

I think the query method is ignoring this parameter.

I've found the code bellow in the query.php file, and it seems that this
file is not using the filter parameter...
The code bellow, shows only the queryByShape using the $oSpatialFilter
parameter...


/// ... ... ... >>>>>>>>>>>>>>>>>>>>>>>>>>>

if (@$oLayer->queryByShape($oSpatialFilter) == MS_SUCCESS) {
        $result->hasSelection = true;
        $layerName = $oLayer->name;
        array_push($result->layers, $layerName);
        $result->$layerName->featureCount = $oLayer->getNumResults();
        //TODO: dump out the extents of the selection
    }

/// >>>>>>>>>>>>>>>>>>>>>>>>>>> ... ... ...




I have a simple widget that uses the following code:

execute : function() {
    var options = {};
    options.selectionType = 'INTERSECTS';
    options.geometry = "POLYGON((-75.58840579710144 -10.755072463768112,
-61.16086956521739 -10.755072463768112, -61.16086956521739
0.005797101449276809, -75.58840579710144 0.005797101449276809,
-75.58840579710144 -10.755072463768112))";
    options.maxFeatures = 0;
    options.filter = "gid=1"
    options.layers = 'States';

    this.getMap().query(options);
}


the polygon intersects with 5 states, but I would like to select just the
state with 'gid = 1', using the filter option.
My code select the 5 states that intersect with the polygon and don't apply
the filter.

What I am doing wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/fusion-users/attachments/20080529/2815f1ef/attachment.html


More information about the fusion-users mailing list