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
Post a Comment