diff --git a/umap/static/umap/js/modules/global.js b/umap/static/umap/js/modules/global.js new file mode 100644 index 00000000..a9485375 --- /dev/null +++ b/umap/static/umap/js/modules/global.js @@ -0,0 +1,5 @@ +import * as L from '../../vendors/leaflet/leaflet-src.esm.js' + +// Exposes the modules to the window global scope, it's expected by leaflet plugins +// in a writeable form. +window.L = { ...L } diff --git a/umap/static/umap/js/modules/urls.js b/umap/static/umap/js/modules/urls.js index 66db6b1a..fd3d4b5f 100644 --- a/umap/static/umap/js/modules/urls.js +++ b/umap/static/umap/js/modules/urls.js @@ -1,4 +1,4 @@ -import { Util } from './vendors.js' +import { Util } from '../../vendors/leaflet/leaflet-src.esm.js' export default class URLs { constructor(serverUrls) { diff --git a/umap/static/umap/js/modules/vendors.js b/umap/static/umap/js/modules/vendors.js deleted file mode 100644 index 85ab07e1..00000000 --- a/umap/static/umap/js/modules/vendors.js +++ /dev/null @@ -1,144 +0,0 @@ -import { - bind, - Bounds, - Browser, - Canvas, - Circle, - Class, - Control, - control, - DivIcon, - DomEvent, - DomUtil, - Draggable, - Evented, - extend, - FeatureGroup, - featureGroup, - GeoJSON, - Handler, - Icon, - LatLng, - latLng, - LatLngBounds, - latLngBounds, - Layer, - LayerGroup, - LineUtil, - Map, - map, - Marker, - Mixin, - Path, - Point, - point, - Polygon, - Polyline, - polyline, - Popup, - Projection, - Rectangle, - rectangle, - setOptions, - stamp, - svg, - TileLayer, - Util, -} from '../../vendors/leaflet/leaflet-src.esm.js' - -// expose the modules to the window.vendors global scope -window.L = { - bind, - Bounds, - Browser, - Canvas, - Circle, - Class, - Control, - control, - DivIcon, - DomEvent, - DomUtil, - Draggable, - Evented, - extend, - FeatureGroup, - featureGroup, - GeoJSON, - Handler, - Icon, - LatLng, - latLng, - LatLngBounds, - latLngBounds, - Layer, - LayerGroup, - LineUtil, - Map, - map, - Marker, - Mixin, - Path, - Point, - point, - Polygon, - Polyline, - polyline, - Popup, - Projection, - Rectangle, - rectangle, - setOptions, - stamp, - svg, - TileLayer, - Util, -} - -export { - bind, - Bounds, - Browser, - Canvas, - Circle, - Class, - Control, - control, - DivIcon, - DomEvent, - DomUtil, - Draggable, - Evented, - extend, - FeatureGroup, - featureGroup, - GeoJSON, - Handler, - Icon, - LatLng, - latLng, - LatLngBounds, - latLngBounds, - Layer, - LayerGroup, - LineUtil, - Map, - map, - Marker, - Mixin, - Path, - Point, - point, - Polygon, - Polyline, - polyline, - Popup, - Projection, - Rectangle, - rectangle, - setOptions, - stamp, - svg, - TileLayer, - Util, -} diff --git a/umap/static/umap/test/index.html b/umap/static/umap/test/index.html index f77b0e74..0d643766 100644 --- a/umap/static/umap/test/index.html +++ b/umap/static/umap/test/index.html @@ -3,7 +3,7 @@