vue 调用arcgis pro 实现地图的实现

vue 调用arcgis pro 实现地图的实现

<template>  
	<div>    
		<!-- 地图主题组件 -->   
		 <div class="main">      
		 	<div id="viewDiv"></div>    
		 </div>     	
	</div>
 </template>
<script>
//引用esri-loader
import { loadModules } from 'esri-loader';
import ToolBar from "@/components/ToolBar.vue";
import Measurement from "@/components/Measurement.vue";
export default {  
name: 'web-map',  
data() {   
 return { };  
        
   }, 
 components: {    
 ToolBar,   
  Measurement, 
   }, 
 mounted() {     
   //延迟加载JavaScript模块和CSS所需的ArcGIS API   
    //使用Dojo的加载器要求类  
      loadModules([     
         'esri/Map',//加载特定于创建地图的代码     
            'esri/views/MapView',//2D地图引入      
              'esri/WebScene',      
                'esri/views/SceneView',//3D地图引入,加载允许以3D模式查看地图的代码 
                       "dojo/domReady!",    
                    ], { css: true })  
                      .then(    
                        ([     
                         ArcGISMap, MapView,     
                          WebScene,SceneView,  
                              ]) => {    
                                  var scene = new WebScene({      
                                        portalItem: {//发布服务的portal  
                                                      id:
                                                       "d30a699e1d0a4f0780bc80373911e86e"        

    },                
        });        
        //创建地图       
         this.view = new SceneView({      
             container: "viewDiv",//视图的容器      
                 map: scene,//引用创建的映射对象,实例放入视图中   
                      });     
                       }  
                         )  
                           .catch(err => { 
                                // handle any script or module loading errors    
                                  console.error(err); 
                                   });
                                   ; 
                                    }, 
};
<style lang="less" scoped>// html,// body {//   padding: 0;//   margin: 0;//   width: 80%;//   height: 100%;// }
.main { position: absolute;  top: 90px;  bottom: 0;  width: 87%;  #viewDiv {    width: 100%;    height: 95%;  }}</style>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值