I am new and inexprience in SandCastle Cesium
My question is:
I have a .kml data source and I want to show the .kml’s location as a pin in the sandcastle cesium
I am able to show it but the pin is at height and on the ground.
My code is:
const viewer = new Cesium.Viewer(“cesiumContainer”, {
terrain: Cesium.Terrain.fromWorldTerrain(),
});
const scene = viewer.scene;
if (!scene.clampToHeightSupported) {
window.alert(
“This browser does not support clampToHeightMostDetailed.”
);
}
const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(1415196);
scene.primitives.add(tileset);
viewer.dataSources
.add(
Cesium.KmlDataSource.load(
“…/…/SampleData/kml/mov.kml”
)
)
.then(function (dataSource) {
viewer.clock.shouldAnimate = false;
const rider = dataSource.entities.getById(“TOUR”);
rider.position.heightReference = Cesium.HeightReference.NONE;
viewer.flyTo(rider).then(function () {
viewer.trackedEntity = rider;
viewer.selectedEntity = viewer.trackedEntity;
viewer.clock.multiplier = 0.08;
viewer.clock.shouldAnimate = true;
});
});
and the respective kml file is:
<?xml version="1.0" encoding="UTF-8"?>1
1
#track
clampToGround
2024-05-07T07:07:52.331446Z
gx:coord-122.3942108 37.7951715 0</gx:coord>
2024-05-07T07:07:52.399398Z
gx:coord-122.3941871 37.7951600 0</gx:coord>
2024-05-07T07:07:52.483399Z
</gx:Track>
</gx:MultiTrack>
and the results I am getting is
Can someone please help in it