GIScience / GIScience/Leaflet.Heightgraph

Error using the source bundle

Open
#107 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
101
Forks
40
PR merge metrics
No merged PRs in 30d

Description

The unminified Rollup bundle [dist/L.Control.Heightgraph.js](https://github.com/GIScience/Leaflet.Heightgraph/blob/master/dist/L.Control.Heightgraph.js) has the dependencies in global scope. The [module wrapper](https://github.com/GIScience/Leaflet.Heightgraph/blob/9e45353ae01e4389124701bdacb62ee255d3fec1/dist/L.Control.Heightgraph.js#L4607-L4623) only encloses the plugin itself.

Loading this source bundle directly leads to an error, see http://plnkr.co/edit/SZzWSpopCELzDcgu?preview (see Console):
```
Uncaught TypeError: Cannot set property top of # which has only a getter
at L.Control.Heightgraph.js:3993
```
Concatenating it with the BRouter-Web dependencies e.g. leads to a conflict with Turf.js, see [#101 (comment)](https://github.com/GIScience/Leaflet.Heightgraph/issues/101#issuecomment-716077109).

The mininfied bundle [dist/L.Control.Heightgraph.min.js](https://github.com/GIScience/Leaflet.Heightgraph/blob/master/dist/L.Control.Heightgraph.min.js) works, as it is enclosed in an IIFE (immediately invoked function expression):
```
!function(){ ... }();
```

So it would be great if the source bundle could be enclosed in an IIFE as well or the module wrapper moved to the top.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.