I am wondering how to use plugins with component style of Leaflet and specifically how to use the pouchDB plugin for caching tiles.

I already got that running with the variant, where you build up the map via js:

//on my vue component (options api) setup function
 this.map = L.map('map').setView(this.mapCenter, this.zoom);

using this setup, I can easily do:

import L from "leaflet"
import PouchDB from 'pouchdb'; window.PouchDB = PouchDB;
import "leaflet.tilelayer.pouchdbcached"

when loading things.

How would I get plugins running when using Leaflet as components:

import "leaflet/dist/leaflet.css"
import {
} from "@vue-leaflet/vue-leaflet"

with the template syntax:

   <l-map> ... </l-map>

I checked the docs but did not find quite a way how to do so. What have I missed?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.