here is parts of source ccode for points and for dam entity.
points:
// add points of interest
try { // try/catch and global var --> because GeoJson is loaded as promise
var pointsGeoJson = await Cesium.GeoJsonDataSource.load(interestPointsPath);
viewer.dataSources.add(pointsGeoJson);
const pointsEntities = pointsGeoJson.entities.values;
for (let i = 0; i < pointsEntities.length; i++) {
let entity = pointsEntities[i];
// set position (Z coordinate)
const cartesianCoords = new Cesium.Cartesian3(entity.position._value.x, entity.position._value.y, entity.position._value.z);
const cartographicCoords = Cesium.Ellipsoid.WGS84.cartesianToCartographic(cartesianCoords);
const longitude = Cesium.Math.toDegrees(cartographicCoords.longitude);
const latitude = Cesium.Math.toDegrees(cartographicCoords.latitude);
entity.position = Cesium.Cartesian3.fromDegrees(longitude,
latitude,
entity.properties.Z_modified + elevationDiff);
// set info in pop up
entity.name = "<h2>" + entity.properties.nazev_sluzby + "</h2>"; // show attributes of geojson in pop up
const type = "<p>typ: " + entity.properties.stav; + "</p>";
const coords = "<p>GPS souřadnice (WGS 84 – EPSG 4326): <br>" + lat + "N, " + lon + "E </p>";
const info = "<p>" + entity.properties.popupContent + "</p>";
entity.description = type + coords + info;
// set marker
let markerPath = markersPath + entity.properties.sluzba + ".svg";
markerPath = markerPath.replace(/[0-9]/g, '');
let multiply = 1;
if (mobileDevice) { multiply = 1.75; }
let scale;
if (entity.properties.nazev_sluzby == "kostel sv. VĂta") {
scale = 0.35 * multiply; // marker of church is bigger to be dominant
} else {
scale = 0.15 * multiply;
}
entity.billboard = {
image: markerPath,
sizeInMeters: false, // great feature!!! can relative / absolute size of icon, width and height have to be but not suitable for my app
//width: 20,
//height: 20,
scale: scale// 0 - 1.0 --> smaller img, 1< --> bigger img
}
}
pointsGeoJson.clustering.enabled = true;
pointsGeoJson.clustering.pixelRange = 0.03;
pointsGeoJson.clustering.minimumClusterSize = 6;
}
catch (error) {
console.log(error);
}
dam entity:
const zahradkaCentroid = Cesium.Cartesian3.fromDegrees(lon, lat, elevation); // mid point of Zahradka 3D model
const damColor = new Cesium.Color(0, 0.75, 1, 0.4); // R, G, B, alpha
function createSvihovDam(centroid, color) {
return new Cesium.Entity({
id: "svihovDam",
name: "<br>v. n. Ĺ vihov",
description: "<p>Klikli jste na hladinu v. n. Ĺ vihov. Pokud jste chtÄ›li kliknout na bodovou znaÄŤku, která je pod hladinou, vypnÄ›te vrstvu pĹ™ehrady v levĂ©m ovládacĂm panelu.</p><p>Ve vĂ˝chozĂm stavu je vrstva pĹ™ehrady v Ăşrovni pĹ™i běžnĂ©m vodnĂm stavu v. n. Ĺ vihov (376,8 m n.m.).</p>",
position: centroid,
show: true,
plane: {
plane: new Cesium.Plane(Cesium.Cartesian3.UNIT_Z, 0.0),
dimensions: new Cesium.Cartesian2(3600, 2652), // dimensions of plane (X Y) (3600, 2652) for fitting Zahradka area
fill: true,
// material: Cesium.Color.DEEPSKYBLUE.withAlpha(0.2),
material: color,
outline: false,
// outlineColor: Cesium.Color.BLUE,
},
});
};
let svihovDam = createSvihovDam(zahradkaCentroid, damColor);
viewer.entities.add(svihovDam);