AW: [OpenLayers-Users] gml filter [solved]
Francesco Geri
francescogeri at yahoo.it
Tue Apr 24 09:16:50 EDT 2012
Thank you, now it works perfectly.
Thanks again,
Francesco
________________________________
Da: Arnd Wippermann <arnd.wippermann at web.de>
A: 'Francesco Geri' <francescogeri at yahoo.it>
Cc: users at openlayers.org
Inviato: Lunedì 23 Aprile 2012 19:06
Oggetto: AW: [OpenLayers-Users] gml filter
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/20120424/ef9ffeba/attachment.html
More information about the Users
mailing list