我正在开发一个php网站。这里我想计算两个城市之间的距离。例如:用户输入班加罗尔作为出发地点,德里作为到达地点。我想知道班加罗尔和德里之间的距离。
有人知道怎么做吗?我已经搜索了很多;我不想输入坐标。
发布于 2012-03-05 17:26:45
http://maps.googleapis.com/maps/api/distancematrix/xml?origins=NEW+YORK+11535&destinations=WASHINGTON+20544&sensor=false请参阅此http://code.google.com/apis/maps/documentation/distancematrix/
发布于 2012-03-05 17:17:12
您需要两个城市的坐标(从、到)。你可以使用googlemaps api在客户端获取坐标。这是一个计算距离的教程:http://www.phpro.org/tutorials/Geo-Targetting-With-PHP-And-MySQL.html
发布于 2012-03-05 17:14:52
您可以使用Google Maps API,参见this。
https://stackoverflow.com/questions/9564060
复制相似问题