@mapgis/webclient-vue3-mapboxgl

MapGIS WebClient Vue3 MapboxGL by Vue3 + TS
824
Install
npm install @mapgis/webclient-vue3-mapboxgl
Latest Version:17.10.5
Vue:3
Last Updated:Oct 8, 2026
Links: npm
Maintainer: lidafengnpm

MapGIS WebClient Vue3 MapboxGL

特性

  • 开箱即用的高质量 Vue 3组件
  • 丰富的文档和示例

安装

# npm
npm install ant-design-vue@^4.2.6
npm install @mapgis/mapbox-gl
npm install @mapgis/webclient-common
npm install @mapgis/webclient-mapboxgl-plugin
npm install @mapgis/webclient-vue3-ui
npm install @mapgis/webclient-vue3-common
npm install @mapgis/webclient-vue3-mapboxgl

# yarn
yarn add ant-design-vue@^4.2.6
yarn add @mapgis/mapbox-gl
yarn add @mapgis/webclient-common
yarn add @mapgis/webclient-mapboxgl-plugin
yarn add @mapgis/webclient-vue3-ui
yarn add @mapgis/webclient-vue3-common
yarn add @mapgis/webclient-vue3-mapboxgl

# pnpm
pnpm add ant-design-vue@^4.2.6
pnpm add @mapgis/mapbox-gl
pnpm add @mapgis/webclient-common
pnpm add @mapgis/webclient-mapboxgl-plugin
pnpm add @mapgis/webclient-vue3-ui
pnpm add @mapgis/webclient-vue3-common
pnpm add @mapgis/webclient-vue3-mapboxgl

用法

在 main.ts 中写入以下内容:

完整引入

import { createApp } from 'vue'
import App from './App.vue'

import '@mapgis/webclient-common'
import '@mapgis/webclient-mapboxgl-plugin'

import Antd from 'ant-design-vue'
import MapGISUIComponents from '@mapgis/webclient-vue3-ui'
import MapGISCommonComponents from '@mapgis/webclient-vue3-common'
import MapGISMapboxGLComponents from '@mapgis/webclient-vue3-mapboxgl'

import 'ant-design-vue/dist/reset.css'
import '@mapgis/webclient-vue3-ui/dist/index.css'
import '@mapgis/webclient-vue3-common/dist/index.css'
import '@mapgis/webclient-vue3-mapboxgl/dist/index.css'

createApp(App).use(Antd).use(MapGISUIComponents).use(MapGISCommonComponents).use(MapGISMapboxGLComponents).mount('#app')

按需导入

默认支持基于 ES modules 的 tree shaking,直接引入 import { WebMap } from '@mapgis/webclient-vue3-mapboxgl'; 就会有按需加载的效果

<template>
  <a-config-provider>
    <mapgis-theme-provider>
      <WebMap></WebMap>
    </mapgis-theme-provider>
  </a-config-provider>
</template>

<script>
import { WebMap } from '@mapgis/webclient-vue3-mapboxgl'
import '@mapgis/webclient-vue3-mapboxgl/dist/theme/web-map.css'
</script>

导入资源

通过webpack、vite等工具实现资源的拷贝,以vite为例:

需要先安装vite-plugin-static-copy

配置vite.config.js

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

import { viteStaticCopy } from 'vite-plugin-static-copy'

export default defineConfig({
  define: {
    MAPGIS_BASE_URL: JSON.stringify('./')
  },
  plugins: [
    vue(),
    viteStaticCopy({
      targets: [
        {
          src: 'node_modules/@mapgis/webclient-common/dist/webclient-common-resource/*',
          dest: 'webclient-common-resource'
        }
      ]
    })
  ]
})

版本说明

v17.10.0

  1. 修复
  • 修复已知问题

Related Packages

@mapgis/webclient-vue3-cesium

MapGIS WebClient Vue3 Cesium by Vue3 + TS

989
@mapgis/webclient-vue3-common

MapGIS WebClient Vue3 Common by Vue3 + TS

942
@mapgis/webclient-vue3-ui

MapGIS WebClient Vue3 UI by Vue3 + TS

890
@mapgis/webclient-vue3-leaflet

MapGIS WebClient Vue3 Leaflet by Vue3 + TS

639
markdown-to-jsx

A very fast and versatile markdown toolchain. AST, React, React Native, SolidJS,...

200,072,413 2,394

Version History

Version Released Vue License
17.10.5 ^3.2.0
17.10.4 ^3.2.0
17.10.3 ^3.2.0
17.8.0 ^3.2.0