diff --git a/modules/behavior/draw.js b/modules/behavior/draw.js index 61c263a77..f8b211bad 100644 --- a/modules/behavior/draw.js +++ b/modules/behavior/draw.js @@ -133,7 +133,7 @@ export function behaviorDraw(context) { } else if (target && target.type === 'way' && (mode.id !== 'add-point' || mode.preset.matchGeometry('vertex'))) { // Snap to a way var choice = geoChooseEdge( - context.childNodes(target), loc, context.projection, context.activeID() + context.graph().childNodes(target), loc, context.projection, context.activeID() ); if (choice) { var edge = [target.nodes[choice.index - 1], target.nodes[choice.index]]; diff --git a/modules/core/context.js b/modules/core/context.js index 255fa87ba..b32cb4df7 100644 --- a/modules/core/context.js +++ b/modules/core/context.js @@ -247,7 +247,6 @@ export function coreContext() { /* Graph */ context.hasEntity = (id) => _history.graph().hasEntity(id); context.entity = (id) => _history.graph().entity(id); - context.childNodes = (way) => _history.graph().childNodes(way); context.geometry = (id) => context.entity(id).geometry(_history.graph()); diff --git a/modules/modes/drag_node.js b/modules/modes/drag_node.js index ea424ada5..c6022f579 100644 --- a/modules/modes/drag_node.js +++ b/modules/modes/drag_node.js @@ -379,7 +379,7 @@ export function modeDragNode(context) { ); } else if (target && target.type === 'way') { - var choice = geoChooseEdge(context.childNodes(target), context.mouse(), context.projection, entity.id); + var choice = geoChooseEdge(context.graph().childNodes(target), context.mouse(), context.projection, entity.id); context.replace( actionAddMidpoint({ loc: choice.loc, diff --git a/modules/modes/select.js b/modules/modes/select.js index f25d17ea1..bddae3a63 100644 --- a/modules/modes/select.js +++ b/modules/modes/select.js @@ -354,7 +354,7 @@ export function modeSelect(context, selectedIDs) { if (!entity) return; if (entity instanceof osmWay && target.classed('target')) { - var choice = geoChooseEdge(context.childNodes(entity), loc, context.projection); + var choice = geoChooseEdge(context.graph().childNodes(entity), loc, context.projection); var prev = entity.nodes[choice.index - 1]; var next = entity.nodes[choice.index]; diff --git a/modules/ui/feature_list.js b/modules/ui/feature_list.js index 6bf324f0c..791bfb650 100644 --- a/modules/ui/feature_list.js +++ b/modules/ui/feature_list.js @@ -343,7 +343,7 @@ export function uiFeatureList(context) { context.map().center(d.entity.loc); } else if (d.entity.type === 'way') { var center = context.projection(context.map().center()); - var edge = geoChooseEdge(context.childNodes(d.entity), center, context.projection); + var edge = geoChooseEdge(context.graph().childNodes(d.entity), center, context.projection); context.map().center(edge.loc); } context.enter(modeSelect(context, [d.entity.id])); diff --git a/modules/ui/fields/address.js b/modules/ui/fields/address.js index f71563986..0a48ad81e 100644 --- a/modules/ui/fields/address.js +++ b/modules/ui/fields/address.js @@ -41,7 +41,7 @@ export function uiFieldAddress(field, context) { (extent[0][0] + extent[1][0]) / 2, (extent[0][1] + extent[1][1]) / 2 ]); - var choice = geoChooseEdge(context.childNodes(d), loc, context.projection); + var choice = geoChooseEdge(context.graph().childNodes(d), loc, context.projection); return { title: d.tags.name,