Fix some mapbox-gl mismatching typings (#20472)

* Fix some mapbox-gl mismatching typings

* Increase version and fix ts options

* Remove flag

* Add back strictFunctionTypes: true flag

* More types fix

* Make fill-outline-color optional
This commit is contained in:
Alexandre
2017-10-16 11:57:48 -07:00
committed by Andy
parent 38bd4efd5d
commit a7a71f2be3
3 changed files with 19 additions and 19 deletions
+6 -6
View File
@@ -1,4 +1,4 @@
// Type definitions for Mapbox GL JS v0.39.1
// Type definitions for Mapbox GL JS v0.40.1
// Project: https://github.com/mapbox/mapbox-gl-js
// Definitions by: Dominik Bruderer <https://github.com/dobrud>, Patrick Reames <https://github.com/patrickr>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -87,7 +87,7 @@ declare namespace mapboxgl {
getLayer(id: string): mapboxgl.Layer;
setFilter(layer: string, filter: any[]): this;
setFilter(layer: string, filter?: any[]): this;
setLayerZoomRange(layerId: string, minzoom: number, maxzoom: number): this;
@@ -224,7 +224,7 @@ declare namespace mapboxgl {
/** If true, enable keyboard shortcuts (see KeyboardHandler). */
keyboard?: boolean;
logoPosition?: boolean;
logoPosition?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
/** If set, the map is constrained to the given bounds. */
maxBounds?: LngLatBoundsLike;
@@ -944,7 +944,7 @@ declare namespace mapboxgl {
"fill-antialias"?: boolean;
"fill-opacity"?: number | StyleFunction;
"fill-color"?: string | StyleFunction;
"fill-outline-color": string | StyleFunction;
"fill-outline-color"?: string | StyleFunction;
"fill-translate"?: number[];
"fill-translate-anchor"?: "map" | "viewport";
"fill-pattern"?: "string";
@@ -958,9 +958,9 @@ declare namespace mapboxgl {
"fill-extrusion-color"?: string | StyleFunction;
"fill-extrusion-translate"?: number[];
"fill-extrusion-translate-anchor"?: "map" | "viewport";
"fill-extrusion-pattern": string;
"fill-extrusion-pattern"?: string;
"fill-extrusion-height"?: number | StyleFunction;
"fill-extrusion-base"?: number;
"fill-extrusion-base"?: number | StyleFunction;
}
export interface LineLayout {
+11 -11
View File
@@ -303,16 +303,6 @@ var mapStyle = {
]
};
map = new mapboxgl.Map({
container: 'map',
minZoom: 14,
zoom: 17,
center: [-122.514426, 37.562984],
bearing: -96,
style: videoStyle,
hash: false
});
/**
* Add video
*/
@@ -362,10 +352,20 @@ map = new mapboxgl.Map({
hash: false
});
map = new mapboxgl.Map({
container: 'map',
minZoom: 14,
zoom: 17,
center: [-122.514426, 37.562984],
bearing: -96,
style: videoStyle,
hash: false
});
/**
* Marker
*/
let marker = new mapboxgl.Marker(null,{offset: [10, 0]})
let marker = new mapboxgl.Marker(undefined, {offset: [10, 0]})
.setLngLat([-50,50])
.addTo(map);
+2 -2
View File
@@ -5,9 +5,9 @@
"es6",
"dom"
],
"strictNullChecks": true,
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
@@ -21,4 +21,4 @@
"index.d.ts",
"mapbox-gl-tests.ts"
]
}
}