Skip to main content

Getting Started

To get started with Mapbox GL JS, choose the method that fits your project setup:

Get Started with CDN

Add Mapbox GL JS to a web project using hosted resources on the Mapbox Content Delivery Network (CDN) and instantiate a map.

GUIDE
Get started with Mapbox GL JS using a CDN
<link href="https://api.mapbox.com/mapbox-gl-js/v3.25.0/mapbox-gl.css" rel="stylesheet">
<script src="https://api.mapbox.com/mapbox-gl-js/v3.25.0/mapbox-gl.js"></script>

Get Started with NPM

Add Mapbox GL JS to a web project using npm and a modern JavaScript framework and instantiate a map.

GUIDE
Get started with Mapbox GL JS using npm
npm install mapbox-gl

Scaffold a web map project

Use our npm create @mapbox/web-app utility to scaffold a new project with Mapbox GL JS implemented into the front end framework of your choice.

GUIDE
Scaffold a web map project
npm create @mapbox/web-app
Was this page helpful?