开发者

Google Map Routing Syntax

开发者 https://www.devze.com 2023-03-04 18:18 出处:网络
can someone please explain to开发者_如何学C me how does the syntax looks like if I wanna write the google map routing?

can someone please explain to开发者_如何学C me how does the syntax looks like if I wanna write the google map routing?

http://maps.google.com/maps?daddr=San+Francisco,+CA&saddr=cupertino

Let say now I dont want use places' name as my input, I have source/destination coordinate, how should I put it?

For example: Destination coordinate = (12,32) Source coordinate = (32, 24)

   http://maps.google.com/maps?daddr=12,32,saddr=32,34

But the above code doesn't work.


 NSString *urlstring=[NSString stringWithFormat:@"http://maps.google.com/?saddr=%f,%f&daddr=%f,%f",32.0,24.0,12.0,32.0];

In general terms:-

 NSString *urlstring=[NSString stringWithFormat:@"http://maps.google.com/?saddr=%f,%f&daddr=%f,%f",sourcelocation.latitude,sourcelocation.longitude,destinationlocation.latitude,destinationlocation.longitude];
0

精彩评论

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