Can you suggest me how to drape a geojson datasource over the terrain in the Scene 3d using STK World Terrain map?
This is my code:
//Creo il viewer con i widget di cesium
var viewer = new Cesium.Viewer(‘map2’,{
sceneMode : Cesium.SceneMode.SCENE3D
});
// Create scene without anisotropic texture filtering
var scene = viewer.scene;
var positions = ; // xy position array
var cesiumTerrainProvider = new Cesium.CesiumTerrainProvider({
url : ‘//assets.agi.com/stk-terrain/world’,
//requestVertexNormals : true,
//requestWaterMask : true
});
viewer.terrainProvider = cesiumTerrainProvider;
//test drap rectangle
var rectangleInstance = new Cesium.GeometryInstance({
geometry : new Cesium.RectangleGeometry({
rectangle : Cesium.Rectangle.fromDegrees(-140.0, 30.0, -100.0, 40.0)
}),
id : ‘rectangle’,
attributes : {
color : new Cesium.ColorGeometryInstanceAttribute(0.0, 1.0, 1.0, 0.5)
}
});
scene.primitives.add(new Cesium.GroundPrimitive({
geometryInstance : rectangleInstance
}));
//can’t drap geojson polygon the feature slide
viewer.dataSources.add(Cesium.GeoJsonDataSource.load(’./data/limiti_regione.json’, {
stroke: Cesium.Color.HOTPINK,
fill: Cesium.Color.PINK.withAlpha(0.2),
strokeWidth: 10,
dashArray : “10, 8”,
perPositionHeight: true
}
));
Hello,
We don’t support this feature yet, but it’s something we plan on adding. Tom did some work towards implementing it in this branch: https://github.com/AnalyticalGraphicsInc/cesium/pull/3406
There’s still a bit more that needs to be done before it is ready.
Best,
Hannah