Skip to content

MapLibre GL JS Examples

On this page

Events & Interaction

Fly the Maptoolkit map camera to a symbol feature's location when the user clicks on it.
Center the Map on a Clicked Symbol
Fly the Maptoolkit map camera to a symbol feature's location when the user clicks on it.
Highlight a map feature on hover using Maptoolkit feature state and a data-driven paint expression.
Create a Hover Effect
Highlight a map feature on hover using Maptoolkit feature state and a data-driven paint expression.
Display the longitude and latitude under the cursor in real time as the user moves the mouse over a Maptoolkit map.
Get Coordinates of the Mouse Pointer
Display the longitude and latitude under the cursor in real time as the user moves the mouse over a Maptoolkit map.
Query all rendered Maptoolkit map features under the mouse cursor and display their properties on hover.
Get Features Under the Mouse Pointer
Query all rendered Maptoolkit map features under the mouse cursor and display their properties on hover.
Display a Maptoolkit Popup with GeoJSON feature properties when the user clicks on a polygon layer.
Show Polygon Information on Click
Display a Maptoolkit Popup with GeoJSON feature properties when the user clicks on a polygon layer.
Create a draggable GeoJSON point on a Maptoolkit map layer using mousedown, mousemove, and mouseup events.
Create a Draggable Point
Create a draggable GeoJSON point on a Maptoolkit map layer using mousedown, mousemove, and mouseup events.
Move a symbol layer feature to the current mouse position on every mousemove event on a Maptoolkit map.
Animate a Symbol to Follow the Mouse
Move a symbol layer feature to the current mouse position on every mousemove event on a Maptoolkit map.
Wire a sidebar list to the map in both directions: hover and click either one, and the other responds.
Sync a List with the Map
Wire a sidebar list to the map in both directions: hover and click either one, and the other responds.
Show and hide subsets of one source with checkbox filters, without touching the data or adding layers.
Filter by Category
Show and hide subsets of one source with checkbox filters, without touching the data or adding layers.
Let readers dial relief shading up and down, and switch it off, with a slider and a checkbox.
Hillshade Strength Slider
Let readers dial relief shading up and down, and switch it off, with a slider and a checkbox.
Update a Maptoolkit map layer's fill color at runtime using UI buttons and setPaintProperty.
Change a Layer's Color with Buttons
Update a Maptoolkit map layer's fill color at runtime using UI buttons and setPaintProperty.
Filter GeoJSON features on a Maptoolkit map by a time value using an HTML range slider and a filter expression.
Create a Time Slider
Filter GeoJSON features on a Maptoolkit map by a time value using an HTML range slider and a filter expression.

3D & Terrain