2017-02-19 8 views
0

それが非地形モードマーカーは

にどのように見えるかこれをカットしていますmがこれを行う:私は地形のURLの入力を与えたときに、その後、

this.viewer = new Cesium.Viewer(this.container.nativeElement , { 
     baseLayerPicker : true, 
     selectedTerrainProviderViewModel: terrain[1] 
    }); 
    this.viewer.terrainProvider = new Cesium.EllipsoidTerrainProvider(); 

をして(地形URLが正しいです: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]; 
    } 

答えて

0

地形上の任意のエンティティを追加するたびに、

 this.cesium.viewer.scene.globe.depthTestAgainstTerrain = true; 
を使用