5

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?

David Rönnqvist
  • 55,638
  • 18
  • 162
  • 201

1 Answers1

8

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.

Community
  • 1
  • 1
  • More info is available on Apple Documentationhttps://developer.apple.com/library/ios/featuredarticles/iPhoneURLScheme_Reference/MapLinks/MapLinks.html may be it is helpful for someone else – Mashhadi Oct 21 '14 at 10:05