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

Cannot read property 'tileProvider' of undefined #70

Closed
richard-smith-sky opened this issue Mar 13, 2019 · 3 comments
Closed

Cannot read property 'tileProvider' of undefined #70

richard-smith-sky opened this issue Mar 13, 2019 · 3 comments
Labels

Comments

@richard-smith-sky
Copy link

richard-smith-sky commented Mar 13, 2019

I'm having some problems with Resium in a new application, when I change from one Route to another using a NavLink. The application initially loads fine and I can change Route to the page featuring a Resium map Viewer. However, when I navigate away again using another NavLink, and the map should no longer be shown, the application crashes and the following error is observed:

Uncaught TypeError: Cannot read property 'tileProvider' of undefined
at Globe.get (Cesium.js:220884)
at eval (resium.es.js:588)
at Array.forEach ()
at detachEvents (resium.es.js:585)
at CesiumComponent.unmount (resium.es.js:794)
at CesiumComponent.componentWillUnmount (resium.es.js:751)
at callComponentWillUnmountWithTimer (react-dom.development.js:17733)
at HTMLUnknownElement.callCallback (react-dom.development.js:147)
at Object.invokeGuardedCallbackDev (react-dom.development.js:196)
at invokeGuardedCallback (react-dom.development.js:250)
at safelyCallComponentWillUnmount (react-dom.development.js:17740)
at commitUnmount (react-dom.development.js:18170)
at commitNestedUnmounts (react-dom.development.js:18206)
at unmountHostComponents (react-dom.development.js:18493)
at commitDeletion (react-dom.development.js:18557)
at commitAllHostEffects (react-dom.development.js:19422)
at HTMLUnknownElement.callCallback (react-dom.development.js:147)
at Object.invokeGuardedCallbackDev (react-dom.development.js:196)
at invokeGuardedCallback (react-dom.development.js:250)
at commitRoot (react-dom.development.js:19661)
at eval (react-dom.development.js:21247)
at Object.unstable_runWithPriority (scheduler.development.js:255)
at completeRoot (react-dom.development.js:21246)
at performWorkOnRoot (react-dom.development.js:21169)
at performWork (react-dom.development.js:21074)
at performSyncWork (react-dom.development.js:21048)
at interactiveUpdates$1 (react-dom.development.js:21333)
at interactiveUpdates (react-dom.development.js:2268)
at dispatchInteractiveEvent (react-dom.development.js:5086)

I notice that the same error can be created on the demo application if I navigate from here:

https://resium.darwineducation.com/examples/?path=/story/clock--basic

to here:

https://resium.darwineducation.com/examples/?path=/story/cesium3dtileset--basic

It seems to be a lifecycle error and I've experimented with manually destroying the Viewer from my component, but this does not seem to work.

This is an approximation of the code I'm using - the terrain and imagery providers are generated as constants before the map is rendered:

<Viewer
    className="radius"
    full
    imageryProvider={false}
    animation={false}
    vrButton={false}
    geocoder={false}
    homeButton={false}
    fullscreenButton={false}
    baseLayerPicker={false}
    infoBox={true}
    navigationHelpButton={false}
    timeline={false}
    sceneMode={SceneMode.SCENE2D}
    sceneModePicker={false}
    terrainProvider={ionTerrainProvider}
>
    <Scene
        sunBloom={false}
        shadowMap={false}
        terrainShadows={false}
        shadows={false}
        fxaa
        resolutionScale={1}
        backgroundColor={Color.ALICEBLUE}
    >
        <Globe
            tileCacheSize={10000}
            baseColor={Color.ALICEBLUE}
            depthTestAgainstTerrain={false}
            enableLighting={false}
        >
            <ImageryLayer imageryProvider={bingImageryProvider} />
            <ImageryLayer imageryProvider={anotherImageryProvider} />
        </Globe>
    </Scene>
</Viewer>

Many thanks for your help in this area.

@rot1024 rot1024 added the bug label Mar 14, 2019
@rot1024
Copy link
Member

rot1024 commented Mar 15, 2019

Hi, thank you for reporting a bug!

It has been fixed and new version v1.3.1 has been released.

@richard-smith-sky
Copy link
Author

Many thanks - problem fixed.

@mrlubos
Copy link

mrlubos commented Apr 24, 2019

Looks like my issue in #77 @rot1024, thanks for the fix! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants