pass the URL of a GPX in the gpx_url parameter, as requested by Nop. There's a fair...
authorRichard Fairhurst <richard@systemed.net>
Sun, 5 Dec 2010 00:05:00 +0000 (00:05 +0000)
committerRichard Fairhurst <richard@systemed.net>
Sun, 5 Dec 2010 00:05:00 +0000 (00:05 +0000)
potlatch2.mxml

index 9fc20b2..47f00c7 100644 (file)
                 }
             }
 
                 }
             }
 
+                       // 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);
 
                        // create GPS trackloader
                        trackLoader=new TrackLoader(theMap,conn.apiBase);