【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);
          });
相关推荐
Irene1991几秒前
Vue 官方推荐:kebab-case(短横线命名法)
javascript·vue.js
GIS之路22 分钟前
GDAL 创建矢量图层的两种方式
前端
2501_948195341 小时前
RN for OpenHarmony英雄联盟助手App实战:符文配置实现
javascript·react native·react.js
小目标一个亿1 小时前
Windows平台Nginx配置web账号密码验证
linux·前端·nginx
rocky1911 小时前
网页版时钟
前端·javascript·html
Aotman_1 小时前
Element-UI Message Box弹窗 使用$confirm方法自定义模版内容,修改默认样式
linux·运维·前端
计算机程序设计小李同学1 小时前
基于SSM框架的动画制作及分享网站设计
java·前端·后端·学习·ssm
一只小阿乐2 小时前
vue-web端实现图片懒加载的方
前端·javascript·vue.js
牛马1112 小时前
Flutter 多语言
前端·flutter
by————组态2 小时前
集成详细说明
前端·物联网·信息可视化·组态·组态软件