[OpenLayers-Users] Probem on OpenLayers WFS

Alextave andrea.alri90 at gmail.com
Thu Oct 3 01:44:58 PDT 2013


Hi everybody, please forgive my late reply. After some hard work on my code I
decided to use event handler and not te proxy because the proxy is too
complicated for no reason (in my opinion).

This is my code and works really nice:
     var Parametri_WFSMuraN=new Object();
      Parametri_WFSMuraN.url="http://localhost:8080/services/WFSbabDB";
      Parametri_WFSMuraN.featureType="MuraN";
      Parametri_WFSMuraN.featureNS="http://www.deegree.org/app";
      Parametri_WFSMuraN.featurePrefix="app";
      Parametri_WFSMuraN.geometryName="Forma";
      Parametri_WFSMuraN.outputFormat="GML2"; 
      var WFSMuraN=new OpenLayers.Protocol.WFS.v1_1_0(Parametri_WFSMuraN);
      
      var LayerWFSMuraN=new OpenLayers.Layer.Vector("WFSMUN", { 
        strategies: [new OpenLayers.Strategy.BBOX()], 
        protocol: WFSMuraN
      });
      
      var GetFeatureMuraN=new OpenLayers.Control.GetFeature({
        protocol: WFSMuraN,
        click: true
      });
      GetFeatureMuraN.events.register("featureselected", this, function(e) {
        LayerWFSMuraN.addFeatures([e.feature]);
        var nome=e.feature.data.Nome_MU;
        var desc=e.feature.data.Descrizione;
 
        doc2.innerHTML="Nome: "+nome+"</br>"+"Descrizione: "+desc+"</br>";
      });

      map.addControl(GetFeatureMuraN);
      GetFeatureMuraN.activate();
      map.addLayer(LayerWFSMuraN);

Thankyou so much for the help
Best regards Andrea



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Probem-on-OpenLayers-WFS-tp5072697p5081565.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list