0
我有一個geosjon來源:如何顯示在3D銫和olcesium多邊形
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
12.671038571165692,
55.64399279138965,
85.8672
],
[
12.685366241531373,
55.63688636891217,
85.8672
],
...
我曾嘗試以下
var ol3d = new olcs.OLCesium({ map: this.map}); // map is the ol.Map instance
var scene = ol3d.getCesiumScene();
ol3d.setEnabled(true);
let datasources = ol3d.getDataSources();
console.log(datasources);
let f = new ol.format.GeoJSON({ defaultDataProjection: "EPSG:4326", featureProjection: this.map.getView().getProjection() });
for (let feature of this._limModel.visualizationSource.getFeatures()) {
feature.set("altitudeMode","relativeToGround");
}
let geojson = JSON.parse(f.writeFeatures(this._limModel.visualizationSource.getFeatures()));
var dataSource = Cesium.GeoJsonDataSource.load(geojson, { clampToGround:false}).then(
function (dataSource) {
var p = dataSource.entities.values;
for (var i = 0; i < p.length; i++) {
p[i].polygon.perPositionHeight = true;
}
datasources.add(dataSource);
}
);
但兩者的同步矢量層olcesium從轉換我ol地圖和geojson數據源繪製在橢圓/地面上,而不是上面顯示的geojson源中z座標的高度。
我該怎麼做才能將我的多邊形顯示爲3D表面。