【Cesium基础】从3dtiles 采高度,已知根据经纬度点集

sampleHeightMostDetailed

* Initiates an asynchronous query for an array of positions using the maximum level of detail for 3D Tilesets in the scene. The height of the input positions is ignored.Returns a promise that is resolved when the query completes. Each point height is modified in place.

使用场景中3D Tilesets的最大细节级别启动对位置数组异步查询。输入位置的高度被忽略。返回查询完成时解析的promise,每个点的高度都被就地修改。

If a height cannot be determined because no geometry can be sampled at that location, or another error occurs, the height is set to undefined.

复制代码
 * @example
 * const positions = [
 *     new Cesium.Cartographic(-1.31968, 0.69887),
 *     new Cesium.Cartographic(-1.10489, 0.83923)
 * ];
 * const promise = viewer.scene.sampleHeightMostDetailed(positions);
 * promise.then(function(updatedPosition) {
 *     // positions[0].height and positions[1].height have been updated.
 *     // updatedPositions is just a reference to positions.
 * }

-------------------------------------------------------------------------------
Scene.prototype.sampleHeightMostDetailed = function (
  positions,
  objectsToExclude,
  width
) {
  return this._picking.sampleHeightMostDetailed(
    this,
    positions,
    objectsToExclude,
    width
  );
};
实验案例
复制代码
        const positions = [new Cesium.Cartographic.fromDegrees(longitude, latitude),
        new Cesium.Cartographic.fromDegrees(longitude, latitude + 0.0001) ];
            const promise = scene.sampleHeightMostDetailed(positions);
            promise.then(function(updatedPositions) {
               positions[0].height = updatedPositions[0].height;
               console.log('Height at point:', height);
          });
相关推荐
玲小珑2 分钟前
Next.js 教程系列(二十七)React Server Components (RSC) 与未来趋势
前端·next.js
Mike_jia3 分钟前
UptimeRobot API状态监控:零成本打造企业级业务健康看板
前端
江城开朗的豌豆4 分钟前
React状态更新踩坑记:我是这样优雅修改参数的
前端·javascript·react.js
CodeSheep22 分钟前
Stack Overflow,轰然倒下了!
前端·后端·程序员
i紸定i22 分钟前
解决html-to-image在 ios 上dom里面的图片不显示出来
前端·ios·vue·html·html-to-image
ai.Neo23 分钟前
(第十七期)HTML图像标签详解:从入门到精通
前端·html
阿珊和她的猫24 分钟前
autofit.js: 自动调整HTML元素大小的JavaScript库
开发语言·javascript·html
excel27 分钟前
JS 函数终极指南:this、闭包、递归、尾调用、柯里化,一次性吃透
前端
夏天想28 分钟前
html模拟websocket通信
前端
阿珊和她的猫5 小时前
v-scale-scree: 根据屏幕尺寸缩放内容
开发语言·前端·javascript