Leaflet.LayerGroup.Collision icon indicating copy to clipboard operation
Leaflet.LayerGroup.Collision copied to clipboard

Uncaught ReferenceError: rbush is not defined

Open jvolker opened this issue 7 years ago • 1 comments

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')

jvolker avatar Jul 24 '17 03:07 jvolker

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

sport4minus avatar Aug 02 '21 13:08 sport4minus