mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[mapbox-gl] add LngLat.distanceTo (#43084)
This commit is contained in:
parent
8193cd43a0
commit
cdc9c593eb
4
types/mapbox-gl/index.d.ts
vendored
4
types/mapbox-gl/index.d.ts
vendored
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user