MapBox Quick Guide

Suowei Hu
2 min readAug 15, 2023

--

Mapbox GL JS quick configuration example

Mapbox GL JS is a client-side JavaScript library for building web maps and web applications with Mapbox’s modern mapping technology. You can use Mapbox GL JS to display Mapbox maps in a web browser or client, add user interactivity, and customize the map experience in your application (GL stands for graphic library, JS stands for Javascript)

(Official Documentation Site: https://docs.mapbox.com/mapbox-gl-js/guides/)

Installation

To use Mapbox GL JS in your project, you need to import it using the Mapbox GL JS CDN:

<script src='https://api.mapbox.com/mapbox-gl-js/v2.15.0/mapbox-gl.js'></script>
<link href='https://api.mapbox.com/mapbox-gl-js/v2.15.0/mapbox-gl.css' rel='stylesheet' />

Useful Links

Usage Example

Baisc Maps: Basic map with light-grey color theme

https://codepen.io/pen?template=YzRmJrr

Map with Control: map with user controll on the left-bottom of the page

https://codepen.io/pen?template=yLQmRzm

Maps with Marker & Popup: which emphasis the important location

https://codepen.io/pen?template=wvQVYPY

--

--

Suowei Hu
Suowei Hu

Written by Suowei Hu

Drupal Developer, createing impactful solutions. | Student at Australian National University, an enthusiastic learner. | Github: https://github.com/SuoweiHu

No responses yet