Support importing the <create> element only of <osmChange> files
authorRichard Fairhurst <richard@systemeD.net>
Mon, 3 Oct 2011 16:22:22 +0000 (17:22 +0100)
committerRichard Fairhurst <richard@systemeD.net>
Mon, 3 Oct 2011 16:22:22 +0000 (17:22 +0100)
net/systemeD/potlatch2/utils/Importer.as
net/systemeD/potlatch2/utils/OsmImporter.as

index 263dacb..665e627 100644 (file)
@@ -42,9 +42,9 @@ package net.systemeD.potlatch2.utils {
                }
                
                protected function fileLoaded(e:Event,filenum:uint):void {
-                       trace("loaded file "+filenum); 
                        files[filenum]=e.target.data;
                        filesloaded++;
+                       trace("loaded file "+filenum+" ("+filesloaded+"/"+filenames.length+")"); 
                        if (filesloaded==filenames.length) {
                 var action:CompositeUndoableAction = new CompositeUndoableAction("Import layer "+connection.name);
                                doImport(action.push);
index 19b2b51..3e7b0c1 100644 (file)
@@ -12,8 +12,9 @@ package net.systemeD.potlatch2.utils {
 
                override protected function doImport(push:Function):void {
                        var map:XML = new XML(files[0]);
+                       if (map.name().localName=='osmChange') { map=map.create[0]; }
+
                        var data:XML;
-                       
             var oldid:Number;
             var tags:Object;