更新时间:2023-01-01 17:00:25
如果您的意思是根据两点将用户带到地图应用程序,那么您可以这样做:
If you mean taking the user to the maps application based on two points, then you can do it like this:
创建一个如下所示的NSURL:
Create an NSURL that looks like this:
NSURL *URL = [NSURL URLWithString:@"http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f"];
您可以适当地插入起始地址和目的地(在lat。和long。)。
告诉您的应用程序打开URL
You plug in your starting address and destination (in lat. and long.) appropriately. Tell your application to open the URL
[[UIApplication sharedApplication] openURL:URL];
它会自动带你到地图应用程序!
It should take you to the maps application automatically!