之前胡乱做过一次类似的webgl打开地形服务,是能够看到地形。现在我重新发布地形和影像服务,结果webgl视图是一片黑。不知道是怎么回事。(代码经纬度没问题)
var viewer = new Cesium.Viewer('cesiumContainer',{
//创建地形服务提供者的实例,url为SuperMap iServer发布的TIN地形服务
terrainProvider : new Cesium.CesiumTerrainProvider({
url : 'http://localhost:8099/iserver/services/3D-terrain_sm-4/rest/realspace/datas/DEM@terrain_test_Terrain',
// url : 'http://www.supermapol.com/realspace/services/3D-dixingyingxiang/rest/realspace/datas/DatasetDEM',
// url : URL_CONFIG.SiChuan_TERRAIN,
isSct : true,//地形服务源自SuperMap iServer发布时需设置isSct为true
invisibility:true
}),
});
//添加SuperMap iServer发布的影像服务
// var layer = viewer.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
// url : 'http://localhost:8099/iserver/services/3D-terrain_sm-2/rest/realspace/datas/gf@image'
// // url : URL_CONFIG.SiChuan_IMG
// }));
viewer.scene.camera.setView({
destination : Cesium.Cartesian3.fromDegrees(112.79,38.32,8005) ,
// destination : new Cesium.Cartesian3(-1206939.1925299785, 5337998.241228442, 3286279.2424502545),
orientation : {
heading : 1.4059101895600987,
pitch : -0.20917672793046682,
roll : 3.708944180085382e-13
}
});