[OpenLayers-Users] parse gml from WMS GetFeatureInfo

Christopher Schmidt crschmidt at metacarta.com
Thu May 22 17:29:49 EDT 2008


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