Apple Maps t = URL Schema

I am trying to set the map type in the url using Apple Maps, but it does not seem to work. What could I do differently? I do this by specifying the type as &t=satellite in the url, for example:

 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://maps.apple.com/?daddr=San+Francisco,+CA&saddr=%@,%@&t=satellite", LatitudeCurrentLocation, LongitudeCurrentLocation]]]; 

Latitude and longitude are NSStrings that contain the latitude and longitude coordinates.

How can I set the input type in the url?

+4
source share
1 answer

By default, a map is displayed with a graphic type of map. You can change the map type to satellite by adding '&t=k' ,

 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://maps.apple.com/?daddr=San+Francisco,+CA&saddr=%@,%@&t=k", LatitudeCurrentLocation, LongitudeCurrentLocation]]]; 

For more information, read this question as well as this documentation.

+7
source

Source: https://habr.com/ru/post/1486608/


All Articles