Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imageryProvider prop on Viewer is typed incorrectly #673

Open
MatthewHerbst opened this issue Sep 4, 2024 · 0 comments
Open

imageryProvider prop on Viewer is typed incorrectly #673

MatthewHerbst opened this issue Sep 4, 2024 · 0 comments

Comments

@MatthewHerbst
Copy link

MatthewHerbst commented Sep 4, 2024

Specs:

  • Resium: 1.18.2
  • Cesium: 1.95.0
  • React: 17.0.2
  • TypeScript: 5.4.5
  • Node: 20.5.1

Expected: imageryProvider prop has no type errors
Actual: imageryProvider prop is not recognized

This was typed correctly in Resium 1.14.3 (we recently upgraded to 1.18.2)

import { Viewer } from "resium";

import { defaultImageryProvider } from "./defaultImageryProvider";

function MyMap() {
  return (
          <Viewer
            ...
            imageryProvider={defaultImageryProvider}
            ...
        >
            ...
        </ResiumViewer>
  );
}

The type error we get is:

⚠ Error (TS2322)

Type:
{
  children: Element[];
  animation: false;
  baseLayerPicker: false;
  className: string;
  fullscreenButton: false;
  geocoder: false;
  globe: Globe;
  homeButton: false;
  imageryProvider: TileCoordinatesImageryProvider;
  infoBox: false;
  navigationHelpButton: false;
  requestRenderMode: true;
  scene3DOnly: true;
  sceneModePicker: false;
  selectionIndicator: false;
  style: { cursor: string };
  targetFrameRate: number;
  terrainProvider: TerrainProvider;
  timeline: false;
}
is not assignable to type:
IntrinsicAttributes & {} & {
  terrainShadows?: ShadowMode | undefined;
  clockTrackedDataSource?: DataSource | undefined;
  targetFrameRate?: number | undefined;
  useDefaultRenderLoop?: boolean | undefined;
  resolutionScale?: number | undefined;
  allowDataSourcesToSuspendAnimation?: boolean | undefined;
  trackedEntity?: Entity | undefined;
  selectedEntity?: Entity | undefined;
  shadows?: boolean | undefined;
  useBrowserRecommendedResolution?: boolean | undefined;
  creditDisplay?: unknown;
} & {} & {
  selectionIndicator?: boolean | undefined;
  infoBox?: boolean | undefined;
  geocoder?: boolean | GeocoderService[] | undefined;
  homeButton?: boolean | undefined;
  sceneModePicker?: boolean | undefined;
  projectionPicker?: boolean | undefined;
  baseLayerPicker?: boolean | undefined;
  navigationHelpButton?: boolean | undefined;
  animation?: boolean | undefined;
  timeline?: boolean | undefined;
  fullscreenButton?: boolean | undefined;
  vrButton?: boolean | undefined;
  dataSources?: DataSourceCollection | undefined;
  clockViewModel?: ClockViewModel | undefined;
  navigationInstructionsInitiallyVisible?: boolean | undefined;
  scene3DOnly?: boolean | undefined;
  shouldAnimate?: boolean | undefined;
  selectedImageryProviderViewModel?: ProviderViewModel | undefined;
  imageryProviderViewModels?: ProviderViewModel[] | undefined;
  selectedTerrainProviderViewModel?: ProviderViewModel | undefined;
  terrainProviderViewModels?: ProviderViewModel[] | undefined;
  skyBox?: false | SkyBox | undefined;
  skyAtmosphere?: false | SkyAtmosphere | undefined;
  fullscreenElement?: string | Element | undefined;
  showRenderLoopErrors?: boolean | undefined;
  automaticallyTrackDataSourceClocks?: boolean | undefined;
  contextOptions?: any;
  sceneMode?: SceneMode | undefined;
  mapProjection?: MapProjection | undefined;
  globe?: false | Globe | undefined;
  orderIndependentTranslucency?: boolean | undefined;
  creditContainer?: string | Element | undefined;
  creditViewport?: string | Element | undefined;
  mapMode2D?: MapMode2D | undefined;
  requestRenderMode?: boolean | undefined;
  maximumRenderTimeChange?: number | undefined;
  depthPlaneEllipsoidOffset?: number | undefined;
  msaaSamples?: number | undefined;
  baseLayer?: unknown;
  blurActiveElementOnCanvasFocus?: unknown;
  terrain?: unknown;
} & ViewerCesiumEvents &
  EventProps<RootEventTarget> & {
  onWheel?: ((delta: number) => void) | undefined;
} & RootComponentInternalProps & {
  className?: string | undefined;
  id?: string | undefined;
  style?: CSSProperties | undefined;
  full?: boolean | undefined;
  containerProps?: any;
  extend?: ViewerMixin | ViewerMixin[] | undefined;
  children?: ReactNode;
  terrainProvider?: TerrainProvider | Promise<TerrainProvider> | undefined;
} & RefAttributes<CesiumComponentRef<Viewer>>
.
  | Property imageryProvider does not exist on type:IntrinsicAttributes & {} & { terrainShadows?: ShadowMode \| undefined; clockTrackedDataSource?: DataSource \| undefined; targetFrameRate?: number \| undefined; useDefaultRenderLoop?: boolean \| undefined; resolutionScale?: number \| undefined; allowDataSourcesToSuspendAnimation?: boolean \| undefined; trackedEntity?: Entity \| undefined; selectedEntity?: Entity \| undefined; shadows?: boolean \| undefined; useBrowserRecommendedResolution?: boolean \| undefined; creditDisplay?: unknown; } & {} & { selectionIndicator?: boolean \| undefined; infoBox?: boolean \| undefined; geocoder?: boolean \| GeocoderService[] \| undefined; homeButton?: boolean \| undefined; sceneModePicker?: boolean \| undefined; projectionPicker?: boolean \| undefined; baseLayerPicker?: boolean \| undefined; navigationHelpButton?: boolean \| undefined; animation?: boolean \| undefined; timeline?: boolean \| undefined; fullscreenButton?: boolean \| undefined; vrButton?: boolean \| undefined; dataSources?: DataSourceCollection \| undefined; clockViewModel?: ClockViewModel \| undefined; navigationInstructionsInitiallyVisible?: \| boolean \| undefined; scene3DOnly?: boolean \| undefined; shouldAnimate?: boolean \| undefined; selectedImageryProviderViewModel?: \| ProviderViewModel \| undefined; imageryProviderViewModels?: \| ProviderViewModel[] \| undefined; selectedTerrainProviderViewModel?: \| ProviderViewModel \| undefined; terrainProviderViewModels?: \| ProviderViewModel[] \| undefined; skyBox?: false \| SkyBox \| undefined; skyAtmosphere?: false \| SkyAtmosphere \| undefined; fullscreenElement?: string \| Element \| undefined; showRenderLoopErrors?: boolean \| undefined; automaticallyTrackDataSourceClocks?: boolean \| undefined; contextOptions?: any; sceneMode?: SceneMode \| undefined; mapProjection?: MapProjection \| undefined; globe?: false \| Globe \| undefined; orderIndependentTranslucency?: boolean \| undefined; creditContainer?: string \| Element \| undefined; creditViewport?: string \| Element \| undefined; mapMode2D?: MapMode2D \| undefined; requestRenderMode?: boolean \| undefined; maximumRenderTimeChange?: number \| undefined; depthPlaneEllipsoidOffset?: number \| undefined; msaaSamples?: number \| undefined; baseLayer?: unknown; blurActiveElementOnCanvasFocus?: unknown; terrain?: unknown; } & ViewerCesiumEvents & EventProps & { onWheel?: ((delta: number) => void) \| undefined; } & RootComponentInternalProps & { className?: string \| undefined; id?: string \| undefined; style?: CSSProperties \| undefined; full?: boolean \| undefined; containerProps?: any; extend?: ViewerMixin \| ViewerMixin[] \| undefined; children?: ReactNode; terrainProvider?: \| TerrainProvider \| Promise \| undefined; } & RefAttributes> . -- | --
(property) imageryProvider: TileCoordinatesImageryProvider
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant