mapwmslayerswitch
v0.3.4
Published
Vue 3 MapGeoWmsSwitch component for controlling CME2D WMS, XYZ, and native map layers.
Downloads
3,129
Readme
mapwmslayerswitch
Vue 3 component package for MapGeoWmsSwitch.vue. It controls WMS, XYZ, and existing native map layers on a CME2D/OpenLayers-compatible map instance.
Install
npm install mapwmslayerswitchThe consuming app must already provide Vue 3, Element Plus, and the CME2D/* module aliases used by the map project.
Usage
Register globally:
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import MapWmsLayerSwitch from 'mapwmslayerswitch'
import 'mapwmslayerswitch/style.css'
createApp(App).use(ElementPlus).use(MapWmsLayerSwitch).mount('#app')Or import the component directly:
<script setup lang="ts">
import { ref } from 'vue'
import { MapGeoWmsSwitch } from 'mapwmslayerswitch'
import 'mapwmslayerswitch/style.css'
const selectedLayers = ref(['city_boundary'])
</script>
<template>
<MapGeoWmsSwitch v-model="selectedLayers" :map="map" />
</template>By default, the component uses the built-in default-maplist.config.js geoInfo configuration. Props such as title, items, wms-url, wms-projection, and z-index are still supported as overrides.
Build And Publish
npm run build
npm publish --access publicBuild output is written to dist/. The npm package only includes dist/ and this README.
