Get nearest location from my current position

Get nearest location from my current position

  

Hi there,

Can anyone tell me how can I get the nearest point from my current position, on a map? For instance, if I have a list with book stores with their positions, I want to show the nearest book store (from my current position) on the map, on mobile app. Don't know if there is some plugin already doing what I intend to do, so I would really appreciate your help.

Thanks,

Ana Santos

Hello Ana

You have the Location Plugin on the forge (https://www.outsystems.com/forge/component/1395/location-plugin/) It was developed by OutSystems, so it does have the OutSystems' seal of approval and and it is supported by OutSystems as well. 

I'm not a 100% sure if it already has out of the box logic to retrieve the nearest location, but it shouldn't be too hard to develop that logic if need be


Best Regards,

Ângelo

From what I understand, this plugin only allows me to get/watch the current position.

What I wanted to know is how I can compare it to the list of positions, and "draw" the map (i.e., pin the nearest position on a map, for example). Maybe I neet to combine the Location plugin with the Google Maps component?

Thanks for your help.

Hello Ana

Yes, the Location Plugin allows you to get the current position.

Since you said you have the bookstores' position on your database, you can create a simple action that compares the current position (from the plugin) with each bookstore and retrieve the nearest one


Best regards,

Ângelo