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 or OS X.
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 on the target platform. 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 5-1 lists the supported parameters 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 in the Maps app.
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 value of this parameter is the latitude and longitude separated by a comma. For example, to specify a latitudinal span of 20.4 degrees and a longitudinal span of 30.8 degrees, you would use the string “sspn=20.4,30.8”.
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.