Map Links

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.

The following examples show the strings you would use to provide driving directions between San Francisco and Cupertino:

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/, http://maps.apple.com/maps, http://maps.apple.com/local, and 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 http://maps.apple.com/?q.

The rules for creating a valid map link are as follows:

Table 5-1 lists the supported parameters along with a brief description of each.

Table 5-1  Supported Apple Maps parameters

Parameter

Notes

q=

The query parameter. This parameter is treated as if it had been typed into the query box by the user in the Maps app. q=* is not supported

near=

The location part of the query.

ll=

The latitude and longitude points (in decimal format, comma separated, and in that order) for the map center point.

sll=

The latitude and longitude points from which a business search should be performed.

spn=

The approximate latitude and longitude span.

sspn=

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”.

t=

The type of map to display.

z=

The zoom level.

saddr=

The source address, which is used when generating driving directions

daddr=

The destination address, which is used when generating driving directions.