0
這怎麼看起來非地形模式標記被切斷
爲了增加標誌物銫,無論是在地形模式和非地形模式我在做這樣的:
this.viewer = new Cesium.Viewer(this.container.nativeElement , {
baseLayerPicker : true,
selectedTerrainProviderViewModel: terrain[1]
});
this.viewer.terrainProvider = new Cesium.EllipsoidTerrainProvider();
,然後,當我給地形網址的輸入(地形網址是否正確:https://assets.agi.com/stk-terrain/world)
if(this.cesium.viewer.terrainProvider.hasOwnProperty("_url")) {
this.cesiumHandler = new Cesium.ScreenSpaceEventHandler(this.cesium.viewer.scene.canvas);
var pickedObject = this.cesium.viewer.scene.pick(event.position);
let positionCartesian3 = this.cesium.viewer.scene.pickPosition(event.position);
let positionCartographic = Cesium.Cartographic.fromCartesian(positionCartesian3);
let lngDeg: number = Cesium.Math.toDegrees(positionCartographic.longitude);
let latDeg: number = Cesium.Math.toDegrees(positionCartographic.latitude);
position = [lngDeg, latDeg, positionCartographic.height];
}
else {
this.cesiumHandler = new Cesium.ScreenSpaceEventHandler(this.cesium.container.nativeElement);
let positionCartesian3 = this.cesium.viewer.camera.pickEllipsoid(event.position);
let positionCartographic = Cesium.Cartographic.fromCartesian(positionCartesian3);
let lngDeg: number = Cesium.Math.toDegrees(positionCartographic.longitude);
let latDeg: number = Cesium.Math.toDegrees(positionCartographic.latitude);
position= [lngDeg, latDeg];
}