MCPcopy Index your code
hub / github.com/maplibre/maplibre-gl-js

github.com/maplibre/maplibre-gl-js @v6.0.0-18 sqlite

repository ↗ · DeepWiki ↗ · release v6.0.0-18 ↗
4,473 symbols 12,416 edges 577 files 769 documented · 17%
README
<img alt="MapLibre Logo" src="https://maplibre.org/img/maplibre-logos/maplibre-logo-for-light-bg.svg" width="200">

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.






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

Extension points exported contracts — how you extend this code

Property (Interface)
(no doc) [6 implementers]
src/style/properties.ts
AttributeBinder (Interface)
* `Binder` is the interface definition for the strategies for constructing, * uploading, and binding paint property d [4 …
src/data/program_configuration.ts
Source (Interface)
(no doc) [6 implementers]
src/source/source.ts
Handler (Interface)
(no doc) [20 implementers]
src/ui/handler_manager.ts
ICameraHelper (Interface)
(no doc) [6 implementers]
src/geo/projection/camera_helper.ts
BenchmarkLike (Interface)
(no doc) [5 implementers]
test/bench/lib/benchmark.ts
IBoundingVolume (Interface)
(no doc) [4 implementers]
src/util/primitives/bounding_volume.ts
IRenderToTexture (Interface)
(no doc) [1 implementers]
src/render/render_to_texture_interface.ts

Core symbols most depended-on inside this repo

on
called by 701
src/ui/map.ts
once
called by 532
src/ui/map.ts
getCanvas
called by 464
src/ui/map.ts
get
called by 445
src/webgl/value.ts
run
called by 366
test/bench/lib/benchmark.ts
remove
called by 312
src/ui/map.ts
fire
called by 282
src/source/source.ts
sleep
called by 246
src/util/test/util.ts

Shape

Method 2,594
Function 1,094
Class 735
Interface 41
Enum 9

Languages

TypeScript100%

Modules by API surface

src/webgl/value.ts149 symbols
src/ui/map.ts129 symbols
src/geo/projection/vertical_perspective_transform.ts110 symbols
src/geo/projection/mercator_transform.ts110 symbols
src/geo/projection/globe_transform.ts106 symbols
src/geo/transform_interface.ts105 symbols
src/style/style.ts88 symbols
src/data/program_configuration.ts86 symbols
src/style/properties.ts84 symbols
src/geo/transform_helper.ts78 symbols
src/util/util.ts69 symbols
src/ui/camera.ts63 symbols

Dependencies from manifests, versioned

@mapbox/mapbox-gl-rtl-text0.4.0 · 1×
@mapbox/mvt-fixtures4.0.0 · 1×
@mapbox/point-geometry1.1.0 · 1×
@mapbox/tiny-sdf2.2.0 · 1×
@mapbox/unitbezier1.0.0 · 1×
@mapbox/vector-tile3.0.0 · 1×
@mapbox/whoots-js3.1.0 · 1×
@maplibre/geojson-vt6.1.0 · 1×
@maplibre/maplibre-gl-style-spec25.0.0 · 1×
@maplibre/mlt1.1.12 · 1×
@maplibre/vt-pbf4.3.2 · 1×
@rollup/plugin-commonjs29.0.0 · 1×

For agents

$ claude mcp add maplibre-gl-js \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact