Leaflet.LayerGroup.Collision
Leaflet.LayerGroup.Collision copied to clipboard
Uncaught ReferenceError: rbush is not defined
I installed the latest version via npm and required via Browserify:
require('leaflet.layergroup.collision')
I got the following error:
Uncaught ReferenceError: rbush is not defined
I could workaround by changing the require part to the following:
global.rbush = require('rbush')
require('leaflet.layergroup.collision')
in the context of an ionic/angular app we had the same error. it could be solved through calling
import * as rbush from "rbush";
in the first line of Leaflet.LayerGroup.Collision.js
instead of
let rbush = require("rbush");
on @carlletons fork -> https://github.com/carlleton/Leaflet.LayerGroup.Collision