vue-use-leaflet
TypeScript icon, indicating that this package has built-in type declarations

0.1.7 • Public • Published

vue-use-leaflet npm version npm downloads

Vue composition utilities for leaflet map.

Documentation & Demo

Installation

# NPM
$ npm install vue-use-leaflet leaflet

# Yarn
$ yarn add vue-use-leaflet leaflet

# pnpm
$ pnpm install vue-use-leaflet leaflet

Usage

import { useLeafletMap, useLeafletTileLayer, useLeafletDisplayLayer } from 'vue-use-leaflet';

export default {
  setup() {
    // dom element reference
    const element = ref(null);

    // create leaflet map
    const map = useLeafletMap(element);

    // create osm tile layer
    const tileLayer = useLeafletTileLayer(
      'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'
    );

    // add layer to the map
    useLeafletDisplayLayer(map, tileLayer);

    return { element };
  }
};

License

Licensed under the MIT License.

Readme

Keywords

Package Sidebar

Install

npm i vue-use-leaflet

Weekly Downloads

261

Version

0.1.7

License

MIT

Unpacked Size

143 kB

Total Files

55

Last publish

Collaborators

  • nikolaynau