vue中使用esri-loader加载Arcgisapi for js 3.x版本显示地图的简单demo
Posted maycpou
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vue中使用esri-loader加载Arcgisapi for js 3.x版本显示地图的简单demo相关的知识,希望对你有一定的参考价值。
代码来自:https://blog.csdn.net/weixin_34261415/article/details/91378280?utm_medium=distribute.pc_relevant.none-task-blog-2~default~BlogCommendFromMachineLearnPai2~default-2.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2~default~BlogCommendFromMachineLearnPai2~default-2.control
<template>
<div class="wrapper">
<div ref="map" class="map"></div>
</div>
</template>
<script>
import esriLoader from "esri-loader";
export default {
name: "",
components: {},
props: {},
data() {
return {};
},
created() {},
mounted() {
const options = { url: "https://js.arcgis.com/3.27/" };
esriLoader
.loadModules(
[
"esri/map"
],
options
)
.then(
([
Map
]) => {
let map = new Map(this.$refs.map, {
backgroundColor: "#eee",
basemap: \'streets\',
logo: false,
slider: false,
zoom: 7,
minZoom: 0
});
}
);
},
computed: {},
methods: {}
};
</script>
<style scoped>
@import url(\'https://js.arcgis.com/3.27/esri/css/esri.css\');
.map {
width: 100%;
height: 100vh;
}
</style>
以上是关于vue中使用esri-loader加载Arcgisapi for js 3.x版本显示地图的简单demo的主要内容,如果未能解决你的问题,请参考以下文章
vue中使用esri-loader加载Arcgisapi for js 3.x版本显示地图的简单demo