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

provider.readyPromise is not a function #4

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 TypeError: provider.readyPromise is not a function
    at eval (index.js:33:10)
    at ./src/index.js (app.js:1702:1)
    at __webpack_require__ (app.js:13123:33)
    at app.js:14328:37
    at app.js:14330:12

I'am using Cesium 1.99 so this should not be a problem with deprecated API.

hongfaqiu commented 1 year ago

Sorry for my mistake. readyPromise is not a function but a promise, so you can use it as follows:

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

or use the await keyword:

await provider.readyPromise