开发者

Google Map Routing Syntax

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜