Use the MapLibre ArcGIS plugin to create a basemap session and display a map for 12 hours.
What you'll learn
You will learn how to:
- Create an API key credential for basemaps.
- Start a basemap session
A basemap session is a timeframe during which a single user of a single application can use a session token to access unlimited basemap tiles from the Basemap Styles service. It is created a session starts and valid for a maximum duration of 12 hours. that is valid for 12 hours. - Display a basemap style from the ArcGIS Basemap Styles service with a session token
A session token is a short-lived authorization string that provides access to an ArcGIS service that supports sessions. It is created when a session starts and valid for up to 12 hours. It only has privileges to access the service it was created from. . - Start a new basemap session when it expires.
- Change basemap styles with the same session token.
- Provide geocoding functionality to find places around the world.
- Support unlimited user interactions such as map zoom, pan, and tilt.
- Create an app that uses the basemap session usage model
A basemap usage model is a programming pattern for an application that determines the type of basemap consumption and the associated costs of accessing a basemap service. There are two models: the tile usage model and the session usage model. . Learn more here.
What you'll use
- MapLibre ArcGIS plugin
-
ArcGIS Basemap Styles service
The ArcGIS Basemap Styles service, also referred to as the Basemap Styles service, is a location service that provides basemap styles and data for the world. It returns styles as Mapbox styles and web maps, and data as vector tiles and/or map tiles. It supports all of the styles in the ArcGIS Basemap style and Open Basemap style family. An ArcGIS Location Platform or ArcGIS Online account is required to use the service. -
API key authentication
API key authentication is a type of authentication that uses an API key to authenticate requests to ArcGIS services and secure portal items. -
Session token
A session token is a short-lived authorization string that provides access to an ArcGIS service that supports sessions. It is created when a session starts and valid for up to 12 hours. It only has privileges to access the service it was created from.
What you'll need
Before you begin, you need the following:
- An ArcGIS Location Platform account. ArcGIS Online or ArcGIS Enterprise accounts are not supported for this how-to.
- A modern web browser, such as recent versions of Chrome, Firefox, Safari, or Edge.
- Basic knowledge of HTML, CSS, and JavaScript.
- A code editor, such as CodePen (recommended for this how-to).
Steps
Step 1

Create an API key
Step 2

Create a basemap session
Step 3

Change the basemap style
Step 4
