Handling Initialization Events
Handle events that trigger when MapKit JS initializes.
mapkit object emits two events to indicate the success or failure of a configuration operation. MapKit is configured when it initializes.
MapKit configuration changed due to either a successful initialization or a refresh. The event has the property
status (String), which indicates the configuration change status.
Initialized: MapKit successfully initialized and configured.
Refreshed: MapKit configuration updated.
MapKit failed to initialize. The event has the property
status (String), which indicates the status response.
Unauthorized: The authorization token provided is invalid.
Too Many Requests: The authorization token provided is based on a Maps ID, which has exceeded its allowed daily usage.
MapKit JS will envoke these events asyncrounously upon success or failure of the initialization request. A common use-case is shown in the following example:
Initialize MapKit JS by providing an authorization callback function and optional language.