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 263dacb786231f42e1a72f17b2c8f0d18098ba2b..665e627f9d374921f94fc83f6bfae6611ffaa48d 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 19b2b5128561540989c2e68d278d386bf5240dca..3e7b0c1a33d9eb4c356d996cacb35461effc4344 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;