Fix dragging selected features. Fixes #271

This commit is contained in:
Tom MacWright
2012-12-13 17:00:34 -05:00
parent 47ea2d82a6
commit 9461fe794c
2 changed files with 5 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ iD.modes._dragFeatures = function(mode) {
var dragbehavior = d3.behavior.drag()
.origin(function(entity) {
var p = mode.map.projection(entity.loc);
d3.event.sourceEvent.stopPropagation();
return { x: p[0], y: p[1] };
})
.on('drag', function(entity) {

View File

@@ -11,8 +11,6 @@ iD.modes.Select = function (entity) {
return { x: p[0], y: p[1] };
})
.on('drag', function(entity) {
if (!mode.map.dragEnable()) return;
d3.event.sourceEvent.stopPropagation();
if (!dragging) {
@@ -32,7 +30,7 @@ iD.modes.Select = function (entity) {
});
})
.on('dragend', function () {
if (!mode.map.dragEnable() || !dragging) return;
if (!dragging) return;
dragging = undefined;
mode.map.redraw();
});
@@ -53,6 +51,8 @@ iD.modes.Select = function (entity) {
target = mode.map.surface.selectAll("*")
.filter(function (d) { return d === entity; });
iD.modes._dragFeatures(mode);
d3.select('.inspector-wrap')
.style('display', 'block')
.style('opacity', 1)
@@ -99,6 +99,7 @@ iD.modes.Select = function (entity) {
.on('touchstart.drag', null);
}
mode.map.surface.on('mousedown.latedrag', null);
mode.map.surface.on("click.browse", null);
mode.map.keybinding().on('⌫.browse', null);