Answer the question
In order to leave comments, you need to log in
How to find the nearest offices to you if you know your location?
A question. The organization has 300 offices in Russia. I get from the user his coordinates in the form - "You are here: latitude 29.937549, longitude 40.265032"
Then I can use these coordinates. The company's offices are crowded on the yandex map and on the google map.
Can you please tell me how can I return the nearest office to the user?
I found the formula - gis-lab.info/qa/great-circles.html
But maybe it's already in the api googl map or yandex map.
Answer the question
In order to leave comments, you need to log in
In terms of user convenience, you need more than one nearest office.
A few nearby offices. Pieces 2-3 at least. And then - let him decide.
You never know - maybe by one of these several offices he will have incidental business.
And when you give away only one single office, you deprive the user of the opportunity to optimize his route.
Therefore, a rough formula is quite sufficient.
I think you are not the first to solve such problems,
so you need to go to Google with this question, there are a lot of answers.
I don’t know what you use on the back to store the coordinates of offices, but for example, if it lives in mongo, then you can use the functionality out of the box,
if it’s a postress with its rich inner world, then you can look here
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question