[OpenLayers-Users] export line to gpx

vrbikdan vrbikdan at gmail.com
Sun Mar 20 12:54:31 EDT 2011


Hi,
I'm trying to export line I drawed to gpx and save in my computer. Now I'm able 
to draw a line via this code:

controls = {
line: new OpenLayers.Control.DrawFeature(trasa,OpenLayers.Handler.Path)};
      for(var key in controls) {
         map.addControl(controls[key]);
      }

function createLine(element) {
    for(key in controls) {
      var control = controls[key];
      if(sta == 'd') {
        control.activate();
	sta = 'a';
	document.getElementById('button').setAttribute('value','UKONČIT 
KRESLENÍ');
      } 
      else {
        control.deactivate();
	sta = 'd';
        document.getElementById('button').setAttribute('value',
'KRESLIT');
      }
    }
}

But I have no idea, how to export this line. Do you know some manual or 
something? I know, that I should use OpenLayers.Format.GPX, but I have no idea 
how :(. I'm just beginner in JavaScript so it's difficult with me.

Thanks, Dan



More information about the Users mailing list