From b2e5f8f7cf360f70d56f166692186c622ccce522 Mon Sep 17 00:00:00 2001 From: TalkTakesTime Date: Tue, 13 Nov 2018 10:39:02 +1300 Subject: [PATCH] [@types/mapbox-gl] Add support for converting from lat/lon --- types/mapbox-gl/index.d.ts | 4 ++-- types/mapbox-gl/mapbox-gl-tests.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/types/mapbox-gl/index.d.ts b/types/mapbox-gl/index.d.ts index 33a619b9ae..91fb68cd96 100644 --- a/types/mapbox-gl/index.d.ts +++ b/types/mapbox-gl/index.d.ts @@ -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 , Patrick Reames // 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[]; diff --git a/types/mapbox-gl/mapbox-gl-tests.ts b/types/mapbox-gl/mapbox-gl-tests.ts index d55cf592e5..422b255900 100644 --- a/types/mapbox-gl/mapbox-gl-tests.ts +++ b/types/mapbox-gl/mapbox-gl-tests.ts @@ -417,6 +417,7 @@ function expectType(value: T) { /* let the compiler handle things */ } expectType(new mapboxgl.LngLat(0, 0)); expectType([0, 0]); expectType({ lng: 0, lat: 0 }); +expectType({ lon: 0, lat: 0 }); /* * LngLat