Apple Maps
Apple Maps is a web mapping service developed by Apple Inc. It provides directions, estimated times of arrival, and daily commutes. Protocol Launcher allows you to generate deep links to open Apple Maps, search for locations, get directions, and explore places.
Usage
There are two ways to use this library:
- On-Demand import from subpaths enables tree-shaking and keeps bundles small.
- Full Import from the root package is convenient but includes all app modules.
Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.
Select Installation Method
On-Demand
Recommended. Optimized for production.
Full Import
Convenient. Good for quick scripts.
Open Maps
ts
import { open } from 'protocol-launcher/apple-map'
const url = open()Search for Places
ts
import { open } from 'protocol-launcher/apple-map'
const url = open({
q: 'Food',
})Search with Location
ts
import { open } from 'protocol-launcher/apple-map'
const url = open({
q: 'Food',
sll: '37.7749,-122.4194',
})Search Near Location
ts
import { open } from 'protocol-launcher/apple-map'
const url = open({
q: 'Food',
near: '37.7749,-122.4194',
})Center Map
ts
import { open } from 'protocol-launcher/apple-map'
const url = open({
ll: '37.7749,-122.4194',
})Center Map with Zoom
ts
import { open } from 'protocol-launcher/apple-map'
const url = open({
ll: '37.7749,-122.4194',
z: 15,
})Create Pin
ts
import { open } from 'protocol-launcher/apple-map'
const url = open({
q: 'Golden Gate Bridge',
ll: '37.8199,-122.4783',
})Satellite View
ts
import { open } from 'protocol-launcher/apple-map'
const url = open({
t: 'k',
ll: '37.7749,-122.4194',
})Display Address
ts
import { open } from 'protocol-launcher/apple-map'
const url = open({
address: '1 Infinite Loop Cupertino CA',
})Get Driving Directions
ts
import { open } from 'protocol-launcher/apple-map'
const url = open({
daddr: 'San Francisco',
dirflg: 'd',
})Get Walking Directions
ts
import { open } from 'protocol-launcher/apple-map'
const url = open({
daddr: 'Union Square',
dirflg: 'w',
})Get Transit Directions
ts
import { open } from 'protocol-launcher/apple-map'
const url = open({
daddr: 'Fisherman\'s Wharf',
dirflg: 'r',
})Get Full Directions
ts
import { open } from 'protocol-launcher/apple-map'
const url = open({
saddr: 'San Jose',
daddr: 'San Francisco',
dirflg: 'd',
})