[OpenLayers-Users] problems using GPX format

Georg Kaspar georg at muenster.de
Mon Apr 4 06:15:48 EDT 2011


Hi,

I'm having problems including GPX track data into my application. The
source:

tmp_layer = new OpenLayers.Layer.Vector(o.result.name, {
   protocol: new OpenLayers.Protocol.HTTP({
      url: o.result.path,
      format: new OpenLayers.Format.GPX
   }),
   strategies: [new OpenLayers.Strategy.Fixed()],
   styleMap: style,
   projection: new OpenLayers.Projection("EPSG:4326")
});

leads to the following trace:

Uncaught TypeError: Cannot read property 'nodeType' of null
OpenLayers.js:1928
OpenLayers.Format.GPX.OpenLayers.Class.parseAttributesOpenLayers.js:1928
OpenLayers.Format.GPX.OpenLayers.Class.readOpenLayers.js:1920
OpenLayers.Protocol.HTTP.OpenLayers.Class.parseFeaturesOpenLayers.js:1801
OpenLayers.Protocol.HTTP.OpenLayers.Class.handleResponseOpenLayers.js:1797
OpenLayers.Protocol.HTTP.OpenLayers.Class.handleReadOpenLayers.js:1792
(anonymous function)OpenLayers.js:301
(anonymous function)OpenLayers.js:113
OpenLayers.Request.runCallbacksOpenLayers.js:922
request.onreadystatechangeOpenLayers.js:919
cXMLHttpRequest.dispatchEventOpenLayers.js:1198
fReadyStateChangeOpenLayers.js:1201
cXMLHttpRequest.open._object.onreadystatechangeOpenLayers.js:1185

strange though, the same code works with KML files (using KML format of
course)...

any help appreciated!
thanks & regards,
Georg



More information about the Users mailing list