我使用iserver发布了dem高程数据,地图中可以看到加载了高程数据,,,但是我调用sampleTerrain获取的高度却为空,这是什么原因呢,能获取到该点地形的高度吗?代码如下:
var a = new Cesium.CesiumTerrainProvider({
url: "http://192.168.80.253:8090/iserver/services/3D-dem/rest/realspace/datas/ASTGTM2_N27E118_dem%40dem",
isSct: true, //地形服务源自SuperMap iServer发布时需设置isSct为true
invisibility: true,
});
viewer.terrainProvider = a;
let terrainProvider = viewer.terrainProvider;
var positions = [
Cesium.Cartographic.fromDegrees(86.925145, 27.988257),
Cesium.Cartographic.fromDegrees(87.0, 28.0)
];
var promise = Cesium.sampleTerrain(terrainProvider, 11, positions);
Cesium.when(promise, function(updatedPositions) {
debugger
});
结果如下: