# \[Solved\] How do I find/add Map Markers Nearest to the User (Haversine formula)

**URL:** <https://community.thunkable.com/t/solved-how-do-i-find-add-map-markers-nearest-to-the-user-haversine-formula/598411>\
**Category:** Maps\
**Created:** [June 6, 2020, 7:42pm UTC](https://community.thunkable.com/t/solved-how-do-i-find-add-map-markers-nearest-to-the-user-haversine-formula/598411 "2020-06-06T19:42:13Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [July 28, 2022, 2:22pm UTC](https://community.thunkable.com/t/solved-how-do-i-find-add-map-markers-nearest-to-the-user-haversine-formula/598411/10 "2022-07-28T14:22:44Z")

</div>

I wanted to share a fun solultion that I created for another project

[https://us-central1-scorecard-x.cloudfunctions.net/returnDistance?long1=45&lat1=-83&long2=22&lat2=-40&miles=true](https://us-central1-scorecard-x.cloudfunctions.net/returnDistance?long1=45&lat1=-83&long2=22&lat2=-40&miles=true)

You can feed it the lat and long for both location 1 and 2, true/false for returning miles or KM. this will return an object that has the distance!

Quick and easy. each response takes apx 44 seconds when the function is warm. If you are doing a 1 off calculation, it takes about a second.

i also replicated it in cloudflare for fun. always faster than the one above

- [distancefinder.codelessconsultant.workers.dev?long1=45&lat1=-83&long2=22&lat2=-40&miles=true](https://distancefinder.codelessconsultant.workers.dev?long1=45&lat1=-83&long2=22&lat2=-40&miles=true)

---

_[View the full topic](https://community.thunkable.com/t/solved-how-do-i-find-add-map-markers-nearest-to-the-user-haversine-formula/598411)._
