iOS Reference Library Apple Developer
Search

Map Links

The maps URL scheme is used to show geographical locations and to generate driving directions between two points. If your application includes address or location information, you can use map links to forward that information to the Maps application on iOS and the Google Maps website on other platforms.

Unlike some schemes, map URLs do not start with a “maps” scheme identifier. Instead, map links are specified as regular http links but are targeted at the Google Maps servers. The following examples show the strings you would use in Safari and in a native application to show a map of the city of Cupertino, California.

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

iOS Note: If the Maps application is not installed on the device, opening a map URL forwards the request to the Google Maps website.

Although the Maps application supports many of the Google Maps parameters and queries, it does not support them all. The rules for creating a valid map link are as follows:

Table 1 lists the parameters supported by iOS along with a brief description of each. For a complete description of these parameters, see Google Map Parameters.

Table 1  Supported Google 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 on the maps.google.com page. 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 Google.

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.

latlng=

A custom ID format that Google uses for identifying businesses.

cid=

A custom ID format that Google uses for identifying businesses.




Last updated: 2009-06-17

Did this document help you? Yes It's good, but... Not helpful...