Add getTileUrl() method to TileLayer (#42859)

This commit is contained in:
Billy Newman
2020-03-06 13:49:51 -07:00
committed by GitHub
parent b1df7df803
commit 1944cc1a08
2 changed files with 6 additions and 0 deletions

View File

@@ -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;

View File

@@ -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) {