开发者

How to find the distance between places

I am having 4 textboxes which are textbox1, textbox2, textbox3, textbox4. The end user will put 4 locations in each textbox like place1, place2, place3, place4. I need to display the distance between the places in the following order:

  1. Distance between palace1 and place2:
  2. Distance between palace2 and place3:
  3. Distance between palace3 and place4:

How to do this? I have taken help of the following link: http://brian开发者_开发知识库cray.com/2009/04/01/how-to-calculate-the-distance-between-two-addresses-with-javascript-and-google-maps-api/ It helps when only two textbox are there.But I was unable to solve my problem.Solutions are expected using Javascript or Jquery or ASP.NET with C#.


Try this this for JQuery not exact answer but you can modify. And want to manipulate in C# so you can use this for getting from longitude and latitude and get longitude and latitude from the maxmind free DB (this one is if you don't want to use relay API)


You need to get the geographic coordinates for each location, and then use the Haversine formula to calculate the approximate distance between them.

Alternately, you might pass the addresses to a service like Google Maps and use the API to get the distance between the two addresses. The problem with using Google Maps is that you have a limited hit count.

Take a look at this article: http://www.ig.utexas.edu/outreach/googleearth/latlong.html

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜