resolved conflict.

This commit is contained in:
Saman Bemel-Benrud
2012-12-12 20:46:12 -05:00
5 changed files with 58 additions and 16 deletions
+23 -4
View File
@@ -63,7 +63,7 @@ iD.modes.DrawArea = function(wayId) {
controller.enter(iD.modes.Browse());
}
function del() {
function backspace() {
d3.event.preventDefault();
history.replace(
@@ -80,10 +80,27 @@ iD.modes.DrawArea = function(wayId) {
}
}
function del() {
d3.event.preventDefault();
history.replace(iD.actions.DeleteWay(wayId));
controller.enter(iD.modes.Browse());
}
function ret() {
d3.event.preventDefault();
history.replace(
iD.actions.DeleteNode(node.id),
iD.actions.AddWayNode(way.id, tailId, -1),
'added to an area');
controller.enter(iD.modes.Browse());
}
map.surface.on('mousemove.drawarea', mousemove);
map.surface.on('click.drawarea', click);
map.keybinding().on('⎋.drawarea', esc);
map.keybinding().on('⌫.drawarea', del);
map.keybinding().on('⎋.drawarea', esc)
.on('⌫.drawarea', backspace)
.on('delete.drawarea', del)
.on('↩.drawarea', ret);
};
mode.exit = function() {
@@ -93,7 +110,9 @@ iD.modes.DrawArea = function(wayId) {
.on('mousemove.drawarea', null)
.on('click.drawarea', null);
mode.map.keybinding().on('⎋.drawarea', null)
.on('⌫.drawarea', null);
.on('⌫.drawarea', null)
.on('delete.drawarea', null)
.on('↩.drawarea', null);
window.setTimeout(function() {
mode.map.dblclickEnable(true);
}, 1000);
+20 -4
View File
@@ -81,7 +81,7 @@ iD.modes.DrawRoad = function(wayId, direction) {
controller.enter(iD.modes.Browse());
}
function del() {
function backspace() {
d3.event.preventDefault();
history.replace(
@@ -96,8 +96,22 @@ iD.modes.DrawRoad = function(wayId, direction) {
}
}
map.keybinding().on('⎋.drawroad', esc);
map.keybinding().on('⌫.drawroad', del);
function del() {
d3.event.preventDefault();
history.replace(iD.actions.DeleteWay(wayId));
controller.enter(iD.modes.Browse());
}
function ret() {
d3.event.preventDefault();
history.replace(iD.actions.DeleteNode(node.id));
controller.enter(iD.modes.Browse());
}
map.keybinding().on('⎋.drawroad', esc)
.on('⌫.drawroad', backspace)
.on('delete.drawroad', del)
.on('↩.drawroad', ret);
};
mode.exit = function() {
@@ -108,7 +122,9 @@ iD.modes.DrawRoad = function(wayId, direction) {
.on('mousemove.drawroad', null)
.on('click.drawroad', null);
mode.map.keybinding().on('⎋.drawroad', null)
.on('⌫.drawroad', null);
.on('⌫.drawroad', null)
.on('delete.drawroad', null)
.on('↩.drawroad', null);
window.setTimeout(function() {
mode.map.dblclickEnable(true);
}, 1000);
+8 -5
View File
@@ -21,11 +21,14 @@ iD.modes.Select = function (entity) {
mode.history.perform(iD.actions.Noop());
}
entity.nodes.forEach(function(node) {
var start = mode.map.projection(node.loc);
var end = mode.map.projection.invert([start[0] + d3.event.dx, start[1] + d3.event.dy]);
node.loc = end;
mode.history.replace(iD.actions.Move(node, end));
_.uniq(_.pluck(entity.nodes, 'id'))
.forEach(function(id) {
var node = mode.history.graph().entity(id),
start = mode.map.projection(node.loc),
end = mode.map.projection.invert([
start[0] + d3.event.dx,
start[1] + d3.event.dy]);
mode.history.replace(iD.actions.Move(id, end));
});
})
.on('dragend', function () {
+1 -1
View File
@@ -32,7 +32,7 @@ iD.Background = function() {
function background() {
var tiles = tile
.scale(projection.scale())
.scaleExtent(source.scaleExtent || [0, 17])
.scaleExtent(source.scaleExtent || [1, 17])
.translate(projection.translate())(),
scaleExtent = tile.scaleExtent(),
z = Math.max(Math.log(projection.scale()) / Math.log(2) - 8, 0),
+6 -2
View File
@@ -5,7 +5,7 @@ iD.Map = function() {
selection = null, hover = null,
translateStart,
keybinding,
projection = d3.geo.mercator(),
projection = d3.geo.mercator().scale(1024),
zoom = d3.behavior.zoom()
.translate(projection.translate())
.scale(projection.scale())
@@ -289,7 +289,11 @@ iD.Map = function() {
function zoomPan() {
if (d3.event && d3.event.sourceEvent.type === 'dblclick') {
if (!dblclickEnabled) return;
if (!dblclickEnabled) {
zoom.scale(projection.scale())
.translate(projection.translate());
return d3.event.sourceEvent.preventDefault();
}
}
var fast = (d3.event.scale === projection.scale() && fastEnabled);
projection