[OpenLayers-Users] store getfeatureinfo results in variables

Roald de Wit roald.dewit at lisasoft.com
Thu Nov 5 05:48:08 EST 2009


Hi,

If you follow the path of WFS GetFeature (as suggested in a previous 
mail yesterday), you can manipulate the values any way you like, since 
they are stored as attributes in the features. WMS GetFEatureInfo 
generally only gives you plain text or HTML results. Getting XML back is 
sometimes possible too. You could then use the OL XML Format to parse that.

Regards, Roald

stash wrote:
> Hello,
> with the following code, I get a wms getfeatureinfo request and the
> information are shown on a window.
>
> map.events.register('click', map, function(e) {
>                var url = "http://...:8080/geoserver/wms" +
> "?REQUEST=GetFeatureInfo" + "&EXCEPTIONS=application/vnd.ogc.se_xml"
>                + "&BBOX=" + map.getExtent().toBBOX()
>                + "&X=" + e.xy.x
>                + "&Y=" + e.xy.y
>                + "&INFO_FORMAT=text/html"
>                + "&QUERY_LAYERS=MY_LAYER"
>                + "&LAYERS=MY_LAYER"
>                + "&FEATURE_COUNT=50"
>                + "&SRS=EPSG:4326"
>                + "&STYLES="
>                + "&WIDTH=" + map.size.w
>                + "&HEIGHT=" + map.size.h;
>
>  window.open(url, "getfeatureinfo",
> "location=0,status=0,scrollbars=1,width=800,height=400");
>
> This is working fine so far. But there is one thing, I don't like. I'm
> talking about the values I get back. Because every time I get a featureinfo
> I get some abbreviations (for example 'ger' instead of 'germany'). This is
> because of the values stored in the database.
>
> Because of this I would like to change the values before the window will
> show them. Is there any possibility to do this. I watched the code in
> firebug but the only thing i saw was the url (getfeatureinfo request).
>
> Can I store the values I get back in variables (to change it manually) and
> then show it in a window?
>
> Please help
>
> Regards
> stash
>
>
>   




More information about the Users mailing list