mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
11 lines
281 B
TypeScript
11 lines
281 B
TypeScript
import * as kdbush from 'kdbush';
|
|
import * as geokdbush from 'geokdbush';
|
|
|
|
const points = [
|
|
{lon: 0, lat: 0},
|
|
{lon: 20, lat: 10},
|
|
{lon: -10, lat: 30},
|
|
];
|
|
const index = kdbush(points, p => p.lon, p => p.lat);
|
|
const nearest = geokdbush.around(index, -119.7051, 34.4363, 1000);
|