πŸ”Œ Vue-Leaflet Plugins Wrapper

October 2, 2025 Β· View on GitHub

npm version npm downloads License
Vue Leaflet

A modern Vue 3 wrapper for Leaflet v2-alpha plugins, extending vue-leaflet. Built with the Composition API, SSR-compatible, and designed to integrate seamlessly with the Vue-Leaflet ecosystem.

⚠️ This is an early-stage project. Only a few plugins are supported yet β€” contributions and requests are welcome via issues or discussions.


πŸš€ What's New

  • βœ… Unified plugin wrapper system for Leaflet v2
  • βœ… Works out-of-the-box with @maxel01/vue-leaflet
  • βœ… SSR support tested with Nuxt
  • βœ… Consistent Vue 3 Composition API interface
  • βœ… Plugin test helpers for easy development

βœ… Available Plugins

The following plugins are currently wrapped and ready for use:

β˜‘οΈ Leaflet.Donut (draw donuts)
β˜‘οΈ Leaflet.heat (heatmap layer)
β˜‘οΈ Leaflet.hotline (heatmap-style polylines)
β˜‘οΈ Leaflet.MarkerCluster (animated marker clustering)
β˜‘οΈ Leaflet.RotatedMarker (rotate markers)

More plugins will be added over time. If you need a specific plugin, open a request in the repo.

⚠️ Note: Leaflet v1 plugins are not directly compatible with Leaflet v2.
However, there is a possibility to use the Leaflet-V1-polyfill. Check out the Leaflet.MarkerCluster implementation for more.


πŸ“¦ Installation

pnpm add @maxel01/vue-leaflet-plugins @maxel01/vue-leaflet leaflet@2.0.0-alpha
# or
yarn add @maxel01/vue-leaflet-plugins @maxel01/vue-leaflet leaflet@2.0.0-alpha
# or
npm i @maxel01/vue-leaflet-plugins @maxel01/vue-leaflet leaflet@2.0.0-alpha

πŸ§‘β€πŸ’» Usage

See the vue-leaflet-plugins-docs for detailed examples. Here’s a quick start using the Hotline plugin:

<script setup lang="ts">
import { LMap, LTileLayer } from '@maxel01/vue-leaflet'
import { LHotline } from '@maxel01/vue-leaflet-plugins'
</script>

<template>
  <LMap :zoom="9" :center="[47.41322, -1.219482]">
    <LTileLayer
        url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
        layer-type="base"
        name="OpenStreetMap"
    />
    <LHotline
        :lat-lngs="[
                [47.334852, -1.509485, 150],
                [47.342596, -1.328731, 250],
                [47.241487, -1.190568, 350],
                [47.234787, -1.358337, 250]
            ]"
        :min="150"
        :max="350"
    />
  </LMap>
</template>

πŸ§ͺ Interactive Playground

Unlock the full potential of vue-leaflet-plugins with interactive demo components built right into the official documentation. The playground lets you explore real-world plugin usage, 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:

git clone https://github.com/maxel01/vue-leaflet-plugins.git
cd vue-leaflet
pnpm install
pnpm dev

Visit: http://127.0.0.1:3000

Or use the Vue-specific playground:

pnpm dev:vue

Visit: http://127.0.0.1:5173


πŸ›  Contribution

This repo uses pnpm for building and development.

πŸ“˜ How to install PNPM

See the contribution guide for more details.


πŸ™Œ Credits