🌜
🌞
maplibre-gl

maplibre-gl

v2.1.9

BSD licensed community fork of mapbox-gl, a WebGL interactive maps library

npm install maplibre-gl

README

MapLibre Logo

MapLibre GL JS

MapLibre GL JS is an open-source library for publishing maps on your websites. Fast displaying of maps is possible thanks to GPU-accelerated vector tile rendering.

It originated as an open-source fork of mapbox-gl-js, before their switch to a non-OSS license in December 2020. The library is intended to be a drop-in replacement for the Mapbox’s version with additional functionality.

LicenseVersionCIPRs


Getting Started

Include the JavaScript and CSS files in the <head> of your HTML file.

<script src='https://unpkg.com/maplibre-gl[email protected]/dist/maplibre-gl.js'></script>
<link href='https://unpkg.com/[email protected]/dist/maplibre-gl.css' rel='stylesheet' />

Include the following code in the <body> of your HTML file.

<div id='map' style='width: 400px; height: 300px;'></div>
<script>
var map = new maplibregl.Map({
  container: 'map',
  style: 'https://demotiles.maplibre.org/style.json', // stylesheet location
  center: [-74.5, 40], // starting position [lng, lat]
  zoom: 9 // starting zoom
});
</script>

Enjoy the map!


Documentation

Full documentation for this library is available here.

Check out the features through examples.

Showcases
Display a map Third party vector tile source
Animate a series of images Create a heatmap layer
3D buildings Visualize population density

Migrating from mapbox-gl to maplibre

The libraries are very similar but diverge with newer features happening from v2 in both libraries where Mapbox turned proprietary.

The overall migration happens by uninstalling mapbox-gl and installing maplibre-gl in your node packages (or see below for CDN links), and replacing mapboxgl with maplibregl throughout your TypeScript, JavaScript and HTML/CSS.

-    var map = new mapboxgl.Map({
+    var map = new maplibregl.Map({

-    <button class="mapboxgl-ctrl">
+    <button class="maplibregl-ctrl">

Compatibility branch

Maplibre v1 is completely backward compatible with Mapbox v1. This compatibility branch (named 1.x) is tagged v1 on npm, and its current verison is 1.15.3.

MapLibre GL JS is distributed via unpkg.com. For more informations please see MapLibre GL is on unpkg.com.

-    <script src="https://api.mapbox.com/mapbox-gl-js/v#.#.#/mapbox-gl.js"></script>
-    <link
-      href="https://api.mapbox.com/mapbox-gl-js/v#.#.#/mapbox-gl.css"
-      rel="stylesheet"
-    />

     
+    <script src="https://unpkg.com/[email protected]#.#.#/dist/maplibre-gl.js"></script>
+    <link
+      href="https://unpkg.com/[email protected]#.#.#/dist/maplibre-gl.css"
+      rel="stylesheet"
+    />

Want an example? Have a look at the official MapLibre GL JS Documentation.

Use MapLibre GL JS bindings for React (https://visgl.github.io/react-map-gl/docs/get-started/get-started#using-with-a-mapbox-gl-fork) and Angular (https://github.com/maplibre/ngx-maplibre-gl). Find more at awesome-maplibre.


Contribution

Getting Involved

Join the #maplibre slack channel at OSMUS: get an invite at https://osmus-slack.herokuapp.com/

Community Leadership

You can find the official status of the backing community and steering committee in the COMMUNITY.md document.

Avoid Fragmentation

If you depend on a free software alternative to mapbox-gl-js, please consider joining our effort! Anyone with a stake in a healthy community-led fork is welcome to help us figure out our next steps. We welcome contributors and leaders! MapLibre GL already represents the combined efforts of a few early fork efforts, and we all benefit from "one project" rather than "our way". If you know of other forks, please reach out to them and direct them here.

MapLibre GL is developed following Semantic Versioning (2.0.0).


Sponsors

We thank everyone who supported us financially in the past and special thanks to the people and organizations who support us with recurring donations!

Read more about the MapLibre Sponsorship Program at https://maplibre.org/sponsors/.

Platinum:

Logo AWS

Silver:

Logo Meta

Stone:

MIERUNE Inc.

Backers and Supporters:

sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor sponsor


Thank you Mapbox 🙏🏽

We'd like to acknowledge the amazing work Mapbox has contributed to open source. The open source community is sad to part ways with them, but we simultaneously feel grateful for everything they already contributed. mapbox-gl-js 1.x is an open source achievement that now lives on as maplibre-gl. We're proud to develop on the shoulders of giants, thank you Mapbox 🙇🏽‍♀️.

Please keep in mind: Unauthorized backports are the biggest threat to the MapLibre project. It is unacceptable to backport code from mapbox-gl-js, which is not covered by the former BSD-3 license. If you are unsure about this issue, please ask!


License

MapLibre GL is licensed under the 3-Clause BSD license.

Release Notes

2.1.9
Published on April 8, 2022

https://github.com/maplibre/maplibre-gl-js Changes since MapLibre GL JS v2.1.8:

🐞 Bug fixes

  • Add back typescript typings to dependencies instead of devDependencies (#1178)
2.1.8
Published on April 7, 2022

https://github.com/maplibre/maplibre-gl-js Changes since MapLibre GL JS v2.1.8-pre.3:

✨ Features and improvements

  • Changed logic for showing the Maplibre logo. The Maplibre logo is now shown by setting the map option 'maplibreLogo' to true or by adding it to a map with addControl. TileJSON no longer controls if the logo is shown. (#786)

🐞 Bug fixes

  • Fix missing touchmove in MapTouchEvent["type"] (#1131)
  • Type CustomLayerInterface renderingMode, onRemove, onAdd, and prerender optional (#1122)
1.15.3
Published on April 14, 2022

https://github.com/maplibre/maplibre-gl-js Changes since MapLibre GL JS v1.15.2:

🐞 Bug fixes

  • Bump minimist dependency to fix security issue in the production dependencies (#1135)

General

License
BSD-3-Clause
Typescript Types
Built-in
Tree-shakeable
Yes

Popularity

GitHub Stargazers
3,565
Community Interest
2,907
Number of Forks
326

Maintenance

Commits
10/219/220150
Last Commit
Open Issues
94
Closed Issues
341
Open Pull Requests
16
Closed Pull Requests
163

Versions

Versions Released
10/219/2208
Latest Version Released
Apr 8, 2022
Current Tags
latest2.1.9
v11.15.3
next2.2.0-pre.3

Contributors

jfirebaugh
jfirebaugh
Commits: 1,561
ansis
ansis
Commits: 1,136
mourner
mourner
Commits: 1,058
kkaefer
kkaefer
Commits: 454
tmcw
tmcw
Commits: 405
anandthakker
anandthakker
Commits: 233
yhahn
yhahn
Commits: 227
ChrisLoer
ChrisLoer
Commits: 219
tristen
tristen
Commits: 139
mollymerp
mollymerp
Commits: 135
andrewharvey
andrewharvey
Commits: 112
bhousel
bhousel
Commits: 99
ryanhamley
ryanhamley
Commits: 97
asheemmamoowala
asheemmamoowala
Commits: 92
wipfli
wipfli
Commits: 92