mapkit object by providing an authorization callback and language.
- MapKit JS 5.0+
MapKit JS initialization options.
Once you have completed your one-time Setting Up MapKit JS on the Apple Developer Website, you are ready to initialize MapKit JS.
If you are using a server to deliver new tokens to MapKit JS, make an asynchronous request to your server here and call the
done() function with the result.
Otherwise, you can simply pass a pre-generated token string.
init call can be made before the content of your page has fully loaded (i.e., before the window's “load” event has fired).
Signing Your Authorization Token with JWT
Visit http://jwt.io for a list of recommended modules for most development languages. When configuring a JWT to generate a signed authorization token, you need to include all relevant properties.
The payload object accepts the following properties.
Time issued in seconds since UNIX epoch. (required)
Expiry time in seconds since UNIX epoch. (required)
Your Apple Developer Team ID. (required)
A domain restriction which should match the Origin header passed by a browser. (recommended)
The config object requires all of the following properties.
Your Key ID
The code for signing a JWT token can be run server-side, and exposed as a web service to your front end. It can also be run on a development machine to generate a long-lived token to be checked directly into source code. Libraries for signing JWT tokens for most programming languages can be found at http://jwt.io.