# Displaying pins on the map within a specified area

**URL:** https://community.thunkable.com/t/displaying-pins-on-the-map-within-a-specified-area/1639308
**Category:** Questions about Thunkable X
**Tags:** googlemaps
**Created:** [November 29, 2021, 8:38pm UTC](https://community.thunkable.com/t/displaying-pins-on-the-map-within-a-specified-area/1639308 "2021-11-29T20:38:38Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![lavrynenko](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/lavrynenko/32/108213_2.png) [@lavrynenko](https://community.thunkable.com/u/lavrynenko)
#### Post date: [November 29, 2021, 8:38pm UTC](https://community.thunkable.com/t/displaying-pins-on-the-map-within-a-specified-area/1639308/1 "2021-11-29T20:38:38Z")

</div>

Friends, please tell me how to implement the display of labels on the map within a given area?

For example, a user indicates that he needs to see placemarks on the map within a radius of 10 kilometers from his current location …? How to implement this?

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [November 30, 2021, 2:25am UTC](https://community.thunkable.com/t/displaying-pins-on-the-map-within-a-specified-area/1639308/2 "2021-11-30T02:25:08Z")

</div>

You would need to use an API that returns data based on lat/lon values. Once you have the values, you could create a pin for each one.

If you can’t use an API, then you would need to create a data source that has lat/lon values and calculate distances using the _haversine_ formula.

---

<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: [November 30, 2021, 3:22am UTC](https://community.thunkable.com/t/displaying-pins-on-the-map-within-a-specified-area/1639308/3 "2021-11-30T03:22:02Z")

</div>

Xano and backendless. Both, offer geoquery capabilities.

If you have lat/long, you can do it yourself. What’s your preference? This is less efficient if you are querying a large dataset.

---

<div class="post-metadata">

### Author: ![lavrynenko](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/lavrynenko/32/108213_2.png) [@lavrynenko](https://community.thunkable.com/u/lavrynenko)
#### Post date: [November 30, 2021, 5:40pm UTC](https://community.thunkable.com/t/displaying-pins-on-the-map-within-a-specified-area/1639308/4 "2021-11-30T17:40:21Z")

</div>

I am making an application that will show a list of users at a distance of 5/10 kilometers from the user.

Those. the logic is like this:

- the user is authorized in the application, and we get his current coordinates, which we write to the database.
- our user has the ability to select other users at some distance from himself (for this we use his current location + a list of coordinates of other users.

I am trying to find the optimal solution …

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [November 30, 2021, 6:01pm UTC](https://community.thunkable.com/t/displaying-pins-on-the-map-within-a-specified-area/1639308/5 "2021-11-30T18:01:42Z")

</div>

Okay, for that I would use the _Haversine_ formula. It’s a little easier but potentially a little slower to do this using a formula in Google Sheets. I prefer to code it within Thunkable but it’s quite complex to set up the blocks. I’ve done this for an app that finds the closest air quality sensor to the user.

This topic includes some interesting suggestions and also a link to info about the Haversine formula in my post within that topic:

> [@How to get all the marker on the map to near to current location in range of 4 kms](https://community.thunkable.com/t/how-to-get-all-the-marker-on-the-map-to-near-to-current-location-in-range-of-4-kms/287046):
>
> how to get all the marker on the map to near to current location in range of 4 kms

---

<div class="post-metadata">

### Author: ![lavrynenko](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/lavrynenko/32/108213_2.png) [@lavrynenko](https://community.thunkable.com/u/lavrynenko)
#### Post date: [November 30, 2021, 6:41pm UTC](https://community.thunkable.com/t/displaying-pins-on-the-map-within-a-specified-area/1639308/6 "2021-11-30T18:41:21Z")

</div>

Thanks! I looked at your link - and found an interesting solution to my problem 🙂

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)
#### Post date: [February 28, 2022, 7:18pm UTC](https://community.thunkable.com/t/displaying-pins-on-the-map-within-a-specified-area/1639308/8 "2022-02-28T19:18:03Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
