Fix incorrect argument type for DynmapTileLayer.getTileInfo

This commit is contained in:
James Lyne 2022-01-14 19:52:23 +00:00
parent b3a685e003
commit 46fc602a96
2 changed files with 7 additions and 2 deletions

5
src/index.d.ts vendored
View File

@ -57,6 +57,11 @@ interface Coordinate {
z: number; z: number;
} }
interface Coordinate2D {
x: number;
y: number;
}
interface LiveAtlasLocation { interface LiveAtlasLocation {
x: number; x: number;
y: number; y: number;

View File

@ -19,7 +19,7 @@
import {Map as LeafletMap, Coords, DoneCallback} from 'leaflet'; import {Map as LeafletMap, Coords, DoneCallback} from 'leaflet';
import {useStore} from "@/store"; import {useStore} from "@/store";
import {Coordinate} from "@/index"; import {Coordinate, Coordinate2D} from "@/index";
import {LiveAtlasTileLayer, LiveAtlasTileLayerOptions} from "@/leaflet/tileLayer/LiveAtlasTileLayer"; import {LiveAtlasTileLayer, LiveAtlasTileLayerOptions} from "@/leaflet/tileLayer/LiveAtlasTileLayer";
import {computed, watch} from "@vue/runtime-core"; import {computed, watch} from "@vue/runtime-core";
import {ComputedRef} from "@vue/reactivity"; import {ComputedRef} from "@vue/reactivity";
@ -159,7 +159,7 @@ export class DynmapTileLayer extends LiveAtlasTileLayer {
return 'z'.repeat(amount) + (amount === 0 ? '' : '_'); return 'z'.repeat(amount) + (amount === 0 ? '' : '_');
} }
private getTileInfo(coords: Coordinate): TileInformation { private getTileInfo(coords: Coordinate2D): TileInformation {
// zoom: max zoomed in = this.options.maxZoom, max zoomed out = 0 // zoom: max zoomed in = this.options.maxZoom, max zoomed out = 0
// izoom: max zoomed in = 0, max zoomed out = this.options.maxZoom // izoom: max zoomed in = 0, max zoomed out = this.options.maxZoom
// zoomoutlevel: izoom < mapzoomin -> 0, else -> izoom - mapzoomin (which ranges from 0 till mapzoomout) // zoomoutlevel: izoom < mapzoomin -> 0, else -> izoom - mapzoomin (which ranges from 0 till mapzoomout)