Add the freetext keys to the autocomplete list - now supports e.g. addr:housenumber
authorAndy Allan <andy@gravitystorm.co.uk>
Fri, 27 May 2011 09:48:26 +0000 (10:48 +0100)
committerAndy Allan <andy@gravitystorm.co.uk>
Fri, 27 May 2011 09:48:26 +0000 (10:48 +0100)
net/systemeD/potlatch2/mapfeatures/MapFeatures.as

index 789241a..605d0a8 100644 (file)
@@ -76,12 +76,17 @@ package net.systemeD.potlatch2.mapfeatures {
         private function tagsFromInputSet(inputSet:XMLList, f:Feature):void {
             for each (var input:XML in inputSet.input) {
                 // Take all the k/v pairs from inputs that have choice
-                // Todo - add the freetext keys (source, addr:housenumber etc)
                 for each (var choice:XML in input..choice ) {
                     if (f.isType('line') || f.isType('area')) { addToTagList('way', {k:String(input.@key), v:String(choice.@value)}); }
                     if (f.isType('relation'))                 { addToTagList('relation',{k:String(input.@key), v:String(choice.@value)}); }
                     if (f.isType('point'))                    { addToTagList('node',{k:String(input.@key), v:String(choice.@value)}); }
                 }
+
+                if (input.@type == 'freetext') {
+                    if (f.isType('line') || f.isType('area')) { addToTagList('way', {k:String(input.@key), v:''}); }
+                    if (f.isType('relation'))                 { addToTagList('relation',{k:String(input.@key), v:''}); }
+                    if (f.isType('point'))                    { addToTagList('node',{k:String(input.@key), v:''}); }
+                }
             }
 
             // inputSets can have their own inputSets, so recurse