# @gis-js
@gis-js/vue2ol (opens new window)为Openlayers (opens new window)提供了vue (opens new window)映射组件,允许以简单地声明式映射构造。
# 安装
# Npm
npm install ol @gis-js/vue2ol --save
# Yarn
yarn add ol @gis-js/vue2ol
# Pnpm
pnpm install ol @gis-js/vue2ol --save
# 用法
# 在 webpack / rollup 构建系统中
全局安装
import Vue from 'vue'
import Vue2ol from "@gis-js/vue2ol"
Vue.use(Vue2ol);
组件内安装
import {Vue2olMap,Vue2olLayerVector,Vue2olSourceVector} from "@gis-js/vue2ol"
export default {
name: 'MyAwesomeMap',
components: {
Vue2olMap,
Vue2olLayerVector,
Vue2olSourceVector,
},
};