hongfaqiu / TIFFImageryProvider

Load GeoTIFF/COG(Cloud optimized GeoTIFF) on Cesium
https://tiff-imagery-provider.opendde.com/?panel=layer
MIT License
52 stars 10 forks source link

TypeError: Cannot read properties of undefined (reading 'nodata') #5

Closed ilyaly closed 1 year ago

ilyaly commented 1 year ago

When loading any .tiff file as proposed in a readme file:

provider.readyPromise().then(() => {
  cesiumViewer.imageryLayers.addImageryProvider(provider);
})

,I always get the error:

caught (in promise) TypeError: Cannot read properties of undefined (reading 'nodata')
    at TIFFImageryProvider.eval (index.js:2031:55)
    at Generator.next (<anonymous>)
    at fulfilled (index.js:39:58)

I am handling this issue by specifying the bands numbers and there min and max values in renderOptions. Is there some additional preprocessing in the demo that is missing in the library, because I never face this issue when working with demo?

hongfaqiu commented 1 year ago

Thank you for testing. I now confirm that you are the first person to use this library! It is true that the demo assigned initial values to the renderOptions parameter. I have fixed this error in the code.