Hi, im new to Cesium. I want to add a GeoJsonDataSource. This worked fine. But is it possible that it "flies" a bit over the earth? It should have some height, like the polygons where i can say with wyoming.polygon.height = 250000; that the height is 250000.
heres my code for the moment:
<script>
var viewer = new Cesium.Viewer('cesiumContainer');
var camera = viewer.camera;
camera.setView({
destination : Cesium.Cartesian3.fromDegrees(8.53, 51.94, 15000.0),
orientation: {
heading : 0,
pitch : Cesium.Math.toRadians(-60),
roll : 0.0
}
});
loadMyData();
function loadMyData() {
var myData = Cesium.GeoJsonDataSource.load('02tracksAny.json');
myData.then(function(dataSource) {
viewer.dataSources.add(dataSource);
//Get the array of entities
var entities = dataSource.entities.values;
for (var i = 0; i < entities.length; i++) {
var entity = entities[i];
console.log(entities);
// *********** dieser Teil funktioniert leider nicht ; (
for (var j = 0; j< entity.polyline.positions.length; j++ ){
var x = entity.polyline.positions[j].x;
var y = entity.polyline.positions[j].y;
var z = 20000 + (j * 10);
postions[j] = new Cesium.Cartesian3(x,y,z);
}
entity.polyline.material = new Cesium.PolylineGlowMaterialProperty({
glowPower : 0.4,
color : Cesium.Color.BLUE
});
//entity.polyline.extrudedHeight = 250000;
//entity.polygon.extrudedHeight = entity.properties.Population / 50.0;
}
// ***********************************************
}).otherwise(function(error){
//Display any errrors encountered while loading.
window.alert(error);
});
};
</script>