The maps URL scheme is used to show geographical locations and to generate driving directions between two points. If your app includes address or location information, you can use map links to forward that information to the Maps app on iOS.
Unlike some schemes, map URLs do not start with a “maps” scheme identifier. Instead, map links are specified as regular
http links and are opened either in Safari or the Maps app. The following examples show the strings you would use in Safari and in a native app to show a map of the city of Cupertino, California in the Maps app.
Native app URL string:
The following examples show the strings you would use to provide driving directions between San Francisco and Cupertino:
Native app string:
URLs that contain no path parameters or that contain specific map paths are opened in Safari and displayed there. For example, URLs based on the paths
http://maps.apple.com/m are all opened in Safari. To open a URL in the Maps app, the path must be of the form
The rules for creating a valid map link are as follows:
The domain must be
The path cannot be
A parameter cannot be
q=*if the value is a URL (so KML is not picked up).
The parameters cannot include
Table 1 lists the parameters supported by iOS along with a brief description of each.
The query parameter. This parameter is treated as if it had been typed into the query box by the user on the
The location part of the query.
The latitude and longitude points (in decimal format, comma separated, and in that order) for the map center point.
The latitude and longitude points from which a business search should be performed.
The approximate latitude and longitude span.
A custom latitude and longitude span format used by Apple.
The type of map to display.
The zoom level.
The source address, which is used when generating driving directions
The destination address, which is used when generating driving directions.
© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-12-13)