mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-18 14:45:12 +02:00
midpoint = true -> type = 'midpoint'
Makes it more consistent with entities.
This commit is contained in:
@@ -34,7 +34,7 @@ iD.behavior.Draw = function(map) {
|
||||
} else if (d.type === 'node') {
|
||||
event.clickNode(d);
|
||||
|
||||
} else if (d.midpoint) {
|
||||
} else if (d.type === 'midpoint') {
|
||||
event.clickMidpoint(d);
|
||||
|
||||
} else {
|
||||
|
||||
@@ -17,7 +17,7 @@ iD.behavior.DrawWay = function(wayId, index, mode, baseGraph) {
|
||||
function move(datum) {
|
||||
var loc = map.mouseCoordinates();
|
||||
|
||||
if (datum.type === 'node' || datum.midpoint) {
|
||||
if (datum.type === 'node' || datum.type === 'midpoint') {
|
||||
loc = datum.loc;
|
||||
} else if (datum.type === 'way') {
|
||||
loc = iD.geo.chooseIndex(datum, d3.mouse(map.surface.node()), map).loc;
|
||||
|
||||
@@ -92,7 +92,7 @@ iD.Map = function() {
|
||||
|
||||
all = _.compact(_.values(only));
|
||||
filter = function(d) {
|
||||
if (d.midpoint) {
|
||||
if (d.type === 'midpoint') {
|
||||
for (var i = 0; i < d.ways.length; i++) {
|
||||
if (d.ways[i].id in only) return true;
|
||||
}
|
||||
|
||||
@@ -20,11 +20,9 @@ iD.svg.Midpoints = function(projection) {
|
||||
|
||||
} else if (iD.geo.dist(projection(a.loc), projection(b.loc)) > 40) {
|
||||
midpoints[id] = {
|
||||
midpoint: true,
|
||||
type: 'midpoint',
|
||||
id: id,
|
||||
loc: iD.geo.interp(a.loc, b.loc, 0.5),
|
||||
a: a.id,
|
||||
b: b.id,
|
||||
ways: [{id: entity.id, index: j + 1}]
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user