From 7c697f75295caff8848873e847a20d234e40603b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Mon, 8 Jan 2024 17:24:36 +0100 Subject: [PATCH] Merge @ybon changes --- umap/static/umap/js/modules/global.js | 5 + umap/static/umap/js/modules/urls.js | 2 +- umap/static/umap/js/modules/vendors.js | 144 ------------------------- umap/static/umap/test/index.html | 33 +++--- umap/templates/umap/content.html | 7 +- umap/templates/umap/js.html | 32 ++++-- 6 files changed, 47 insertions(+), 176 deletions(-) create mode 100644 umap/static/umap/js/modules/global.js delete mode 100644 umap/static/umap/js/modules/vendors.js 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 @@ Umap front Tests - + @@ -26,6 +26,7 @@ + @@ -77,21 +78,21 @@ }) chai.config.includeStack = true - - - - - - - - - - - - - - - + + + + + + + + + + + + + + +