Daniel Ran Lehmann
Daniel Ran Lehmann

Reputation: 377

Apple Maps URL Scheme t=

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?

Upvotes: 5

Views: 4657

Answers (1)

user2289379
user2289379

Reputation:

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.

Upvotes: 8

Related Questions