Class

mapkit

The JavaScript API for embedding Apple maps on your website.

Declaration

interface mapkit

Overview

The mapkit object is the main namespace for the MapKit JS framework. Similar to MapKit for apps, you can use the mapkit library to display interactive maps with customized annotations and overlays, and provide directions and search services. Your app can supply step-by-step navigation, and help a user find a location by autocompleting a search query.

MapKit JS lets you customize the look of your map. You can choose style details for overlays and annotations, display a standard street map or one that uses satellite imagery, and adjust the visibility of map controls. Additionally, you can customize a map's behavior by providing event handlers that scroll the map or respond when users select items. You can also enable or disable panning, zooming, and rotation.

Topics

Initialization

Handling Initialization Events

Handle events that trigger when MapKit JS initializes.

init

Initialize a mapkit object by providing an authorization callback and language.

MapKitInitOptions

Initialization options for MapKit JS.

addEventListener

Subscribes a listener function to an event type.

removeEventListener

Unsubscribes a listener function from an event type.

Maps

mapkit.Map

An embeddable interactive map that you add to a webpage.

maps

An array to which maps are automatically added and removed as they are initialized and destroyed.

Geocoder

mapkit.Geocoder

A geocoder that converts human-readable addresses to geographic coordinates and vice versa.

Search

mapkit.Search

An object that retrieves map-based search results for a user-entered query.

Directions

mapkit.Directions

An object that provides directions and estimated travel time based on the route you provide.

Map View Customization

mapkit.Padding

The values that define content padding within the map view frame.

mapkit.FeatureVisibility

Constants indicating the visibility of different adaptive map features.

Geographical Features

importGeoJSON

Converts imported GeoJSON data to MapKit JS items.

GeoJSONDelegate

A delegate object that controls a GeoJSON import in order to override default behavior and provide custom style.

ItemCollection

A tree structure containing annotations, overlays, and nested item collection objects.

Map Coordinates

mapkit.Coordinate

An object representing the latitude and longitude for a point on the Earth's surface.

mapkit.CoordinateRegion

A rectangular area on a map defined by a center coordinate and a span, expressed in degrees of latitude and longitude.

mapkit.CoordinateSpan

The width and height of a map region.

mapkit.BoundingRegion

A rectangular area on a map, defined by coordinates of the rectangle's northeast and southwest corners.

Map Units

mapkit.MapPoint

A location on a map when the Earth's surface is projected onto a two-dimensional surface.

mapkit.MapRect

A rectangular area on a two-dimensional map projection.

mapkit.MapSize

A pair of values in map units that define the width and height of a projected coordinate span.

Version and Language

language

A language ID indicating the selected language.

build

The build string.

version

The version of MapKit JS.

See Also

MapKit JS

Setting Up MapKit JS

Complete a one-time setup to create a Maps ID and obtain a private key to use with MapKit JS.

MapKit JS Release Notes

Learn about changes to the MapKit JS API.