Merge remote branch 'gravitystorm/relationrevert'
authorRichard Fairhurst <richard@systemeD.net>
Fri, 27 May 2011 14:00:27 +0000 (15:00 +0100)
committerRichard Fairhurst <richard@systemeD.net>
Fri, 27 May 2011 14:00:27 +0000 (15:00 +0100)
13 files changed:
net/systemeD/potlatch2/mapfeatures/Feature.as
net/systemeD/potlatch2/mapfeatures/MapFeatures.as
net/systemeD/potlatch2/mapfeatures/editors/RouteIcon.mxml
net/systemeD/potlatch2/mapfeatures/editors/TurnRestrictionIcon.mxml
resources/features/pois/transport_car_wash.n.24.png [new file with mode: 0644]
resources/icons/accommodation_blank.png [deleted file]
resources/icons/shopping_garden_centre.n.16.png
resources/icons/transport_car_wash.n.16.png [new file with mode: 0644]
resources/imagery.xml
resources/map_features/buildings.xml
resources/map_features/tourism.xml
resources/map_features/transport.xml
resources/stylesheets/core_pois.css

index 007c87e0fd2a4095b382ecde2010c3c84e13288a..beb69ffaa88fc46e423109fa376a1cd93d4463d7 100644 (file)
@@ -81,7 +81,6 @@ package net.systemeD.potlatch2.mapfeatures {
             var inputType:String = inputXML.@type;
             var presenceStr:String = inputXML.@presence;
             var sortOrderStr:String = inputXML.@priority;
-//          _tags.push( { k:String(inputXML.@key) } ); /* add the key to tags so that e.g. addr:housenumber shows up on autocomplete */
             var editor:EditorFactory = EditorFactory.createFactory(inputType, inputXML);
             if ( editor != null ) {
                 editor.presence = Presence.getPresence(presenceStr);
index e7ce89592f70d4a0932213c35555328351c9eb90..605d0a854095a2e30163f0254b03f387a201ada1 100644 (file)
@@ -59,6 +59,10 @@ package net.systemeD.potlatch2.mapfeatures {
                     if (f.isType('relation'))                 { addToTagList('relation',tag); }
                     if (f.isType('point'))                    { addToTagList('node',tag); }
                 }
+
+                for each (var inputSet:XML in feature..inputSet) {
+                    tagsFromInputSet(definition.inputSet.(@id == String(inputSet.@ref)), f);
+                }
             }
 
             _categories = new Array();
@@ -69,6 +73,28 @@ package net.systemeD.potlatch2.mapfeatures {
             dispatchEvent(new Event("featuresLoaded"));
         }
 
+        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
+                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
+            for each (var i:XML in inputSet.inputSet) {
+                tagsFromInputSet(definition.inputSet.(@id == String(i.@ref)), f);
+            }
+        }
+
         /** Add one item to tagList index, which will end up being a list like: ["way"]["highway"]["residential"] */
                private function addToTagList(type:String,tag:Object):void {
                        if (tag.v=='*') { return; }
index 6eca2c7f760353ff4ea2a25bc79da970000f80d2..7ab0003d6388c279d5d4aab1d903a0e5d19ddde3 100644 (file)
     
     private function setRole(role:String):void {
         var member:RelationMember = new RelationMember(_route["entity"], role);
-        _route["relation"].setMember(_route["index"], member);
+        Relation(_route["relation"]).setMember(_route["index"], member, MainUndoStack.getGlobalStack().addAction);
     }
 
        private function removeFromRelation():void {
-               _route["relation"].removeMember(_route["entity"], MainUndoStack.getGlobalStack().addAction);
+               Relation(_route["relation"]).removeMember(_route["entity"], MainUndoStack.getGlobalStack().addAction);
        }
     
     ]]></mx:Script>
index 943a41c9c6080738697a9f9bf2e44e4c586c5ad1..40259a2671d9bc2663eba3b561526ff00b2d1014 100644 (file)
                // now add new entity
                rel.appendMember(new RelationMember(entity,role), undo.push);
 
-        undo.doAction();
+        MainUndoStack.getGlobalStack().addAction(undo);
 
                if (show.label=='Hide') { setHighlights(true); }
        }
diff --git a/resources/features/pois/transport_car_wash.n.24.png b/resources/features/pois/transport_car_wash.n.24.png
new file mode 100644 (file)
index 0000000..1c173e2
Binary files /dev/null and b/resources/features/pois/transport_car_wash.n.24.png differ
diff --git a/resources/icons/accommodation_blank.png b/resources/icons/accommodation_blank.png
deleted file mode 100644 (file)
index d12f23e..0000000
Binary files a/resources/icons/accommodation_blank.png and /dev/null differ
index 37d2ecc8eedc01cb8a974b38a1e5b517992e8e7e..7af4465d013aaec97bc22a6b9e45995bd292f4ac 100644 (file)
Binary files a/resources/icons/shopping_garden_centre.n.16.png and b/resources/icons/shopping_garden_centre.n.16.png differ
diff --git a/resources/icons/transport_car_wash.n.16.png b/resources/icons/transport_car_wash.n.16.png
new file mode 100644 (file)
index 0000000..07acd4e
Binary files /dev/null and b/resources/icons/transport_car_wash.n.16.png differ
index 5caaf3b0cc41233de392322d649301cb689b73d9..eaf416acb6b76664e7e12977a89fe1e1614e3a66 100644 (file)
        <set minlat="49.8" minlon="-9" maxlat="61.1" maxlon="1.9">
                <name>OS OpenData Streetview</name>
                <url>http://os.openstreetmap.org/sv/$z/$x/$y.png</url>
-               <sourcetag>OS OpenData StreetView</sourcetag>
+               <sourcetag>OS_OpenData_StreetView</sourcetag>
        </set>
        <set minlat="49.8" minlon="-9" maxlat="61.1" maxlon="1.9">
                <name>OS OpenData Locator</name>
                <url>http://tiles.itoworld.com/os_locator/$z/$x/$y.png</url>
-               <sourcetag>OS OpenData Locator</sourcetag>
+               <sourcetag>OS_OpenData_Locator</sourcetag>
                <sourcekey>source:name</sourcekey>
        </set>
        <set minlat="49.8" minlon="-9" maxlat="61.1" maxlon="1.9">
index dc6dc3c255b7d7680c2eabb6e25729c3a8d57c81..d05720c587674d92bc7087c13d960588fd4a2cdb 100644 (file)
       ${addr:housenumber} ${addr:street} ${addr:postcode}\r
     </icon>\r
 \r
-    <area/>\r
+    <area/>
+    <point/>\r
     <!-- This should catch all the "building=*" tags in use: yes, hut, house, residential, entrance, apartments, garage, industrial,  garages, service, manufacture, collapsed... \r
          Is this possible? -->\r
     <!-- <tag k="building" v="*"/> -->\r
index 826a52e6cc00c39ae280de7545b891820edad148..e807e186ed1ea47af6f22ac5c080dc0272f74ce6 100644 (file)
   </feature>\r
 \r
 \r
-  <feature name="Ruin">\r
+  <feature name="Ruins">\r
     <category>tourism</category>\r
     <point/>\r
     <area/>\r
     <inputSet ref="simpleName"/>\r
     <icon image="features/pois/tourist_ruin.n.24.png"/>\r
-    <tag k="historic" v="ruin"/>\r
+    <tag k="historic" v="ruins"/>\r
     <inputSet ref="common"/>\r
   </feature>\r
 \r
     <tag k="tourism" v="theme_park"/>\r
     <inputSet ref="common"/>\r
   </feature>\r
-</featureGroup>
\ No newline at end of file
+</featureGroup>\r
index a039e0ad8d9732e2f10c9085dd0fef09f3715100..7c0bad00b0d6e2f7f8cd14ae1447a75813923839 100644 (file)
         <inputSet ref="common"/>
       </feature>
     
+  <feature name="Car Wash">
+    <category>transport</category>
+    <icon image="features/pois/transport_car_wash.n.24.png">
+      ${name}
+    </icon>
+    <help>http://wiki.openstreetmap.org/wiki/Tag:amenity%3Dcar_wash</help>
+    <point/>
+    <area/>
+    <tag k="amenity" v="car_wash"/>
+    <inputSet ref="names"/>
+    <input type="freetext" presence="onTagMatch" category="Naming" name="Operator" key="operator" description="The company/organisation that runs the car wash" priority="low"/>
+    <input type="freetext" presence="onTagMatch" category="Operation" name="Opening hours" key="opening_hours" priority="normal"/>
+    <input type="choice" presence="onTagMatch" category="Operation" name="Self service" key="self_service" priority="low">
+       <choice value="yes" text="Yes" />
+       <choice value="no" text="No" />
+    </input>
+    <input type="choice" presence="onTagMatch" category="Operation" name="Automated" key="automated" priority="low">
+       <choice value="yes" text="Yes" />
+       <choice value="no" text="No" />
+    </input>
+    
+    <inputSet ref="common"/>
+  </feature>
     
       <feature name="Bus station">
         <category>transport</category>
index 158096d622c901f154ba50903c100fa7519fa286..62d804088ac01fd3d274761157456cd3033a8ea7 100644 (file)
@@ -62,7 +62,7 @@ node[historic=memorial] { icon-image: icons/tourist_memorial.n.16.png; text-offs
 node[historic=monument] { icon-image: icons/tourist_monument.n.16.png; text-offset:15; text: name; z-index: 20; }
 node[tourism=museum] { icon-image: icons/tourist_museum.n.16.png; text-offset:15; text: name; z-index: 20; }
 node[tourism=picnic_site] { icon-image: icons/tourist_picnic.n.16.png; z-index: 20; }
-node[historic=ruin] { icon-image: icons/tourist_ruin.n.16.png; z-index: 20; }
+node[historic=ruins] { icon-image: icons/tourist_ruin.n.16.png; z-index: 20; }
 node[amenity=theatre] { icon-image: icons/tourist_theatre.n.16.png; z-index: 20; }
 node[tourism=viewpoint] { icon-image: icons/tourist_view_point.n.16.png; z-index: 20; }
 node[tourism=zoo] { icon-image: icons/tourist_zoo.n.16.png; z-index: 20; }
@@ -70,6 +70,7 @@ node[aeroway=aerodrome] { icon-image: icons/transport_aerodrome.n.16.png; z-inde
 node[amenity=bus_station] { icon-image: icons/transport_bus_station.n.16.png; z-index: 20; }
 node[highway=bus_stop] { icon-image: icons/transport_bus_stop2.n.16.png; z-index: 20; }
 node[amenity=fuel] { icon-image: icons/transport_fuel.n.16.png; z-index: 20; }
+node[amenity=car_wash] { icon-image: icons/transport_car_wash.n.16.png; z-index: 20; }
 node[amenity=bicycle_parking] { icon-image: icons/transport_parking_bicycle.n.16.png; text-offset: 15; text: capacity; z-index: 20; }
 node[amenity=parking] { icon-image: icons/transport_parking_car.n.16.png; z-index: 20; }
 node[amenity=ferry_terminal] { icon-image: icons/transport_port.n.16.png; z-index: 20; }