vertical polyline cannot be explored

Skip to first unread message

Apr 8, 2019, 4:52:34 AM4/8/19
to cesium-dev

the following code can be run in the Cesium Sandcastle to render a vertical polyline.
But when panning or zooming the map, the polyline disappears. Could this be a bug?

var viewer = new Cesium.Viewer('cesiumContainer');

var dashedLine = viewer.entities.add({
name : 'Blue dashed line',
polyline : {
positions : Cesium.Cartesian3.fromDegreesArrayHeights([-75, 45, 500000,
-75, 45, 500100]),
width : 4,
material : new Cesium.PolylineDashMaterialProperty({
color: Cesium.Color.CYAN



Omar Shehata

Apr 12, 2019, 9:27:34 AM4/12/19
to cesium-dev
It disappears just because the camera moves too fast with any click. Try setting the first point's height to 0 to see that it doesn't disappear.

Another thing you can do is set the camera's reference frame to be on the line so you never lose it:

var center = Cesium.Cartesian3.fromDegrees(-75, 45, 500050);
var transform = Cesium.Transforms.eastNorthUpToFixedFrame(center);, new Cesium.HeadingPitchRange(0, -Math.PI/4, 200));

Here's a Sandcastle link to the camera orbitting this line.

To reset the transform you can then do:
Reply all
Reply to author
0 new messages