我正在尝试使用 Apple Maps 在 URL 中设置 map 类型,但它似乎不起作用。
我能做些什么不同的事情?为此,我在 URL 中将类型指定为 &t=satellite
,如下所示:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://maps.apple.com/?daddr=San+Francisco,+CA&saddr=%@,%@&t=satellite", LatitudeCurrentLocation, LongitudeCurrentLocation]]];
纬度和经度是包含纬度和经度坐标的 NSString。
如何设置 URL 中的可能类型?
最佳答案
默认情况下, map 以图形 map 类型显示。您可以通过附加 ‘&t=k’
将 map 类型更改为卫星,
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://maps.apple.com/?daddr=San+Francisco,+CA&saddr=%@,%@&t=k", LatitudeCurrentLocation, LongitudeCurrentLocation]]];
有关更多信息,请阅读 This Question还有This Documentation.
关于ios - 苹果 map URL 方案 t=,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17146854/