Leaflet Examples
Getting Started

Basemap and Style Switcher
Maptoolkit basemap tiles in L.tileLayer, with a switcher for seven styles.

Basic Map
Display a Maptoolkit vector tile map using Leaflet.

Custom Markers
Colored SVG pins with numbers, labels and data, fitted to the map.

Layer Control and Legend
Basemaps, overlays and a legend that shows only what is on the map.

User Location
A locate button with an accuracy circle and error handling.
Markers & Data

Custom Markers
Colored SVG pins with numbers, labels and data, fitted to the map.

Marker Clustering
Group thousands of markers into clusters on a Leaflet map.

Heatmap
Where people live in Europe, from the Eurostat population grid.

Choropleth with Legend
Color countries by a value, with popups and a legend.

Layer Control and Legend
Basemaps, overlays and a legend that shows only what is on the map.

Temperature, Rain and Wind
Temperature, rain and wind over a Leaflet basemap.
Routing

Route Display
Calculate a car route and draw it on a Leaflet map with turn-by-turn markers.

Route Planner
Drag A or B to reroute, and hover a step to see it on the map.

Animate a Vehicle
A car driving a real route, turned to its heading, with a trail.

Snapped GPS Track
A recorded walk, snapped to the paths it was walked on.

Route by Surface Type
A bike route colored by what it runs on, with a surface breakdown.
Geocoding & Isochrones

Geocoder Search
Add a geocoder search control to a Leaflet map using the leaflet-control-geocoder plugin.

Reverse Geocoding on Click
Click the map to look up the address at that point.

Walking Area
Fetch a walking isochrone and draw it as a polygon on a Leaflet map.

Travel Time Bands
5, 10 and 15 minutes on foot from one point, as shaded bands.

Locations Inside an Isochrone
Drag the origin to see which places are within a 15 minute walk.
Frameworks

React Leaflet
Maptoolkit raster tiles in a React app with react-leaflet.

Next.js with Leaflet
React Leaflet with Maptoolkit raster tiles in a Next.js app.

Vue Leaflet
Maptoolkit raster tiles in a Vue 3 app with vue-leaflet.

Angular with ngx-leaflet
Maptoolkit raster tiles in an Angular app with ngx-leaflet.




