Playground: Add GeoJSON
How to add GeoJSON data to a map.
MapLibre GL JS offers several ways to add content to a map.
To display GeoJSON data, first add it as a source using map.addSource()
, and then create one or more layers using map.addLayer()
. Refer to Layers in the Style Specification for a complete list of styling options.
We generally recommend exploring the MapLibre examples to see what is possible in MapLibre.