diff --git a/modules/modes/add_point.js b/modules/modes/add_point.js index 678be7c68..ac978babf 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) + ); }