[OpenLayers-Users] store getfeatureinfo results in variables
stash
st.sonstiges at web.de
Thu Nov 5 07:48:09 EST 2009
Roald de Wit-2 wrote:
>
> Hi stash,
>
> stash wrote:
>> Hi Roald,
>> thanks for your answer. I know it would be much easier if I used a wfs
>> getfeature instead of a wms getfeatureinfo. But the problem is that my
>> proxyhost doesn't work (I don't know why and I spent so much time in
>> solving
>> this problem), therefore I want to solve my problem with a wms.
>>
>> You wrote that it is sometimes possible to get a xml back even with wms.
>> What do you mean by this?
>>
> Different WMS servers have different output formats for GetFeaturInfo.
> IIRC you are using GeoServer. If that is correct, you can specify the
> INFO_FORMAT to be 'application/vnd.ogc.gml', then you could pass the
> output to the OL GML reader which looks a bit like this:
>
> var gmlReader = new OpenLayers.Format.GML();
>
> var features = gmlReader.read(data); // assuming the result of the
> output is in the variable called data
>
> Then you can loop through the features and change the attribute
> information any way you like and visualise it any way you want.
>
> Regards, Roald
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
Thanks. That's a good advice. I tried it and I get back a gml with all the
features .That's great. But unfortunately I can't read it with my gmlReader.
What value do I have to insert at gmlreader.read(data) instead of data so
that i can read my output.
Thanks for the help.
Regards
stash
--
View this message in context: http://n2.nabble.com/store-getfeatureinfo-results-in-variables-tp3951318p3951905.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list