【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);
          });
相关推荐
孟祥_成都几秒前
前端下午茶!看看炫酷的动画,轻松一下!
前端·动效
lxh01136 分钟前
合并K个升序链表题解
前端·数据结构·链表
小周码代码13 分钟前
js 数字金额转为大写 js 金额转大写
开发语言·前端·javascript·js工具
航Hang*17 分钟前
WEBSTORM前端——第1章:HTML——第2节:列表,表格,下拉菜单,文本框与按钮
前端·html·css3·webstorm
云计算DevOps-韩老师18 分钟前
HTML盒子模型详解
前端·html
不一样的少年_18 分钟前
不仅免费,还开源?这个 AI Mock 神器我必须曝光它
前端·javascript·浏览器
2501_9310480820 分钟前
HTML `<select>` 标签深度解析
前端·html
WZl21 分钟前
在传统的HTML、CSS与JavaScript项目中加入vue
javascript·css·vue.js·html
xcLeigh23 分钟前
AI 绘制图表专栏:用豆包轻松实现 HTML 柱状图、折线图与饼图
前端·人工智能·html·折线图·柱状图·图表·豆包
码代码的霖23 分钟前
HTML———标签元素
前端·html