小编Tyl*_*ler的帖子

计算"如乌鸦飞行"距离php

我正在计算一个函数内部的一个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)

然后将用户通过表单输入的来源和目的地插入到网址中.是否有可能使用类似的方法来计算"像乌鸦飞行"的距离,还是我必须重新修改我的功能?

php google-maps

6
推荐指数
1
解决办法
3717
查看次数

标签 统计

google-maps ×1

php ×1