Can OpenLayers parse GPX data which is stored as a string in a javascript variable? -



Can OpenLayers parse GPX data which is stored as a string in a javascript variable? -

i have map site using openlayers, imports , displays gpx info using next code:

var lgpx = new openlayers.layer.gml(gpxtracktitle, gpxfileaddress, { format: openlayers.format.gpx, style: {strokecolor: plmapvars.colourarray[i%7], strokewidth: 5, strokeopacity: 0.7}, projection: new openlayers.projection("epsg:4326") }); map.addlayer(lgpx);

i'm looking way display gpx info which, rather beingness stored file, saved string in javascript variable:

var gpxstring ="<?xml ... </gpx>"

i've tried passing string code above info uri, without success. openlayers capable of parsing gpx string in way i'm attempting it?

thanks in advance help.

maybe there easier way, here go:

you know openlayers.format.gpx [docs]. has read method, accepts xml document , returns array of features. can add together feature layer.

how parse xml string , create xml document described in how create , utilize xml document object considering browser compatibility?

openlayers gpx

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -