Examples
Getting Started

Basic Map
Display an interactive Maptoolkit vector map with MapLibre GL JS.

Change the Map Style
Switch between the Maptoolkit community styles at runtime.

Navigation Controls
Add zoom, compass, and scale controls to the map.

Non-Interactive Map
Render a static map that ignores user input.

Pitch and Bearing
Open the map tilted and rotated.

Change the Map Language
Switch place labels between local and translated names at runtime.
Markers & Popups

Add a Default Marker
Place a default MapLibre marker at a coordinate.

Add a Custom Marker
Use your own HTML element as a marker.

Display a Popup
Show a standalone popup at a coordinate.

Popup on Click
Open a popup when the user clicks a feature.

Popup on Hover
Show a popup that follows the pointer over features.

Attach a Popup to a Marker
Bind a popup that toggles when the marker is clicked.

Draggable Marker
Let the user drag a marker and read its coordinates.
GeoJSON & Data

Add a GeoJSON Point
Render a point from a GeoJSON source as a circle layer.

Add a GeoJSON Line
Draw a line string with a line layer.

Add a GeoJSON Polygon
Fill an area with a polygon and outline.

Multiple Geometries from One Source
Style points, lines, and polygons from a single source.

Data-Driven Circles
Size and color circles from a feature property.
3D & Terrain
Controls & Interaction

Fullscreen Control
Add a button that expands the map to fullscreen.

Geolocate Control
Add a button that centers on the user location.

Disable Scroll Zoom
Stop the wheel and trackpad from zooming.

Disable Map Rotation
Lock the map bearing to north.

Hover Effect
Highlight a feature under the pointer with feature-state.

Pointer Coordinates
Read the lng/lat under the pointer.

Features Under the Pointer
Query rendered features at the pointer.

Toggle Layer Visibility
Show and hide a layer with a button.
Layers & Styling

Add a Layer Below Labels
Insert a layer beneath the map labels.

Change a Layer Color
Recolor a layer at runtime with buttons.

Heatmap Layer
Visualize point density with a heatmap.

Cluster Points
Group nearby points into styled clusters.

Pattern Fill
Fill a polygon with a generated image pattern.

Zoom-Based Building Color
Color 3D buildings differently as you zoom.
Camera & Animation

Fly To a Location
Animate a smooth flight to a new center.

Fit to a Bounding Box
Frame the map to a geographic extent.

Rotate Around a Point
Continuously spin the camera bearing.

Jump Through Locations
Cycle the map through a list of places.

Animate a Point
Move a GeoJSON point every frame.

Animate a Marker
Move a marker continuously over the map.

Center on a Clicked Feature
Ease the map to a feature when clicked.



