[OpenLayers-Users] Problem on xlink:href

Alextave andrea.alri90 at gmail.com
Wed Nov 20 04:58:47 PST 2013


I made this WFS and its GetFeature to retrieve his elements:

      var Parametri_WFSMonumentiB=ParamWFS_Babilonia("Monumento", "Shape");
      var WFSMonumentiB=new
OpenLayers.Protocol.WFS.v1_1_0(Parametri_WFSMonumentiB);
      
      var LayerWFSMonumentiB=new OpenLayers.Layer.Vector("WFSMB", { 
        strategies: [new OpenLayers.Strategy.BBOX()], 
        protocol: WFSMonumentiB
      });
      
      var GetFeatureMonumentiB=new OpenLayers.Control.GetFeature({
        protocol: WFSMonumentiB,
        click: true
      });
      GetFeatureMonumentiB.events.register("featureselected", this,
function(e) {
        LayerWFSMonumentiB.addFeatures([e.feature]);
        var nome=NomeMonumento(e.feature.fid);
        var desc=e.feature.data.Descrizione;
        var autore=e.feature.data.Autore;
        var data=e.feature.data.Datastorica;
        var tipo=e.feature.data.Tipo;
 
        doc2.innerHTML="Nome: "+nome+"</br>"+"Descrizione:
"+desc+"</br>"+"Autore: "+autore+"</br>"+"Data: "+data+"</br>"+"Tipologia
del monumento: "+tipo+"</br></br>";
      });

      map.addControl(GetFeatureMonumentiB);
      GetFeatureMonumentiB.activate();
      map.addLayer(LayerWFSMonumentiB);

It works well, and when I click on a feature I have this feature collection
:
<?xml version='1.0' encoding='UTF-8'?>
<wfs:FeatureCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"
xmlns:wfs="http://www.opengis.net/wfs" timeStamp="2013-11-20T12:54:42Z"
xmlns:gml="http://www.opengis.net/gml">
  <gml:featureMember>
    <app:Monumento xmlns:app="http://www.deegree.org/MyApp"
gml:id="APP_MONUMENTO_Etemenanki (Torre di Babele)">
      <app:Nome_C>Babilonia</app:Nome_C>
      <app:Descrizione>Tempio principale della città di Babilonia dedicato
al dio Marduk. Base quadrata di 92 metri di lato e alta circa 100
metri.</app:Descrizione>
      <app:Datastorica>II millennio a.C.</app:Datastorica>
      <app:Autore>Hammurabi</app:Autore>
      <app:Tipo>Tempio</app:Tipo>
      <app:Shape>
        <gml:Polygon gml:id="APP_MONUMENTO_Etemenanki (Torre di
Babele)_APP_SHAPE" srsName="EPSG:4326">
          <gml:exterior>
            <gml:LinearRing srsName="EPSG:4326">
              <gml:posList>44.421069 32.535315 44.421206 32.535379 44.421075
32.535759 44.421490 32.535887 44.421134 32.536819 44.420672 32.536692
44.420570 32.536928 44.420546 32.536808 44.420206 32.536582 44.420238
32.536582 44.420227 32.536283 44.420423 32.535677 44.420511 32.535625
44.420903 32.535734 44.421069 32.535315</gml:posList>
            </gml:LinearRing>
          </gml:exterior>
        </gml:Polygon>
      </app:Shape>
      <app:Confina_M xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="http://www.mygeoportal.com/services/WFScittaDB?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetGmlObject&OUTPUTFORMAT=text%2Fxml%3B+subtype%3Dgml%2F3.1.1&TRAVERSEXLINKDEPTH=0&GMLOBJECTID=feature_Strada5)#feature_Strada5)"/>
    </app:Monumento>
  </gml:featureMember>
</wfs:FeatureCollection>


I need the attribute xlink:href of Confina_M element because it contains
"Strada5" which is the name of a feature I want to show on the map. How can
I do this using OpenLayers?
This problem drives me out of my head, I have surfed the net but I can't
find a solution. I have to finish my thesis.

Best regards



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


More information about the Users mailing list