You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The recommended solution is to import * as L from 'leaflet/dist/leaflet-src.esm'; which works, but causes issues with using the Leaflet-AreaSelect plugin which requires L to be available.
Though L is available when import * as L from 'leaflet/dist/leaflet-src.esm'; is used, the plugin fails either with an:
Uncaught ReferenceError: L is not defined (when importing the plugin immediately after leaflet)
or L.AreaSelect is read-only (if leaflet is imported in main.js) - this references the first line of the plugin
At the moment, the project uses Vue3 and a beta version of Vue-Leaflet that supports Vue3 (the stable version only supports Vue2).
There is an issue, documented here: vue-leaflet/vue-leaflet#48 (comment) which results in two instances of leaflet being imported.
The recommended solution is to
import * as L from 'leaflet/dist/leaflet-src.esm';
which works, but causes issues with using the Leaflet-AreaSelect plugin which requiresL
to be available.Though
L
is available whenimport * as L from 'leaflet/dist/leaflet-src.esm';
is used, the plugin fails either with an:Uncaught ReferenceError: L is not defined
(when importing the plugin immediately after leaflet)or
L.AreaSelect is read-only
(if leaflet is imported inmain.js
) - this references the first line of the pluginThis may be related to ES6 imports: Leaflet/Leaflet.markercluster#874
The text was updated successfully, but these errors were encountered: