开发者

How to show nearest store based on zipcode

I am creating an app tha is for a a bussines that has 开发者_开发知识库several stores around the state. How can i show the information for the nearest sores based in the zip code?

Thanks for any help


The basic idea is:

  1. Convert the ZIP code to geographical coordinates (longitude and latitude).
  2. Compute the distance of each store to this coordinate.
  3. Order the results by distance, ascending.

Step 2 can be optimized a bit -- for example, you might limit the search to those stores in the same state. You may also want to limit the number of stores returned if you are only going to display 10, for example.

This is about all the detail I can provide since your question is quite general.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜