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

How disable Viewer default imageryProvider createWorldImagery() #50

Closed
Cootcha opened this issue Jan 14, 2019 · 5 comments
Closed

How disable Viewer default imageryProvider createWorldImagery() #50

Cootcha opened this issue Jan 14, 2019 · 5 comments
Labels
question suggestion Suggestion about functions or documents

Comments

@Cootcha
Copy link

Cootcha commented Jan 14, 2019

How can i disable default imageryProvider? If you create your own imagery provider and use it like this:

<Viewer
    full
    timeline={false}
    animation={false}
    vrButton={false}
    geocoder={false}
    homeButton={false}
    fullscreenButton={false}
    baseLayerPicker={false}
    infoBox={false}
    navigationHelpButton={false}
    scene3DOnly      
>
  <Scene
    debugShowFramesPerSecond
    sunBloom={false}
    shadowMap={false}
    terrainShadows={false}
    shadows={false}
    fxaa
    resolutionScale={1}
    backgroundColor={Color.ALICEBLUE}
  >
    <Globe
       tileCacheSize={10000}
       baseColor={Color.ALICEBLUE}
       depthTestAgainstTerrain={false}
       enableLighting={false}
    >
      <OwnImageryProvider /> //its component ImageryLayer from resium with my own props
    </Globe>
  <Scene>
<Viewer>

my imagery were displayed, but on background i still request from the default imageLayer, because default imageryProvider is createWorldImagery ()

@rot1024
Copy link
Member

rot1024 commented Jan 15, 2019

In current version, there is no way to disable the default imagery layer except using ref. I will implement how to remove default imagery provider soon.

Workaround is as following.

class Component extends React.PureComponent {
  viewer;

  componentDidMount() {
    this.viewer.imageryLayers.removeAll();
    this.viewer.imageryLayers.add(/* ImageryProvider */);
  }

  render() {
    return (
      <Viewer ref={e => { this.viewer = e && e.cesiumElement; }}>
        {/* something */}
      </Viewer>
    );
  }
}

@rot1024 rot1024 added question suggestion Suggestion about functions or documents labels Jan 15, 2019
@rot1024
Copy link
Member

rot1024 commented Jan 15, 2019

Resium v1.2.0 has been released.

You can disable default imagery layer as following:

<Viewer imageryProvider={false} />

@Cootcha
Copy link
Author

Cootcha commented Jan 15, 2019

It work's great. Thanks

@rot1024 rot1024 closed this as completed Jan 15, 2019
@bigkrp
Copy link
Contributor

bigkrp commented Aug 7, 2023

imageryProvider

after v.1.17 it doesn't work

@bigkrp
Copy link
Contributor

bigkrp commented Aug 7, 2023

But helps baseLayer={false}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question suggestion Suggestion about functions or documents
Projects
None yet
Development

No branches or pull requests

3 participants