stuartmatthews / leaflet-geotiff

Leaflet plugin for displaying geoTIFF raster data
MIT License
174 stars 76 forks source link

Update leaflet-geotiff.js #1

Closed monemihir closed 7 years ago

monemihir commented 7 years ago

Atm the checking of plotty and GeoTIFF libraries is being done at script load time.

This means a JS error is thrown for NodeJS applications where those libraries are only loaded on an as needed basis instead of a global load for all web pages.

Suggest moving those 2 if statements into the initialize function

monemihir commented 7 years ago

Yep it poses an issue.

Since the library does not export any module it can't get included as a node reference. Furthermore it is also not available via npm so may be this issue was not detected before.

I'm including all required references plotty, geotiff and leaflet via npm.