开发者

Insert textual instructions with the google map API

I use the google maps API to trace the route between two points, my code is this :

NSString *urlString = [NSString stringWithFormat:@"https://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f&hl=fr&output=embed&om=5",latUtilisateur,longUtilisateur,latStation,longStation];

//Create a URL object.
NSURL *url = [NSURL URLWithString:urlString];

//URL Requst Object
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];

//Load the request in the UIWebView.
[webView loadRequest:requestObj];

However, this didn't has the textual instructions feature. Am i missing some parameters in the request above or someth开发者_开发问答ing else?


The output=embed parameter is resulting in the full screen map. You can try a couple of alternatives:

  • For the standard map/directions page.

    http://maps.google.com/maps?saddr=Sydney&daddr=Brisbane&hl=fr&output=html&om=5

  • For a mobile friendly directions page. This version includes links to static maps for each step of the journey.

    http://maps.google.com/maps?saddr=Sydney&daddr=Brisbane&hl=fr&output=mobile&om=5

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜