0

我正在研究谷歌地图中的谷歌地图,如何用路线中的路点向用户表示行车路线。根据谷歌地图 SDK,他们提供了一个我尝试过的示例 url,但我无法获得 json 响应。

网址: http ://maps.googleapis.com/maps/api/directions/json?origin=Boston,MA&destination=Concord,MA&waypoints=Charlestown,MA|Lexington,MA&sensor=false

错误:错误域=NSURLErrorDomain 代码=-1000“错误 URL”UserInfo=0x9245e00 {NSUnderlyingError=0x8643f00“错误 URL”,NSLocalizedDescription=错误 URL}

4

1 回答 1

0

我认为您应该执行以下操作

NSURL *url=[NSURL URLWithString:[@" http://maps.googleapis.com/maps/api/directions/json?origin=Boston,MA&destination=Concord,MA&waypoints=Charlestown,MA|Lexington,MA&sensor=false" stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
于 2013-03-27T06:25:37.660 回答