mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 18:39:22 +08:00
refactor(geomap): skip module loader for JS
This commit is contained in:
parent
eca3955dc2
commit
2b8ee31be3
@ -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" ],
|
||||
}
|
||||
|
||||
|
@ -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], {
|
||||
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user