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

相关推荐
yiqiqukanhaiba10 分钟前
STM32学习笔记13-通信协议I2C&MPU6050&I2C软件控制
笔记·stm32·学习
NeilNiu22 分钟前
开源AI工具Midscene.js
javascript·人工智能·开源
Warren981 小时前
软件测试-Selenium学习笔记
java·javascript·笔记·学习·selenium·测试工具·安全
萌萌哒草头将军1 小时前
有了它 ,我彻底告别了 try-finally 🔥🔥🔥
前端·javascript·vue.js
老虎06271 小时前
JavaWeb前端02(JavaScript)
开发语言·前端·javascript
Python私教2 小时前
YggJS RLogin暗黑霓虹主题登录注册页面 版本:v0.1.1
开发语言·javascript·ecmascript
南半球与北海道#2 小时前
el-table合并单元格
javascript·vue.js·elementui·表格合并
Jimmy2 小时前
客户端存储 - IndexedDB
前端·javascript·indexeddb
在路上`2 小时前
前端学习之后端小白java的一些理论知识(框架)
java·学习
成小白3 小时前
前端实现两个页面之间的通讯
前端·javascript