Don't allow adding point-only features as vertices

This commit is contained in:
Quincy Morgan
2019-03-04 17:04:35 -05:00
parent 5e02523396
commit b828ada0e2
9 changed files with 30 additions and 30 deletions
+5 -1
View File
@@ -127,11 +127,15 @@ export function behaviorDraw(context) {
var d = datum();
var target = d && d.properties && d.properties.entity;
var mode = context.mode();
var allowsSnappingToWay = (mode.id !== 'add-point' || mode.preset.matchGeometry('vertex'));
if (target && target.type === 'node' && allowsVertex(target)) { // Snap to a node
dispatch.call('clickNode', this, target, d);
return;
} else if (target && target.type === 'way') { // Snap to a way
} else if (target && target.type === 'way' && allowsSnappingToWay) { // Snap to a way
var choice = geoChooseEdge(
context.childNodes(target), context.mouse(), context.projection, context.activeID()
);