Examples
The following examples are based on the official examples in MapLibre Docs. They are defined in the examples directory of the repository and automatically bundeled in the docs.
Add a raster tile source π π
Add a third-party raster source to the map.
Add a WMS source π π
Add an external Web Map Service raster layer to the map.
Check if WebGL is supported π π
Check for WebGL browser support.
Display a globe with an atmosphere π π
Display a globe with an atmosphere.
Display a map π π
Initialize a map with Yew and the unofficial MapLibre GL JS Rust bindings.
Display a map with HTMLElement π π
Initialize a map with Yew and the unofficial MapLibre GL JS Rust bindings by passing an HTMLElement reference.
Display a map with MLT π π
Initialize a map in an HTML element with MapLibre GL JS. This example is using a style that uses MLT (MapLibre Tiles). The example is very similar to the regular one except the tiles are in a different encoding.
Display a satellite map π π
Display a satellite raster baselayer.
Display a non-interactive map π π
Create a map without interactivity.
Set pitch and bearing π π
Initialize a map with pitch and bearing camera options.
Style labels with local fonts π π
Apply local fonts to your styleβs text labels. This option is suitable if you donβt need every user to see exactly the same font, or if you want to avoid relying on a third-party content delivery network (CDN). For maximum compatibility, the text-font property should include fonts commonly found on multiple platforms.
Style labels with Web fonts π π
Apply Web fonts to your styleβs text labels. Unlike signed distance field (SDF) glyph sets, Web fonts are available from a variety of providers, or your can make your own using popular tools. This option is suitable for fonts that are only available through a third-party content delivery network (CDN) for technical or legal reasons, as well as fonts that are incompatible with SDF, such as variable fonts. For compatibility with Android and iOS applications, specify equivalent fonts in the styleβs font-faces property.











