1

我正在使用 google Direction Service 查找以下两个地址的地图

var start = "2115 First Avenue SE Unit 1306, Cottage Grove Place, Cedar Rapids, IA, 52402";     //Set the source/ origin
var end = "6126 Rockwell Dr. Apt 128, Keystone Place, Cedar Rapids, IA, 52402";

通过谷歌地图直接选择它方向它工作正常

链接:https ://www.google.co.in/maps/dir/Keystone+Place-Blair's+Ferry,+6126+Rockwell+Drive+Northeast,+Cedar+Rapids,+IA+52402,+United+States/ Cottage+Grove+Place,+2115+1st+Avenue+Southeast,+Cedar+Rapids,+IA+52402,+United+States/@42.0179234,-91.6739759,13z/data=!3m1!4b1!4m13!4m12!1m5 !1m1!1s0x87e4f0459aacb105:0x63c416fc0edc61d6!2m2!1d-91.6475339!2d42.039779!1m5!1m1!1s0x87e4f0d795c1b96b:0xa1ccbbf6400b01aa!2m2!1d-91.6362972!2d41.9959428?hl=en

使用方向服务时它的工作方式不同。查找以下示例

http://jsfiddle.net/MRHQ4/291/(致谢作者:Shreerang Patwardhan)

当我从源和目标中删除 Address2 时它工作正常

4

2 回答 2

1

单元和公寓信息可能会导致地理编码器中的解析问题。如果可以,请尽量删除它们。将地址更改为

var start = "2115 First Avenue SE, Cedar Rapids, IA, 52402";     //Set the source/ origin
var end = "6126 Rockwell Dr, Cedar Rapids, IA, 52402";

你会看到它工作得更好。

减少地址信息

有邻里信息

带有公寓/单位信息

于 2016-01-27T07:17:17.533 回答
0

“Cottage Grove Place”和“Keystone Place”不是地址2,这些是地名(或者你可以说地名),只需将它们移动到地址的开头(没有其他更改),如下所示,它工作正常:

var start = "Cottage Grove Place, 2115 First Avenue SE Unit 1306, Cedar Rapids, IA, 52402";     //Set the source/ origin

var end = "Keystone Place, 6126 Rockwell Dr. Apt 128, Cedar Rapids, IA, 52402";  //Set the destination

我测试了,它工作正常,请检查,谢谢。

于 2016-01-27T07:40:48.430 回答