[@types/mapbox-gl] Add support for converting from lat/lon

This commit is contained in:
TalkTakesTime
2018-11-13 10:52:47 +13:00
parent 867913d396
commit b2e5f8f7cf
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
// Type definitions for Mapbox GL JS v0.49.0
// Type definitions for Mapbox GL JS v0.51.0
// 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
@@ -17,7 +17,7 @@ declare namespace mapboxgl {
export function setRTLTextPlugin(pluginURL: string, callback: (error: Error) => void): void;
type LngLatLike = LngLat | { lng: number; lat: number; } | [number, number];
type LngLatLike = LngLat | { lng: number; lat: number; } | { lon: number; lat: number; } | [number, number];
type LngLatBoundsLike = LngLatBounds | [LngLatLike, LngLatLike] | [number, number, number, number];
type PointLike = Point | [number, number];
type Expression = any[];
+1
View File
@@ -417,6 +417,7 @@ function expectType<T>(value: T) { /* let the compiler handle things */ }
expectType<mapboxgl.LngLatLike>(new mapboxgl.LngLat(0, 0));
expectType<mapboxgl.LngLatLike>([0, 0]);
expectType<mapboxgl.LngLatLike>({ lng: 0, lat: 0 });
expectType<mapboxgl.LngLatLike>({ lon: 0, lat: 0 });
/*
* LngLat