From 09fdd3087680c063442a27d877bee033c9a7cd24 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Tue, 14 May 2019 18:43:08 -0600 Subject: [PATCH] Upgrade to rbush@3 --- package.json | 3 +-- src/ol/render/canvas/Executor.js | 4 ++-- src/ol/structs/RBush.js | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 1db4424fc5..38acaa1d63 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "dependencies": { "pbf": "3.2.0", "pixelworks": "1.1.0", - "rbush": "2.0.2" + "rbush": "^3.0.0" }, "devDependencies": { "@babel/core": "^7.4.0", @@ -47,7 +47,6 @@ "@types/arcgis-rest-api": "^10.4.4", "@types/geojson": "^7946.0.7", "@types/pbf": "^3.0.1", - "@types/rbush": "^2.0.2", "@types/topojson-specification": "^1.0.1", "babel-loader": "^8.0.5", "buble": "^0.19.7", diff --git a/src/ol/render/canvas/Executor.js b/src/ol/render/canvas/Executor.js index be254c38e3..c3de7a96c4 100644 --- a/src/ol/render/canvas/Executor.js +++ b/src/ol/render/canvas/Executor.js @@ -21,7 +21,7 @@ import { import {createCanvasContext2D} from '../../dom.js'; import {labelCache, defaultTextAlign, measureTextHeight, measureAndCacheTextWidth, measureTextWidths} from '../canvas.js'; import Disposable from '../../Disposable.js'; -import rbush from 'rbush'; +import RBush from 'rbush'; /** @@ -429,7 +429,7 @@ class Executor extends Disposable { value: feature }; if (!declutterTree) { - declutterTree = rbush(9, undefined); + declutterTree = new RBush(9); } if (!declutterTree.collides(box)) { declutterTree.insert(box); diff --git a/src/ol/structs/RBush.js b/src/ol/structs/RBush.js index 4c0ae6c41b..c051ba3fda 100644 --- a/src/ol/structs/RBush.js +++ b/src/ol/structs/RBush.js @@ -2,7 +2,7 @@ * @module ol/structs/RBush */ import {getUid} from '../util.js'; -import rbush from 'rbush'; +import RBush_ from 'rbush'; import {createOrUpdate, equals} from '../extent.js'; import {isEmpty} from '../obj.js'; @@ -31,7 +31,7 @@ class RBush { /** * @private */ - this.rbush_ = rbush(opt_maxEntries, undefined); + this.rbush_ = new RBush_(opt_maxEntries); /** * A mapping between the objects added to this rbush wrapper