【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);
          });
相关推荐
HEX9CF9 分钟前
【CTF Web】Pikachu xss之href输出 Writeup(GET请求+反射型XSS+javascript:伪协议绕过)
开发语言·前端·javascript·安全·网络安全·ecmascript·xss
凌云行者21 分钟前
使用rust写一个Web服务器——单线程版本
服务器·前端·rust
华农第一蒟蒻37 分钟前
Java中JWT(JSON Web Token)的运用
java·前端·spring boot·json·token
积水成江38 分钟前
关于Generator,async 和 await的介绍
前端·javascript·vue.js
Z3r4y39 分钟前
【Web】portswigger 服务端原型污染 labs 全解
javascript·web安全·nodejs·原型链污染·wp·portswigger
___Dream40 分钟前
【黑马软件测试三】web功能测试、抓包
前端·功能测试
金灰40 分钟前
CSS3练习--电商web
前端·css·css3
人生の三重奏43 分钟前
前端——js补充
开发语言·前端·javascript
Tandy12356_1 小时前
js逆向——webpack实战案例(一)
前端·javascript·安全·webpack
TonyH20021 小时前
webpack 4 的 30 个步骤构建 react 开发环境
前端·css·react.js·webpack·postcss·打包