我正在计算一个函数内部的一个wordpress网站上两点之间的行车距离.我通过调用谷歌距离矩阵完成此任务
wp_remote_get(
"http://maps.googleapis.com/maps/api/distancematrix/json?origins=".
urlencode($origin).
"&destinations=".
urlencode($destination).
"&sensor=false&units=imperial"
)
Run Code Online (Sandbox Code Playgroud)
然后将用户通过表单输入的来源和目的地插入到网址中.是否有可能使用类似的方法来计算"像乌鸦飞行"的距离,还是我必须重新修改我的功能?