Mapbox
Learn how to integreate high-performance maps in your application.
Mapbox GL JS is a JavaScript library for vector maps on the Web. Its performance, real-time styling, and interactivity features set the bar for anyone building fast, immersive maps on the web.
Installation
In order to use the Mapbox GL JS, you need to create a Mapbox access token. Read more about it here
Configuration
Open .env
file (or create) in the project's root folder and set the
variable NEXT_PUBLIC_MAPBOX_API_KEY
with the access token ID provided by Mapbox platform.
The environment variables, will be used in src/config.ts
file.
Usage
Removing Mapbox support
If you do not need to support Mapbox, you can remove it by following the next steps.
- Uninstall the
mapbox-gl
andreact-map-gl
dependencies. - Remove the related styles from
styles/global.css