I am trying to add the polyline using the following code in the viewer
const polylineOptions = {
mtype: 1,
polyline: {
clampToGround: false,
material: {
red: 0.9686274509803922,
green: 0.8784313725490196,
blue: 0.12549019607843137,
alpha: 1
},
positions:[
{
x: 4587184.226708501,
y: 263034.9288440118,
z: 4408875.3130637
},
{
x: 4587020.391536608,
y: 263038.279352096,
z: 4409044.42829542
},
{
x: 4587020.391536608,
y: 263038.279352096,
z: 4409044.42829542
}
]
width: 3,
zIndex: 1000
},
}
this.viewer.entities.add(this.polylineOptions);
but the behaviour is unexpected as follows
open this gif to see my result
and it is giving the following log in console
Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored.
What I actually want is to draw a space line but with clampToGround:false options, it creates the polyline that id attached to the terrain but when I use clampToGround:false then it hides under the tilelayer as shown in the gif