# πŸ—ΊοΈ Vue-Leaflet v2 Wrapper [![npm version][npm-version-src]][npm-version-href] [![npm downloads][npm-downloads-src]][npm-downloads-href] [![License][license-src]][license-href] \ [![Vue][vue-src]][vue-href] [![Leaflet][leaflet-src]][leaflet-href] A modern Vue 3 wrapper for Leaflet v2-alpha, based on [vue-leaflet/vue-leaflet](https://github.com/vue-leaflet/vue-leaflet). Built with the Composition API, fully SSR-compatible, and designed for future extensibility. > ⚠️ This is a **Beta version** and may be unstable. Contributions, feedback, and bug reports are welcome via [issues](https://github.com/Maxel01/vue-leaflet/issues) or [discussions](https://github.com/Maxel01/vue-leaflet/discussions). > βœ… Fully compatible with SSR (tested in Nuxt playground) --- ## πŸš€ What's New - βœ… Leaflet v2-alpha support - βœ… Refactored with Vue 3 Composition API - βœ… SSR compatibility without `useGlobalLeaflet` - βœ… >95% test coverage - βœ… Improved documentation ([vue-leaflet-docs](https://maxel01.github.io/vue-leaflet/)) - βœ… Component playground for live demos - βœ… Plugin support via [vue-leaflet-plugins](https://github.com/Maxel01/vue-leaflet-plugins) --- ## βœ… Available Components β˜‘οΈ LCircle β˜‘οΈ LCircleMarker β˜‘οΈ LControl β˜‘οΈ LControlAttribution β˜‘οΈ LControlLayers β˜‘οΈ LControlScale β˜‘οΈ LControlZoom β˜‘οΈ LFeatureGroup β˜‘οΈ LGeoJson β˜‘οΈ LIcon β˜‘οΈ LImageOverlay β˜‘οΈ LMap β˜‘οΈ LMarker β˜‘οΈ LPolygon β˜‘οΈ LPolyline β˜‘οΈ LPopup β˜‘οΈ LRectangle β˜‘οΈ LSVGOverlay β˜‘οΈ LTileLayer β˜‘οΈ LTooltip β˜‘οΈ LVideoOverlay β˜‘οΈ LWmsTileLayer --- ## πŸ”Œ Plugin Support Leaflet plugins compatible with version 2 can be seamlessly integrated using a dedicated wrapper: \ πŸ‘‰ [vue-leaflet-plugins](https://github.com/Maxel01/vue-leaflet-plugins) Explore the documentation to see which plugins are already supported and learn how to build your own wrappers for additional functionality. The first plugin has already been implemented. If you need support for a specific plugin, open an issue in the plugin repo and help shape the roadmap. > ⚠️ **Important:** Leaflet v1 plugins are **not compatible** with Leaflet v2 and cannot be used directly. To use a plugin with v2, it must be ported and wrapped appropriately. \ > However, there is a possibility to use the [Leaflet-V1-polyfill](https://github.com/Falke-Design/Leaflet-V1-polyfill). Check out the [`vue-leaflet-plugins`](https://github.com/Maxel01/vue-leaflet-plugins) wrapper for more. --- ## πŸ“¦ Installation ```bash pnpm add @maxel01/vue-leaflet leaflet@2.0.0-alpha # or yarn add @maxel01/vue-leaflet leaflet@2.0.0-alpha # or npm i @maxel01/vue-leaflet leaflet@2.0.0-alpha ``` --- ## πŸ§‘β€πŸ’» Usage Check out the full documentation at [vue-leaflet-docs](https://maxel01.github.io/vue-leaflet/) or explore the [playground](https://github.com/Maxel01/vue-leaflet/tree/master/playground/app/pages). Most props mirror the vanilla [Leaflet options](https://leafletjs.com/reference-2.0.0.html) for a familiar experience. ### ⚑ Quickstart ```vue ``` --- ## πŸ§ͺ Interactive Playground Unlock the full potential of **vue-leaflet** with interactive demo components built right into the [official documentation](https://maxel01.github.io/vue-leaflet/). The playground lets you explore real-world examples, experiment with features live, and see how everything fits together. Want to test **Server-Side Rendering (SSR)**? Dive into the **Nuxt playground** for a hands-on SSR experience. To run the **Nuxt Playground** locally: ```bash git clone https://github.com/maxel01/vue-leaflet.git cd vue-leaflet pnpm install pnpm dev ``` Visit: [http://127.0.0.1:3000](http://127.0.0.1:3000) Or use the Vue-specific playground: ```bash pnpm dev:vue ``` Visit: [http://127.0.0.1:5173](http://127.0.0.1:5173) --- ## πŸ›  Contribution This repo uses `pnpm` for building and development. > πŸ“˜ [How to install PNPM](https://pnpm.io/installation) See the [contribution guide](https://maxel01.github.io/vue-leaflet/getting-started/contribution.html) for more. --- ## πŸ™Œ Credits - [vue-leaflet/vue-leaflet](https://github.com/vue-leaflet/vue-leaflet) - [nuxt-modules/leaflet](https://github.com/nuxt-modules/leaflet) [npm-version-src]: https://img.shields.io/npm/v/@maxel01/vue-leaflet/latest.svg?color=0F81C2 [npm-version-href]: https://www.npmjs.com/package/@maxel01/vue-leaflet [npm-downloads-src]: https://img.shields.io/npm/dm/@maxel01/vue-leaflet.svg [npm-downloads-href]: https://www.npmjs.com/package/@maxel01/vue-leaflet [license-src]: https://img.shields.io/npm/l/@maxel01/vue-leaflet.svg [license-href]: https://www.npmjs.com/package/@maxel01/vue-leaflet [vue-src]: https://img.shields.io/npm/dependency-version/@maxel01/vue-leaflet/peer/vue?label=Vue&logo=vue.js&colorA=18181B [vue-href]: https://vuejs.org [leaflet-src]: https://img.shields.io/npm/dependency-version/@maxel01/vue-leaflet/peer/leaflet?label=Leaflet&logo=leaflet&colorA=18181B [leaflet-href]: https://leafletjs.com/