Skip to content
Snippets Groups Projects
Commit d28e834c authored by Xaver Maierhofer's avatar Xaver Maierhofer Committed by Xaver Maierhofer
Browse files

[TASK] Rbush 3

parent f4017953
No related branches found
No related tags found
No related merge requests found
define(['leaflet', 'rbush', 'helper'], define(['leaflet', 'rbush', 'helper'],
function (L, rbush, helper) { function (L, RBush, helper) {
'use strict'; 'use strict';
return L.GridLayer.extend({ return L.GridLayer.extend({
...@@ -11,7 +11,7 @@ define(['leaflet', 'rbush', 'helper'], ...@@ -11,7 +11,7 @@ define(['leaflet', 'rbush', 'helper'],
}; };
}, },
setData: function (data) { setData: function (data) {
var rtreeOnlineAll = rbush(9); var rtreeOnlineAll = new RBush(9);
this.data = rtreeOnlineAll.load(data.nodes.online.filter(helper.hasLocation).map(this.mapRTree)); this.data = rtreeOnlineAll.load(data.nodes.online.filter(helper.hasLocation).map(this.mapRTree));
......
define(['leaflet', 'rbush', 'helper', 'moment'], define(['leaflet', 'rbush', 'helper', 'moment'],
function (L, rbush, helper, moment) { function (L, RBush, helper, moment) {
'use strict'; 'use strict';
var groupOnline; var groupOnline;
...@@ -239,7 +239,7 @@ define(['leaflet', 'rbush', 'helper', 'moment'], ...@@ -239,7 +239,7 @@ define(['leaflet', 'rbush', 'helper', 'moment'],
} }
for (var z = minZoom; z <= maxZoom; z++) { for (var z = minZoom; z <= maxZoom; z++) {
trees[z] = rbush(9); trees[z] = new RBush(9);
trees[z].load(labels.map(nodeToRect(z))); trees[z].load(labels.map(nodeToRect(z)));
} }
...@@ -291,7 +291,7 @@ define(['leaflet', 'rbush', 'helper', 'moment'], ...@@ -291,7 +291,7 @@ define(['leaflet', 'rbush', 'helper', 'moment'],
}).sort().reverse()[0]; }).sort().reverse()[0];
} }
this.labels = rbush(9); this.labels = new RBush(9);
this.labels.load(labels.map(mapRTree)); this.labels.load(labels.map(mapRTree));
this.redraw(); this.redraw();
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
"navigo": "^7.1.2", "navigo": "^7.1.2",
"node-polyglot": "2.2.2", "node-polyglot": "2.2.2",
"promise-polyfill": "^8.1.0", "promise-polyfill": "^8.1.0",
"rbush": "^2.0.2", "rbush": "^3.0.1",
"requirejs": "^2.3.6", "requirejs": "^2.3.6",
"snabbdom": "^0.7.3" "snabbdom": "^0.7.3"
}, },
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment