more turn restriction stuff, and checkboxes, and a bunch of little fixes
authorRichard Fairhurst <richard@systemed.net>
Thu, 8 Jul 2010 09:12:04 +0000 (09:12 +0000)
committerRichard Fairhurst <richard@systemed.net>
Thu, 8 Jul 2010 09:12:04 +0000 (09:12 +0000)
18 files changed:
net/systemeD/halcyon/WayUI.as
net/systemeD/halcyon/connection/Connection.as
net/systemeD/halcyon/connection/Node.as
net/systemeD/halcyon/connection/XMLBaseConnection.as
net/systemeD/halcyon/styleparser/Style.as
net/systemeD/potlatch2/controller/SelectedWayNode.as
net/systemeD/potlatch2/mapfeatures/EditorFactory.as
net/systemeD/potlatch2/mapfeatures/editors/CheckboxEditor.mxml [new file with mode: 0755]
net/systemeD/potlatch2/mapfeatures/editors/CheckboxEditorFactory.as [new file with mode: 0755]
net/systemeD/potlatch2/mapfeatures/editors/ChoiceEditor.mxml
net/systemeD/potlatch2/mapfeatures/editors/FreeTextEditor.mxml
net/systemeD/potlatch2/mapfeatures/editors/FreeTextEditorFactory.as
net/systemeD/potlatch2/mapfeatures/editors/SingleTagEditor.as
net/systemeD/potlatch2/mapfeatures/editors/SingleTagEditorFactory.as
net/systemeD/potlatch2/mapfeatures/editors/TurnRestrictionEditor.mxml
net/systemeD/potlatch2/mapfeatures/editors/TurnRestrictionIcon.mxml
resources/map_features.xml
resources/potlatch.css

index 199381992e8e15fb9f3a6667b4469bb1fbce17ef..ea3d14a6aaa0a724e538a4fbbff15fd0c934669e 100755 (executable)
@@ -35,6 +35,7 @@ package net.systemeD.halcyon {
             attachRelationListeners();
             recalculate();
                        redraw();
+                       redrawMultis();
                }
                
                private function attachNodeListeners():void {
@@ -190,6 +191,7 @@ package net.systemeD.halcyon {
                        for each (var m:Relation in multis) {
                                inners=inners.concat(m.findMembersByRole('inner'));
                        }
+
                        for each (var sublayer:Number in sl.sublayers) {
                                if (sl.shapeStyles[sublayer]) {
                                        var s:ShapeStyle=sl.shapeStyles[sublayer];
index 13a9914ab68a08b47a9b88de0bc0af526cb2967f..f8e23713c8608df2d4dc572ee89f9ba359b83aae 100755 (executable)
@@ -275,6 +275,7 @@ package net.systemeD.halcyon.connection {
                        var ok:Boolean;
             for each (var relation:Relation in relations) {
                                ok=true;
+                               if (relation.deleted) { ok=false; }
                                for (var k:String in match) {
                                        if (!relation.getTagsHash()[k] || relation.getTagsHash()[k]!=match[k]) { ok=false; }
                                }
index 4982db07c260486d837e6f9596fc36ee32461f0d..ab86a8c5a189fa4441117721b6a92eccb240c680 100644 (file)
@@ -15,7 +15,7 @@ package net.systemeD.halcyon.connection {
         }
 
                public function update(version:uint, tags:Object, loaded:Boolean, lat:Number, lon:Number):void {
-                       updateEntityProperties(version,tags,loaded); this.lat=lat; this.lon=lon;
+                       updateEntityProperties(version,tags,loaded); setLatLonImmediate(lat,lon);
                }
 
         public function get lat():Number {
index 9c68b0e68382b435f84cc6017b3187a11f696503..6f67b5f7ab972c99a39bb96cdcf4affccccb7dd2 100644 (file)
@@ -21,43 +21,6 @@ package net.systemeD.halcyon.connection {
             var version:uint;
             var tags:Object;
 
-            for each(var nodeData:XML in map.node) {
-                id = Number(nodeData.@id);
-                version = uint(nodeData.@version);
-
-                var node:Node = getNode(id);
-                if ( node == null || !node.loaded ) {
-                    var lat:Number = Number(nodeData.@lat);
-                    var lon:Number = Number(nodeData.@lon);
-                    tags = parseTags(nodeData.tag);
-                    if ( node == null )
-                        setNode(new Node(id, version, tags, true, lat, lon),false);
-                    else {
-                        node.update(version, tags, true, lat, lon);
-                        sendEvent(new EntityEvent(NEW_NODE, node), false);
-                    }
-                }
-            }
-
-            for each(var data:XML in map.way) {
-                id = Number(data.@id);
-                version = uint(data.@version);
-
-                var way:Way = getWay(id);
-                if ( way == null || !way.loaded ) {
-                    var nodes:Array = [];
-                    for each(var nd:XML in data.nd)
-                        nodes.push(getNode(Number(nd.@ref)));
-                    tags = parseTags(data.tag);
-                    if ( way == null )
-                        setWay(new Way(id, version, tags, true, nodes),false);
-                    else {
-                        way.update(version, tags, true, nodes);
-                        sendEvent(new EntityEvent(NEW_WAY, way), false);
-                    }
-                }
-            }
-            
             for each(var relData:XML in map.relation) {
                 id = Number(relData.@id);
                 version = uint(relData.@version);
@@ -104,6 +67,43 @@ package net.systemeD.halcyon.connection {
                 }
             }
             
+            for each(var nodeData:XML in map.node) {
+                id = Number(nodeData.@id);
+                version = uint(nodeData.@version);
+
+                var node:Node = getNode(id);
+                if ( node == null || !node.loaded ) {
+                    var lat:Number = Number(nodeData.@lat);
+                    var lon:Number = Number(nodeData.@lon);
+                    tags = parseTags(nodeData.tag);
+                    if ( node == null )
+                        setNode(new Node(id, version, tags, true, lat, lon),false);
+                    else {
+                        node.update(version, tags, true, lat, lon);
+                        sendEvent(new EntityEvent(NEW_NODE, node), false);
+                    }
+                }
+            }
+
+            for each(var data:XML in map.way) {
+                id = Number(data.@id);
+                version = uint(data.@version);
+
+                var way:Way = getWay(id);
+                if ( way == null || !way.loaded ) {
+                    var nodes:Array = [];
+                    for each(var nd:XML in data.nd)
+                        nodes.push(getNode(Number(nd.@ref)));
+                    tags = parseTags(data.tag);
+                    if ( way == null )
+                        setWay(new Way(id, version, tags, true, nodes),false);
+                    else {
+                        way.update(version, tags, true, nodes);
+                        sendEvent(new EntityEvent(NEW_WAY, way), false);
+                    }
+                }
+            }
+            
             registerPOINodes();
         }
         
index 0c1afdbce1cc62bf7a9df015a4cbef29fdde039f..8f8e22eed6314c07cd9d250f1e1527df9ded836f 100755 (executable)
@@ -7,7 +7,7 @@ package net.systemeD.halcyon.styleparser {
 
                public var merged:Boolean=false;
                public var edited:Boolean=false;                // true once a property has been set from a string
-               public var sublayer:uint=5;
+               public var sublayer:Number=5;
                public var interactive:Boolean=true;    
                public var evals:Object={};                             // compiled SWFs for each eval. We keep it here, not in the property 
                                                                                                //  | itself, so that we can retain typing for each property
index d6b96b51e3b0bf70eebbf248d0367d120887983d..3e3411e236d0017408d43b7119363744054e5d00 100644 (file)
@@ -22,7 +22,7 @@ package net.systemeD.potlatch2.controller {
 
             clearSelection(this);
             controller.setSelectedEntity(node);
-            controller.map.setHighlight(way, { showNodes: true, nodeSelected: node.id });
+            controller.map.setHighlight(way, { hover: false, showNodes: true, nodeSelected: node.id });
             selectedWay = way; initWay = way;
                        selectedIndex = index; initIndex = index;
             selectedNode = node;
index 6e0bd18eda4150890fb45dcd4ddf41e5ae4c31ad..017523ebd4e6546ae2c1425963bdeb99b72e1864 100644 (file)
@@ -16,6 +16,7 @@ package net.systemeD.potlatch2.mapfeatures {
             switch ( inputType ) {
             
             case "freetext": return new FreeTextEditorFactory(inputXML);
+            case "checkbox": return new CheckboxEditorFactory(inputXML);
             case "choice": return new ChoiceEditorFactory(inputXML);
             case "speed": return new SpeedEditorFactory(inputXML);
             case "route": return new RouteEditorFactory(inputXML);
@@ -65,6 +66,7 @@ package net.systemeD.potlatch2.mapfeatures {
         public function get description():String {
             return _description;
         }
+
     }
 
 }
diff --git a/net/systemeD/potlatch2/mapfeatures/editors/CheckboxEditor.mxml b/net/systemeD/potlatch2/mapfeatures/editors/CheckboxEditor.mxml
new file mode 100755 (executable)
index 0000000..bef6075
--- /dev/null
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<edit:SingleTagEditor
+       xmlns:mx="http://www.adobe.com/2006/mxml" 
+       xmlns:edit="net.systemeD.potlatch2.mapfeatures.editors.*"
+       xmlns:flexlib="flexlib.controls.*"
+       verticalGap="0"
+       width="100%"
+       toolTip="{fieldDescription}">
+
+       <mx:HBox>
+       <mx:Label text="{fieldName}:"/>
+       <mx:CheckBox id="inputBox" creationComplete="initCheckbox()"
+                                labelPlacement="right" label=""
+                                change="value=toYesNo()" />
+       </mx:HBox>
+  <mx:Script><![CDATA[
+  
+       protected function initCheckbox():void {
+               // ** FIXME - these should really be bindings (selected="{...}"). 
+               //    500 bonus points if you can get them to work as such, because I can't.
+               inputBox.selected=parseBoolean(value);
+               inputBox.label=checkValidity(value);
+               dispatchEvent(new Event("factory_set"));
+       }
+
+       [Bindable(event="factory_set")]
+       protected function checkValidity(value:String):String {
+               if (_factory==null || value==null) { return CheckboxEditorFactory(_factory).notPresentText; }
+               var cv:String=value.toLowerCase();
+               if (cv=='yes' || cv=='no' || cv=='1' || cv=='0' || cv=='true' || cv=='false') { return null; }
+               return CheckboxEditorFactory(_factory).notBooleanText;
+       }
+
+       [Bindable(event="factory_set")]
+       protected function parseBoolean(value:String):Boolean {
+               if (!value) { return false; }
+               var cv:String=value.toLowerCase();
+               if (cv=='yes' || cv=='1' || cv=='true') { return true; }
+               return false;
+       }
+       
+       protected function toYesNo():String {
+               inputBox.label='';
+               return inputBox.selected ? 'yes':'no';
+       }
+       
+  ]]></mx:Script>
+</edit:SingleTagEditor>
+
diff --git a/net/systemeD/potlatch2/mapfeatures/editors/CheckboxEditorFactory.as b/net/systemeD/potlatch2/mapfeatures/editors/CheckboxEditorFactory.as
new file mode 100755 (executable)
index 0000000..3e98470
--- /dev/null
@@ -0,0 +1,27 @@
+package net.systemeD.potlatch2.mapfeatures.editors {
+
+    import net.systemeD.halcyon.connection.*;
+    import net.systemeD.potlatch2.mapfeatures.*;
+    import flash.display.*;
+
+       public class CheckboxEditorFactory extends SingleTagEditorFactory {
+           private var _notPresentText:String;
+           private var _notBooleanText:String;
+        
+        public function CheckboxEditorFactory(inputXML:XML) {
+            super(inputXML);
+            _notPresentText = inputXML.hasOwnProperty("@absenceText") ? String(inputXML.@absenceText) : "Unset";
+            _notBooleanText = inputXML.hasOwnProperty("@invalidText") ? String(inputXML.@absenceText) : "Not yes/no";
+        }
+        
+        override protected function createSingleTagEditor():SingleTagEditor {
+            return new CheckboxEditor();
+        }
+        
+        public function get notPresentText():String { return _notPresentText; }
+        public function get notBooleanText():String { return _notBooleanText; }
+    }
+
+}
+
+
index 0126334f5b73ba7825f9ee18d7434ccf85f2ced7..0df86a97839e8a74a666ec776ff487a502925bfc 100644 (file)
@@ -5,6 +5,7 @@
        verticalGap="0"
        toolTip="{fieldDescription}">
 
+<mx:Box direction="{fieldDirection}">
   <mx:Label text="{fieldName}:"/>
   <edit:ChoiceComboBox id="inputBox" dataProvider="{choices}" selectedItem="{selectFromTag}"
       change="value = inputBox.selectedItem.value"
@@ -18,6 +19,7 @@
         </mx:Component>
       </edit:itemRenderer>
   </edit:ChoiceComboBox>
+</mx:Box>
 
   <mx:Script><![CDATA[
       import mx.collections.*;
index 0c9819c7e4166fa3e0b44e09f30edebec52e3c60..e49b2e3d47c08c27b191782e521cf71de1331c45 100644 (file)
@@ -7,8 +7,10 @@
        width="100%"
        toolTip="{fieldDescription}">
 
+  <mx:Box direction="{fieldDirection}">
   <mx:Label text="{fieldName}:"/>
   <flexlib:PromptingTextInput id="inputBox" prompt="{prompt}" text="{value}" width="100%" change="value = inputBox.text"/>
+  </mx:Box>
 
   <mx:Script><![CDATA[
   
index 2b209e2175356370574ff91d2b48c969a8a6784f..dc1c3b93aec59aa3f5d7a3c970da9077a85aa0e2 100644 (file)
@@ -19,6 +19,7 @@ package net.systemeD.potlatch2.mapfeatures.editors {
         public function get notPresentText():String {
             return _notPresentText;
         }
+
     }
 
 }
index c600745c4896735e02d85e73317aa426ba2d9e1b..6e2b87b6f9043b1bf6ce2bfe566082eb512328c6 100644 (file)
@@ -19,6 +19,11 @@ package net.systemeD.potlatch2.mapfeatures.editors {
       public function get fieldDescription():String {
           return _factory == null ? "" : _factory.description;
       }
+
+      [Bindable(event="factory_set")]
+      public function get fieldDirection():String {
+          return _factory == null ? "" : _factory.direction;
+      }
       
       [Bindable(event="tag_changed")]
       public function get value():String {
index f6e858b2f43525277cd286bb8ea154497dbbb09f..05df6c9c58dca4e70578367104cedf9290304f7c 100644 (file)
@@ -6,10 +6,12 @@ package net.systemeD.potlatch2.mapfeatures.editors {
 
        public class SingleTagEditorFactory extends EditorFactory {
            private var tagKey:String;
+               private var boxDirection:String;
         
         public function SingleTagEditorFactory(inputXML:XML) {
             super(inputXML);
             tagKey = inputXML.@key;
+                       boxDirection = inputXML.@layout=='horizontal' ? 'horizontal' : 'vertical';
         }
         
         override public function areTagsMatching(entity:Entity):Boolean {
@@ -20,6 +22,10 @@ package net.systemeD.potlatch2.mapfeatures.editors {
             return tagKey;
         }
         
+        public function get direction():String {
+            return boxDirection;
+        }
+        
         override public function createEditorInstance(entity:Entity):DisplayObject {
             var editor:SingleTagEditor = createSingleTagEditor();
             editor.factory = this;
index b007f97983deea1539e0d660d8e02440e99a0ee4..c5ee509136aa972eb110ad511f63c721f7744381 100755 (executable)
@@ -15,7 +15,6 @@
   <mx:Script><![CDATA[
        import net.systemeD.halcyon.connection.*;
        import net.systemeD.potlatch2.*;
-       import mx.managers.PopUpManager;
        import mx.core.*;
 
        /* ** FIXME: some of this is common with RouteEditor.mxml. We can probably refactor */
                for each(var relation:Object in matchedRelations) {
                        var icon:TurnRestrictionIcon = new TurnRestrictionIcon();
                        icon.setTurnRestriction(relation);
-                       
-                       icon.addEventListener(MouseEvent.CLICK, turnRestrictionClicked);
                        turnRestrictionIcons.addChild(icon);
                }
        }
-       
-       public function turnRestrictionClicked(event:Event):void {
-               var relation:Object = TurnRestrictionIcon(event.currentTarget).turnRestriction;
-               var panel:RelationEditorPanel = RelationEditorPanel(
-                       PopUpManager.createPopUp(Application(Application.application), RelationEditorPanel, true));
-               panel.setRelation(relation["relation"]);
-               PopUpManager.centerPopUp(panel);
-       }
 
        public function addNewTurnRestriction():void {
                var conn:Connection = Connection.getConnectionInstance();
index 9603601927344c7d406bdc3347c9be610fea12b1..3860bcebef79bf3bb12a11422589b15f75ac71b7 100755 (executable)
@@ -3,10 +3,12 @@
        xmlns:mx="http://www.adobe.com/2006/mxml" 
        xmlns:edit="net.systemeD.potlatch2.mapfeatures.editors.*"
        xmlns:flexlib="flexlib.controls.*"
+       horizontalScrollPolicy="off"
        borderStyle="inset" verticalAlign="middle" width="100%" paddingLeft="3">
-       
+
+       <mx:VBox width="100%">
        <mx:Grid width="100%">
-               <mx:GridRow>
+               <mx:GridRow width="100%">
                        <mx:GridItem rowSpan="2">
                                <edit:ChoiceComboBox id="inputBox" dropdownFactory="mx.controls.TileList"
                                        itemRenderer="net.systemeD.potlatch2.mapfeatures.editors.TurnRestrictionRenderer"
                                        </mx:ArrayCollection>
                                </edit:ChoiceComboBox>
                                </mx:GridItem>
-                       <mx:GridItem><mx:Text text="From" selectable="false"/></mx:GridItem>
-                       <mx:GridItem><mx:ComboBox id="from" dataProvider="{connectingWays}"
+                       <mx:GridItem>
+                       <mx:Text text="From" selectable="false"/>
+                       </mx:GridItem>
+                       <mx:GridItem width="100%" id="fromCt">
+                                                <mx:ComboBox id="from" dataProvider="{connectingWays}" width="{fromCt.width}"
                                                        selectedItem="{findSelected('from')}"
                                                        change="setMember(from.selectedItem.data,'from')"
                                                        click="event.stopPropagation()" /></mx:GridItem>
                </mx:GridRow>
+
                <mx:GridRow>
                        <mx:GridItem><mx:Text text="To" selectable="false"/></mx:GridItem>
-                       <mx:GridItem><mx:ComboBox id="to" dataProvider="{connectingWays}"
+                       <mx:GridItem width="100%" id="toCt">
+                                                <mx:ComboBox id="to" dataProvider="{connectingWays}" width="{toCt.width}"
                                                        selectedItem="{findSelected('to')}"
                                                        change="setMember(to.selectedItem.data,'to')"
                                                click="event.stopPropagation()" /></mx:GridItem>
                </mx:GridRow>
        </mx:Grid>
 
+       <mx:HBox>
+               <mx:LinkButton id="show" label="Show" click="showFromTo()" paddingTop="0" paddingLeft="0" paddingBottom="0" paddingRight="0" />
+               <mx:Text text="|" color='0xCCCCCC' />
+               <mx:LinkButton label="Advanced..." click="openAdvanced()" paddingTop="0" paddingLeft="0" paddingBottom="0" paddingRight="0"  />
+               <mx:Text text="|" color='0xCCCCCC' />
+               <mx:LinkButton label="Delete" click="deleteRestriction()" paddingTop="0" paddingLeft="0" paddingBottom="0" paddingRight="0"  />
+       </mx:HBox>
+       </mx:VBox>
+
     <mx:Script><![CDATA[
     import net.systemeD.halcyon.connection.*;
     import net.systemeD.halcyon.styleparser.RuleSet;
+    import net.systemeD.potlatch2.RelationEditorPanel;
     import net.systemeD.potlatch2.mapfeatures.*;
+       import net.systemeD.halcyon.Map;
+       import net.systemeD.halcyon.Globals;
     import flash.events.*;
     import mx.collections.ArrayCollection;
        import mx.utils.ObjectProxy;
+       import mx.core.Application;
+       import mx.managers.PopUpManager;
 
     private var _turn:Object;
        [Bindable(event="turn_inited")] private var connectingWays:ArrayCollection;
 
                var ways:Array=[];
                for each (var way:Way in Entity(_turn.entity).parentWays) {
-                       ways.push( { label:way.getDescription(), data:way } );
+                       // ** FIXME - endsWith only works for nodes, and ways can be in the 'via' role too
+                       if (way.endsWith(Node(_turn.entity))) {
+                               ways.push( { label:way.getDescription(), data:way } );
+                       }
                }
                connectingWays=new ArrayCollection(ways);
 
@@ -65,7 +89,6 @@
     }
 
        private function findSelected(role:String):Object {
-               trace("calling findSelected for "+role);
                var rel:Relation=Relation(_turn.relation);
                for each (var item:Object in connectingWays) {
                        if (rel.hasMemberInRole(item.data,role)) { return item; }
        }
     
        private function setMember(entity:Entity,role:String):void {
-               trace("setMember "+role+" to "+entity);
                var rel:Relation=Relation(_turn.relation);
         var undo:CompositeUndoableAction = new CompositeUndoableAction("Delete refs");
-
+               if (show.label=='Hide') { setHighlights(false); }
+               
                // first, remove existing role from relation
                var old:Array=rel.findMembersByRole(role);
                for each (var memberEntity:Entity in old) {
                // now add new entity
                // ** FIXME - appendMember should be undoable
                rel.appendMember(new RelationMember(entity,role))
+
+               if (show.label=='Hide') { setHighlights(true); }
        }
        
        private function setRestrictionType(type:String):void {
                var rel:Relation=Relation(_turn.relation);
                rel.setTag('restriction', type, MainUndoStack.getGlobalStack().addAction);
-               trace ("set restriction type to "+type);
        }
        
        private function findSelectedRestrictionType():Object {
     public function get turnRestriction():Object {
         return _turn;
     }
+
+       public function openAdvanced():void {
+               var rel:Relation=Relation(_turn.relation);
+               var panel:RelationEditorPanel = RelationEditorPanel(
+                       PopUpManager.createPopUp(Application(Application.application), RelationEditorPanel, true));
+               panel.setRelation(rel);
+               PopUpManager.centerPopUp(panel);
+       }
+       
+       public function deleteRestriction():void {
+               var rel:Relation=Relation(_turn.relation);
+               rel.remove(MainUndoStack.getGlobalStack().addAction);
+       }
+
+       public function showFromTo():void {
+               if (show.label=='Show') {
+                       show.label='Hide'; setHighlights(true);
+               } else {
+                       show.label='Show'; setHighlights(false);
+               }
+               // ** FIXME - we should really remove the highlights when this icon panel is
+               // closed. But since the removedFromStage event basically doesn't fire at the 
+               // right point (thanks Flex), I can't yet see a way to do that.
+       }
+       
+       private function setHighlights(bool:Boolean):void {
+               var map:Map = Globals.vars.root;
+               var from:Object=findSelected('from'); if (from) { map.setHighlight(from.data, { restrictfrom: bool } ); }
+               var to:Object  =findSelected('to'  ); if (to  ) { map.setHighlight(to.data  , { restrictto: bool   } ); }
+       }
     
     ]]></mx:Script>
 </mx:HBox>
index 62fe7f2478c8b7e5e7a7f5ceda4f1a61d66180fe..2207bd501186f445c27379f74599dc4e4b1bc3df 100644 (file)
@@ -37,6 +37,9 @@
   <category name="Amenity" id="amenity">
   </category>
 
+  <category name="Advanced" id="advanced">
+  </category>
+
   <!-- Common input sets -->
   
   <inputSet id="names">
     <tag k="amenity" v="pharmacy"/>
     <inputSet ref="names"/>
     <inputSet ref="buildingAddress"/>
-    <input type="choice" presence="always" category="Amenity" name="Dispensing" key="dispensing" description="Does this pharmacy sell prescription drugs?">
-      <choice value="yes" text="Yes"/>
-      <choice value="no" text="No"/>
+    <input type="checkbox" category="Amenity" presence="always" description="Does this pharmacy sell prescription drugs?" name="Dispensing" key="dispensing" layout="horizontal"/>
+  </feature>
+
+  <!-- advanced relations -->
+  <feature name="Turn restriction">
+    <category>advanced</category>
+    <help>http://wiki.openstreetmap.org/wiki/Turn_restrictions</help>
+    <relation/>
+    <tag k="type" v="restriction"/>
+    <input type="choice" category="Restrictions" presence="always" name="Type" key="restriction" description="What's the restriction?" layout="horizontal" priority="high">
+      <choice value="no_left_turn"      text="No left turn"/>
+      <choice value="no_right_turn"     text="No right turn"/>
+      <choice value="no_u_turn"         text="No U turns"/>
+      <choice value="no_straight_on"    text="No straight on"/>
+      <choice value="only_left_turn"    text="Left turn only"/>
+      <choice value="only_right_turn"   text="Right turn only"/>
+      <choice value="only_straight_on"  text="Straight on only"/>
+    </input>
+    <input type="choice" category="Restrictions" presence="always" name="Except" key="except" description="Are any vehicles exempt?" layout="horizontal">
+      <choice value="psv"      text="Bus"/>
+      <choice value="bicycle"  text="Bicycle"/>
+      <choice value="motorcar" text="Car"/>
+      <choice value="hgv"      text="HGV"/>
     </input>
+    <input type="freetext" category="Restrictions" presence="always" name="Start day"  key="day_on"   description="What day of the week does it start?" layout="horizontal" priority="low" />
+    <input type="freetext" category="Restrictions" presence="always" name="Start time" key="hour_on"  description="What time of day does it start?"     layout="horizontal" priority="low" />
+    <input type="freetext" category="Restrictions" presence="always" name="End day"    key="day_off"  description="What day of the week does it end?"   layout="horizontal" priority="lowest" />
+    <input type="freetext" category="Restrictions" presence="always" name="End time"   key="hour_off" description="What time of day does it end?"       layout="horizontal" priority="lowest" />
+  </feature>
+
+  <feature name="Multipolygon">
+    <category>advanced</category>
+    <relation/>
+    <tag k="type" v="multipolygon"/>
   </feature>
 
   <!-- cycle stuff -->
index b0a5da75a73273d4a86ef5b319be680f2e97c94d..27ccb7cd7ff29a910ae17b6566dd751c9235d042 100644 (file)
@@ -138,6 +138,8 @@ way .highlighted { color: pink; }
 
 way :hover     { z-index: 2; width: eval('_width+10'); color: #ffff99; }
 way :selected { z-index: 2; width: eval('_width+10'); color: yellow; opacity: 0.7;}
+way :restrictfrom { z-index: -1; width: eval('_width+10'); color: red; opacity: 0.7;}
+way :restrictto { z-index: -1; width: eval('_width+10'); color: blue; opacity: 0.7;}
 way !:drawn { z-index:10; width: 0.5; color: gray; } 
 
 relation[type=restriction] node { z-index:11; icon-image: icons/restriction.png; }