Vue.js library for drawing and editing geographic objects on maps
Map Draw is a Vue.js library that provides components for drawing and editing geographic objects on maps. The library supports drawing points, lines, polygons, and other complex shapes with an intuitive and easy-to-use interface.
npm install @hungpvq/vue-map-drawyarn add @hungpvq/vue-map-draw- ✅ Drawing tools - Point, line, and polygon drawing tools
- ✅ Edit tools - Edit existing features
- ✅ Multiple geometries - Support for various geometry types
- ✅ Inspect mode - Inspect and analyze drawn features
- ✅ Custom styling - Customizable drawing styles
- ✅ Integration - Easy integration with dataset management
- ✅ TypeScript support - Full TypeScript support
- ✅ Vue 3 Composition API - Modern Vue 3 Composition API
<template>
<Map @map-loaded="onMapLoaded">
<DrawControl position="top-right" :drawOptions="drawOptions" />
</Map>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { Map } from '@hungpvq/vue-map-core';
import { DrawControl, DrawingType, type DrawOption } from '@hungpvq/vue-map-draw';
import '@hungpvq/vue-map-core/style.css';
const drawOptions: DrawOption = {
drawSupports: [DrawingType.POINT, DrawingType.LINE_STRING, DrawingType.POLYGON],
async save(geojson: any) {
console.info('Save drawing:', geojson);
},
};
function onMapLoaded(map: any) {
console.info('Map loaded:', map);
}
</script>All contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
MIT License