From 1944cc1a08fc725aa0c4f5df2dee5b34bb0e45d4 Mon Sep 17 00:00:00 2001 From: Billy Newman Date: Fri, 6 Mar 2020 13:49:51 -0700 Subject: [PATCH] Add getTileUrl() method to TileLayer (#42859) --- types/leaflet/index.d.ts | 1 + types/leaflet/leaflet-tests.ts | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/types/leaflet/index.d.ts b/types/leaflet/index.d.ts index 06ebbe9df2..f37400a65b 100644 --- a/types/leaflet/index.d.ts +++ b/types/leaflet/index.d.ts @@ -806,6 +806,7 @@ export interface TileLayerOptions extends GridLayerOptions { export class TileLayer extends GridLayer { constructor(urlTemplate: string, options?: TileLayerOptions); setUrl(url: string, noRedraw?: boolean): this; + getTileUrl(coords: L.Coords): string; protected _abortLoading(): void; protected _getZoomForUrl(): number; diff --git a/types/leaflet/leaflet-tests.ts b/types/leaflet/leaflet-tests.ts index 8a7a4cf9b6..5630ac49d8 100644 --- a/types/leaflet/leaflet-tests.ts +++ b/types/leaflet/leaflet-tests.ts @@ -728,6 +728,11 @@ export class ExtendedTileLayer extends L.TileLayer { newCoords.z = coords.z; return super.createTile(newCoords, done); } + + getTileUrl(coords: L.Coords) { + return super.getTileUrl(coords); + } + _abortLoading() { // adapted from TileLayer's implementation for (const i in this._tiles) {