AW: [OpenLayers-Users] gml filter

Arnd Wippermann arnd.wippermann at web.de
Mon Apr 23 13:06:31 EDT 2012


Are you sure you can use strategies for Layer.GML and not only Layer.Vector
with Protocol.HTTP.
 
from OpenLayers apidocs
Create a vector layer by parsing a GML file.  The GML file is passed in as a
parameter.  Deprecated.  To be removed in 3.0.  Instead use
OpenLayers.Layer.Vector with Protocol.HTTP and Strategy.Fixed.  Provide the
protocol with a format parameter to get the parser you want for your data.
 
Layer.Vector works with Strategy.Filter.
 
Arnd

  _____  

Von: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] Im Auftrag von Francesco
Geri
Gesendet: Montag, 23. April 2012 16:34
An: openlayers-users at lists.osgeo.org
Betreff: [OpenLayers-Users] gml filter


Hello,
I have a gml file and I would like to filter the features visualization
based on the presence of an attribute. In particular I have a gml file that
may or not have the latitude attribute: if this attribute is present the
features should not be viewed.
I'm working with the strategy filter but I don't get results.

This is an extract of my code:

filter = new OpenLayers.Filter.Logical({
type: OpenLayers.Filter.Comparison.LIKE,
property: 'latitude',
value: undefined
});


filterStrategy = new OpenLayers.Strategy.Filter({filter: filter});
puntigml = new OpenLayers.Layer.GML("Point", "provider.gml",
{
projection: new OpenLayers.Projection("EPSG:4326"),
strategies: filterStrategy
}); 
map.addLayer(puntigml); 


Thanks for the help!

Francesco
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120423/c3afca52/attachment.html


More information about the Users mailing list