mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
Remove context.childNodes function
This commit is contained in:
@@ -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]];
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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];
|
||||
|
||||
|
||||
@@ -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]));
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user