“Find nearest location” by Zip/Postal Code?

后端 未结 3 1236
星月不相逢
星月不相逢 2021-01-31 06:35

I need a \"find nearest location\" on our website.

Where visitor enters their zip/postal code, then they are redirected to specific webpage for our nearest location. We

相关标签:
3条回答
  • 2021-01-31 07:08

    You need a database of zip codes with longitude and latitude, from which you can calculate the distance.

    0 讨论(0)
  • 2021-01-31 07:16

    if you have the longitudes and latitudes of each zipcode (search google) you can use the Haversine Formula to calculate nearest neighbours.

    http://www.codecodex.com/wiki/Calculate_Distance_Between_Two_Points_on_a_Globe

    0 讨论(0)
  • 2021-01-31 07:20

    Google Maps have restrictions in using is for business purposes, so you might want to consider those (restrictions) upfront. From my former experience I would suggest MapQuest API. You can find details here: http://developer.mapquest.com/ and some quick start guide here http://www.mapquest.com/features/developer_tools_oapi_quickstart

    MapQuest seams to be better when it comes to commercial deals. Anyway, check their T&C before you will implement it in production.

    They have JavaScriopt an I think regular WS for geo-location decoding.

    Regards Konrad

    0 讨论(0)
提交回复
热议问题