Question

I'm trying to set the map type in the URL using Apple Maps but it doens't seem to be working. What could I do differently? I do this by specifying the type as &t=satellite in the URL, like this:

[[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 contains the latitude and longitude coordinates.

How can I set the may type in the URL?

Was it helpful?

Solution

By default, Map is display with the graphical map type. You can change the map type to satellite by appending ‘&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 and also This Documentation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top