Hello,
I'm trying to find a simple example explaining how to load a set of ellipses and displaying them with Cesium.
Here is a very simple geojson I made up:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"name": 1,
"color": "#fd9826"},
"geometry": {
"type": "Ellipse",
"coordinates": [-110.0,35.0],
"semiMinorAxis": 80000.0,
"semiMajorAxis" : 80000.0,
"height" : 350000
}
}
{
"type": "Feature",
"properties": {
"name": 2,
"color": "#1c9524"},
"geometry": {
"type": "Ellipse",
"coordinates": [-120.0,45.0],
"semiMinorAxis": 60000.0,
"semiMajorAxis" : 60000.0,
"height" : 150000
}
}]
}
The closest I could get is this code:
var viewer = new Cesium.Viewer('cesiumContainer');
var promise = Cesium.GeoJsonDataSource.load('../Apps/ess.geojson');
promise.then(function(dataSource) {
viewer.dataSources.add(dataSource);
var entities = dataSource.entities.values;
for (var i = 0; i < entities.length; i++) {
var entity = entities[i];
entity.ellipse = new Cesium.EllipseGraphics({
position : Cesium.Cartesian3.fromDegrees(entity.coordinates[0],entity.coordinates[1])
color: Cesium.Color.fromCssColorString(entity.color),
semiMinorAxis : entity.semiMinorAxis,
semiMajorAxis : entity.semiMajorAxis,
height : entity.height,
});
}
});
Which doesn't work, and I'm kind of lost here... Do you have any suggestion in terms of examples where I could learn more about how to achieve this, or what I am doing wrong?
Thanks a lot!
Rodolphe