fix small relation issues
authorDave Stubbs <osm@randomjunk.co.uk>
Thu, 7 Jan 2010 12:05:57 +0000 (12:05 +0000)
committerDave Stubbs <osm@randomjunk.co.uk>
Thu, 7 Jan 2010 12:05:57 +0000 (12:05 +0000)
net/systemeD/halcyon/connection/XMLConnection.as
net/systemeD/potlatch2/mapfeatures/editors/RouteEditor.mxml
net/systemeD/potlatch2/mapfeatures/editors/RouteIcon.mxml
resources/features/transport__bus.png [new file with mode: 0644]
resources/map_features.xml

index cff6efc..0104931 100644 (file)
@@ -71,8 +71,10 @@ package net.systemeD.halcyon.connection {
                     tags = parseTags(nodeData.tag);
                     if ( node == null )
                         setNode(new Node(id, version, tags, true, lat, lon),false);
-                    else
+                    else {
                         node.update(version, tags, true, lat, lon);
+                        sendEvent(new EntityEvent(NEW_NODE, node), false);
+                    }
                 }
             }
 
@@ -88,8 +90,10 @@ package net.systemeD.halcyon.connection {
                     tags = parseTags(data.tag);
                     if ( way == null )
                         setWay(new Way(id, version, tags, true, nodes),false);
-                    else
+                    else {
                         way.update(version, tags, true, nodes);
+                        sendEvent(new EntityEvent(NEW_WAY, way), false);
+                    }
                 }
             }
             
@@ -132,8 +136,10 @@ package net.systemeD.halcyon.connection {
                     
                     if ( rel == null )
                         setRelation(new Relation(id, version, tags, true, members), false);
-                    else
+                    else {
                         rel.update(version,tags,true,members);
+                        sendEvent(new EntityEvent(NEW_RELATION, rel), false);
+                    }
                 }
             }
             
index 9abe7e8..9599620 100644 (file)
             var icon:RouteIcon = new RouteIcon();
             icon.setRoute(relation, RouteEditorFactory(_factory).icon);
             
-            icon.addEventListener(MouseEvent.CLICK, function(event:Event):void {
-                trace(relation+" is clicked");
-                var panel:RelationEditorPanel = RelationEditorPanel(
-                    PopUpManager.createPopUp(Application(Application.application), RelationEditorPanel, true));
-                panel.setRelation(relation);
-                PopUpManager.centerPopUp(panel);
-            });
+            icon.addEventListener(MouseEvent.CLICK, routeClicked);
             routeIcons.addChild(icon);
         }
     }
     
+    public function routeClicked(event:Event):void {
+        var relation:Relation = RouteIcon(event.currentTarget).route;
+        trace(relation+" is clicked");
+        var panel:RelationEditorPanel = RelationEditorPanel(
+            PopUpManager.createPopUp(Application(Application.application), RelationEditorPanel, true));
+        panel.setRelation(relation);
+        PopUpManager.centerPopUp(panel);
+    }
+    
   ]]></mx:Script>
 </edit:RelationMemberEditor>
 
index dba2041..08b0b95 100644 (file)
     private var _iconHTML:String = "";
     private var _bg:String = "white";
     private var _fg:String = "black";
+    private var _relation:Relation;
          
     public function setRoute(relation:Relation, icon:XMLList):void {   
+        _relation = relation;
         _iconHTML = Feature.makeHTMLIcon(icon, relation);
 
         if ( icon.length() > 0 ) {
     private function get bg():uint {
         return MapCSS.parseCSSColor(_bg);
     }
+    
+    public function get route():Relation {
+        return _relation;
+    }
     ]]></mx:Script>
 </mx:HBox>
 
diff --git a/resources/features/transport__bus.png b/resources/features/transport__bus.png
new file mode 100644 (file)
index 0000000..b779706
Binary files /dev/null and b/resources/features/transport__bus.png differ
index 79da68b..9730746 100644 (file)
@@ -29,6 +29,8 @@
     <inputSet ref="roadRefs"/>
     <inputSet ref="roadRestrictions"/>
     <inputSet ref="roadPhysical"/>
+    <inputSet ref="cycle"/>
+    <inputSet ref="bus-route"/>
   </inputSet>
   
   <inputSet id="minorRoad">
@@ -36,6 +38,7 @@
     <inputSet ref="roadRestrictions"/>
     <inputSet ref="roadPhysical"/>
     <inputSet ref="cycle"/>
+    <inputSet ref="bus-route"/>
   </inputSet>
   
   <inputSet id="roadNames">
     <inputSet ref="naptan" />
   </inputSet>
   
+  <inputSet id="bus-route">
+    <input type="route" name="Bus Route" description="Bus route" category="Transport" priority="low" presence="onTagMatch">
+      <match k="type" v="route"/>
+      <match k="route" v="bus"/>
+      <icon image="features/transport__bus.png">
+        <font size="12pt">${operator} <b>${ref}</b></font>
+      </icon>
+    </input>
+  </inputSet>
+  
   <inputSet id="cycle">
     <input type="route" name="National Cycle Route" description="National cycle route" category="Cycle" priority="normal">
        <match k="type" v="route"/>
     </input>
   </inputSet>
   
-  <inputSet id="cycle-route">
+  <inputSet id="route">
     <inputSet ref="roadNames"/>
     <inputSet ref="roadRefs"/>
   </inputSet>
     <tag k="type" v="route"/>
     <tag k="network" v="ncn"/>
       
-    <inputSet ref="cycle-route"/>
+    <inputSet ref="route"/>
   </feature>
   
   <feature name="Regional Cycle Network">
     <tag k="type" v="route"/>
     <tag k="network" v="rcn"/>
       
-    <inputSet ref="cycle-route"/>
+    <inputSet ref="route"/>
   </feature>
 
   <feature name="Local Cycle Network">
     <tag k="type" v="route"/>
     <tag k="network" v="lcn"/>
       
-    <inputSet ref="cycle-route"/>
+    <inputSet ref="route"/>
   </feature>
 
+
+  <!-- paths -->
+  <feature name="Long Distance Path">
+    <category>paths</category>
+    <icon image="features/paths__footway.png" background="green" foreground="white">
+      <font size="14pt"><b>${ref}</b></font><br />
+      <font size="12pt">${name}</font>
+    </icon>
+
+    <relation/>
+    <tag k="type" v="route"/>
+    <tag k="route" v="foot"/>
+      
+    <inputSet ref="route"/>
+  </feature>
+
+
+  <!-- bus routes -->
+  <feature name="Bus Route">
+    <category>transport</category>
+    <icon image="features/transport__bus.png">
+      <font size="12pt">${operator} <b>${ref}</b></font>
+    </icon>
+
+    <relation/>
+    <tag k="type" v="route"/>
+    <tag k="route" v="bus"/>
+      
+    <inputSet ref="route"/>
+  </feature>
+  
+  
 </mapFeatures>