Hello list!
I am trying to filter the features in a vector layer so I can decide which
of them are displayed on the map and which are not. I have succesfully
created the vector layer allDetections with the code below, and I can see
all the detections in openlayers. But I cant fiter by a certain field. I
used this code:
allDetections.filter =new
OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:
'confidencei',value: 1200});
allDetections.refresh({force: true});
Executing these two lines when clicking on a button does nothing in the
map,no filtering. Is this filtering possible? after googling for a while I
cant find anything about filtering vector layers filled manually.
I really appreciate your help! thanks!!
Regards.
// CREATE DETECTIONS LAYER
var styleAllDetections = { styleMap: new OpenLayers.StyleMap( {"default":
{
graphicName: "ship",
rotation: "${heading}"
} ,
}
) };
allDetections = new OpenLayers.Layer.Vector("Detections",
styleAllDetections);
var featuresAll = [];
<!-- FILL VECTOR LAYER WITH THE ITEMS OF THE DETECCTIONS LIST -->
<logic:iterate name="product" property="detections" id="item">
featuresAll.push(new OpenLayers.Feature.Vector(new
OpenLayers.Geometry.Point(<bean:write name="item" property="lon"/>,
<bean:write name="item" property="lat"/>),
{ id: <bean:write
name="item" property="id"/>,
lat: <bean:write
name="item" property="lat"/>,
lon: <bean:write
name="item" property="lon"/>,
confidence:
<bean:write name="item" property="confidence"/
} ) );
</logic:iterate>
allDetections.addFeatures(featuresAll);
map.addLayer(allDetections);
Best regards.
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users