From: Richard Fairhurst Date: Sun, 5 Dec 2010 00:05:00 +0000 (+0000) Subject: pass the URL of a GPX in the gpx_url parameter, as requested by Nop. There's a fair... X-Git-Tag: 2.0~253 X-Git-Url: https://git.openstreetmap.org/potlatch2.git/commitdiff_plain/806fe7d4f6b60da9c4f444a1e5449813cd0d23b4 pass the URL of a GPX in the gpx_url parameter, as requested by Nop. There's a fair amount of refactoring one could do, but this'll do for now --- diff --git a/potlatch2.mxml b/potlatch2.mxml index 9fc20b23..47f00c73 100644 --- a/potlatch2.mxml +++ b/potlatch2.mxml @@ -242,6 +242,18 @@ } } + // Load arbitrary GPX from provided URL + if (loaderInfo.parameters['gpx_url']) { + var vectorlayer:VectorLayer=new VectorLayer(name,theMap,"gpx.css"); + vectorlayer.url=loaderInfo.parameters['gpx_url']; + var gpx:GpxImporter=new GpxImporter(vectorlayer, vectorlayer.paint, [vectorlayer.url], + function(success:Boolean,message:String=null):void { + if (!success) return; + theMap.addVectorLayer(vectorlayer); + dispatchEvent(new Event("layers_changed")); + }, false); + } + // create GPS trackloader trackLoader=new TrackLoader(theMap,conn.apiBase);