arcgis vue 添加图层优化_vue + ArcGIS 地图应用系列三:添加常规的地图组件

本文介绍了如何在Vue项目中使用ArcGIS实现地图组件,包括底图切换、测量工具、标绘功能的详细步骤。通过组件通信实现地图操作,如添加矢量和影像图层,以及比例尺的添加。同时提供了标绘组件的实现,包括点、线、面、圆形和矩形的绘制。
摘要由CSDN通过智能技术生成

1. 首先创建工具菜单组件

创建文件 srccomponentsToolBar.vue

并通过组件通信写好对应接口

矢量

影像

底图

开始测量

取消测量

测量

线

圆形

长方形

停止标绘

清除标绘

标绘

图例

图层

export default {

name: "ToolBar",

methods: {

// 开启测量

measurement(type) {

this.$emit("measurement", type);

},

// 底图切换

baseMapChange(type) {

this.$emit("baseMapChange", type);

},

// 标绘

draw(type) {

this.$emit("draw", type);

},

// 显示图例

showLegend() {

this.$emit("showLegend");

},

// 显示图层

showLayerList() {

this.$emit("showLayerList");

},

},

};

.toolbar {

position: absolute;

top: 80px;

right: 40px;

height: 40px;

width: auto;

z-index: 99;

}

在 srcApp.vue 显示页面引入,并提供组件通讯接口

@measurement="measurement"

@baseMapChange="baseMapChange"

@draw="draw"

@showLegend="showLegend"

@showLayerList="showLayerList"

>

:show="isShowMeasurement"

@closMmeasurement="measurement"

>

import ToolBar from "./components/ToolBar.vue";

components: {

ToolBar

},

methods: {

// 测量

measurement(type) {

switch (type) {

case 0:

this.isShowMeasurement = false;

Map.MeasurementClose();

break;

case 1:

this.isShowMeasurement = true;

}

},

/* 地图切换 */

baseMapChange(type) {

Map.baseMapChang

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值