且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何计算PHP中两个纬度和经度之间的驾驶距离

更新时间:2023-02-01 22:55:09

You can calculate the straight line distance, you can't "calculate" the driving distance without a routing database/engine.

If you need the driving distance, you can use either the Google directions API (for a single route, potentially with waypoints) or the Google distance matrix API (can provide results for multiple origin/destinations)