Console中的报错信息如下:
http://localhost:8090/iserver/services/3D-SDG/rest/realspace/datas/Info/data/path/layer.json Failed to load resource: the server responded with a status of 404 ()
将地形地址贴入珠峰的实例中时也是报错如下:
http://localhost:8090/iserver/services/3D-SDG/rest/realspace/datas/GC/data/path/1/2/0.terrainz?v=1.16389.0 404 () An error occurred in "M": Failed to obtain terrain tile X: 2 Y: 1 Level: 1.
但是地址贴入SuperMapEarth里面时就能正常显示。
地形生成缓存时选择的是TIN。
代码如下,求助求助:
var parameter = new Array("url", "type");
function onload(Cesium) {
//console.log(Cesium.ScreenSpaceEventType);
window.viewer = new Cesium.Viewer('cesiumContainer'); //添加地球
parameter.url='http://localhost:8090/iserver/services/3D-SDG/rest/realspace/datas/Img'//影像地址
addImageLayerFromSaveData(parameter);
parameter.url ='http://localhost:8090/iserver/services/3D-SDG/rest/realspace/datas/GC'//地形地址
addTerrainLayerFromSaveData(parameter);
}
//添加地形
function addTerrainLayerFromSaveData(addLayer) {
var terrainProvider = new Cesium.CesiumTerrainProvider({
url: addLayer.url,
// requestWaterMask: true, //是否请求水面效果,默认为false
// requestVertexNormals: true, //是否请求额外的照明信息,默认false
isSct: true //是否为iServer发布的地形
});
viewer.terrainProvider = terrainProvider;
}
//添加影像
function addImageLayerFromSaveData(addLayer) {
var imageryLayers = viewer.imageryLayers;
var imageryProvider = new Cesium.SuperMapImageryProvider({
url: addLayer.url
});
var layer = imageryLayers.addImageryProvider(imageryProvider);
viewer.flyTo(layer);
}