diff --git a/umap/static/umap/js/modules/formatter.js b/umap/static/umap/js/modules/formatter.js index ac7ed595..7efea950 100644 --- a/umap/static/umap/js/modules/formatter.js +++ b/umap/static/umap/js/modules/formatter.js @@ -3,19 +3,12 @@ import { translate } from './i18n.js' export default class Formatter { async fromGPX(str) { - let togeojson - await import('../../vendors/togeojson/togeojson.es.js').then((module) => { - togeojson = module - }) + const togeojson = await import('../../vendors/togeojson/togeojson.es.js') return togeojson.gpx(this.toDom(str)) } async fromKML(str) { - console.log(str) - let togeojson - await import('../../vendors/togeojson/togeojson.es.js').then((module) => { - togeojson = module - }) + const togeojson = await import('../../vendors/togeojson/togeojson.es.js') return togeojson.kml(this.toDom(str), { skipNullGeometry: true, }) @@ -111,10 +104,7 @@ export default class Formatter { } async toGPX(geojson) { - let togpx - await import('../../vendors/geojson-to-gpx/index.js').then((module) => { - togpx = module - }) + const togpx = await import('../../vendors/geojson-to-gpx/index.js') for (const feature of geojson.features) { feature.properties.desc = feature.properties.description } @@ -123,10 +113,7 @@ export default class Formatter { } async toKML(geojson) { - let tokml - await import('../../vendors/tokml/tokml.es.js').then((module) => { - tokml = module - }) + const tokml = await import('../../vendors/tokml/tokml.es.js') return tokml.toKML(geojson) } } diff --git a/umap/storage.py b/umap/storage.py index aa185428..52c9ace2 100644 --- a/umap/storage.py +++ b/umap/storage.py @@ -35,6 +35,10 @@ class UmapManifestStaticFilesStorage(ManifestStaticFilesStorage): r"""(?Pimport\(["'](?P.*?)["']\))\.then""", """import("%(url)s")""", ), + ( + r"""(?Pawait import\(["'](?P.*?)["']\))""", + """import("%(url)s")""", + ), ), )