refactor(geomap): skip module loader for JS

This commit is contained in:
Elian Doran 2025-01-20 20:36:58 +02:00
parent eca3955dc2
commit 2b8ee31be3
No known key found for this signature in database
2 changed files with 4 additions and 6 deletions

View File

@ -107,7 +107,6 @@ const HIGHLIGHT_JS: Library = {
};
const LEAFLET: Library = {
js: [ "node_modules/leaflet/dist/leaflet.js" ],
css: [ "node_modules/leaflet/dist/leaflet.css" ],
}

View File

@ -13,11 +13,8 @@ const TPL = `\
</style>
<div class="geo-map-container"></div>
</div>
</div>`
`
//@ts-nocheck
export default class GeoMapWidget extends NoteContextAwareWidget {
constructor(widgetMode: "type") {
@ -30,7 +27,9 @@ export default class GeoMapWidget extends NoteContextAwareWidget {
const $container = this.$widget.find(".geo-map-container");
library_loader.requireLibrary(library_loader.LEAFLET)
.then(() => {
.then(async () => {
const L = (await import("leaflet")).default;
const map = L.map($container[0], {
});