mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-04 18:33:38 +00:00
@@ -66,26 +66,35 @@ export function coreTree(head) {
|
|||||||
tree.intersects = function(extent, graph) {
|
tree.intersects = function(extent, graph) {
|
||||||
if (graph !== head) {
|
if (graph !== head) {
|
||||||
var diff = coreDifference(head, graph);
|
var diff = coreDifference(head, graph);
|
||||||
var insertions = {};
|
var changed = diff.didChange;
|
||||||
|
|
||||||
head = graph;
|
if (changed.addition || changed.deletion || changed.geometry) {
|
||||||
|
var insertions = {};
|
||||||
|
head = graph;
|
||||||
|
|
||||||
diff.deleted().forEach(function(entity) {
|
if (changed.deletion) {
|
||||||
rtree.remove(bboxes[entity.id]);
|
diff.deleted().forEach(function(entity) {
|
||||||
delete bboxes[entity.id];
|
rtree.remove(bboxes[entity.id]);
|
||||||
});
|
delete bboxes[entity.id];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
diff.modified().forEach(function(entity) {
|
if (changed.geometry) {
|
||||||
rtree.remove(bboxes[entity.id]);
|
diff.modified().forEach(function(entity) {
|
||||||
insertions[entity.id] = entity;
|
rtree.remove(bboxes[entity.id]);
|
||||||
updateParents(entity, insertions, {});
|
insertions[entity.id] = entity;
|
||||||
});
|
updateParents(entity, insertions, {});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
diff.created().forEach(function(entity) {
|
if (changed.addition) {
|
||||||
insertions[entity.id] = entity;
|
diff.created().forEach(function(entity) {
|
||||||
});
|
insertions[entity.id] = entity;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
rtree.load(Object.values(insertions).map(entityBBox));
|
rtree.load(Object.values(insertions).map(entityBBox));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return rtree.search(extent.bbox())
|
return rtree.search(extent.bbox())
|
||||||
|
|||||||
Reference in New Issue
Block a user