[OpenLayers-Users] Openlayer

Julien Cigar jcigar at ulb.ac.be
Wed Nov 28 06:21:51 PST 2012


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
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20121128/27088436/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jcigar.vcf
Type: text/x-vcard
Size: 292 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20121128/27088436/attachment.vcf>


More information about the Users mailing list