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

Setting imageryProvider=false doesn't disable the default layer #624

Open
alaney opened this issue Sep 2, 2023 · 1 comment
Open

Setting imageryProvider=false doesn't disable the default layer #624

alaney opened this issue Sep 2, 2023 · 1 comment

Comments

@alaney
Copy link

alaney commented Sep 2, 2023

When I use the Viewer with imageryProvider=false and an ImageLayer I still see a request to the Cesium API (https://api.cesium.com/v1/assets/2/endpoint...). I would expect that disabling the default layer would prevent this request. Here is my component:

import { SceneMode } from 'cesium';
import { forwardRef } from 'react';
import { CesiumComponentRef, Viewer } from 'resium';
import { ViewerProps } from 'resium/dist/Viewer/Viewer';
import { Viewer as CesiumViewer } from 'cesium';

const MapViewer = forwardRef(
  (props: ViewerProps, ref: React.ForwardedRef<CesiumComponentRef<CesiumViewer>>): JSX.Element => {
    const { children, ...rest } = props;
    return (
      <Viewer
        ref={ref}
        className='mapView'
        imageryProvider={false}
        baseLayerPicker={false}
        geocoder={false}
        timeline={false}
        animation={false}
        fullscreenButton={false}
        infoBox={false}
        homeButton={false}
        sceneModePicker={false}
        sceneMode={SceneMode.SCENE2D}
        navigationHelpButton={false}
        selectionIndicator={false}
        {...rest}
      >
        <ImageryLayer imageryProvider={imageryProvider} />
      </Viewer>
    );
  }
);

MapViewer.displayName = 'MapViewer';
export default MapViewer;

Should disabling the default imagery provider prevent this request from being issued? Is there another way to prevent the request?

@michfarmer
Copy link

@alaney Try baseLayer={false} instead.

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

2 participants