vue-arcgis-api

vue-arcgis-api
763 3
Install
npm install vue-arcgis-api
Latest Version:0.2.5
Vue:2 · 3
License:MIT
Last Updated:Jul 3, 2023
Links: GitHub  ·  npm
Maintainer: soullyoko

vue-arcgis-api

安装

yarn add @arcgis/core ncp --dev
yarn add vue-arcgis-api
  • 在 package.json 中为你的 scripts 添加: "cp:arcgis": "ncp ./node_modules/@arcgis/core/assets ./public/assets"
  • 运行一次 yarn cp:arcgis 将 acrgisapi 拷贝到项目目录下就可以开始啦

快速上手

全局引入

main.js

import Vue from "vue";
import App from "./App.vue";
import VueArcgis from "../packages";
import "@arcgis/core/assets/esri/themes/light/main.css";
import esriConfig from "@arcgis/core/config.js";
esriConfig.assetsPath = "/assets";

Vue.use(VueArcgis);

new Vue({
  render: h => h(App)
}).$mount("#app");

App.vue

<template>
  <div class="mapDiv">
    <EMap :basemap="basemap">
      <EMapView :center="center" :zoom="zoom"></EMapView>
    </EMap>
  </div>
</template>

<script>
export default {
  name: "App",
  data() {
    return {
      basemap: "topo",
      center: [0, 0],
      zoom: 0
    };
  }
};
</script>

<style scoped>
.mapDiv {
  width: 100%;
  height: 300px;
}
</style>

按需引入

App.vue

<template>
  <div class="mapDiv">
    <EMap :basemap="basemap">
      <EMapView :center="center" :zoom="zoom"></EMapView>
    </EMap>
  </div>
</template>

<script>
import { EMap, EMapView } from "vue-arcgis-api";
import "@arcgis/core/assets/esri/themes/light/main.css";
import esriConfig from "@arcgis/core/config.js";
esriConfig.assetsPath = "/assets";

export default {
  name: "App",
  components: { EMap, EMapView },
  data() {
    return {
      basemap: "topo",
      center: [0, 0],
      zoom: 0
    };
  }
};
</script>

<style scoped>
.mapDiv {
  width: 100%;
  height: 300px;
}
</style>

Related Packages

map-plugin-arcgis

map-plugin-arcgis

1,208
gisviewer-vue3-arcgis

在应用中引入私服的包, 项目根目录下 新建文件 .npmrc 在 .npmrc 中对包源进行配置:

28,365
dt-fcsmap-fed

A Vue 3 map component library based on ArcGIS

12,817
arcgis-mvt-renderer

Seamless MVT (Mapbox Vector Tile) rendering integration between ArcGIS Maps SDK...

385
mapbox-gl-arcgis-featureserver

A small library for requesting features from an arcgis feature server using tile...

479,419 68

Version History

Version Released Vue License
0.2.5 ^2.6.0 || >=3.2.0 MIT
0.2.4 ^2.6.0 || >=3.2.0 MIT
0.2.3 ^2.6.0 || >=3.2.0 MIT
0.2.2 ^2.0.0 || >=3.0.0 MIT
0.2.1 ^2.0.0 || >=3.0.0 MIT
Pre-releases (3)
Version Released Vue License
0.1.4-beta.2 ^2.0.0 || >=3.0.0 MIT
0.1.4-beta.1 ^2.0.0 || >=3.0.0 MIT
0.1.4-beta.0 ^2.0.0 || >=3.0.0 MIT