diff --git a/src/index.d.ts b/src/index.d.ts index f35b241..c6dc0d0 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -192,7 +192,6 @@ interface LiveAtlasMapProvider { logout(): void; register(formData: FormData): void; - getTilesUrl(): string; getMarkerIconUrl(icon: string): string; } diff --git a/src/leaflet/tileLayer/DynmapTileLayer.ts b/src/leaflet/tileLayer/DynmapTileLayer.ts index d996d7e..b7f558b 100644 --- a/src/leaflet/tileLayer/DynmapTileLayer.ts +++ b/src/leaflet/tileLayer/DynmapTileLayer.ts @@ -44,7 +44,7 @@ export class DynmapTileLayer extends LiveAtlasTileLayer { super('', options); this._mapSettings = options.mapSettings; - this._baseUrl = this._store.state.currentMapProvider!.getTilesUrl(); + this._baseUrl = options.mapSettings.baseUrl; this._namedTiles = Object.seal(new Map()); this._pendingUpdates = computed(() => !!this._store.state.pendingTileUpdates.length); diff --git a/src/leaflet/tileLayer/OverviewerTileLayer.ts b/src/leaflet/tileLayer/OverviewerTileLayer.ts index 5b225eb..ca3593c 100644 --- a/src/leaflet/tileLayer/OverviewerTileLayer.ts +++ b/src/leaflet/tileLayer/OverviewerTileLayer.ts @@ -18,13 +18,11 @@ */ import {LiveAtlasTileLayer, LiveAtlasTileLayerOptions} from "@/leaflet/tileLayer/LiveAtlasTileLayer"; -import {Store, useStore} from "@/store"; import {Coords, Util} from "leaflet"; // noinspection JSUnusedGlobalSymbols export class OverviewerTileLayer extends LiveAtlasTileLayer { private readonly _baseUrl: string; - private readonly _store: Store = useStore(); constructor(options: LiveAtlasTileLayerOptions) { super('', options); @@ -34,7 +32,7 @@ export class OverviewerTileLayer extends LiveAtlasTileLayer { Util.setOptions(this, options); this._mapSettings = options.mapSettings; - this._baseUrl = this._store.state.currentMapProvider!.getTilesUrl(); + this._baseUrl = options.mapSettings.baseUrl; } getTileUrl(coords: Coords): string { diff --git a/src/leaflet/tileLayer/Pl3xmapTileLayer.ts b/src/leaflet/tileLayer/Pl3xmapTileLayer.ts index 65466ec..65f5175 100644 --- a/src/leaflet/tileLayer/Pl3xmapTileLayer.ts +++ b/src/leaflet/tileLayer/Pl3xmapTileLayer.ts @@ -15,16 +15,12 @@ */ import {LiveAtlasTileLayer, LiveAtlasTileLayerOptions} from "@/leaflet/tileLayer/LiveAtlasTileLayer"; -import {useStore} from "@/store"; import {Util} from "leaflet"; // noinspection JSUnusedGlobalSymbols export class Pl3xmapTileLayer extends LiveAtlasTileLayer { constructor(options: LiveAtlasTileLayerOptions) { - const worldName = options.mapSettings.world.name, - baseUrl = useStore().state.currentMapProvider!.getTilesUrl(); - - super(`${baseUrl}${worldName}/{z}/{x}_{y}.png`, options); + super(`${options.mapSettings.baseUrl}${options.mapSettings.world.name}/{z}/{x}_{y}.png`, options); options.zoomReverse = false; diff --git a/src/providers/DynmapMapProvider.ts b/src/providers/DynmapMapProvider.ts index 4ecc546..cb5c933 100644 --- a/src/providers/DynmapMapProvider.ts +++ b/src/providers/DynmapMapProvider.ts @@ -311,10 +311,6 @@ export default class DynmapMapProvider extends MapProvider { } } - getTilesUrl(): string { - return this.config.tiles; - } - getMarkerIconUrl(icon: string): string { return `${this.config.markers}_markers_/${icon}.png`; } diff --git a/src/providers/MapProvider.ts b/src/providers/MapProvider.ts index 2a8b0a4..9875159 100644 --- a/src/providers/MapProvider.ts +++ b/src/providers/MapProvider.ts @@ -33,7 +33,6 @@ export default abstract class MapProvider implements LiveAtlasMapProvider { abstract loadServerConfiguration(): Promise; abstract createTileLayer(options: LiveAtlasTileLayerOptions): LiveAtlasTileLayer; - abstract getTilesUrl(): string; abstract getMarkerIconUrl(icon: string): string; async populateWorld(world: LiveAtlasWorldDefinition): Promise {} diff --git a/src/providers/OverviewerMapProvider.ts b/src/providers/OverviewerMapProvider.ts index bd815f5..c2356db 100644 --- a/src/providers/OverviewerMapProvider.ts +++ b/src/providers/OverviewerMapProvider.ts @@ -307,10 +307,6 @@ export default class OverviewerMapProvider extends MapProvider { return new OverviewerTileLayer(options); } - getTilesUrl(): string { - return this.config; - } - getMarkerIconUrl(icon: string): string { return this.config + icon; } diff --git a/src/providers/Pl3xmapMapProvider.ts b/src/providers/Pl3xmapMapProvider.ts index ccaa520..20d2e5d 100644 --- a/src/providers/Pl3xmapMapProvider.ts +++ b/src/providers/Pl3xmapMapProvider.ts @@ -600,10 +600,6 @@ export default class Pl3xmapMapProvider extends MapProvider { } } - getTilesUrl(): string { - return `${this.config}tiles/`; - } - getMarkerIconUrl(icon: string): string { return `${this.config}images/icon/registered/${icon}.png`; }