Skip to content

Commit

Permalink
Merge pull request #5413 from quincylvania/add-point-on-way-as-vertex
Browse files Browse the repository at this point in the history
Adding a new point on a way will add a vertex, not a standalone point
  • Loading branch information
bhousel authored Oct 19, 2018
2 parents 6fada31 + 70c3d9c commit 9b84f96
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions modules/modes/add_point.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
);
}


Expand Down

0 comments on commit 9b84f96

Please sign in to comment.