-
Notifications
You must be signed in to change notification settings - Fork 127
Closed
Description
These dependencies were not found:
- leaflet in ./node_modules/@vue-leaflet/vue-leaflet/dist/vue-leaflet.esm.js
- leaflet/dist/images/marker-icon-2x.png in ./node_modules/@vue-leaflet/vue-leaflet/dist/vue-leaflet.esm.js
- leaflet/dist/images/marker-icon.png in ./node_modules/@vue-leaflet/vue-leaflet/dist/vue-leaflet.esm.js
- leaflet/dist/images/marker-shadow.png in ./node_modules/@vue-leaflet/vue-leaflet/dist/vue-leaflet.esm.js
- leaflet/dist/leaflet-src.esm in ./node_modules/@vue-leaflet/vue-leaflet/dist/vue-leaflet.esm.js, ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/App.vue?vue&type=script&lang=js
- leaflet/dist/leaflet.css in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/App.vue?vue&type=script&lang=js
To install them, you can run: npm install --save leaflet leaflet/dist/images/marker-icon-2x.png leaflet/dist/images/marker-icon.png leaflet/dist/images/marker-shadow.png leaflet/dist/leaflet-src.esm leaflet/dist/leaflet.css
i'm user the same example in documentation
import "leaflet/dist/leaflet.css"
import { LMap, LGeoJson } from "@vue-leaflet/vue-leaflet";
export default {
name: 'App',
components: {
LMap,
LGeoJson,
},
data() {
return {
geojson: {
type: "FeatureCollection",
features: [
// ...
],
},
geojsonOptions: {
// Options that don't rely on Leaflet methods.
},
};
},
async beforeMount() {
// HERE is where to load Leaflet components!
const { circleMarker } = await import("leaflet/dist/leaflet-src.esm");
// And now the Leaflet circleMarker function can be used by the options:
this.geojsonOptions.pointToLayer = (feature, latLng) =>
circleMarker(latLng, { radius: 8 });
this.mapIsReady = true;
},
Metadata
Metadata
Assignees
Labels
No labels