onaci/leaflet-geotiff-2

Switching from leaflet-geotiff to leaflet-geotiff-2 causes errors

Closed this issue · 1 comments

I have a website using node and npm to manage modules. I was successfully using the leaflet-geotiff module and then decided to switch to leaflet-geotiff-2 for the upgrades and bug fixes.

I uninstalled leaflet-geotiff and installed leaflet-geotiff-2. Also changed import statements to:
require('leaflet-geotiff-2');
require('leaflet-geotiff-2/dist/leaflet-geotiff-plotty');

These are the dependencies in package.json:
"dependencies": {
"babel-runtime": "^6.26.0",
"bootbox": "^4.4.0",
"bootstrap": "^4.4.1",
"bootstrap-select": "^1.13.12",
"bootstrap-slider": "^9.10.0",
"bootstrap-validator": "^0.11.9",
"child_process": "^1.0.2",
"chroma-js": "^1.4.1",
"classnames": "^2.2.6",
"core-js": "^2.6.11",
"cubic-spline": "^1.0.4",
"d3": "^4.13.0",
"esri-leaflet": "^2.3.3",
"font-awesome": "^4.7.0",
"fs": "0.0.1-security",
"geotiff": "^1.0.0-beta.7",
"http": "0.0.0",
"https": "^1.0.0",
"jquery": "^2.2.4",
"jquery.2": "^1.0.0",
"jquery2": "^2.0.3-a",
"leaflet": "^1.6.0",
"leaflet-geotiff-2": "^0.1.4",
"leaflet-hotline": "^0.4.0",
"leaflet.layergroup.collision": "^0.3.1",
"meteor-node-stubs": "^0.2.11",
"moment": "^2.24.0",
"moment-timezone": "^0.5.27",
"rbush": "^1.4.3",
"url": "^0.11.0",
"validator": "^6.3.0"
},

When trying to display page - get a bunch of Errors (50) first of which is the following ...
"Cannot use import statement outside a module" referring to this line in the Plotty code:

import { colorscales } from './colorscales';

Any guesses on why just uninstalling leaflet-geotiff and installing leaflet-geotiff-2 would cause theses problems? Thanks!

I found solution for this.