• 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); //参考系

  • 相关阅读:
    iOS
    2016-北京游线路规划
    OC 组合实现多继承
    如何把项目托管到GitHub
    iOS6和iOS7代码的适配(2)——status bar
    iOS6和iOS7代码的适配(1)
    Xcode ARC需要什么版本的环境支持
    内容页直接输出图集函数及使用方法
    vue-cli如何引入bootstrap工具
    实现Sublime Text3中vue文件高亮显示的最有效的方法
  • 原文地址:https://www.cnblogs.com/2008nmj/p/15638757.html
Copyright © 2020-2023  润新知