From ae08714357b9827fd5ff3569202255d1cab29d45 Mon Sep 17 00:00:00 2001 From: Andrew Pinkham Date: Tue, 6 Mar 2018 10:37:08 -0500 Subject: [PATCH] Protect internal props; createTile on GridLayer --- types/leaflet/index.d.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/types/leaflet/index.d.ts b/types/leaflet/index.d.ts index 922b9ab686..41b4fbd84c 100644 --- a/types/leaflet/index.d.ts +++ b/types/leaflet/index.d.ts @@ -392,7 +392,6 @@ export interface InteractiveLayerOptions extends LayerOptions { } export class Layer extends Evented { - _map: Map; constructor(options?: LayerOptions); addTo(map: Map|LayerGroup): this; remove(): this; @@ -425,6 +424,8 @@ export class Layer extends Evented { getEvents?(): {[name: string]: (event: LeafletEvent) => void}; getAttribution?(): string | null; beforeAdd?(map: Map): this; + + protected _map: Map; } export interface GridLayerOptions { @@ -444,6 +445,8 @@ export interface GridLayerOptions { keepBuffer?: number; } +export type DoneCallback = (error?: Error, tile?: HTMLElement) => void; + export interface InternalTiles { [key: string]: { active?: boolean, @@ -466,10 +469,11 @@ export class GridLayer extends Layer { redraw(): this; getTileSize(): Point; - _tileCoordsToKey(coords: Coords): string; + protected createTile(coords: Coords, done: DoneCallback): HTMLElement; + protected _tileCoordsToKey(coords: Coords): string; - _tiles: InternalTiles; - _tileZoom?: number; + protected _tiles: InternalTiles; + protected _tileZoom?: number; } export function gridLayer(options?: GridLayerOptions): GridLayer; @@ -489,15 +493,12 @@ export interface TileLayerOptions extends GridLayerOptions { [name: string]: any; } -export type DoneCallback = (error?: Error, tile?: HTMLElement) => void; - export class TileLayer extends GridLayer { constructor(urlTemplate: string, options?: TileLayerOptions); - createTile(coords: Coords, done: DoneCallback): HTMLElement; setUrl(url: string, noRedraw?: boolean): this; - _abortLoading(): void; - _getZoomForUrl(): number; + protected _abortLoading(): void; + protected _getZoomForUrl(): number; options: TileLayerOptions; }