0

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 {
    LMap,
    LTileLayer
} from "@vue-leaflet/vue-leaflet"

with the template syntax:

<template>
   <l-map> ... </l-map>
</tempalte>

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

0

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.