From 806fe7d4f6b60da9c4f444a1e5449813cd0d23b4 Mon Sep 17 00:00:00 2001 From: Richard Fairhurst Date: Sun, 5 Dec 2010 00:05:00 +0000 Subject: [PATCH] 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 --- potlatch2.mxml | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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); -- 2.30.0