On 11/28/2012 15:00, yassine bouderaa wrote:
Thanks for your answer. in matter of fact I do the getfeatureinfo(wms request) but I don't know how can'I extract the PK from it. here is a part of my code which get the feature data .
map.events.register('click', map, function (e) {
  //alert(map.getExtent().toBBOX());
  x1=parseInt(e.xy.x);
  y1=parseInt(e.xy.y);
    var url = 'http://localhost:8181/geoserver/cite/wms'
      + "?REQUEST=GetFeatureInfo"
      + "&EXCEPTIONS=application/vnd.ogc.se_xml"
      + "&BBOX=" + map.getExtent().toBBOX()
      + "&X=" + x1
      + "&Y=" + y1
      + "&INFO_FORMAT=text/html"
      + "&QUERY_LAYERS=cite:test"
      + "&LAYERS=test"
      + "&FEATURE_COUNT=50"
      + "&SRS=EPSG:900913"
      + "&STYLES="
      + "&WIDTH=" + map.size.w
      + "&HEIGHT=" + map.size.h;
    window.open(url,
      "getfeatureinfo",
      "location=10,status=10,scrollbars=1,width=600,height=150"
    );
  });


this is really a dirty way to do a GetFeatureInfo request. You should use the OpenLayers.Control.WMSGetFeatureInfo control. You can control the output format with the infoFormat property (defaults to 'text/html', but you can use 'application/vnd.ogc.gml' for GML).

If you use the 'application/vnd.ogc.gml' infoFormat then the GML is available under the 'features' property of the getfeatureinfo event listener

but the probleme here is the data is displayed in a new window page !!!!
is there anything you can do for more help and thank you


_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users


--
No trees were killed in the creation of this message.
However, many electrons were terribly inconvenienced.

<<attachment: jcigar.vcf>>

_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to