diff --git a/manifest.json b/manifest.json index 89b9220..10000b4 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "id": "obsidian-leaflet-plugin", "name": "Obsidian Leaflet", "description": "Interactive maps inside your notes", - "version": "4.3.3", + "version": "4.3.4", "minAppVersion": "0.12.12", "author": "Jeremy Valentine", "repo": "valentine195/obsidian-leaflet-plugin", diff --git a/package.json b/package.json index b6cb51e..d53eef9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-leaflet-plugin", - "version": "4.3.3", + "version": "4.3.4", "description": "Leaflet integration for Obsidian.md", "main": "main.js", "scripts": { diff --git a/src/main.ts b/src/main.ts index d4bfe4e..b57ee31 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,4 +1,4 @@ -import "leaflet"; +/* import "leaflet"; */ import "../node_modules/leaflet/dist/leaflet.css"; import "./assets/main.css"; import type InitiativeTracker from "../../obsidian-initiative-tracker/src/main"; @@ -54,6 +54,7 @@ import { LeafletMapView } from "./map/view"; import { SRDMonster } from "../../obsidian-initiative-tracker/@types"; import { Length } from "convert/dist/types/units"; + //add commands to app interface declare module "obsidian" { interface App { diff --git a/src/utils/leaflet-import.ts b/src/utils/leaflet-import.ts index c884f4e..038712f 100644 --- a/src/utils/leaflet-import.ts +++ b/src/utils/leaflet-import.ts @@ -10,16 +10,17 @@ declare global { export const LeafletSymbol = "OBSIDIAN_LEAFLET_PLUGIN"; const WindowL = window.L; +if (!window.L) { + require("leaflet"); +} -require("leaflet"); -window.L.Circle.mergeOptions({ +window[LeafletSymbol] = window.L; +window[LeafletSymbol].Circle.mergeOptions({ weight: MAP_OVERLAY_STROKE_WIDTH, opacity: MAP_OVERLAY_STROKE_OPACITY }); -window[LeafletSymbol] = window.L; - -window.L = WindowL; - require("leaflet-fullscreen"); require("leaflet-hotline"); + +window.L = WindowL; diff --git a/versions.json b/versions.json index 006bdea..6ce4662 100644 --- a/versions.json +++ b/versions.json @@ -32,5 +32,5 @@ "3.24.3": "0.12.10", "4.0.0": "0.12.12", "4.2.2": "0.12.12", - "4.3.3": "0.12.12" + "4.3.4": "0.12.12" } \ No newline at end of file