midpoint = true -> type = 'midpoint'

Makes it more consistent with entities.
This commit is contained in:
John Firebaugh
2013-01-30 16:24:33 -05:00
parent 363cd53af1
commit e4c513ae87
4 changed files with 4 additions and 6 deletions
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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;
}
+1 -3
View File
@@ -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}]
};
}