Potlatch 2: main outstanding issues
-----------------------------------
-** = required before P2 goes live
== Core geometry ==
+* purgeOutside simply doesn't work - WayUIs stay around. To investigate
* P1-style J (join) / shift-J (unjoin)
* Make parallelise properly undoable
* Make Quadralatalawhatsit properly undoable
lastymouse=downY=mouseY;
}
- public function mouseUpHandler(event:MouseEvent):void {
+ public function mouseUpHandler(event:MouseEvent=null):void {
if (dragstate==DRAGGING) {
updateCoords(x,y);
updateEntityUIs(false, false);
if (!wayuis[way.id]) { return; }
wayuis[way.id].removeSprites();
delete wayuis[way.id];
+ for (var i:uint=0; i<way.length; i++) {
+ deleteNodeUI(way.getNode(i));
+ }
}
public function deleteNodeUI(node:Node):void {
}
public function purgeOutside(left:Number, right:Number, top:Number, bottom:Number):void {
+ return;
+ // ** this doesn't work - WayUIs stick around.
+ // ** should purge POIs and relations too
for each (var way:Way in ways) {
if (!way.within(left,right,top,bottom) && !way.isDirty) {
killWayWithNodes(way.id);
}
}
- // ** should purge POIs and relations too
}
public function markDirty():void {
}
}
+ override public function processKeyboardEvent(event:KeyboardEvent):ControllerState {
+ if (event.keyCode==27) {
+ selectedWay.dispatchEvent(new WayDraggedEvent(Connection.WAY_DRAGGED, selectedWay, 0, 0));
+ return new SelectedWay(selectedWay);
+ }
+ return this;
+ }
+
private function dragTo(event:MouseEvent):ControllerState {
selectedWay.dispatchEvent(new WayDraggedEvent(Connection.WAY_DRAGGED, selectedWay, event.localX-downX, event.localY-downY));
return this;
private var downX:Number;
private var downY:Number;
+ private var originalLat:Number;
+ private var originalLon:Number;
private var dragstate:uint=NOT_MOVED;
private const NOT_DRAGGING:uint=0;
private const NOT_MOVED:uint=1;
selectedWay = way;
draggingIndex = index;
draggingNode = way.getNode(index);
+ originalLat = draggingNode.lat;
+ originalLon = draggingNode.lon;
downX = event.localX;
downY = event.localY;
isNew = newNode;
}
}
+ override public function processKeyboardEvent(event:KeyboardEvent):ControllerState {
+ if (event.keyCode==27) {
+ draggingNode.setLatLon( originalLat, originalLon, MainUndoStack.getGlobalStack().addAction );
+ return new SelectedWayNode(selectedWay,draggingIndex);
+ }
+ return this;
+ }
+
private function endDrag():ControllerState {
return previousState;
}
}
override public function enterState():void {
+ controller.map.mouseUpHandler();
Globals.vars.root.addDebug("**** -> "+this);
}
override public function exitState(newState:ControllerState):void {
<tag k="tourism" v="viewpoint"/>
</feature>
- <feature name="Viewpoint">
+ <feature name="Zoo">
<category>tourism</category><point /><inputSet ref="simpleName" />
<icon image="features/pois/tourist_zoo.n.24.png"/>
<tag k="tourism" v="zoo"/>
This is used as a debugger for finding unstyled areas; it's obviously oversimplistic since
it picks up closed-loop highways. */
-way :area { color: red; width: 1; fill-color: red; fill-opacity: 0.5; }
+/* way :area { color: red; width: 1; fill-color: red; fill-opacity: 0.5; } */
/* A set of fairly standard rules.
We use z-index to make sure high-priority roads appear above minor ones.
way[highway=primary],way[highway=primary_link],
way[highway=secondary],way[highway=secondary_link],
way[highway=tertiary],way[highway=tertiary_link],
-way[highway=residential] { text: name; text-color: black; font-size: 7; text-position: line;}
+way[highway=residential] { text: name; text-color: black; font-size: 10; text-position: line; text-halo-color: white; text-halo-radius: 2; }
way[highway=motorway],way[highway=motorway_link] { z-index: 9; color: #809BC0; width: 7; casing-color: black; casing-width: 8; }
way[highway=trunk],way[highway=trunk_link] { z-index: 9; color: #7FC97F; width: 7; casing-color: black; casing-width: 8; }
way[highway=primary],way[highway=primary_link] { z-index: 8; color: #E46D71; width: 7; casing-color: black; casing-width: 8; }
node[amenity=post_box] { icon-image: icons/amenity_post_box.n.16.png; z-index: 20; }
node[amenity=recycling] { icon-image: icons/amenity_recycling.n.16.png; z-index: 20; }
node[barrier=bollard] { icon-image: icons/barrier_bollard.n.16.png; z-index: 20; }
-node[barrier=gate], node[highway=gate] { icon-image: icons/barrier_gate.n.16.png; z-index: 20; }
+node[barrier=gate], node[highway=gate] { icon-image: icons/gate.png; z-index: 20; }
node[barrier=toll_booth] { icon-image: icons/barrier_toll_booth.n.16.png; z-index: 20; }
node[amenity=school] { icon-image: icons/education_school.n.16.png; text-offset:15; text: name; z-index: 20; }
node[amenity=bar] { icon-image: icons/food_bar.n.16.png; text-offset:15; text: name; z-index: 20; }