Merge pull request #5413 from quincylvania/add-point-on-way-as-vertex

Adding a new point on a way will add a vertex, not a standalone point
This commit is contained in:
Bryan Housel
2018-10-18 21:17:40 -04:00
committed by GitHub

View File

@@ -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)
);
}