【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);
          });
相关推荐
像风一样自由202026 分钟前
HTML与JavaScript:构建动态交互式Web页面的基石
前端·javascript·html
aiprtem1 小时前
基于Flutter的web登录设计
前端·flutter
浪裡遊1 小时前
React Hooks全面解析:从基础到高级的实用指南
开发语言·前端·javascript·react.js·node.js·ecmascript·php
why技术1 小时前
Stack Overflow,轰然倒下!
前端·人工智能·后端
GISer_Jing1 小时前
0704-0706上海,又聚上了
前端·新浪微博
止观止2 小时前
深入探索 pnpm:高效磁盘利用与灵活的包管理解决方案
前端·pnpm·前端工程化·包管理器
whale fall2 小时前
npm install安装的node_modules是什么
前端·npm·node.js
烛阴2 小时前
简单入门Python装饰器
前端·python
袁煦丞3 小时前
数据库设计神器DrawDB:cpolar内网穿透实验室第595个成功挑战
前端·程序员·远程工作
天天扭码3 小时前
从图片到语音:我是如何用两大模型API打造沉浸式英语学习工具的
前端·人工智能·github