zoukankan      html  css  js  c++  java
  • Cesium视角

         <el-row><el-col :span="9">视角模式</el-col><el-col :span="15">
            <el-select size="mini" v-model="detail.visualAngle" placeholder="请选择视角模式" @change="onChange">
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
          </el-col></el-row>
        handleFlyRoamInputChange(detail,data){
            const { visualAngle, visualClearance, visualHeight } = detail
            let camera = {
              type: "",
              followedX: Number(visualClearance),
              followedZ: Number(visualHeight)
            }
            switch (visualAngle){
              case '':
                camera.type = ""
                camera.followedX = undefined
                camera.followedZ = undefined
                break;
              case 'zdy':
                camera.type = "zdy"
                camera.followedZ = undefined
                break;
              case 'gs':
                camera.type = "gs"
                camera.followedX = undefined
                camera.followedZ = undefined
                break;
              case 'dy':
                camera.type = "dy"
                break;
              case 'sd':
                camera.type = "sd"
                camera.followedX = undefined
                break;
            }
            window.flyLine && window.flyLine.updateStyle({camera});
          },
    window.flyLine({camera})&&window.flyLine.updateStyle({camera})
    key: "updateAngle",
        value: function updateAngle(isAuto, opts) {
          if (isAuto) {
            this.entity.orientation = this.velocityOrientation; //基于移动位置自动计算方位
    
            this._heading = null;
            this._pitch = null;
            this._roll = null;
          } else {
            opts = opts || {};
    
            var position = this.position; //当前点
            var _orientation = this.orientation; //获取当前角度
            if (!position || !_orientation) return null;
    
            var autoHpr = (0, _matrix.getHeadingPitchRollByOrientation)(position, _orientation, this.viewer.scene.globe.ellipsoid, this._fixedFrameTransform);
    
            //重新赋值新角度
            var heading = autoHpr.heading;
            var pitch = Cesium.Math.toRadians(Number(opts.pitch || 0.0));
            var roll = Cesium.Math.toRadians(Number(opts.roll || 0.0));
    
            this._heading = heading;
            this._pitch = pitch;
            this._roll = roll;
    
            this.entity.orientation = Cesium.Transforms.headingPitchRollQuaternion(position, new Cesium.HeadingPitchRoll(heading, pitch, roll), this.viewer.scene.globe.ellipsoid, this._fixedFrameTransform);
          }
    {
        key: "updateStyle",
        value: function updateStyle(params) {
          if (!this.options) return;
          for (var i in params) {
            if (_typeof(params[i]) === "object" && this.options[i]) {
              for (var key2 in params[i]) {
                this.options[i][key2] = params[i][key2];
              }
            } else {
              this.options[i] = params[i];
            }
          }
        }

    createPath

    lookAtTransform:控制朝向

    viewer.scene.preUpdate.addEventListener:https://www.freesion.com/article/57661009683/

    _this._fixedFrameTransform = Cesium.defaultValue(options.fixedFrameTransform, Cesium.Transforms.eastNorthUpToFixedFrame); //参考系

  • 相关阅读:
    设计模式---单例模式
    Linux介绍
    集合---Map
    集合---Collection
    JDK1.7中HashMap底层实现原理(转)
    算法面试题-用单向链表表示十进制整数,求两个正整数之和。1234+34=1268
    idea 常用插件
    ehcache配置log4j日志,或与spirng cache整合用注解形式,打印注解日志
    spring cache @CacheEvict 清除多个key
    tomcat源码及其下载版本
  • 原文地址:https://www.cnblogs.com/2008nmj/p/15638757.html
Copyright © 2011-2022 走看看