If I have billboards loaded at a certain height above the terrain, how can I then draw a polyline using the same positions as the billboards based on the following? When I use the positions from the billboards, the polyline ends up much higher than the billboards.
var terrainModels = Cesium.createDefaultTerrainProviderViewModels();
var viewer = new Cesium.Viewer('cesiumContainer', {
selectedTerrainProviderViewModel: terrainModels[1],
timeline: false,
navigationHelpButton: false,
baseLayerPicker: true,
animation: false,
fullscreenButton: false,
scene3DOnly: true
});
var pb = new Cesium.PinBuilder();
var PB_SIZE = 40;
var pbName = "BB 1";
var pbColor = Cesium.Color.BLUE;
var myPositions = [[-86.361, 36.3981, 7.62],
[-86.3613, 36.398, 7.62],
[-86.3615, 36.3979, 7.62]];
var bbs = viewer.scene.primitives.add(
new Cesium.BillboardCollection({
scene: viewer.scene
})
);
bbs.add({
id: pbName,
position: Cesium.Cartesian3.fromDegrees(myPositions[0][0], myPositions[0][1], myPositions[0][2]),
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
heightReference: Cesium.HeightReference.RELATIVE_TO_GROUND,
image: pb.fromText(pbName, pbColor, PB_SIZE).toDataURL()
});
pbName = "BB 2";
bbs.add({
id: pbName,
position: Cesium.Cartesian3.fromDegrees(myPositions[1][0], myPositions[1][1], myPositions[1][2]),
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
heightReference: Cesium.HeightReference.RELATIVE_TO_GROUND,
image: pb.fromText(pbName, pbColor, PB_SIZE).toDataURL()
});
pbName = "BB 3";
bbs.add({
id: pbName,
position: Cesium.Cartesian3.fromDegrees(myPositions[2][0], myPositions[2][1], myPositions[2][2]),
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
heightReference: Cesium.HeightReference.RELATIVE_TO_GROUND,
image: pb.fromText(pbName, pbColor, PB_SIZE).toDataURL()
});