Files
iD/js/id/behavior/drag_node.js
John Firebaugh c927ff5b5d Rationalize vocabulary
- nodes
  - vertices
  - points
- ways
  - lines
  - areas
2012-12-29 09:18:05 -08:00

25 lines
730 B
JavaScript

iD.behavior.DragNode = function(mode) {
var history = mode.history,
projection = mode.map.projection;
return iD.behavior.drag()
.delegate(".node")
.origin(function(entity) {
return projection(entity.loc);
})
.on('start', function() {
history.perform(
iD.actions.Noop());
})
.on('move', function(entity) {
d3.event.sourceEvent.stopPropagation();
history.replace(
iD.actions.MoveNode(entity.id, projection.invert(d3.event.point)));
})
.on('end', function() {
history.replace(
iD.actions.Noop(),
'moved a node');
});
};