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

EllipsoidGraphics.maximumCone cannot be dynamic #8271

Closed
hanyingling opened this issue Oct 10, 2019 · 1 comment · Fixed by #8277
Closed

EllipsoidGraphics.maximumCone cannot be dynamic #8271

hanyingling opened this issue Oct 10, 2019 · 1 comment · Fixed by #8277

Comments

@hanyingling
Copy link

在cesium1.62 , EllipsoidGraphics.maximumCone 使用 new Cesium.CallbackProperty不起作用?
例:
var viewer = new Cesium.Viewer('cesiumContainer');
var i = 50;
var entity = viewer.entities.add({
name : 'Dome with inner radius',
position: Cesium.Cartesian3.fromDegrees(-114.0, 40.0),
ellipsoid : {
radii : new Cesium.Cartesian3(1000, 1000, 1000),
maximumCone :new Cesium.CallbackProperty(setAngle, false),
material : Cesium.Color.RED.withAlpha(0.3),
outline : true
}
});

function setAngle() {
//只走一次
if(i>0){
i-=10;
}
return Cesium.Math.toRadians(i);
}

viewer.zoomTo(viewer.entities);
请问怎么解决这个问题

@OmarShehata OmarShehata changed the title cesium 1.62 中 EllipsoidGraphics.maximumCone 使用 new Cesium.CallbackProperty不起作用 EllipsoidGraphics.maximumCone cannot be dynamic Oct 10, 2019
@OmarShehata
Copy link
Contributor

Thanks @HuZhuangQiang . I can reproduce this. Here's a Sandcastle where the ellipsoid will pulsate by changing its radii, but the cone angle won't change from the initial value set (so if you change the Math.sin to Math.cos in the setAngle callback it'll have a different initial value).

I think the maximumCone property just needs to be wired up here to detect updates to it and make sure the new value is used?

https://github.com/AnalyticalGraphicsInc/cesium/blob/85b869cf78b3832c38f1c5e3350bba9404c2a126/Source/DataSources/EllipsoidGeometryUpdater.js#L193-L201

does that sounds right @hpinkos ?

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

Successfully merging a pull request may close this issue.

2 participants