【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);
          });
相关推荐
环信15 小时前
2026年开发者选择即时通讯厂商应注意的几点
前端
卷帘依旧15 小时前
Generator 全面解析 + async/await 深度对比
前端·javascript
weixin_4713830315 小时前
统一缩放单位基础(px、em、rem)
开发语言·javascript·ecmascript
yqcoder15 小时前
数据劫持的双雄:深入解析 Object.defineProperty 与 Proxy
开发语言·前端·javascript
lichenyang45315 小时前
鸿蒙聊天 Demo 练习 03:接入 Next.js 后端接口,实现真机前后端联调
前端
小三金15 小时前
EXPO+RN echarts图表库,以及如何使用
前端·javascript·react.js
ZFSS16 小时前
Midjourney Shorten API 的集成与使用
java·前端·数据库·人工智能·ai·midjourney·ai编程
Pu_Nine_916 小时前
IntersectionObserver 详解:封装 Vue 指令实现图片懒加载
前端·javascript·vue.js·性能优化
清灵xmf16 小时前
Web 和 Native 是怎么“对话“的?JSBridge 解答
前端·webview·native·jsbridge·hybrid
jiayong2317 小时前
前端面试题库 - ES6+新特性篇
前端·面试·es6