From 3a28f34a974a472394298120c9c069bd8839669c Mon Sep 17 00:00:00 2001 From: Adrien Bustany Date: Thu, 17 Apr 2014 17:12:18 +0200 Subject: [PATCH] Leaflet: Fix the L.tileLayer function typing The current version was being rejected by Typescript 1.0. The new typing follows the advice from the Handbook. --- leaflet/leaflet.d.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index 3044970b0..a2d91032a 100644 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -3655,25 +3655,27 @@ declare module L { } } - export class tileLayer { + export interface TileLayerFactory { /** * Instantiates a tile layer object given a URL template and optionally an options * object. */ - function (urlTemplate: string, options?: TileLayerOptions): TileLayer; + (urlTemplate: string, options?: TileLayerOptions): TileLayer; /** * Instantiates a WMS tile layer object given a base URL of the WMS service and * a WMS parameters/options object. */ - static wms(baseUrl: string, options: WMSOptions): L.TileLayer.WMS; + wms(baseUrl: string, options: WMSOptions): L.TileLayer.WMS; /** * Instantiates a Canvas tile layer object given an options object (optionally). */ - static canvas(options?: TileLayerOptions): L.TileLayer.Canvas; + canvas(options?: TileLayerOptions): L.TileLayer.Canvas; } + + export var tileLayer: TileLayerFactory; } declare module L {