Hi I want to drape the terrain of geojson file, including lines and polygons, as this link. (https://twitter.com/CesiumJS/status/638821250140254208/photo/1), but it looks that the layer is above the map. Any ideas?. Thanks.
This is my code:
var promise= Cesium.GeoJsonDataSource.load('area.geojson');//Load geojson in the world map
var scene = viewer.scene;
promise.then(function(dataSource) {
viewer.dataSources.add(dataSource);
viewer.zoomTo(dataSource);
//Get the array of entities
var entities = dataSource.entities.values;
for (var i = 0; i < entities.length; i++) {
var entity = entities[i];
var _geometry;
if(entity.polygon!==undefined){
_geometry = new Cesium.PolygonGeometry({
polygonHierarchy : entity.polygon.hierarchy._value
});
}
if(!_geometry)continue;
var _geometryInstance = new Cesium.GeometryInstance({
geometry : _geometry,
id : "work_"+i,
attributes : {
color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)
}
});
scene.primitives.add(new Cesium.GroundPrimitive({
geometryInstance : _geometryInstance
}));
_geometry=null;
//viewer.flyTo(entity);
}