Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google maps api 3 谷歌地图-错误(不同)路线方向_Google Maps Api 3 - Fatal编程技术网

Google maps api 3 谷歌地图-错误(不同)路线方向

Google maps api 3 谷歌地图-错误(不同)路线方向,google-maps-api-3,Google Maps Api 3,我试图从两点获取路线方向的指令,但是当我通过源代码(coorrect route)给出坐标时,路线与函数从文本框获取坐标时有所不同。我想让你知道,我只想通过坐标而不是地址找到路线 先谢谢你 表单源代码(正确路径)—— 从文本框(错误路线)这是两件不同的事情。正确的路线通过google.map.LatLng对象,不正确的路线不会通过。要使用地理坐标,您需要传入google.map.LatLng对象,否则坐标将进行地理编码 destination LatLng|string Location o

我试图从两点获取路线方向的指令,但是当我通过源代码(coorrect route)给出坐标时,路线与函数从文本框获取坐标时有所不同。我想让你知道,我只想通过坐标而不是地址找到路线

先谢谢你

表单源代码(正确路径)——


从文本框(错误路线)

这是两件不同的事情。正确的路线通过google.map.LatLng对象,不正确的路线不会通过。要使用地理坐标,您需要传入google.map.LatLng对象,否则坐标将进行地理编码

destination LatLng|string   Location of destination. This can be specified as either a string to be geocoded or a LatLng. Required.
origin  LatLng|string   Location of origin. This can be specified as either a string to be geocoded or a LatLng. Required.
有关如何将逗号分隔的字符串转换为google.maps.LatLng对象的信息,请参见