[OpenLayers-Users] parse gml from WMS GetFeatureInfo

G. Allegri giohappy at gmail.com
Thu May 22 21:14:02 EDT 2008


I've not solved it yet, having no item. I used XML/DOM classical
methods to parse it. Anyway the GML output from the request was
correct...
Thank you

2008/5/22 Christopher Schmidt <crschmidt at metacarta.com>:
> On Thu, May 22, 2008 at 11:09:08PM +0200, G. Allegri wrote:
>> Thanks Christopher but I can't get it to work.
>> I had alreay tried to alert(_gml[0].geometry.CLASS_NAME) but I receive
>> that _gml[0] hasn't properties.
>
> Then your list is empty. Get firebug, console.log response.responseXML
> and _gml, and see what they look like, and check the data coming back in
> the XmlHttpRequest to see if there's anything there.
>
> -- Chris
>
>>
>>
>> 2008/5/22 Christopher Schmidt <crschmidt at metacarta.com>:
>> > On Thu, May 22, 2008 at 10:54:38PM +0200, G. Allegri wrote:
>> >> Hi list,
>> >> I need to parse the response I get from a GetFeatureInfo. I thought I
>> >> could do it with OpenLayers.Format.GML, but I get back nothing... I
>> >> tried this way:
>> >>
>> >>               var gmlReader = new OpenLayers.Format.GML({extractAttributes: true});
>> >>               var _gml = gmlReader.read(response.responseXML);
>> >>               var my_attributes = _gml.attributes;
>> >
>> >
>> > _gml is an array of OpenLayers.Feature.Vector objects.
>> >
>> > Regards,
>> > --
>> > Christopher Schmidt
>> > MetaCarta
>> >
>
> --
> Christopher Schmidt
> MetaCarta
>



More information about the Users mailing list