diff --git a/src/index.d.ts b/src/index.d.ts index 9449b0f..b49a325 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -17,7 +17,7 @@ import {State} from "@/store"; import {DynmapUrlConfig} from "@/dynmap"; import LiveAtlasMapDefinition from "@/model/LiveAtlasMapDefinition"; -import {Coords, DoneCallback, PathOptions, PointTuple, PolylineOptions} from "leaflet"; +import {Coords, DoneCallback, InternalTiles, PathOptions, PointTuple, PolylineOptions} from "leaflet"; import {CoordinatesControlOptions} from "@/leaflet/control/CoordinatesControl"; import {ClockControlOptions} from "@/leaflet/control/ClockControl"; import {LogoControlOptions} from "@/leaflet/control/LogoControl"; @@ -339,6 +339,10 @@ interface LiveAtlasChat { timestamp: number; } +export interface LiveAtlasInternalTiles extends InternalTiles { + [key: string]: LiveAtlasTile; +} + export interface LiveAtlasTile { active?: boolean; coords: Coords; diff --git a/src/leaflet/tileLayer/DynmapTileLayer.ts b/src/leaflet/tileLayer/DynmapTileLayer.ts index affb5b2..8288a6b 100644 --- a/src/leaflet/tileLayer/DynmapTileLayer.ts +++ b/src/leaflet/tileLayer/DynmapTileLayer.ts @@ -19,7 +19,7 @@ import {Coords, DoneCallback} from 'leaflet'; import {useStore} from "@/store"; -import {Coordinate, LiveAtlasTile} from "@/index"; +import {Coordinate} from "@/index"; import {LiveAtlasTileLayer, LiveAtlasTileLayerOptions} from "@/leaflet/tileLayer/LiveAtlasTileLayer"; import {computed, watch} from "@vue/runtime-core"; import {ComputedRef} from "@vue/reactivity"; @@ -123,7 +123,7 @@ export class DynmapTileLayer extends LiveAtlasTileLayer { continue; } - tile = this._tiles[i] as LiveAtlasTile; + tile = this._tiles[i]; if (tile.coords.z !== this._tileZoom) { if (tile.loaded && tile.el && tile.el.tileName) { @@ -136,7 +136,7 @@ export class DynmapTileLayer extends LiveAtlasTileLayer { } _removeTile(key: string) { - const tile = this._tiles[key] as LiveAtlasTile; + const tile = this._tiles[key]; if (!tile) { return; diff --git a/src/leaflet/tileLayer/LiveAtlasTileLayer.ts b/src/leaflet/tileLayer/LiveAtlasTileLayer.ts index b3d573a..01edcfb 100644 --- a/src/leaflet/tileLayer/LiveAtlasTileLayer.ts +++ b/src/leaflet/tileLayer/LiveAtlasTileLayer.ts @@ -16,7 +16,7 @@ import LiveAtlasMapDefinition from "@/model/LiveAtlasMapDefinition"; import {Coords, DomUtil, DoneCallback, TileLayer, TileLayerOptions, Util} from "leaflet"; -import {LiveAtlasTile, LiveAtlasTileElement} from "@/index"; +import {LiveAtlasInternalTiles, LiveAtlasTileElement} from "@/index"; import falseFn = Util.falseFn; export interface LiveAtlasTileLayerOptions extends TileLayerOptions { @@ -27,6 +27,7 @@ export interface LiveAtlasTileLayerOptions extends TileLayerOptions { // noinspection JSUnusedGlobalSymbols export abstract class LiveAtlasTileLayer extends TileLayer { declare options: LiveAtlasTileLayerOptions; + declare _tiles: LiveAtlasInternalTiles; protected _mapSettings: LiveAtlasMapDefinition; private readonly tileTemplate: LiveAtlasTileElement; @@ -150,7 +151,7 @@ export abstract class LiveAtlasTileLayer extends TileLayer { continue; } - const tile = this._tiles[i] as LiveAtlasTile; + const tile = this._tiles[i]; if(tile.loaded) { this.loadQueue.push(tile.el); @@ -168,7 +169,7 @@ export abstract class LiveAtlasTileLayer extends TileLayer { continue; } - tile = this._tiles[i] as LiveAtlasTile; + tile = this._tiles[i]; if (tile.coords.z !== this._tileZoom) { if (!tile.loaded && tile.el && tile.el.abortController) { @@ -187,7 +188,7 @@ export abstract class LiveAtlasTileLayer extends TileLayer { } _removeTile(key: string) { - const tile = this._tiles[key] as LiveAtlasTile; + const tile = this._tiles[key]; if (!tile) { return;