function kRingIndexes(searchLocation, pad = 0) {
const origin = h3.geoToH3(searchLocation.lat, searchLocation.lng, res);
const e = h3.edgeLength(res, h3.UNITS.km);
const radius = (((searchRadiusKm - e)/e)) * (2/3) + pad;
let k = 1;
let foundh3Inside = true;
const h3s = [origin];
while (foundh3Inside) {
foundh3Inside = false;
const newH3s = h3.hexRing(origin, k);
newH3s.forEach(newH3 => {
const h3Center = h3.h3ToGeo(newH3);
if(h3.pointDist([searchLocation.lat, searchLocation.lng], h3Center, h3.UNITS.km) < (searchRadiusKm + e)) {
foundh3Inside = true;
h3s.push(newH3);
}
});
k++;
}
return h3s;
}