开发者

How can i draw direction (route) using google map api?

开发者 https://www.devze.com 2023-04-02 19:08 出处:网络
I want to draw a route using google api please suggest me i开发者_如何学Cs there any google api is available for drawing route between 2 latitude and Longitude.NSString * urlString = nil;

I want to draw a route using google api please suggest me i开发者_如何学Cs there any google api is available for drawing route between 2 latitude and Longitude.


    NSString * urlString = nil;

    urlString = [NSString stringWithFormat: @"http://maps.google.com/maps?saddr=%f,%f&daddr=%@",12.58, 77.35, [NSString stringWithFormat:@"%@,%@,%@",[detailInfoDict valueForKey:@"address"],[detailInfoDict valueForKey:@"city"],[detailInfoDict valueForKey:@"state"]]];
    urlString = [urlString stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString: urlString]]


You can do using this way as well. Step 1: Add this Frameworks

How can i draw direction (route) using google map api?

Step 2: Imports these files into your View Controllers .h file

How can i draw direction (route) using google map api?

Step 3: Provide 2 Location's latitude and longitude in ViewControllers' .m file

How can i draw direction (route) using google map api?

OutPut:You will get output like this

How can i draw direction (route) using google map api?

0

精彩评论

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