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

polyline rendered error when positions set height in 2D. #12435

Closed
wangzwswip opened this issue Jan 15, 2025 · 1 comment
Closed

polyline rendered error when positions set height in 2D. #12435

wangzwswip opened this issue Jan 15, 2025 · 1 comment

Comments

@wangzwswip
Copy link

What happened?

when viewer mapMode2D set to MapMode2D.ROTATE. And the positions to create polyline include height, then the polyline dose not work. test code :

const viewer = new Cesium.Viewer("cesiumContainer", {mapMode2D: Cesium.MapMode2D.ROTATE});
viewer.scene.mode = 2;
// when set height, polyline dose not work
let positions = Cesium.Cartesian3.fromDegreesArrayHeights([100, 10, 100, 110, 10,100, 120, 20, 100]);
// when height = 0, it work
let positions2 = Cesium.Cartesian3.fromDegreesArray([100, 10, 110, 10, 120, 20]);
const line = new Cesium.GeometryInstance({
geometry: new Cesium.PolylineGeometry({
positions: positions,
width: 2,
vertexFormat:Cesium.PolylineColorAppearance.VERTEX_FORMAT,
}),
attributes:{
color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.RED)
}
});
let aa = new Cesium.Primitive({
geometryInstances: line,
asynchronous: false,
appearance: new Cesium.PolylineColorAppearance({
translucent: true,
}),
show: true
});
viewer.scene.primitives.add(aa);

Reproduction steps

...

Sandcastle example

No response

Environment

Browser: chrome
CesiumJS Version: 1.125
Operating System: windows 11

@ggetz
Copy link
Contributor

ggetz commented Jan 31, 2025

Thanks for the report @wangzwswip!

I believe we're already tracking it in #4620. I'm going to close your issue to keep the discussion in one place. If you have any further input on this, please post it there instead.

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

No branches or pull requests

2 participants