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: [], // 清空事件按钮 (缩放至、...)
      };

相关推荐
晓得迷路了2 分钟前
栗子前端技术周刊第 84 期 - Vite v7.0 beta、Vitest 3.2、Astro 5.9...
前端·javascript·vite
独立开阀者_FwtCoder6 分钟前
最全301/302重定向指南:从SEO到实战,一篇就够了
前端·javascript·vue.js
Moment15 分钟前
给大家推荐一个超好用的 Marsview 低代码平台 🤩🤩🤩
前端·javascript·github
whoarethenext1 小时前
C++ OpenCV 学习路线图
c++·opencv·学习
明似水1 小时前
用 Melos 解决 Flutter Monorepo 的依赖冲突:一个真实案例
前端·javascript·flutter
独立开阀者_FwtCoder1 小时前
stagewise:让AI与代码编辑器无缝连接
前端·javascript·github
恰薯条的屑海鸥1 小时前
零基础在实践中学习网络安全-皮卡丘靶场(第十四期-XXE模块)
网络·学习·安全·web安全·渗透测试
江城开朗的豌豆1 小时前
JavaScript篇:对象派 vs 过程派:编程江湖的两种武功心法
前端·javascript·面试
Lester_11011 小时前
嵌入式学习笔记 - freeRTOS vTaskPlaceOnEventList()函数解析
笔记·学习
菥菥爱嘻嘻1 小时前
JS手写代码篇---手写ajax
开发语言·javascript·ajax