mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 13:00:19 +00:00
[mapbox-gl] add LngLat.distanceTo (#43084)
This commit is contained in:
Vendored
+4
@@ -1056,6 +1056,10 @@ declare namespace mapboxgl {
|
||||
/** Return a LngLat as a string */
|
||||
toString(): string;
|
||||
|
||||
/** Returns the approximate distance between a pair of coordinates in meters
|
||||
* Uses the Haversine Formula (from R.W. Sinnott, "Virtues of the Haversine", Sky and Telescope, vol. 68, no. 2, 1984, p. 159) */
|
||||
distanceTo(lngLat: LngLat): number;
|
||||
|
||||
toBounds(radius: number): LngLatBounds;
|
||||
|
||||
static convert(input: LngLatLike): mapboxgl.LngLat;
|
||||
|
||||
@@ -687,6 +687,7 @@ expectType<mapboxgl.LngLatLike>({ lon: 0, lat: 0 });
|
||||
|
||||
new mapboxgl.LngLat(0, 0);
|
||||
expectType<mapboxgl.LngLat>(mapboxgl.LngLat.convert(lnglatlike));
|
||||
expectType<number>(new mapboxgl.LngLat(0, 0).distanceTo(new mapboxgl.LngLat(0, 0)));
|
||||
|
||||
/*
|
||||
* LngLatBoundsLike
|
||||
|
||||
Reference in New Issue
Block a user