Good morning all,
I’m working with CZML array and loading them for Polygons and Points.
Labels have an unexpected behavior with points, in fact, they are shown at the same position of the points and are not affected by pixelOffset property, indeed I would like to show the label next to the point, not behind:
var czml = [
{
id: "document",
name: "CZML Point",
version: "1.0",
},
{
id: "point 1",
name: "point",
description: "<table class='cesium-infoBox-defaultTable'><tbody><tr><th>Aeroporto di: </th ><td>PRATICA DI MARE</td></tr><tr><th>ICAO: </th><td>LIRE</td></tr><tr><th>Type: </th><td>AD</td></tr><tr><th>Stato Operativo: </th><td></td></tr><tr><th>Warning: </th><td></td></tr></tbody ></table>",
position: {
cartographicDegrees: [-111.0, 40.0, 0],
},
point: {
color: {
rgba: [255, 255, 255, 255],
},
outlineColor: {
rgba: [255, 0, 0, 255],
},
outlineWidth: 4,
pixelSize: 20,
},
label:{
text:"LIRE",
show:true,
showBackground:true,
font:"14px monospace",
horizontalOrigin:2,
heightReference : Cesium.HeightReference.CLAMP_TO_GROUND,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
pixelOffset: new Cesium.Cartesian2(10.0, 20.0),
}
}
];
var viewer = new Cesium.Viewer("cesiumContainer");
var dataSourcePromise = Cesium.CzmlDataSource.load(czml);
viewer.dataSources.add(dataSourcePromise);
viewer.zoomTo(dataSourcePromise);
I tried several times but I had had always the same result, attached the link for sandcastle:
SandCastle Example
I hope someone ca help me to solve it.
Best regards.