manuelbieh / geolib

Zero dependency library to provide some basic geo functions
MIT License
4.21k stars 341 forks source link

Find the nearest coordinates for given bounds #280

Open yulafezmesi opened 2 years ago

yulafezmesi commented 2 years ago

How can I find the nearest coordinates by given bounds with existing functions?

I have got a center point that I want to fetch the nearest coordinates. orderByDistance is sorting the distance but I would like to pass a distance parameter to get all coordinates based on the max distance. Is that possible?

Like this:

orderByDistance({ lat: query.center_lat, lng: query.center_lng }, maxDistance:10000);
Asinox commented 2 years ago

Wow, I'm want to know the same thing...