• Stars
    star
    6,404
  • Rank 6,207 (Top 0.2 %)
  • Language
    TypeScript
  • License
    Other
  • Created almost 4 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

MapLibre GL JS - Interactive vector tile maps in the browser

MapLibre Logo

MapLibre GL JS

MapLibre GL JS is an open-source library for publishing maps on your websites or webview based apps. 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's initial versions (1.x) were intended to be a drop-in replacement for the Mapbox’s OSS version (1.x) with additional functionality, but have evolved a lot since then.

LicenseVersionCIPRs

Getting Started

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

<script src='https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.js'></script>
<link href='https://unpkg.com/maplibre-gl@latest/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 version is 1.15.3.

CDN Links

MapLibre GL JS is distributed via unpkg.com. For more information, 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/maplibre-gl@#.#.#/dist/maplibre-gl.js"></script>
+    <link
+      href="https://unpkg.com/maplibre-gl@#.#.#/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://slack.openstreetmap.us/ Read the CONTRIBUTING.md guide in order to get familiar with how we do things around here.

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).

Bounties

We offer Bounties for some tasks in the MapLibre GL JS repo. Read more about the Bounties in our step-by-step guide:

https://maplibre.org/roadmap/step-by-step-bounties-guide/

And find all currently published Bounties in MapLibre GL JS here.


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

Logo MIERUNE

Logo komoot

Logo JawgMaps

Backers and Supporters:


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.

More Repositories

1

martin

Blazing fast and lightweight PostGIS, MBtiles and PMtiles tile server, tile generation, and mbtiles tooling.
Rust
2,231
star
2

maputnik

An open source visual editor for the 'MapLibre Style Specification'
TypeScript
2,094
star
3

maplibre-rs

Experimental Maps for Web, Mobile and Desktop
Rust
1,343
star
4

maplibre-native

MapLibre Native - Interactive vector tile maps for iOS, Android and other platforms.
C++
1,048
star
5

awesome-maplibre

A collection of awesome things that use or support MapLibre!
378
star
6

flutter-maplibre-gl

Customizable, performant and vendor-free vector and raster maps, flutter wrapper for maplibre-native and maplibre-gl-js (fork of flutter-mapbox-gl/maps)
Dart
210
star
7

maplibre-react-native

A MapLibre react native module for creating custom maps
Java
209
star
8

maplibre-tile-spec

Next generation vector tiles format
Java
171
star
9

font-maker

Web app to convert font files into fontstacks for MapLibre GL
TypeScript
161
star
10

maplibre-gl-leaflet

This is a binding from MapLibre GL JS to the familiar Leaflet API.
JavaScript
123
star
11

maplibre-navigation-android

Maplibre Navigation SDK for Android
Java
91
star
12

demotiles

Demo vector tiles and map style for web, helloworld and CI tests @MapLibre. Hosted directly on GitHub Pages, serverless, no keys.
HTML
74
star
13

maplibre

Documents that span across multiple MapLibre projects
73
star
14

ngx-maplibre-gl

Angular binding of maplibre-gl
TypeScript
73
star
15

maplibre-gl-directions

A plugin to show routing directions on a MapLibre GL JS map
TypeScript
72
star
16

maplibre-style-spec

MapLibre Style Specification & Utilities
TypeScript
66
star
17

mbtileserver-rs

Deprecated mbtiles server in Rust. Use Martin tile server instead.
Rust
61
star
18

maplibre-gl-native-distribution

MapLibre Native for iOS distributed via the Swift Package Manager.
Swift
51
star
19

maplibre-gl-inspect

Maplibre GL Inspect adds an inspect control to maplibre-gl-js to view all features of the vector sources and allows hovering over features to see their properties.
TypeScript
39
star
20

maplibre-native-qt

MapLibre Native Qt Bindings and Qt Location Plugin
C++
38
star
21

maplibre-navigation-ios

MapLibre Navigation SDK for iOS
Swift
36
star
22

maplibre-navigation-android-legacy

Legacy MapLibre Navigation SDK for Android
Java
33
star
23

maplibre-gl-compare

Swipe and sync between two maps
JavaScript
32
star
24

maplibre-gl-js-docs

Deprecated - Docs are in the /docs folder of the maplibre-gl-js repo.
JavaScript
23
star
25

maplibre-plugins-android

MapLibre Native for Android Plugins
Java
22
star
26

maplibre-java

MapLibre Native Android utilities
Java
16
star
27

maplibre.github.io

HTML
13
star
28

maplibre-native-base

MapLibre Native Base C++ Libraries
C++
4
star
29

maplibre-native-android-examples

MapLibre Native Android Examples
3
star
30

workshop

HTML
2
star
31

mvt-cpp

C++ library for decoding MVT files
C++
2
star
32

martin-landing-page

JavaScript
1
star
33

maplibre-gestures-android

The MapLibre Gestures for Android library makes it easy to detect and handle user gestures on an Android device.
Java
1
star
34

homebrew-martin

Homebrew for Martin
Ruby
1
star
35

repo-stats

A repository to get statistics on other maplibre repos
1
star