MapLibre GL JS 6 (maintained by the MapLibre organization under the BSD 3-Clause License) is an open-source TypeScript and JavaScript library for rendering interactive vector and raster maps in web browsers using WebGL. Originating as the community-driven open-source fork of Mapbox GL JS, MapLibre GL JS 6 ships as pure ES modules and powers modern web GIS portals, 3D terrain viewers, logistics trackers, and custom vector tile applications without vendor lock-in or mandatory token fees.
1. In-Depth Review: Why Web GIS & Frontend Developers Use MapLibre GL JS 6
- Smooth 60 FPS WebGL Vector Tile & 3D Globe Rendering: Renders Mapbox Vector Tiles (MVT), 3D extruded buildings, DEM-driven 3D terrain, and interactive globe projections directly on the GPU with fluid pitch, bearing, and zoom transitions.
- 100% Free & Open-Source Under BSD 3-Clause License: Eliminates per-map-load API token fees, allowing teams to pair MapLibre GL JS with self-hosted PMTiles, Martin tile servers, GeoServer, or open vector tile providers.
- Modern ES Module Architecture & First-Class TypeScript Types: Version 6 transitions to native ES modules with WebGL2 focus, named imports, and built-in TypeScript definitions for Vite, Next.js, Rollup, and webpack workflows.
2. Key Features & Capabilities
- Vector Tile Styling & Data-Driven Expressions: Style vector layers dynamically using the open MapLibre Style Specification with zoom-interpolated colors, line widths, fill patterns, and collision-free labels.
- 3D Terrain, Hillshading & Globe View: Drape vector and raster layers over Raster DEM elevation tiles (`RasterDEMTileSource`), toggle 3D terrain controls (`TerrainControl`), and switch smoothly to a 3D globe (`GlobeControl`).
- GeoJSON, Raster & Custom WebGL Layer Sources: Load live `GeoJSONSource` feeds, `RasterTileSource` XYZ/WMS tiles, `ImageSource` overlays, and custom WebGL shaders via `CustomLayerInterface`.
- Custom Protocols & Serverless PMTiles Support: Register custom tile fetchers with `addProtocol()` to stream serverless `.pmtiles` archives directly from static object storage without running a dedicated tile server.
- Interactive Camera, Markers, Popups & Controls: Fly smoothly between coordinates (`flyTo`, `easeTo`), place HTML markers and popups, and add `NavigationControl`, `GeolocateControl`, `ScaleControl`, and `FullscreenControl`.
- Companion Ecosystem Across Mobile & Tile Servers: Shares style specifications with MapLibre Native (Android, iOS, macOS, React Native, Flutter) and tile tools like Martin and MapLibre Tile (MLT).
- Official Links: Free Trial, Free / Education & Pricing
Always download MapLibre GL JS packages, release bundles, and official API documentation from the official MapLibre portals:
- Official MapLibre Website: https://maplibre.org/
- Official MapLibre GL JS Documentation & API Reference: https://maplibre.org/maplibre-gl-js/docs/
- Official GitHub Repository & Releases: https://github.com/maplibre/maplibre-gl-js/releases
- Pricing & Licensing (100% Free & Open-Source under BSD 3-Clause License): https://maplibre.org/

4. Step-by-Step Installation Guide
- Verify Development Environment & Browser Support: Confirm your workstation runs Node.js (v18+ LTS recommended) with `npm` and a modern bundler (such as Vite, webpack 5+, or Rollup), alongside a WebGL2-capable desktop or mobile browser.
- Install via npm or Download Official Release Bundle: Run `npm install maplibre-gl` in your project directory to install the v6 package, or download the prebuilt `dist.zip` bundle from https://github.com/maplibre/maplibre-gl-js/releases.
- Configure Stylesheet & Web Worker URL: Import `'maplibre-gl/dist/maplibre-gl.css'`, use named ES module imports (`import { Map, setWorkerUrl } from 'maplibre-gl'`), and call `setWorkerUrl(...)` once before initializing your first map when using a bundler.
- Verify Map & Worker Rendering in Browser: Launch your local dev server (`npm run dev`) and confirm that vector tiles, labels, and camera pitch/rotate controls render smoothly without worker errors.
5. How to Use MapLibre GL JS 6: Beginner Workflow
- Create a Styled Map Container: Add `<div id="map"></div>` to your HTML page and give it explicit dimensions via CSS (`#map { width: 100%; height: 600px; }`).
- Initialize `Map` with a Style JSON URL: Instantiate `const map = new Map({ container: 'map', style: 'https://demotiles.maplibre.org/style.json', center: [104.75, 16.55], zoom: 11 });` using `[longitude, latitude]` coordinate order.
- Add Navigation & Geolocation Controls: Attach UI widgets with `map.addControl(new NavigationControl())` and `map.addControl(new ScaleControl())`.
- Load Custom GeoJSON or Vector Layers on `load`: Inside `map.on('load', () => { ... })`, register `map.addSource('parcels', { type: 'geojson', data: geojsonUrl })` and render polygons or lines using `map.addLayer(...)`.
- Add Click Queries, Popups & Build for Production: Listen to `map.on('click', 'parcels-layer', (e) => { ... })` to display feature attributes in a `Popup`, then run `npm run build` for production deployment.
6. Frequently Asked Questions (FAQ)
- Is MapLibre GL JS 6 completely free for commercial and government web portals?Yes. MapLibre GL JS is 100% free and open-source software licensed under the BSD 3-Clause License, requiring no API keys or per-load fees from MapLibre.
- What changed in MapLibre GL JS v6 compared to v5?MapLibre GL JS v6 transitions fully to pure ES modules (using named imports like `import { Map } from 'maplibre-gl'` and explicit `setWorkerUrl()` configuration in bundlers) and drops legacy WebGL1 support to focus on modern WebGL2 performance.
- Can MapLibre GL JS display 3D terrain and a 3D globe?Yes. MapLibre GL JS supports Raster DEM 3D terrain elevation (`TerrainControl`), 3D building extrusions, and an interactive 3D globe view (`GlobeControl`).