mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-31 04:09:33 +02:00
Documentation and better naming
This commit is contained in:
@@ -153,7 +153,7 @@ declare("iD.controller.shape.DrawWay", [iD.controller.ControllerState], {
|
||||
|
||||
appendNewNode:function(event, undo) {
|
||||
var map=this.controller.map;
|
||||
var node=this.getConnection().createNode(
|
||||
var node=this.getConnection().doCreateNode(
|
||||
{},
|
||||
map.coord2lat(map.mouseY(event)),
|
||||
map.coord2lon(map.mouseX(event)), lang.hitch(undo,undo.push) );
|
||||
|
||||
@@ -57,11 +57,11 @@ declare("iD.controller.shape.NoSelection", [iD.controller.ControllerState], {
|
||||
// Click to start a new way
|
||||
var undo = new iD.actions.CompositeUndoableAction();
|
||||
console.log("Event is ",event.type);
|
||||
var startNode = this.getConnection().createNode(
|
||||
var startNode = this.getConnection().doCreateNode(
|
||||
{},
|
||||
map.coord2lat(map.mouseY(event)),
|
||||
map.coord2lon(map.mouseX(event)), lang.hitch(undo,undo.push) );
|
||||
var way = this.getConnection().createWay({}, [startNode], lang.hitch(undo,undo.push) );
|
||||
var way = this.getConnection().doCreateWay({}, [startNode], lang.hitch(undo,undo.push) );
|
||||
this.controller.undoStack.addAction(undo);
|
||||
this.controller.map.createUI(way);
|
||||
console.log("Started new way");
|
||||
|
||||
@@ -53,7 +53,7 @@ declare("iD.controller.shape.SelectedWay", [iD.controller.ControllerState], {
|
||||
var ways=entity.parentWays();
|
||||
if (entity.hasParent(this.way)) {
|
||||
// start a branching way from an existing point
|
||||
var way = this.getConnection().createWay({}, [entity], lang.hitch(this,this.undoAdder) );
|
||||
var way = this.getConnection().doCreateWay({}, [entity], lang.hitch(this,this.undoAdder) );
|
||||
this.controller.map.createUI(way);
|
||||
return new iD.controller.shape.DrawWay(way);
|
||||
} else if (ways.length==0) {
|
||||
@@ -68,12 +68,12 @@ declare("iD.controller.shape.SelectedWay", [iD.controller.ControllerState], {
|
||||
// start a branching way from a new point
|
||||
var map = this.controller.map;
|
||||
var undo = new iD.actions.CompositeUndoableAction();
|
||||
var startNode = this.getConnection().createNode(
|
||||
var startNode = this.getConnection().doCreateNode(
|
||||
{},
|
||||
map.coord2lat(map.mouseY(event)),
|
||||
map.coord2lon(map.mouseX(event)), lang.hitch(undo,undo.push) );
|
||||
entity.doInsertNodeAtClosestPosition(startNode, true, lang.hitch(undo,undo.push));
|
||||
var way = this.getConnection().createWay({}, [startNode], lang.hitch(undo,undo.push) );
|
||||
var way = this.getConnection().doCreateWay({}, [startNode], lang.hitch(undo,undo.push) );
|
||||
this.controller.undoStack.addAction(undo);
|
||||
this.controller.map.createUI(way);
|
||||
return new iD.controller.shape.DrawWay(way);
|
||||
|
||||
Reference in New Issue
Block a user