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);
+ }
}
}
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);
+ }
}
}
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);
+ }
}
}
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>
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>
<inputSet ref="roadRefs"/>
<inputSet ref="roadRestrictions"/>
<inputSet ref="roadPhysical"/>
+ <inputSet ref="cycle"/>
+ <inputSet ref="bus-route"/>
</inputSet>
<inputSet id="minorRoad">
<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>