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 'setColor' of undefined #5607

Closed
KlienCy opened this issue Jul 11, 2017 · 6 comments
Closed

Cannot read property 'setColor' of undefined #5607

KlienCy opened this issue Jul 11, 2017 · 6 comments

Comments

@KlienCy
Copy link

KlienCy commented Jul 11, 2017

When I use this._viewer.scene.primitives.add(cesium3DTileset) , at the time of the mouse on the tileset, using this._viewer.scene.primitives.remove(cesium3DTileset), there will be an error

I use the viewer.extend(Cesium.viewerCesium3DTilesInspectorMixin); in the main function

`Uncaught TypeError:
Cannot read property 'setColor' of undefined

at Cesium3DTileFeature.set (Cesium3DTileFeature.js:91)
at Cesium3DTilesInspectorViewModel.set (Cesium3DTilesInspectorViewModel.js:979)
at Cesium3DTilesInspectorViewModel.js:342
at handleMouseMove (ScreenSpaceEventHandler.js:252)
at handlePointerMove (ScreenSpaceEventHandler.js:644)
at HTMLCanvasElement.listener (ScreenSpaceEventHandler.js:67)`

The Cesium3DTileFeature this._content.batchTable is undefined

@hpinkos
Copy link
Contributor

hpinkos commented Jul 11, 2017

Thanks for reporting this @kelien! I'm having a little trouble reproducing it though. Could you please put together a short Sandcastle example to reproduce the error?

@KlienCy
Copy link
Author

KlienCy commented Jul 14, 2017

http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=3D%20Tiles%20Inspector.html&label=3D%20Tiles

JS

var btn = document.getElementById("removeTiles");
btn.onclick=function(){
   viewer.scene.primitives.remove(tileset);
};

html
<button id="removeTiles" style="position:absolute;z-index:1000;top:30px;left:40px;">remove tiles</button>

qq 20170714091914

console
Uncaught TypeError: Cannot read property 'setColor' of undefined (on line 91 of http://cesiumjs.org/Cesium/Source/Scene/Cesium3DTileFeature.js)
Uncaught TypeError: Cannot read property 'setColor' of undefined (on line 91 of http://cesiumjs.org/Cesium/Source/Scene/Cesium3DTileFeature.js)
Uncaught TypeError: Cannot read property 'setColor' of undefined (on line 91 of http://cesiumjs.org/Cesium/Source/Scene/Cesium3DTileFeature.js)
Uncaught TypeError: Cannot read property 'setColor' of undefined (on line 91 of http://cesiumjs.org/Cesium/Source/Scene/Cesium3DTileFeature.js)
@hpinkos

unless i set viewer.cesium3DTilesInspector.viewModel.picking = false;

@hpinkos
Copy link
Contributor

hpinkos commented Jul 14, 2017

Thanks @kelien, I submitted a fix for this here: #5630

@KlienCy
Copy link
Author

KlienCy commented Jul 20, 2017

the same problem to Cesium3DTileFeature @hpinkos

Cesium3DTileFeature.js:91 Uncaught TypeError: Cannot read property 'setColor' of undefined
    at Cesium3DTileFeature.set (Cesium3DTileFeature.js:91)
    at SelectTileset.restoreFeatureColor (SelectTileset.js:29)
    at SelectTileset.js:36
    at handleMouseDown (ScreenSpaceEventHandler.js:166)
    at handlePointerDown (ScreenSpaceEventHandler.js:608)
    at HTMLCanvasElement.listener (ScreenSpaceEventHandler.js:67)

@hpinkos
Copy link
Contributor

hpinkos commented Jul 20, 2017

Thanks @kelien, that should be fixed as well. Feel free to re-open this issue if you're still seeing problem after the next release comes out.

@KlienCy
Copy link
Author

KlienCy commented Jul 21, 2017

OK,thanks your reply:)

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