mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 02:57:24 +08:00
Added declarations for 'leaflet.gridlayer.googlemutant'.
This commit is contained in:
78
leaflet.gridlayer.googlemutant/index.d.ts
vendored
Normal file
78
leaflet.gridlayer.googlemutant/index.d.ts
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
// Type definitions for leaflet.gridlayer.googlemutant 0.4
|
||||
// Project: https://gitlab.com/IvanSanchez/Leaflet.GridLayer.GoogleMutant#README
|
||||
// Definitions by: Ernest Rhinozeros <https://github.com/ernest-rhinozeros>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="leaflet" />
|
||||
|
||||
declare namespace L.GridLayer {
|
||||
export interface GoogleMutant extends L.GridLayer {
|
||||
setElementSize(e: HTMLElement, size: L.Point): void ;
|
||||
}
|
||||
|
||||
export type GoogleMutantType = 'roadmap' | 'satellite' | 'terrain' | 'hybrid';
|
||||
|
||||
export interface GoogleMutantStyler {
|
||||
hue?: string;
|
||||
lightness?: number;
|
||||
saturation?: number;
|
||||
gamma?: number;
|
||||
invert_lightness?: boolean;
|
||||
visibility?: string;
|
||||
color?: string;
|
||||
weight?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Google's map style.
|
||||
*
|
||||
* https://developers.google.com/maps/documentation/javascript/style-reference
|
||||
*/
|
||||
export interface GoogleMutantStyle {
|
||||
|
||||
/**
|
||||
* https://developers.google.com/maps/documentation/javascript/style-reference#style-features
|
||||
*/
|
||||
featureType?: string;
|
||||
|
||||
/**
|
||||
* https://developers.google.com/maps/documentation/javascript/style-reference#style-elements
|
||||
*/
|
||||
elementType?: string;
|
||||
|
||||
/**
|
||||
* https://developers.google.com/maps/documentation/javascript/style-reference#stylers
|
||||
*/
|
||||
stylers?: GoogleMutantStyler[];
|
||||
}
|
||||
|
||||
export interface GoogleMutantOptions extends L.TileLayerOptions {
|
||||
minZoom?: number;
|
||||
maxZoom?: number;
|
||||
maxNativeZoom?: number;
|
||||
tileSize?: number | Point;
|
||||
subdomains?: string | Array<string>;
|
||||
errorTileUrl?: string;
|
||||
|
||||
/**
|
||||
* The mutant container will add its own attribution anyways.
|
||||
*/
|
||||
attribution?: string;
|
||||
|
||||
opacity?: number;
|
||||
continuousWorld?: boolean,
|
||||
noWrap?: boolean;
|
||||
|
||||
/**
|
||||
* Google's map type. 'hybrid' is not really supported.
|
||||
*/
|
||||
type?: GoogleMutantType;
|
||||
|
||||
/**
|
||||
* Google's map styles.
|
||||
*/
|
||||
styles?: GoogleMutantStyle[]
|
||||
}
|
||||
|
||||
export function googleMutant(options?: GoogleMutantOptions): GoogleMutant;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
let map = L.map('foo');
|
||||
|
||||
let roads = L.GridLayer.googleMutant({
|
||||
type: 'roadmap'
|
||||
}).addTo(map);
|
||||
|
||||
let styled = L.GridLayer.googleMutant({
|
||||
type: 'satellite',
|
||||
styles: [
|
||||
{ elementType: 'labels', stylers: [ { visibility: 'off' } ] },
|
||||
{ featureType: 'water' , stylers: [ { color: '#444444' } ] }
|
||||
]
|
||||
}).addTo(map);
|
||||
20
leaflet.gridlayer.googlemutant/tsconfig.json
Normal file
20
leaflet.gridlayer.googlemutant/tsconfig.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"leaflet.gridlayer.googlemutant-tests.ts"
|
||||
]
|
||||
}
|
||||
1
leaflet.gridlayer.googlemutant/tslint.json
Normal file
1
leaflet.gridlayer.googlemutant/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Reference in New Issue
Block a user