【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);
          });
相关推荐
谢尔登28 分钟前
【React】React 18 并发特性
前端·react.js·前端框架
Joker`s smile31 分钟前
使用React+ant Table 实现 表格无限循环滚动播放
前端·javascript·react.js
国家不保护废物36 分钟前
🌟 React 魔法学院入学指南:从零构建你的第一个魔法阵(项目)!
前端·react.js·架构
然我37 分钟前
从原生 JS 到 React:手把手带你开启 React 业务开发之旅
javascript·react.js·前端框架
import_random38 分钟前
[机器学习]svm支持向量机(优势在哪里)
前端
国家不保护废物40 分钟前
从刀耕火种到现代框架:DOM编程 vs Vue/React 进化史
前端·vue.js·react.js
陈随易40 分钟前
Univer v0.8.0 发布,开源免费版 Google Sheets
前端·后端·程序员
wkj00144 分钟前
QuaggaJS 配置参数详解
java·linux·服务器·javascript·quaggajs
不怎么爱学习的dan1 小时前
实现 ECharts 多国地区可视化方案
前端
嘉小华1 小时前
Android Lifecycle 状态同步与分发机制深度解析
前端