mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-05 01:30:17 +00:00
#15313: TileLayerOptions should not be a dictionary to make it checkable
This commit is contained in:
6
types/leaflet/index.d.ts
vendored
6
types/leaflet/index.d.ts
vendored
@@ -494,7 +494,11 @@ export interface TileLayerOptions extends GridLayerOptions {
|
||||
zoomReverse?: boolean;
|
||||
detectRetina?: boolean;
|
||||
crossOrigin?: boolean;
|
||||
[name: string]: any;
|
||||
// [name: string]: any;
|
||||
// You are able add additional properties, but it makes this interface unchackable.
|
||||
// See: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/15313
|
||||
// Example:
|
||||
// tileLayer = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png?{foo}&{bar}&{abc}', {foo: 'bar', bar: (data: any) => 'foo', abc: () => ''});
|
||||
}
|
||||
|
||||
export class TileLayer extends GridLayer {
|
||||
|
||||
@@ -227,9 +227,6 @@ tileLayerOptions = {
|
||||
pane: '',
|
||||
className: '',
|
||||
keepBuffer: 1,
|
||||
foo: 'bar',
|
||||
bar: () => 'foo',
|
||||
abc: (data: any) => 'foobar'
|
||||
};
|
||||
|
||||
tileLayerOptions.subdomains = 'a';
|
||||
@@ -245,11 +242,9 @@ tileLayerOptions.bounds = latLngBoundsLiteral;
|
||||
let tileLayer: L.TileLayer;
|
||||
tileLayer = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png');
|
||||
tileLayer = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', tileLayerOptions);
|
||||
tileLayer = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png?{foo}&{bar}&{abc}', {foo: 'bar', bar: (data: any) => 'foo', abc: () => ''});
|
||||
|
||||
tileLayer = new L.TileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png');
|
||||
tileLayer = new L.TileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', tileLayerOptions);
|
||||
tileLayer = new L.TileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png?{foo}&{bar}&{abc}', {foo: 'bar', bar: (data: any) => 'foo', abc: () => ''});
|
||||
|
||||
// imageOverlay
|
||||
let imageOverlayOptions: L.ImageOverlayOptions;
|
||||
|
||||
Reference in New Issue
Block a user