Hi. I am trying to develop an application that displays the result of a Route Finder algorithm. The route is the result of invoking a WPS service that returns a GMLPacket with a LineString.
I was able to draw the route by manually parsing the Coordinates and creating Geometry Points and a LineString, but I was wondering if there is a better way. So far I have tried using OpenLayers.Format.GML (.read, .parseFeature .parseGeometry.linestring) and OpenLayers.Format.WFST(.read) passing a dom element with the GMLPacket without success. Which is the correct way of parsing the GML? The GMLPacket has the following structure (coordinates abbreviated for clarity): <pac:GMLPacket xmlns:pac="http://www.opengis.net/examples/packet"> <pac:packetMember> <pac:StaticFeature> <gml:lineStringProperty xmlns:gml="http://www.opengis.net/gml"> <gml:LineString> <gml:Coordinates decimal="." cs=", " ts=" ">-3.37311377427177, 40.49464603550032 -3.373278606759657, 40.49458119028385 -3.3731094985900345, 40.48313247722438</gml:Coordinates> </gml:LineString> </gml:lineStringProperty> </pac:StaticFeature> </pac:packetMember> </pac:GMLPacket> This is an excerpt of my JS code. var map; //the OpenLayers map var layer = new OpenLayers.Layer.Vector("Route Layer"); map.addLayers([layer]); var gmlpacket; //dom with the GMLPacket var fmt = new OpenLayers.Format.GML(); gml.read(packet); //fails with TypeError: node is undefined gml.parseFeature(packet); //returns a Vector with emtpy data layer.addFeatures([feature]); Any help is really appreciated. Regards, Rodrigo. -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/parse-GMLPacket-tp5599717p5599717.html Sent from the OpenLayers Users mailing list archive at Nabble.com. _______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
