From 70c3d9cf24c9fbec0f0bb0c85932b3060f661bfd Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Thu, 18 Oct 2018 17:36:30 -0700 Subject: [PATCH] Adding a new point on a way now adds a vertex, not a standalone point --- modules/modes/add_point.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/modes/add_point.js b/modules/modes/add_point.js index 678be7c686..ac978babf8 100644 --- a/modules/modes/add_point.js +++ b/modules/modes/add_point.js @@ -3,6 +3,8 @@ import { actionAddEntity } from '../actions'; import { behaviorDraw } from '../behavior'; import { modeBrowse, modeSelect } from './index'; import { osmNode } from '../osm'; +import { geoChooseEdge } from '../geo'; +import { actionAddMidpoint } from '../actions'; export function modeAddPoint(context) { @@ -37,8 +39,17 @@ export function modeAddPoint(context) { } - function addWay(loc) { - add(loc); + function addWay(loc, edge, d) { + var node = osmNode(); + + context.perform( + actionAddMidpoint({loc: loc, edge: edge}, node), + t('operations.add.annotation.vertex') + ); + + context.enter( + modeSelect(context, [node.id]).newFeature(true) + ); }