mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
Fix dragging nodes that are members of multiple ways
This commit is contained in:
@@ -40,6 +40,11 @@ circle.teaser-point {
|
||||
stroke-width: 3;
|
||||
}
|
||||
|
||||
.casing:hover {
|
||||
stroke:#FF0F0F !important;
|
||||
opacity:0.8;
|
||||
}
|
||||
|
||||
.casing.active {
|
||||
stroke:#FFF9C9;
|
||||
stroke-opacity:1;
|
||||
|
||||
@@ -150,10 +150,16 @@ iD.actions.DrawRoad = function(way) {
|
||||
this._doubleTime = window.setTimeout(function(e) {
|
||||
return function() {
|
||||
d3.event = e;
|
||||
var t = d3.select(d3.event.target);
|
||||
d3.event.stopPropagation();
|
||||
// connect a way to an existing way
|
||||
if (t.data() && t.data()[0] && t.data()[0].type === 'node') {
|
||||
node = t.data()[0];
|
||||
} else {
|
||||
node = iD.actions._node(that.map.projection.invert(
|
||||
d3.mouse(surface.node())));
|
||||
}
|
||||
way.nodes.pop();
|
||||
var ll = that.map.projection.invert(d3.mouse(surface.node()));
|
||||
var node = iD.actions._node(ll);
|
||||
way.nodes.push(node.id);
|
||||
that.map.operate(iD.operations.changeWayNodes(way, node));
|
||||
way.nodes = way.nodes.slice();
|
||||
|
||||
@@ -108,7 +108,10 @@ iD.Map = function(elem) {
|
||||
var graph = history.graph(),
|
||||
all = graph.intersects(getExtent());
|
||||
|
||||
var ways = [], areas = [], points = [];
|
||||
var ways = [],
|
||||
areas = [],
|
||||
points = [],
|
||||
waynodes = [];
|
||||
|
||||
var active_entity = null;
|
||||
var selected_id = selection;
|
||||
@@ -125,6 +128,8 @@ iD.Map = function(elem) {
|
||||
}
|
||||
} else if (a._poi) {
|
||||
points.push(a);
|
||||
} else if (!a._poi && a.type === 'node') {
|
||||
waynodes.push(a);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,12 +188,7 @@ iD.Map = function(elem) {
|
||||
});
|
||||
|
||||
var handles = hit_g.selectAll('rect.handle')
|
||||
// TODO: this could be faster
|
||||
.data(areas.reduce(function(memo, w) {
|
||||
return memo.concat(w.nodes);
|
||||
}, ways.reduce(function(memo, w) {
|
||||
return memo.concat(w.nodes);
|
||||
}, [])), key);
|
||||
.data(waynodes, key);
|
||||
|
||||
handles.exit().remove();
|
||||
handles.enter().append('rect')
|
||||
|
||||
Reference in New Issue
Block a user