Skip to content

Commit

Permalink
fix: Inspect document body for theme instead of vault config (close #440
Browse files Browse the repository at this point in the history
)
  • Loading branch information
valentine195 committed Mar 31, 2024
1 parent 1dc8676 commit fa1a3f4
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/map/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,10 @@ export abstract class BaseMap extends Events implements BaseMapDefinition {
mapLayers: LayerGroup<L.TileLayer | L.ImageOverlay>[] = [];
get markerIcons(): Map<string, MarkerIcon> {
return new Map(
[...this.plugin.markerIcons, ...(this.options.localMarkerTypes ?? [])].map((markerIcon) => [
markerIcon.type,
markerIcon
])
[
...this.plugin.markerIcons,
...(this.options.localMarkerTypes ?? [])
].map((markerIcon) => [markerIcon.type, markerIcon])
);
}
get markerTypes() {
Expand Down Expand Up @@ -1481,10 +1481,9 @@ export class RealMap extends BaseMap {

this.log("Building initial map layer.");

const tileServer =
this.plugin.app.vault.config.theme == "moonstone"
? this.plugin.data.defaultTile
: this.plugin.data.defaultTileDark;
const tileServer = document.body.hasClass("theme-light")
? this.plugin.data.defaultTile
: this.plugin.data.defaultTileDark;

let osmLayer = {
id: "real",
Expand Down

0 comments on commit fa1a3f4

Please sign in to comment.