IITC-CE / Leaflet.Canvas-Markers

Leaflet plugin for displaying icons on canvas instead of DOM
MIT License
2 stars 4 forks source link

Uncaught ReferenceError: module is not defined #17

Closed LukePrior closed 3 years ago

LukePrior commented 3 years ago

I have included the script and rbush however when I load the page I get the following error:

Uncaught ReferenceError: module is not defined at leaflet.canvas-markers.js:458

Here is my code:

<script type="text/javascript" language="javascript" src="js/rbush.js"></script>
<script type="text/javascript" language="javascript" src="js/leaflet.canvas-markers.js"></script>
LukePrior commented 3 years ago

I managed to get it working with the following taken from the example:

<script src="https://unpkg.com/rbush@2.0.2/rbush.js"></script>
<script>var module = {};</script>
<script src="js/leaflet.canvas-markers.js"></script>
<script>module.exports(L);</script>

However, it seems to cause problems:

ReferenceError: IScroll is not defined
LukePrior commented 3 years ago

I got it all working