[OpenLayers-Dev] WFS layer and filter – only partly solved

SWEYKAM at telefonica.net SWEYKAM at telefonica.net
Tue Dec 21 04:39:19 EST 2010


I finally found out that geometryName and filter property have to be e x a c t l y this way:
geometryName: 'mne:posicionEspacial/mne:PosicionEspacial/mne:geometria',
property: 'mne:nombreEntidad/mne:NombreEntidad/mne:nombre',

But there is still no way to read the feature.attributes.
The higher level namespaces ‘nombreEntidad’, ‘tipoEntidad’ etc. are there, but null. The information I actually want sits one level lower (‘nombre’, ‘tipo’ etc.).

Any idea how I can drill down to the information? 

My gazetteer layer now:

var myFilter = new OpenLayers.Filter.Comparison({
         type: "~",
         property: 'mne:nombreEntidad/mne:NombreEntidad/mne:nombre', 
         value: "Madrid" 
});

var myLayer = new OpenLayers.Layer.Vector( "my title",   {              
   strategies: [new OpenLayers.Strategy.BBOX({ ratio:1, resFactor:1 })],
   protocol: new OpenLayers.Protocol.WFS({
      url: "http://www.idee.es/IDEE-WFS-Nomenclator-NGC/services?",
      featureType: 'Entidad', 
      featurePrefix: 'mne',
      featureNS :  "http://www.idee.es/mne",
      geometryName: 'mne:posicionEspacial/mne:PosicionEspacial/mne:geometria',
      readFormat: new OpenLayers.Format.GML(),
      srsName: "EPSG:4230",
      version: '1.1.0',    
      extractAttributes: true
   }),
   projection: new OpenLayers.Projection("EPSG:4230"),
   filter: myFilter
});
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20101221/44d1cdba/attachment.html


More information about the Dev mailing list