Arcgis for javascript 开发学习经验

初始化viewer:

提示:这里简述项目相关背景:

c 复制代码
const mapBaseLayer = new WebTileLayer({
        urlTemplate: SystemConfig.dydImgUrl,
        visible: true,
        id: 'DYDImage',
      });

      //地图初始化map
      const map = new Map({
        basemap: 'satellite',
        ground: 'world-elevation',
        layers: [mapBaseLayer],
      });
            //初始化3D场景
      const view3d = new SceneView({
        container: container,
        map: map,
        //camera: SystemConfig.viewConfig.initCamera,
        qualityProfile: SystemConfig.viewConfig.qualityProfile,
        // viewingMode: SystemConfig.viewConfig.viewModel,
        // clippingArea: SystemConfig.viewConfig.kansasExtent,
        environment: {
          atmosphere: {
            quality: SystemConfig.viewConfig.quality,
          },
          // weather: {
          //   type: 'cloudy', // autocasts as new CloudyWeather()
          // },
          background: {
            type: 'color',
            color: '#03c0fa',
          },
          starsEnabled: false,
          atmosphereEnabled: false,
        },
      });
      view3d.ui.components = [];
      view3d.popup = {
        dockEnabled: false,
        dockOptions: {
          buttonEnabled: false,
          // position: 'bottom-right',
          breakpoint: true,
        },
        collapseEnabled: false, // 移除title点击折叠功能
        spinnerEnabled: false,
        // autoCloseEnabled:true,
        actions: [], // 清空事件按钮 (缩放至、...)
      };
      //地图初始化中心点
      let pt = null;
      pt = SystemConfig.viewConfig.center
        ? new Point({
            x: SystemConfig.viewConfig.center.x,
            y: SystemConfig.viewConfig.center.y,
            spatialReference: SystemConfig.viewConfig.spatialReference,
          })
        : null;

      view3d.when(() => {
        view3d.goTo(
          {
            center: pt,
            zoom: 12.45840402466091,
            tilt: SystemConfig.viewConfig.initCamera.tilt,
            heading: SystemConfig.viewConfig.initCamera.heading,
          },
          {
            duration: 10000,
          },
        );
      });

      window.view = view3d;

      const viewLocal = new SceneView({
        container: null,
        map: map,
        camera: SystemConfig.viewConfig.localCamera,
        qualityProfile: SystemConfig.viewConfig.qualityProfile,
        viewingMode: SystemConfig.viewConfig.viewModel,
        //clippingArea: SystemConfig.viewConfig.kansasExtent,
        environment: {
          atmosphere: {
            quality: SystemConfig.viewConfig.quality,
          },
          weather: {
            type: 'sunny', // autocasts as new CloudyWeather()
          },
          background: {
            type: 'color',
            color: [99, 104, 68, 1],
          },
          starsEnabled: false,
          atmosphereEnabled: false,
        },
      });

      viewLocal.ui.components = [];
      viewLocal.popup = {
        dockOptions: {
          buttonEnabled: false,
        },
        collapseEnabled: false, // 移除title点击折叠功能
        spinnerEnabled: false,
        // autoCloseEnabled:true,
        actions: [], // 清空事件按钮 (缩放至、...)
      };

相关推荐
山河木马3 小时前
矩阵专题3-怎么创建投影矩阵(uProjectionMatrix)
javascript·webgl·计算机图形学
泯泷4 小时前
第 2 篇:设计第一套字节码:Opcode、Instruction 与 Constant Pool
前端·javascript·安全
泯泷4 小时前
第 1 篇:从 1 + 2 开始:亲手写出第一台 JSVM
前端·javascript·安全
朦胧之5 小时前
页面白屏卡住排查方法
前端·javascript
犇驫聊AI6 小时前
Chrome DevTools MCP + Claude Code 自定义skills生成接口代码生成器
前端·javascript
kyriewen6 小时前
别再这样写 async/await 了:我在 Code Review 中见过最多的 8 个错误
前端·javascript·面试
用户2986985301411 小时前
在 React 中使用 JavaScript 将 Excel 转换为 SVG
前端·javascript·react.js
labixiong11 小时前
手写Promise--微任务、静态方法、async/await 全搞懂(三)
前端·javascript
铁皮饭盒13 小时前
3行代码搞定页面截图,Bun.WebView真的简单
javascript
kyriewen1 天前
我手写了一个 EventEmitter,面试官追问了 6 个问题——第 4 个我没答上来
前端·javascript·面试