mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-14 05:12:13 +02:00
Remove the context.intersects passthrough function
This commit is contained in:
@@ -53,7 +53,7 @@ export function behaviorLasso(context) {
|
||||
var bounds = lasso.extent().map(context.projection.invert);
|
||||
var extent = geoExtent(normalize(bounds[0], bounds[1]));
|
||||
|
||||
var intersects = context.intersects(extent).filter(function(entity) {
|
||||
var intersects = context.history().intersects(extent).filter(function(entity) {
|
||||
return entity.type === 'node' &&
|
||||
geoPointInPolygon(context.projection(entity.loc), lasso.coordinates) &&
|
||||
!context.features().isHidden(entity, graph, entity.geometry(graph));
|
||||
|
||||
@@ -429,7 +429,6 @@ export function coreContext() {
|
||||
|
||||
_history = coreHistory(context);
|
||||
context.graph = _history.graph;
|
||||
context.intersects = _history.intersects;
|
||||
context.pauseChangeDispatch = _history.pauseChangeDispatch;
|
||||
context.resumeChangeDispatch = _history.resumeChangeDispatch;
|
||||
context.perform = withDebouncedSave(_history.perform);
|
||||
|
||||
@@ -268,6 +268,8 @@ export function coreHistory(context) {
|
||||
},
|
||||
|
||||
|
||||
// Returns the entities from the active graph with bounding boxes
|
||||
// overlapping the given `extent`.
|
||||
intersects: function(extent) {
|
||||
return _tree.intersects(extent, _stack[_index].graph);
|
||||
},
|
||||
|
||||
@@ -313,7 +313,7 @@ export function rendererMap(context) {
|
||||
var mode = context.mode();
|
||||
var graph = context.graph();
|
||||
var features = context.features();
|
||||
var all = context.intersects(map.extent());
|
||||
var all = context.history().intersects(map.extent());
|
||||
var fullRedraw = false;
|
||||
var data;
|
||||
var set;
|
||||
@@ -343,7 +343,7 @@ export function rendererMap(context) {
|
||||
}
|
||||
|
||||
if (extent) {
|
||||
data = context.intersects(map.extent().intersection(extent));
|
||||
data = context.history().intersects(map.extent().intersection(extent));
|
||||
set = new Set(data.map(function(entity) { return entity.id; }));
|
||||
filter = function(d) { return set.has(d.id); };
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ export function uiContributors(context) {
|
||||
if (!osm) return;
|
||||
|
||||
var users = {},
|
||||
entities = context.intersects(context.map().extent());
|
||||
entities = context.history().intersects(context.map().extent());
|
||||
|
||||
entities.forEach(function(entity) {
|
||||
if (entity && entity.user) users[entity.user] = true;
|
||||
|
||||
@@ -36,7 +36,7 @@ export function uiFieldAddress(field, context) {
|
||||
var l = extent.center();
|
||||
var box = geoExtent(l).padByMeters(200);
|
||||
|
||||
var streets = context.intersects(box)
|
||||
var streets = context.history().intersects(box)
|
||||
.filter(isAddressable)
|
||||
.map(function(d) {
|
||||
var loc = context.projection([
|
||||
@@ -68,7 +68,7 @@ export function uiFieldAddress(field, context) {
|
||||
var l = extent.center();
|
||||
var box = geoExtent(l).padByMeters(200);
|
||||
|
||||
var cities = context.intersects(box)
|
||||
var cities = context.history().intersects(box)
|
||||
.filter(isAddressable)
|
||||
.map(function(d) {
|
||||
return {
|
||||
@@ -106,7 +106,7 @@ export function uiFieldAddress(field, context) {
|
||||
var l = extent.center();
|
||||
var box = geoExtent(l).padByMeters(200);
|
||||
|
||||
var results = context.intersects(box)
|
||||
var results = context.history().intersects(box)
|
||||
.filter(function hasTag(d) { return _entityIDs.indexOf(d.id) === -1 && d.tags[key]; })
|
||||
.map(function(d) {
|
||||
return {
|
||||
|
||||
@@ -146,7 +146,7 @@ export function uiSectionRawMembershipEditor(context) {
|
||||
});
|
||||
} else {
|
||||
|
||||
context.intersects(context.map().extent()).forEach(function(entity) {
|
||||
context.history().intersects(context.map().extent()).forEach(function(entity) {
|
||||
if (entity.type !== 'relation' || entity.id === entityID) return;
|
||||
|
||||
var value = baseDisplayLabel(entity);
|
||||
|
||||
Reference in New Issue
Block a user