You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The options.imageryProvider of the CesiumWidget constructor is deprecated since v1.104. The suggested replacement for this is to use the option.baseLayer. However, reading the documentation of the CesiumWidget it says that the constructor has a seperate baseLayer parameter you can provide to the CesiumWidget. Unfortunately when I provide this parameter with the value 'false' it doesn't work and it loads the default Cesium baselayer.
Looking at the actual constructor in the source code there only seems to be two parameters (container and options) and the baseLayer parameter is missing.
I tried using options.baseLayer in my TypeScript code, but this causes type errors saying that baseLayer isn't part of the options: return new CesiumWidget(this.elementId, { terrainProvider, baseLayer: false, });
causes TS2345: Argument of type '{ terrainProvider: CesiumTerrainProvider | undefined; baseLayer: boolean; }' is not assignable to parameter of type '{ clock?: Clock | undefined; imageryProvider?: false | ImageryProvider | undefined; terrainProvider?: TerrainProvider | undefined; terrain?: Terrain | undefined; ... 20 more ...; msaaSamples?: number | undefined; }'. Object literal may only specify known properties, and 'baseLayer' does not exist in type '{ clock?: Clock | undefined; imageryProvider?: false | ImageryProvider | undefined; terrainProvider?: TerrainProvider | undefined; terrain?: Terrain | undefined; ... 20 more ...; msaaSamples?: number | undefined; }'.
Only when I provide the options.baseLayer as follows in my code it seems to work:
return new CesiumWidget(this.elementId, { terrainProvider, baseLayer: false, } as any);
Expected behaviour:
I can provide the baseLayer parameter as separately from the options parameter and the default Cesium baseLayer isn't loaded.
Actual behaviour:
I have to provide the baseLayer as part of the options (as options.baseLayer), which causes errors in the types and seems to be contrary to the documentation.
The
options.imageryProvider
of the CesiumWidget constructor is deprecated since v1.104. The suggested replacement for this is to use theoption.baseLayer
. However, reading the documentation of the CesiumWidget it says that the constructor has a seperatebaseLayer
parameter you can provide to the CesiumWidget. Unfortunately when I provide this parameter with the value 'false' it doesn't work and it loads the default Cesium baselayer.Looking at the actual constructor in the source code there only seems to be two parameters (
container
andoptions
) and thebaseLayer
parameter is missing.I tried using
options.baseLayer
in my TypeScript code, but this causes type errors saying that baseLayer isn't part of the options:return new CesiumWidget(this.elementId, { terrainProvider, baseLayer: false, });
causes
TS2345: Argument of type '{ terrainProvider: CesiumTerrainProvider | undefined; baseLayer: boolean; }' is not assignable to parameter of type '{ clock?: Clock | undefined; imageryProvider?: false | ImageryProvider | undefined; terrainProvider?: TerrainProvider | undefined; terrain?: Terrain | undefined; ... 20 more ...; msaaSamples?: number | undefined; }'. Object literal may only specify known properties, and 'baseLayer' does not exist in type '{ clock?: Clock | undefined; imageryProvider?: false | ImageryProvider | undefined; terrainProvider?: TerrainProvider | undefined; terrain?: Terrain | undefined; ... 20 more ...; msaaSamples?: number | undefined; }'.
Only when I provide the
options.baseLayer
as follows in my code it seems to work:return new CesiumWidget(this.elementId, { terrainProvider, baseLayer: false, } as any);
Expected behaviour:
I can provide the
baseLayer
parameter as separately from theoptions
parameter and the default Cesium baseLayer isn't loaded.Actual behaviour:
I have to provide the
baseLayer
as part of theoptions
(asoptions.baseLayer
), which causes errors in the types and seems to be contrary to the documentation.Sandcastles:
Expected to work
What actually works
Version used: "@cesium/engine": "^2.4.1",
The text was updated successfully, but these errors were encountered: