maplibre-gl-js README

The project's README from github.com/maplibre/maplibre-gl-js. As one markdown file: README.md.

MapLibre Logo

MapLibre GL JS

License Version CI PRs codecov

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.

Getting Started

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

<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 type='module'>
import * as maplibregl from 'https://unpkg.com/maplibre-gl@latest/dist/maplibre-gl.mjs';

const 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

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

Use MapLibre GL JS bindings for React and Angular. 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.

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 JS 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 JS 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/.

Gold:

Logo MSFT

Logo AWS

Silver:

Logo MIERUNE

Logo komoot

Logo JawgMaps

Logo Radar

Logo mapme

Logo maptiler

Logo Caltopo

Logo SmartMaps

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 JS is licensed under the 3-Clause BSD license.

maplibre-gl-js (maplibre/maplibre-gl-js)

Searching Database…

Что это такое?Опенсорсная JavaScript-библиотека для встраивания интерактивных векторных карт на сайты и в приложения на основе webview, с рендерингом на GPU.
Это готовый картографический сервис, на который я просто ставлю ссылку, или код, который добавляю на свою страницу?Это клиентская библиотека, которую вы подключаете к собственной HTML-странице, — а не хостинговый сервис. Она работает в браузере или webview и рисует векторные тайлы на GPU через WebGL.
Как добавить карту на страницу?Добавьте CSS-файл MapLibre GL и код библиотеки на свою HTML-страницу — и карта из quickstart сразу заработает; полная документация и примеры есть на официальном сайте.
Мне нужен Node.js или сборка проекта, чтобы этим пользоваться?Во время работы ничего, кроме браузера, не нужно. Node.js 16.14+ и npm 8.1+ требуются, только если вы собираете саму библиотеку из исходников.
Есть ли подвох из-за происхождения от Mapbox?Сам код полностью открыт под лицензией BSD-3-Clause, но жёсткое правило действует для контрибьюторов: код из mapbox-gl-js нельзя портировать обратно, если он не покрывается прежней лицензией BSD-3.
Я веб-разработчик и пишу на React — подойдёт ли она для моего стека?Да: помимо обычных HTML/JS, есть официальные биндинги для React и Angular, а документация построена на примерах.
Чем она отличается от Mapbox GL JS?Это форк mapbox-gl-js от декабря 2020 года, появившийся после того, как Mapbox отказалась от открытой лицензии. Первые релизы 1.x стремились быть заменой открытой версии Mapbox 1.x без переделок, но с тех пор библиотека сильно развилась своим путём.
Где я могу посмотреть, что она умеет, прежде чем выбирать её?На официальном сайте документации есть большая подборка примеров и галерея showcases, а список awesome-maplibre собирает ещё больше демо и проектов, созданных с её помощью.
Creator
maplibre
Size
1 GB
Stars
11.9K
Age
5y
Commits · 90 Days