The ultimate playbook for building stunning, interactive 2D-focused geospatial applications.
Welcome to Awesome Maps Examples! Whether you are building a data-rich visualization dashboard, a real-time fleet tracking platform, or a lightning-fast store locator, you will find the inspiration and implementation details you need right here.
This repository is a meticulously curated collection of over 500 interactive, 2D-focused map examples, highlighting the industry's leading rendering engines:
- 🍃 Leaflet.js - The legendary, mobile-friendly interactive mapping library.
- 🚀 MapLibre GL JS - High-performance WebGL vector maps for dynamic 2D rendering.
- ☁️ OpenLayers - High-performance, open-source (BSD) web mapping library.
📚 Geo Resources: For non-example reference material (algorithms, libraries by language, spatial databases, service APIs), see awesome-geo-resources.md.
Unlike traditional lists grouped simply by library, this collection is categorized entirely by feature and topic (e.g., Routing, Controls & UI, Spatial Analysis). This structure empowers you to directly mix, match, and compare how different libraries solve the exact same problems!
We've also included advanced integration ideas, Turf.js architectures, and a complete overview of the global geospatial ecosystem to help you architect your next great map.
This section provides a direct mapping to all 123 interactive examples implemented natively within this repository.
| Example Name | File Path | Description |
|---|---|---|
| 3D Building | leaflet-implementation/3d-building.html |
Simulate 3D extruded building footprints using the OSMBuildings plugin. |
| Animate Line | leaflet-implementation/animate-line.html |
Progressive line drawing animation with play/reset |
| Basic Map | leaflet-implementation/basic-map.html |
Minimal Leaflet map setup |
| Choropleth | leaflet-implementation/choropleth.html |
Data-driven polygon coloring |
| Click Coordinates | leaflet-implementation/click-coordinates.html |
Capture click coordinates |
| Context Menu | leaflet-implementation/context-menu.html |
Right-click context menu |
| Custom Controls | leaflet-implementation/custom-controls.html |
Custom zoom + rotate-north controls |
| Custom Marker | leaflet-implementation/custom-marker.html |
Custom HTML marker with popup |
| Draw GeoJSON | leaflet-implementation/drawing-tools.html |
Draw and export GeoJSON features |
| External Layer Control | leaflet-implementation/external-layer-control.html |
Build an external HTML UI to programmatically drive the map layers. |
| Fly To Animation | leaflet-implementation/fly-to-animation.html |
Animated fly-to with easing |
| Fullscreen | leaflet-implementation/fullscreen.html |
Fullscreen toggle control |
| GeoJSON Upload | leaflet-implementation/geojson-upload.html |
Drag and drop GeoJSON files to render |
| Geocoding | leaflet-implementation/geocoding.html |
Search locations with Nominatim |
| Geofence | leaflet-implementation/geofence.html |
Geofence detection using Turf.js |
| Geolocation | leaflet-implementation/geolocation.html |
User position tracking with accuracy |
| Heatmap | leaflet-implementation/heatmap.html |
Heat map density visualization |
| Hover Effect | leaflet-implementation/hover-effect.html |
Interactive hover highlighting on polygons with tooltip |
| Image Overlay | leaflet-implementation/image-overlay.html |
Overlay an image on the map with opacity control |
| Layer Toggle | leaflet-implementation/layer-toggle.html |
Switch between multiple tile layers |
| Marker Clustering | leaflet-implementation/cluster-markers.html |
Cluster nearby markers together |
| Mini Map | leaflet-implementation/minimap.html |
Overview minimap synced to main view |
| Mouse Follow | leaflet-implementation/mouse-follow.html |
Marker that follows the mouse cursor |
| Popup & Tooltip | leaflet-implementation/popup-tooltip.html |
Rich popups with images and hover tooltips |
| Realtime Data | leaflet-implementation/realtime-data.html |
Live-updating point data stream |
| Satellite Map | leaflet-implementation/satellite-map.html |
Style switcher with satellite imagery |
| Scale Bar | leaflet-implementation/scale-bar.html |
Metric and imperial scale bar |
| Store Locator | leaflet-implementation/store-locator.html |
Store locator with search and category filtering |
| Sync Maps | leaflet-implementation/sync-maps.html |
Multiple maps with synchronized movement |
| Sync Maps Comparison | leaflet-implementation/sync-maps-comparison.html |
Side-by-side map comparison with synced views |
| Time Slider | leaflet-implementation/time-slider.html |
Temporal data visualization with time slider |
| Turf Area Measurement | leaflet-implementation/turf-area-measurement.html |
Measure area of drawn polygon using Turf.js |
| Turf Buffer | leaflet-implementation/turf-buffer.html |
Calculate 10km buffer around clicked point using Turf.js |
| Turf Convex Hull | leaflet-implementation/turf-convex-hull.html |
Create convex hull from points using Turf.js |
| Turf Great Circle | leaflet-implementation/turf-great-circle.html |
Draw geodesic curves using Turf.js |
| Turf Intersection | leaflet-implementation/turf-intersection.html |
Find intersection of two overlapping polygons using Turf.js |
| Turf Nearest Point | leaflet-implementation/turf-nearest-point.html |
Find nearest point using Turf.js |
| Turf Point in Polygon | leaflet-implementation/turf-point-in-polygon.html |
Test point containment using Turf.js |
| Turf Voronoi | leaflet-implementation/turf-voronoi.html |
Generate Voronoi polygons from points using Turf.js |
| WASD Navigation | leaflet-implementation/wasd-navigation.html |
Game-like WASD keyboard navigation |
| Weather | leaflet-implementation/weather.html |
Weather overlay with NOAA radar data |
| Example Name | File Path | Description |
|---|---|---|
| 3D Building | maplibre-implementation/3d-building.html |
3D building extrusion with pitch/bearing |
| Animate Line | maplibre-implementation/animate-line.html |
Progressive line drawing animation |
| Basic Map | maplibre-implementation/basic-map.html |
Minimal MapLibre GL JS setup |
| Choropleth | maplibre-implementation/choropleth.html |
Choropleth with data-driven styling |
| Click Coordinates | maplibre-implementation/click-coordinates.html |
Capture click coordinates |
| Cluster Markers | maplibre-implementation/cluster-markers.html |
Supercluster-based marker clustering |
| Context Menu | maplibre-implementation/context-menu.html |
Right-click context menu with zoom-to and add marker actions |
| Custom Controls | maplibre-implementation/custom-controls.html |
Custom rotate-north control button |
| Custom Marker | maplibre-implementation/custom-marker.html |
Custom HTML marker with popup |
| Draw Polygon | maplibre-implementation/drawing-tools.html |
Draw and edit polygons with mapbox-gl-draw |
| External Layer Control | maplibre-implementation/external-layer-control.html |
Control layers from outside the map |
| Fly To Animation | maplibre-implementation/fly-to-animation.html |
Animate camera movement combining panning and zooming smoothly. |
| Fullscreen | maplibre-implementation/fullscreen.html |
Fullscreen control |
| GeoJSON Upload | maplibre-implementation/geojson-upload.html |
Drag and drop GeoJSON files |
| Geocode Nominatim | maplibre-implementation/geocoding.html |
Search locations with Nominatim API |
| Geofence | maplibre-implementation/geofence.html |
Geofence detection using Turf.js |
| Geolocation | maplibre-implementation/geolocation.html |
User position tracking with accuracy circle |
| Heatmap | maplibre-implementation/heatmap.html |
WebGL-accelerated heatmap layer |
| Hover Effect | maplibre-implementation/hover-effect.html |
Interactive hover highlighting on polygons |
| Image Overlay | maplibre-implementation/image-overlay.html |
Static image overlay with opacity control |
| Layer Toggle | maplibre-implementation/layer-toggle.html |
Switch between different base styles such as street and satellite imagery. |
| Mini Map | maplibre-implementation/minimap.html |
Overview minimap synced to main view |
| Mouse Follow | maplibre-implementation/mouse-follow.html |
Dynamically update a marker position to track the mouse cursor over the canvas. |
| Popup & Tooltip | maplibre-implementation/popup-tooltip.html |
Rich popups with images and hover tooltips |
| Realtime Data | maplibre-implementation/realtime-data.html |
Live-updating point data stream |
| Satellite Map | maplibre-implementation/satellite-map.html |
Style switcher with satellite imagery |
| Scale Bar | maplibre-implementation/scale-bar.html |
Metric scale bar control |
| Store Locator | maplibre-implementation/store-locator.html |
Store locator with search and category filtering |
| Sync Maps | maplibre-implementation/sync-maps.html |
Multiple maps with synchronized movement |
| Sync Maps Comparison | maplibre-implementation/sync-maps-comparison.html |
Side-by-side map comparison with synced views |
| Time Slider | maplibre-implementation/time-slider.html |
Temporal data visualization with time slider |
| Turf Area Measurement | maplibre-implementation/turf-area-measurement.html |
Measure area of drawn polygon using Turf.js |
| Turf Buffer | maplibre-implementation/turf-buffer.html |
Calculate 10km buffer around clicked point using Turf.js |
| Turf Convex Hull | maplibre-implementation/turf-convex-hull.html |
Create convex hull from points using Turf.js |
| Turf Great Circle | maplibre-implementation/turf-great-circle.html |
Draw geodesic curves using Turf.js |
| Turf Intersection | maplibre-implementation/turf-intersection.html |
Find intersection of two overlapping polygons using Turf.js |
| Turf Nearest Point | maplibre-implementation/turf-nearest-point.html |
Find nearest point using Turf.js |
| Turf Point in Polygon | maplibre-implementation/turf-point-in-polygon.html |
Test point containment using Turf.js |
| Turf Voronoi | maplibre-implementation/turf-voronoi.html |
Generate Voronoi polygons from points using Turf.js |
| WASD Navigation | maplibre-implementation/wasd-navigation.html |
Game-like WASD keyboard navigation |
| Weather | maplibre-implementation/weather.html |
Weather overlay with NOAA radar data |
| Example Name | File Path | Description |
|---|---|---|
| 3D Building | openlayers-implementation/3d-building.html |
Styled polygons with rotation control |
| Animate Line | openlayers-implementation/animate-line.html |
Progressive line drawing animation |
| Basic Map | openlayers-implementation/basic-map.html |
Minimal map setup with OpenLayers |
| Choropleth Map | openlayers-implementation/choropleth.html |
Thematic area shading by data values |
| Click Coordinates | openlayers-implementation/click-coordinates.html |
Capture click coordinates on the map |
| Cluster Markers | openlayers-implementation/cluster-markers.html |
Supercluster-based marker clustering |
| Context Menu | openlayers-implementation/context-menu.html |
Right-click context menu with actions |
| Custom Controls | openlayers-implementation/custom-controls.html |
Custom rotate-north control button |
| Custom Marker | openlayers-implementation/custom-marker.html |
Pulsing animated marker with popup |
| Drawing Tools | openlayers-implementation/drawing-tools.html |
Draw points, lines, and polygons on the map |
| External Layer Control | openlayers-implementation/external-layer-control.html |
Use external HTML buttons to toggle the visibility properties of map layers. |
| Fly-To Animation | openlayers-implementation/fly-to-animation.html |
Smooth animated fly-to with easing |
| Fullscreen | openlayers-implementation/fullscreen.html |
Fullscreen toggle control |
| GeoJSON Upload | openlayers-implementation/geojson-upload.html |
Drag and drop GeoJSON files |
| Geocode Nominatim | openlayers-implementation/geocoding.html |
Search locations with Nominatim API |
| Geofence | openlayers-implementation/geofence.html |
Geofence detection with moving marker |
| Geolocation | openlayers-implementation/geolocation.html |
User position tracking with accuracy circle |
| Heatmap | openlayers-implementation/heatmap.html |
Heat map density visualization |
| Hover Effect | openlayers-implementation/hover-effect.html |
Interactive hover highlighting on polygons |
| Image Overlay | openlayers-implementation/image-overlay.html |
Overlay an image on the map |
| Layer Toggle | openlayers-implementation/layer-toggle.html |
Switch between multiple tile layers |
| Mini Map | openlayers-implementation/minimap.html |
Overview minimap synced to main view |
| Mouse Follow | openlayers-implementation/mouse-follow.html |
Marker that follows the mouse cursor |
| Popup & Tooltip | openlayers-implementation/popup-tooltip.html |
Rich popups with hover tooltips |
| Realtime Data | openlayers-implementation/realtime-data.html |
Live-updating point data stream |
| Satellite Map | openlayers-implementation/satellite-map.html |
Style switcher with satellite imagery |
| Scale Bar | openlayers-implementation/scale-bar.html |
Scale bar with imperial/metric units |
| Store Locator | openlayers-implementation/store-locator.html |
Store locator with search and filtering |
| Sync Maps | openlayers-implementation/sync-maps.html |
Multiple maps with synchronized movement |
| Sync Maps Comparison | openlayers-implementation/sync-maps-comparison.html |
Side-by-side map comparison with synced views |
| Time Slider | openlayers-implementation/time-slider.html |
Temporal data visualization with time slider |
| Turf Area Measurement | openlayers-implementation/turf-area-measurement.html |
Measure area of drawn polygon using Turf.js |
| Turf Buffer | openlayers-implementation/turf-buffer.html |
Calculate 500km buffer around clicked point using Turf.js |
| Turf Convex Hull | openlayers-implementation/turf-convex-hull.html |
Create convex hull from points using Turf.js |
| Turf Great Circle | openlayers-implementation/turf-great-circle.html |
Draw geodesic curves using Turf.js |
| Turf Intersection | openlayers-implementation/turf-intersection.html |
Find intersection of two overlapping polygons using Turf.js |
| Turf Nearest Point | openlayers-implementation/turf-nearest-point.html |
Find nearest point using Turf.js |
| Turf Point in Polygon | openlayers-implementation/turf-point-in-polygon.html |
Test point containment using Turf.js |
| Turf Voronoi | openlayers-implementation/turf-voronoi.html |
Generate Voronoi polygons from points using Turf.js |
| WASD Navigation | openlayers-implementation/wasd-navigation.html |
Game-like WASD keyboard navigation |
| Weather | openlayers-implementation/weather.html |
Weather overlay with radar data |
- OpenLayers: Animate a choropleth map - Animated choropleth over time
- OpenLayers: Animate a GPS trace - Smooth GPS trace animation
- OpenLayers: Animation easings - Built-in easing functions
- OpenLayers: Get map camera details - Camera state access
- Leaflet: Fly to with easing - Animated flyTo with custom easing options
- Leaflet: Pan animation with hooks - Custom pan/zoom animations via map events
- Leaflet: Scroll-driven fly-to - Fly map position based on scroll position
- Leaflet: Animate a line progressively - Progressive line drawing animation with play/reset controls
- MapLibre: Animate a line progressively - Progressive line drawing animation
- MapLibre: Customize camera animations - Custom easing curves
- MapLibre: Disable map rotation - Lock bearing
- MapLibre: Fly to a location - Animated fly-to
- MapLibre: Fly to a location based on scroll position - Scroll-driven fly-to
- MapLibre: Jump to a series of locations - Sequential location jumps
- MapLibre: Set pitch and bearing - Tilt and rotate
- MapLibre: Slowly fly to a location - Slow fly-to
- OpenLayers: Bring data into view control - Auto-fit to data bounds
- OpenLayers: Category legend options - Legend type options
- OpenLayers: Create a legend control - Custom legend
- OpenLayers: Create HTML legend - HTML-based legend
- OpenLayers: Custom navigation controls - External nav controls
- OpenLayers: Custom styled legend - CSS-styled legend
- OpenLayers: Fullscreen control - Fullscreen toggle
- OpenLayers: Fullscreen control options - Fullscreen options
- OpenLayers: Geolocation control - Custom geolocation UI
- OpenLayers: Geolocation control options - Geolocation options
- OpenLayers: Gradient legend options - Gradient legend type
- OpenLayers: Legend control options - Legend control options
- OpenLayers: Map navigation control options - Navigation options
- OpenLayers: Map style picker - Style picker control
- OpenLayers: Map user interaction options - User interaction options
- OpenLayers: Mini overview map - Overview minimap
- OpenLayers: Mini overview map options - Overview minimap options
- OpenLayers: Simple scale bar control - Custom scale bar
- OpenLayers: Spyglass map visualization - Spyglass data viewer
- OpenLayers: Spyglass module options - Spyglass options
- OpenLayers: Swipe map with fullscreen support - Swipe with fullscreen
- Leaflet: Changing locate zoom control - Custom zoom control positioning
- Leaflet: Controlling the map from outside - External map controls
- Leaflet: Create additional control placeholders - Custom control positions
- Leaflet: Fullscreen - Fullscreen toggle
- Leaflet: Scale - Map scale bar
- Leaflet: Custom legend control - HTML legend overlay with data classes
- Leaflet: Swipe comparison control - Side-by-side map swipe
- Leaflet: Custom navigation controls - Custom zoom + rotate-north controls
- Leaflet: Mini overview map - Synced minimap in the corner
- MapLibre: Change building color based on zoom level - Zoom-driven styling
- MapLibre: Context menu - Right-click context menu with zoom and marker actions
- MapLibre: Custom controls - Custom rotate-north button
- MapLibre: Display map navigation controls - Standard zoom/rotate controls
- MapLibre: Level of Detail Control - LOD management
- MapLibre: Navigate the map with game-like controls - WASD navigation
- MapLibre: WASD navigation - Keyboard navigation with accelerated movement
- MapLibre: Toggle interactions - Enable/disable controls
- MapLibre: View a fullscreen map - Fullscreen toggle
- MapLibre: Scale bar control - Scale bar with metric units
- MapLibre: Mini overview map - Overview minimap synced to main map
- OpenLayers: Bubble layer data viz - Bubble layer for point magnitude
- OpenLayers: Heat map data viz - Heat map for density visualization
- OpenLayers: Choropleth map - Thematic area shading
- Leaflet: Leaflet.heat for density maps - Heatmap plugin for point density
- Leaflet: Choropleth with GeoJSON - Data-driven polygon coloring
- Leaflet: Marker clustering density - Cluster-based density visualization
- Leaflet: Realtime data stream - Live random point stream with counter
- Leaflet: Time slider data filter - Hourly data driven by time slider
- MapLibre: Visualize population density - Choropleth visualization
- MapLibre: Create a heatmap layer - Heatmap density visualization
- MapLibre: Choropleth with data joins - Join external CSV data to polygon features
- OpenLayers: Add a GeoJSON LineString - Basic line rendering
- OpenLayers: Add a GeoJSON polygon - Basic polygon fill
- OpenLayers: Add drawing toolbar to map - Basic drawing toolbar
- OpenLayers: Allow map panning with drawing tools - Pan while drawing
- OpenLayers: Animate a line - Line position animation
- OpenLayers: Animate a snakeline - Snake-like line drawing
- OpenLayers: Calculate a convex hull - Convex hull from array of shapes
- OpenLayers: Cardinal Spline Options - Cardinal spline controls
- OpenLayers: Change drawing rendering style - Custom draw styles
- OpenLayers: Choropleth map - Thematic area shading
- OpenLayers: Create isobands from isolines - Isobands from isoline data
- OpenLayers: Curved lines - Three ways to create curved lines
- OpenLayers: Data-driven line layer styling - Property-based styling
- OpenLayers: Data-driven polygon extrusion styling - Extrusion styling
- OpenLayers: DataSource and Shape events - DataSource and Shape events
- OpenLayers: Display isoline data - Contour lines with data-driven styling
- OpenLayers: Drag and drop GeoJSON file - GeoJSON drag & drop
- OpenLayers: Drag and drop shapefiles - Shapefile drag & drop
- OpenLayers: Draw gridded polygon - Grid pattern in polygon
- OpenLayers: Drawing manager options - Manager options
- OpenLayers: Drawing toolbar options - Toolbar options
- OpenLayers: Drawing tools events - Drawing events
- OpenLayers: GeoJSON file optimizer - Optimize GeoJSON files
- OpenLayers: Geospatially Accurate Circle - Geospatially accurate circle
- OpenLayers: Get drawn shapes from drawing manager - Export drawn shapes
- OpenLayers: Large GeoJSON files - Performance with large data
- OpenLayers: Line layer options - All line options
- OpenLayers: Line with Stroke Gradient - Stroke gradient on a line
- OpenLayers: Load data into drawing manager - Programmatic loading
- OpenLayers: Load large shapefiles with Web Worker - Worker-based shapefile loading
- OpenLayers: Load shapefiles onto the map - Basic shapefile loading
- OpenLayers: Merge two polygons together - Polygon union
- OpenLayers: Morph shape animation - Geometry morphing
- OpenLayers: Moving dashed line - Flowing dash animation
- OpenLayers: Polygon extrusion layer options - Extrusion options
- OpenLayers: Polygon Fill Pattern - Pattern fill for polygons
- OpenLayers: Polygon Hover Style - Polygon hover effect
- OpenLayers: Polygon layer options - Polygon options
- OpenLayers: Polygon masks - Polygon masks for MultiPolygon
- OpenLayers: Read and write Well Known Text - WKT as GeoJSON
- OpenLayers: Select data in drawn polygon area - Area selection
- OpenLayers: Simple Cardinal Spline - Simple cardinal spline
- OpenLayers: Simple MultiPolygon - Render a MultiPolygon
- OpenLayers: Simplify polygon - Polygon simplification
- OpenLayers: Snap drawn line to roads - Road snapping
- OpenLayers: Use a snapping grid - Grid snapping
- Leaflet: Add rectangle over click tiles - Draw on tile click
- Leaflet: Calculate area - Area calculation on polygon
- Leaflet: Controlling polygons - Create and manage polygons
- Leaflet: Create and save GeoJSON - Draw and export GeoJSON
- Leaflet: Enlarge a polygon box by 5% - Buffer polygon with Turf.js
- Leaflet: GeoJSON extended action - Interactive GeoJSON features
- Leaflet: GeoJSON simple - Basic GeoJSON rendering
- Leaflet: Great circle - Great circle arcs with Turf.js
- Leaflet: Leaflet-Geoman - Full geometry editing toolkit
- Leaflet: Part of the common - Polygon intersection with Turf.js
- Leaflet: Polygon with gradient - Gradient-filled polygons
- Leaflet: Polyline - Draw polylines
- Leaflet: Hover effect on features - Highlight polygons + tooltip on hover
- Leaflet: GeoJSON drag & drop upload - Drop GeoJSON files to render
- MapLibre: Add a GeoJSON line - GeoJSON LineString
- MapLibre: Add a GeoJSON polygon - GeoJSON polygon fill
- MapLibre: Add a pattern to a polygon - Repeating fill pattern
- MapLibre: Add Contour Lines - Contour lines from raster-dem
- MapLibre: Add live realtime data - Realtime GeoJSON streams
- MapLibre: Add multiple geometries from one GeoJSON source - Multi-geometry source
- MapLibre: Animate a line - Line drawing animation
- MapLibre: Create a gradient line using an expression - Gradient line styling
- MapLibre: Create a gradient line with dasharray using an expression - Gradient dashed line
- MapLibre: Display line that crosses 180th meridian - Antimeridian handling
- MapLibre: Draw a Circle - Circle drawing
- MapLibre: Draw geometries with terra-draw - Geometry drawing with terra-draw
- MapLibre: Drawing tools with mapbox-gl-draw - Polygon drawing with draw plugin
- MapLibre: Fit to the bounds of a LineString - Fit to line geometry
- MapLibre: Restrict map panning to an area - Bounds constraint
- MapLibre: Style lines with a data-driven property - Data-driven line styling
- MapLibre: Update GeoJSON polygons - Dynamic polygon updates
- MapLibre: View local GeoJSON - Load local GeoJSON file
- OpenLayers: Add a Context Menu to the Map - Right-click context menu
- OpenLayers: Create a basic map - Minimal map setup
- OpenLayers: Detect if browser is supported - Browser support detection
- OpenLayers: Display map with different language - Language options
- OpenLayers: Display map with different projections - Map projections
- OpenLayers: Enable map events - Event handling
- OpenLayers: Lazy Load the Map - Delay SDK loading
- OpenLayers: Limit Map to Two Finger Panning - Mobile-friendly panning
- OpenLayers: Limit map view with maxBounds - Restrict map view
- OpenLayers: Multiple Maps - Multiple maps on one page
- OpenLayers: Show a user's position - Basic geolocation
- OpenLayers: Simple Store Locator - Store locator tutorial
- OpenLayers: Swipe between two maps - Side-by-side map comparison
- OpenLayers: Synchronize map views - Synced map views
- Leaflet: Back to home button - Reset view button
- Leaflet: Contextmenu - Right-click context menu
- Leaflet: Coordinates after clicking on the map - Capture click coordinates
- Leaflet: Coordinates of the center of the visible map - Track map center in real-time
- Leaflet: Coordinates of the visible map - Get current viewport bounds
- Leaflet: Custom button - Add custom map buttons
- Leaflet: FitBounds with padding - Responsive bounds fitting
- Leaflet: Linked view - Synchronized map views
- Leaflet: Location button - Geolocation button
- Leaflet: Map rotation - Rotate with right-click drag or pinch
- Leaflet: MaxBound map restricts the view - Restrict panning to a region
- Leaflet: MiniMap plugin - Overview minimap
- Leaflet: Simple map - Minimal map setup
- Leaflet: Store locator with search - Filterable store list with category + text search
- MapLibre: Add a video - Video overlay on satellite
- MapLibre: Add support for right-to-left scripts - RTL text rendering
- MapLibre: Change a map's language - Dynamic language switch
- MapLibre: Change the default position for attribution - Attribution positioning
- MapLibre: Check if WebGL is supported - Feature detection
- MapLibre: Cooperative gestures - Multi-finger scroll zoom
- MapLibre: Create a hover effect - Hover state styling
- MapLibre: Create a time slider - Temporal data slider
- MapLibre: Disable scroll zoom - Disable wheel zoom
- MapLibre: Display a map - Basic map initialization
- MapLibre: Display a non-interactive map - Static, non-interactive map
- MapLibre: Display and style rich text labels - Rich text formatting
- MapLibre: Fit a map to a bounding box - Fit to bounds
- MapLibre: Locate the user - Geolocation
- MapLibre: Render world copies - Infinite horizontal wrap
- MapLibre: Sync movement of multiple maps - Multi-map sync
- MapLibre: Update a feature in realtime - Realtime feature updates
- MapLibre: Variable label placement - Smart label positioning
- MapLibre: Geolocation - Browser geolocation with accuracy circle and tracking
- MapLibre: Store locator - Filterable store list with category + text search
- MapLibre: Sync maps - Two maps synchronized pan/zoom/bearing
- MapLibre: Sync maps comparison - Side-by-side swipe comparison
- OpenLayers: Add a raster tile source - Raster tiles
- OpenLayers: Add a vector tile source - Vector tiles
- OpenLayers: Add a WMS source - Web Map Service
- OpenLayers: Add an image layer - Basic image overlay
- OpenLayers: Add Bing Maps tile layer - Bing Maps tiles
- OpenLayers: Animated tile layer - Tile layer sequence
- OpenLayers: Bubble layer options - All bubble layer options
- OpenLayers: Consistent zoomable heat map - Zoom-consistent radius
- OpenLayers: Create a layer control - Layer toggle control
- OpenLayers: Data-driven bubble layer styling - Magnitude-based styling
- OpenLayers: Dynamic legend and layer controls - Dynamic controls
- OpenLayers: Export Map as Image - Export map canvas as image
- OpenLayers: Heat map layer options - All heat map options
- OpenLayers: OGC map layer example - OGC WMS/WMTS overlay
- OpenLayers: PMTiles Buildings - PMTiles with Overture buildings
- OpenLayers: PMTiles layer - PMTiles single-file
- OpenLayers: PMTiles Places - PMTiles with Overture places
- OpenLayers: PMTiles Transportation - PMTiles with Overture transport
- OpenLayers: Pulse animation with bubble layer - Bubble layer pulse
- OpenLayers: Simple heat map layer - Basic heat map
- OpenLayers: Tile Layer Options - Tile layer options
- OpenLayers: Update layer based on map style - Style-driven layer updates
- OpenLayers: Video layer - Video on satellite basemap
- OpenLayers: Weighted heat map layer - Property-weighted intensity
- Leaflet: OpenLayers Leaflet options - OpenLayers tiles in Leaflet
- Leaflet: Change tile style when click - Dynamic tile style switching
- Leaflet: Control layers outside the map - External layer controls
- Leaflet: Image instead of map - Image overlay as base layer
- Leaflet: Image on map - Overlay images on the map
- Leaflet: Multiple tile layers - Switch between tile providers
- Leaflet: Render OpenLayers in Leaflet - OpenLayers raster in Leaflet
- Leaflet: Store plan - full project - OSM + image overlay combination
- Leaflet: TileLayer - Custom tile layer configuration
- Leaflet: Tiles gray - Grayscale tile style
- Leaflet: PMTiles protocol in Leaflet - PMTiles single-file archive support
- Leaflet: WMS source integration - Web Map Service tile layer
- Leaflet: Image overlay - Static image overlay with opacity control
- Leaflet: Satellite / Streets / Dark layer switcher - Toggle between basemap styles
- MapLibre: Add a canvas source - HTML canvas as source
- MapLibre: Add a COG raster source - Cloud Optimized GeoTIFF
- MapLibre: Add a custom style layer - Custom WebGL rendering
- MapLibre: Add a hillshade layer - Hillshade from DEM
- MapLibre: Add a new layer below labels - Layer ordering
- MapLibre: Add a raster tile source - Third-party raster tiles
- MapLibre: Add a stretchable image to the map - 9-slice stretchable image
- MapLibre: Add a vector tile source - Vector tile source
- MapLibre: Add a WMS source - Web Map Service
- MapLibre: Animate a series of images - Image sequence animation
- MapLibre: Change a layer's color with buttons - Button-driven color change
- MapLibre: Create a heatmap layer - Heatmap visualization
- MapLibre: Display a map with MLT - MapLibre Tiles format
- MapLibre: Display a satellite map - Satellite imagery basemap
- MapLibre: Display Map Performance Metrics - FPS and tile stats
- MapLibre: Filter within a Layer - Layer-based filtering
- MapLibre: PMTiles source and protocol - PMTiles single-file archives
- MapLibre: Use a fallback image - Error handling for tiles
- MapLibre: Image overlay - Static image overlay with opacity control
- OpenLayers: Add a symbol layer - Basic symbol layer
- OpenLayers: All built-in icon templates as HTML markers - Icon template gallery
- OpenLayers: All built-in icon templates as symbols - Built-in icon templates
- OpenLayers: Animate to new position of marker - Marker position transition
- OpenLayers: Bouncing marker animation - CSS bouncing marker
- OpenLayers: Cluster aggregate average values - Cluster aggregation
- OpenLayers: Cluster aggregates - Custom cluster properties
- OpenLayers: Clustered pie chart HTML markers - Pie chart clusters
- OpenLayers: CSS styled HTML marker - CSS-based markers
- OpenLayers: Data-driven symbol icons - Multiple custom icons
- OpenLayers: Data-driven symbol layer styling - Property-based styling
- OpenLayers: Draggable HTML marker - Draggable markers
- OpenLayers: Draggable Symbols - Draggable symbol layer
- OpenLayers: Drop markers on interval - Interval marker drops
- OpenLayers: Drop multiple markers animation - Batch marker drops
- OpenLayers: Expanding Spider Clusters - Spider cluster layout
- OpenLayers: HTML marker events - Marker event handling
- OpenLayers: HTML marker pulse animation - CSS pulse effect
- OpenLayers: HTML marker with custom SVG template - SVG template markers
- OpenLayers: Simple HTML Marker - Basic HTML marker
- OpenLayers: Simple HTML marker animation - Basic marker movement
- OpenLayers: Symbol layer options - All symbol options
- Leaflet: Add data attribute to marker - Custom data-* attributes
- Leaflet: Add, move and delete marker - Full marker CRUD operations
- Leaflet: Adding one marker - Place a single marker
- Leaflet: Awesome markers plugin - Font Awesome icon markers
- Leaflet: Center map when click marker - Pan to marker on click
- Leaflet: Checking if the marker is in viewport - Viewport-based filtering
- Leaflet: Controlling different groups of markers - Toggle marker groups
- Leaflet: Count markers - Display marker count
- Leaflet: Custom marker and popup - Styled popups with custom content
- Leaflet: Draggable markers - Drag markers to reposition
- Leaflet: Many markers - Render multiple markers
- Leaflet: Many markers (100K) with Web Worker - Web Worker + IndexedDB + RBush
- Leaflet: Marker slide to - Smooth marker transitions
- Leaflet: Markers 60K - 60K markers with canvas + clustering
- Leaflet: Open popup markercluster from outside - Trigger cluster popups externally
- Leaflet: Random marker in map bounds - Generate markers randomly
- Leaflet: SVG markers with legends - Custom SVG marker icons
- Leaflet: Text below a marker - Label markers with text
- MapLibre: Add a default marker - Basic marker
- MapLibre: Add a generated icon to the map - Runtime-generated icon
- MapLibre: Add an animated icon to the map - Canvas API animated icon
- MapLibre: Add an icon to the map - External URL icon
- MapLibre: Add custom icons with Markers - Custom marker icons
- MapLibre: Animate a marker - Marker position animation
- MapLibre: Animate symbol to follow the mouse - Mouse-following symbol
- MapLibre: Attach a popup to a marker instance - Popup bound to marker
- MapLibre: Center the map on a clicked symbol - Click-to-center
- MapLibre: Create a draggable Marker - Draggable marker
- MapLibre: Create and style clusters - Marker clustering
- MapLibre: Display a remote SVG symbol - SVG as symbol layer
- MapLibre: Display HTML clusters with custom properties - Custom cluster popups
- MapLibre: Filter layer symbols using global state - Global state filtering
- MapLibre: Filter symbols by text input - Text-based filtering
- MapLibre: Filter symbols by toggling a list - List-based filtering
- MapLibre: Generate and add a missing icon to the map - Dynamic icon generation
- OpenLayers: Accessible popups - Keyboard-accessible popups
- OpenLayers: Accessible shape selection - Keyboard selection via hidden popups
- OpenLayers: Add a popup with an image - Image in popup
- OpenLayers: All popup options - Full popup options
- OpenLayers: Auto open popup on hover - Auto-hover popup
- OpenLayers: Customize a popup - Custom popup styling
- OpenLayers: Popup events - Popup event handling
- OpenLayers: Popup templates - Popup templates from properties
- OpenLayers: Popup with DOM element content - DOM-element popup content
- OpenLayers: Popup with Media Content - Media content popups
- OpenLayers: Popups on Shapes - Popups on any shape
- OpenLayers: Popups with leader lines - Leader line popups
- OpenLayers: Reuse a popup template - Reusable popup template
- OpenLayers: Show popup on hover - Hover-triggered popup
- OpenLayers: Simple popup - Basic popup
- Leaflet: Data on sidebar - Display data in sidebar
- Leaflet: Dynamic data on sidebar - Live-updating sidebar data
- Leaflet: Follow mouse - Tooltip follows cursor
- Leaflet: Popup in a fixed position - Fixed-position popup overlay
- Leaflet: Sidebar - Sidebar component
- Leaflet: Sidebar replacing popup - Sidebar as popup alternative
- Leaflet: Tabs in popup - Tabbed popup content
- MapLibre: Display a popup - Basic popup
- MapLibre: Display a popup on click - Click-triggered popup
- MapLibre: Display a popup on hover - Hover-triggered popup
- MapLibre: Show polygon information on click - Feature info popup
- MapLibre: Popup with custom HTML layout - Rich HTML popup with tabs/media
- MapLibre: Popup with leader line - Pointer line from popup to feature
- MapLibre: Sidebar panel alongside map - Sidebar as info panel alternative
- MapLibre: Popup & tooltip - Rich popup with images and hover tooltip
- OpenLayers: Add Arrow along a Path - Arrow icons along a line
- OpenLayers: Alternate routes with deviation constraints - Alternative routes with constraints
- OpenLayers: Animate along a path - Symbol along path with controls
- OpenLayers: Animate along a route path - Timestamp-aware route animation
- OpenLayers: Animate marker along path - HTML marker path animation
- OpenLayers: Calculate a Simple Isochrone - Drive time polygon
- OpenLayers: Calculate a simple route - Basic route calculation
- OpenLayers: Calculate concentric isochrones - Concentric isochrone rings
- OpenLayers: Calculate distance - Point-to-point distance
- OpenLayers: Calculate spaced positions along route - Evenly spaced route positions
- OpenLayers: Car vs truck route comparison - Multi-modal routing
- OpenLayers: Create a measuring tool - Distance/area measurement
- OpenLayers: Draggable route lines - Interactive route editing
- OpenLayers: Filter Data Along Route - Buffer-based route filtering
- OpenLayers: Get directions - Route directions
- OpenLayers: Get route range - Isochrone polygon
- OpenLayers: Multiple routes by mode of travel - Multi-modal route tutorial
- OpenLayers: Route along GeoJSON network - Shortest path on GeoJSON network
- OpenLayers: Route Waypoint Optimization - Waypoint optimization
- OpenLayers: Search along route - Route-based POI search
- OpenLayers: Search for POIs along route - POIs along a route
- OpenLayers: Simple REST Directions - Basic directions between two points
- OpenLayers: Snap points to logical route path - Snap to road network
- Leaflet: Arrow marked lines - Directional polyline arrows
- Leaflet: Distance between cities - Distance measurement with autocomplete
- Leaflet: Leaflet Routing Machine - Turn-by-turn routing with OSRM
- Leaflet: Marker tracking with direction indicator - Real-time marker tracking
- Leaflet: Isochrone with Turf.js - Drive time polygon with Turf.js
- Leaflet: Multi-modal transit routing - Public transit routing via ORS
- MapLibre: Animate a point along a route - Turf.js route animation
- MapLibre: Hash routing - URL hash sync
- MapLibre: Measure distances - Distance measurement
- MapLibre: Turn-by-turn directions - OSRM/Mapbox Directions API
- MapLibre: Isochrone visualization - Drive time polygons with Mapbox API
- MapLibre: Multi-modal routing comparison - Car vs bike vs foot routing
- OpenLayers: Address search - Forward geocoding
- OpenLayers: Autocomplete - Address autocomplete
- OpenLayers: Autocomplete search - Search suggestions
- OpenLayers: Fill Address Form with Autocomplete - Form-filling with autocomplete
- OpenLayers: Fuzzy search - Fuzzy text search
- OpenLayers: Interactive Search Quickstart - Interactive search tutorial
- OpenLayers: Load POIs as the map moves - Dynamic POI loading
- OpenLayers: Nearby search - POI nearby search
- OpenLayers: Page through POI results - Paginated POI results
- OpenLayers: Search category - Category-based search
- OpenLayers: Search for boundaries - Administrative boundary search
- OpenLayers: Search for points of interest - POI search tutorial
- OpenLayers: Simple REST Geocoding Request - Basic geocoding
- OpenLayers: Voronoi diagram analysis - Voronoi from point set
- Leaflet: Autocomplete on map - button - Search with autocomplete
- Leaflet: Autocomplete with GeoJSON - Search within GeoJSON data
- Leaflet: Geocoding addresses (search engine outside map) - Autocomplete geocoding
- Leaflet: Multi layer search - Search across multiple layers
- Leaflet: Nominatim geocoding - OpenStreetMap geocoding
- Leaflet: Pelias geocoding - Open-source geocoder
- MapLibre: Geocode with Nominatim - OpenStreetMap geocoding
- MapLibre: Get coordinates of the mouse pointer - Mouse coordinate tracking
- MapLibre: Get features under the mouse pointer - Feature query on hover
- MapLibre: Search autocomplete with Nominatim - Autocomplete search box
- MapLibre: Filter points by search text - Client-side search filtering
- OpenLayers: Add TopoJSON data to the map - TopoJSON import
- OpenLayers: Census block group analysis - Census data spatial join
- OpenLayers: Convex hull - Convex hull computation
- OpenLayers: Extract photo location - EXIF GPS extraction
- OpenLayers: Geofence - Geofence detection
- OpenLayers: Introduction to Spatial Math - Built-in spatial math functions
- OpenLayers: Point in circle - Circle containment
- OpenLayers: Point in polygon - Polygon containment
- OpenLayers: Point in rectangle - Rectangle containment
- OpenLayers: Simple WFS example - Web Feature Service query
- OpenLayers: Spatial data gallery - Spatial data file types
- OpenLayers: Visualize Excel data - Excel file visualization
- OpenLayers: WFS service explorer - WFS explorer tool
- Leaflet: Story map with IntersectionObserver - Scroll-driven story map
- Leaflet: Buffer analysis with Turf.js - Create buffer zones around features
- Leaflet: Voronoi diagram with Turf.js - Voronoi polygons from points
- Leaflet: Point-in-polygon with Turf.js - Spatial containment test
- Leaflet: Geofencing with Turf.js - Real-time geofence monitoring
- Leaflet: Union/intersection with Turf.js - Polygon boolean operations
- Leaflet: Geofence with Turf.js - Click to test point-in-fence detection
- MapLibre: Buffer analysis with Turf.js - Create buffer zones around features
- MapLibre: Voronoi diagram with Turf.js - Voronoi polygons from points
- MapLibre: Point-in-polygon with Turf.js - Spatial containment test
- MapLibre: Union/intersection with Turf.js - Polygon boolean operations
- MapLibre: Isoline from raster-dem - Contour/isoline extraction
- MapLibre: Geofence - Interactive geofence detection using Turf.js
- OpenLayers: Animated traffic flow - Flowing dashed traffic lines
- OpenLayers: Display traffic tiles - Traffic overlay
- OpenLayers: Get traffic incidents - Incident markers
- OpenLayers: Show traffic along route - Traffic info along route
- OpenLayers: Traffic control options - Traffic toggle options
- OpenLayers: Traffic controls - Traffic toggle + legend
- OpenLayers: Traffic flow - Live traffic data
- OpenLayers: Popup & Tooltip - Rich popup with tooltip
- OpenLayers: Traffic Overlay Options - Traffic overlay options
- Leaflet: TomTom traffic tiles - Real-time traffic tile overlay
- Leaflet: HERE traffic flow layer - Traffic flow visualization
- Leaflet: Traffic incident markers - Incident data on map
- MapLibre: TomTom traffic tiles - Real-time traffic tile overlay
- MapLibre: HERE traffic flow layer - Traffic flow visualization
- MapLibre: Traffic incident markers - Incident data on map
- OpenLayers: Current Air Quality - Air Quality data via REST API
- OpenLayers: Display weather layers - Weather overlay
- OpenLayers: Forecasted Air Quality - Forecasted AQ data
- OpenLayers: Get current weather at a location - Current conditions REST API
- OpenLayers: Get weather along a route - Route weather data
- OpenLayers: Historical Weather - Historical weather REST API
- OpenLayers: Show weather overlays on a map - Radar + infrared overlays
- OpenLayers: Tropical Storm Locations - Tropical storm tracking
- Leaflet: OpenWeatherMap tile layer - Weather radar tile overlay
- Leaflet: Device orientation sensor - Compass heading from device sensors
- Leaflet: Geolocation watch position - Continuous GPS tracking
- Leaflet: Weather radar overlay - NOAA weather radar with toggle + opacity
- MapLibre: OpenWeatherMap tile layer - Weather radar tile overlay
- MapLibre: Device orientation sensor - Compass heading from device sensors
- MapLibre: Weather data as GeoJSON points - Weather station markers with data
- MapLibre: Weather radar overlay - NOAA weather radar with toggle + opacity
Turf.js is the industry standard for performing advanced geospatial analysis directly in the browser (or Node.js) without needing a backend server like PostGIS. Below are some potential, high-value examples that could be built combining Turf.js with the rendering engines (Leaflet, MapLibre, or OpenLayers):
- Concept: Track a user's live device location and trigger visual alerts or notifications when they cross boundaries.
- Turf.js Methods:
turf.booleanPointInPolygon(),turf.booleanCrosses() - Rendering: MapLibre GL JS (for smooth 60fps tracking) or OpenLayers.
- Concept: Take a massive dataset of scatter points (e.g., 50,000 taxi drop-offs) and group them into a honeycomb grid to visualize density.
- Turf.js Methods:
turf.hexGrid(),turf.collect(),turf.pointsWithinPolygon() - Rendering: Mapbox / MapLibre GL JS using data-driven styling (
fill-colorbased on count).
- Concept: When a user is drawing a custom path or placing markers, automatically snap their cursor to the nearest point on a complex pre-existing road network line.
- Turf.js Methods:
turf.nearestPointOnLine(),turf.pointToLineDistance() - Rendering: Leaflet with
Leaflet-Geomanor MapLibre withmapbox-gl-draw.
- Concept: Select a group of distributed assets (like delivery trucks or localized outbreaks) and instantly draw a boundary wrapping around them to define an active zone.
- Turf.js Methods:
turf.convex(),turf.concave(),turf.buffer() - Rendering: Leaflet or MapLibre GL JS for rendering the resulting polygon mask.
- Concept: A web-based land management tool where a user can select two adjacent property polygons to merge them into one, or draw a line through a property to split it into two distinct polygons, instantly recalculating the square footage.
- Turf.js Methods:
turf.union(),turf.intersect(),turf.area(), and line-splitting utilities. - Rendering: Any renderer, but highly dependent on good drawing controls (OpenLayers Drawing Tools or Leaflet-Geoman).
- Concept: Input a GeoJSON collection of random elevation or temperature points. Generate a topographic contour map directly in the browser.
- Turf.js Methods:
turf.tin()(Triangulated Irregular Network),turf.isobands(),turf.isolines() - Rendering: Rendered as a vector tile source in MapLibre, with 3D terrain extrusion applied to the resulting polygons for a beautiful 3D topographic view.
- Concept: A store locator that doesn't just list the nearest store, but draws a curved flight-path (great circle arc) from the user's location to the 3 closest stores.
- Turf.js Methods:
turf.nearestPoint(),turf.greatCircle(),turf.distance() - Rendering: OpenLayers or Leaflet.
While individual libraries are powerful, combining them unlocks the ability to build production-grade geographic editors, data dashboards, and storytelling experiences. Here are some potential architectures combining multiple libraries:
- Combination:
MapLibre GL JS+terra-draw+Turf.js - Concept: Build an interactive data creation tool similar to geojson.io.
- MapLibre handles the high-performance basemap.
- terra-draw provides uniform, cross-browser drawing tools for lines, polygons, and points.
- Turf.js runs real-time topology validation (e.g., preventing self-intersecting polygons using
turf.kinks) and live area calculations in the sidebar.
- Combination:
Mapbox\/MapLibre GL JS+PMTiles - Concept: Visualize millions of spatial records (e.g., nationwide building footprints or live telematics) entirely in the browser.
- PMTiles allows you to stream massive vector tile datasets directly from an S3 bucket (serverless architecture).
- MapLibre provides the underlying styled basemap and renders the dense vector geometries rapidly using WebGL.
- Combination:
MapLibre GL JS+IntersectionObserver(orScrollMagic) +D3.js - Concept: Create an immersive journalistic experience.
- As the user scrolls down an article, IntersectionObserver triggers the map camera to smoothly fly (using
map.flyTo) between different points of interest. - D3.js renders dynamic charts over the map that animate and update based on the features currently visible in the map's bounding box.
- As the user scrolls down an article, IntersectionObserver triggers the map camera to smoothly fly (using
- Combination:
OpenLayers+Socket.io+Turf.js - Concept: A logistics dashboard where vehicle positions are streamed live.
- Socket.io streams GPS telemetry to the frontend.
- OpenLayers renders the live markers and overlays live traffic incident data.
- Turf.js locally calculates distance to the nearest warehouse (
turf.distance) or detects if a truck has entered a delivery geofence (turf.booleanPointInPolygon) without requiring backend spatial queries.
- Combination:
Leaflet+Leaflet Routing Machine+GraphHopperAPI - Concept: Build a custom navigation app for specialized vehicles (e.g., bicycles, RVs).
- GraphHopper acts as the backend routing engine, calculating the fastest path considering elevation and vehicle restrictions.
- Leaflet Routing Machine provides the frontend turn-by-turn instruction UI and draggable waypoints.
- Leaflet renders the UI over top of custom OpenStreetMap tiles.
- Combination:
MapLibre GL JS+mapbox-gl-indoor - Concept: Build an interactive campus or mall directory.
- Use MapLibre to render indoor floor plans.
- Implement mapbox-gl-indoor to give users a UI widget to toggle between different floors (Level 1, Level 2, etc.).
- Clicking on a room highlights it and opens a custom pop-up to update occupancy metadata or reserve the space.
- Leaflet.markercluster - Cluster nearby markers
- Leaflet.awesome-markers - Font Awesome / Bootstrap icons
- Leaflet.fullscreen - Fullscreen control
- Leaflet.MiniMap - Overview minimap
- Leaflet.Routing.Machine - Route planning
- Leaflet-Geoman - Draw & edit geometries
- Leaflet.Marker.SlideTo - Animate marker movement
- leaflet-rotation - Map rotation
- Leaflet.heat - Heatmap layer
- Turf.js - Geospatial analysis
- Autocomplete - Search with suggestions
- RBush - Spatial index for performance
- mapbox-gl-draw - Draw & edit geometries
- terra-draw - Multi-shape drawing
- maplibre-gl-rtl-text - Right-to-left text
- Turf.js - Geospatial analysis
- PMTiles - Single-file tile archives
- OpenLayers Drawing Tools - Draw & edit geometries
- OpenLayers Spatial IO - Import KML, CSV, GeoJSON
- OpenLayers Animation - Marker & data animation
- OpenLayers Control - Core SDK with layers, controls
- OpenLayers REST API - Geocoding, routing, search, traffic
- Turf.js - Geospatial analysis
- Flowmap.gl - Flow visualization
Turf.js is the standard geospatial analysis library for JavaScript. It works standalone in Node.js or in the browser with any map renderer. Below are potential examples organized by capability, showing both Turf.js alone and combined with map libraries.
- Category - Modules
- Measurement -
area,length,distance,bearing,rhumb-distance,rhumb-bearing - Transformation -
buffer,bezier-spline,simplify,clean-coords,flip,rewind,line-offset - Comparison -
boolean-point-in-polygon,boolean-contains,boolean-crosses,boolean-disjoint,boolean-intersects,boolean-overlap,boolean-touches,boolean-within,boolean-equal,boolean-parallel,boolean-valid - Combination -
union,difference,intersect,dissolve,combine,collect,mask - Aggregation -
convex,concave,envelope,voronoi,hex-grid,point-grid,rectangle-grid - Interpolation -
interpolate,isobands,isolines,idw - Centers -
center,center-of-mass,centroid,center-mean,center-median,midpoint - Clustering -
clusters-dbscan,clusters-kmeans - Analysis -
turf-meta,quadrat-analysis,nearest-neighbor-analysis,moran-index,directional-mean,distance-weight - Nearest -
nearest-point,nearest-point-on-line,nearest-point-to-line,point-to-line-distance,point-to-polygon-distance - Selection -
points-within-polygon,tag,sample - Measurement Geometry -
along,line-chunk,line-segment,line-intersect,line-slice,line-slice-along,line-split - Measurement Polygon -
polygon-tangents,polygon-smooth,polygon-to-line,line-to-polygon,polygonize - Curves -
great-circle,line-arc,sector,circle,ellipse - Generation -
random,destination,point-on-feature,explode - Gridding -
hex-grid,point-grid,rectangle-grid
| Example | Turf.js Module(s) | Renderer | Description |
|---|---|---|---|
| Point-to-point distance | distance |
Leaflet / MapLibre / OpenLayers | Click two points, display distance in km/mi |
| Route length measurement | length |
Leaflet / MapLibre | Click along a polyline, show cumulative length |
| Bearing calculator | bearing, destination |
Leaflet | Click origin + destination, show bearing angle |
| Area calculator | area |
Any | Draw polygon, show area in m²/km²/acres |
| Distance from point to line | point-to-line-distance |
MapLibre | Drag point, show shortest distance to route |
| Distance from point to polygon | point-to-polygon-distance |
MapLibre | Drag point, show distance to nearest polygon edge |
| Midpoint finder | midpoint |
Leaflet | Click two points, place marker at midpoint |
| Example | Turf.js Module(s) | Renderer | Description |
|---|---|---|---|
| 🆕 Point buffer zone | buffer |
Leaflet / MapLibre / OpenLayers | Click point, draw radius buffer (km/mi) |
| 🆕 Dynamic radius buffer | buffer |
MapLibre | Slider to adjust buffer radius in real-time |
| 🆕 Multi-ring buffer | buffer |
Leaflet / MapLibre | Concentric rings (1km, 5km, 10km) around POI |
| 🆕 Line buffer (corridor) | buffer |
MapLibre | Buffer around a polyline route |
| 🆕 Polygon buffer (inset/outset) | buffer |
Any | Expand or shrink polygon boundary |
| 🆕 Buffer intersection | buffer, intersect |
MapLibre | Find area overlap between two buffered zones |
| 🆕 Buffer difference | buffer, difference |
MapLibre | Subtract one buffer from another |
| Example | Turf.js Module(s) | Renderer | Description |
|---|---|---|---|
| Point-in-polygon test | boolean-point-in-polygon |
Leaflet / MapLibre | Drag point, highlight containing polygon |
| Points within polygon | points-within-polygon |
Leaflet / MapLibre | Select markers inside drawn area |
| Polygon intersection | intersect |
MapLibre / OpenLayers | Draw two polygons, show overlap area |
| Polygon difference | difference |
MapLibre | Cut one polygon from another |
| Polygon union | union |
MapLibre | Merge two overlapping polygons |
| Line-polygon intersection | line-intersect, intersect |
MapLibre | Find where road crosses zone boundary |
| Boolean contains | boolean-contains |
Any | Check if polygon fully contains another |
| Boolean overlaps | boolean-overlap |
Any | Check if two polygons overlap |
| Boolean crosses | boolean-crosses |
Any | Check if line crosses polygon boundary |
| Boolean disjoint | boolean-disjoint |
Any | Check if two features don't touch |
| Example | Turf.js Module(s) | Renderer | Description |
|---|---|---|---|
| Voronoi diagram from points | voronoi |
MapLibre / Leaflet | Generate service areas from store locations |
| Point grid sampling | point-grid, tag |
MapLibre | Grid of sample points, tag with polygon properties |
| Rectangle grid analysis | rectangle-grid |
Leaflet / MapLibre | Overlay grid, aggregate data per cell |
| Concave hull from points | concave |
MapLibre | Draw boundary around cluster of points |
| Convex hull from points | convex |
Leaflet / MapLibre / OpenLayers | Enclose points in smallest convex polygon |
| Envelope bounding box | envelope |
Any | Draw bounding box around feature collection |
| Dissolve adjacent polygons | dissolve |
MapLibre | Merge touching polygons into single feature |
| Polygon mask | mask |
MapLibre | Invert polygon to create mask overlay |
| Example | Turf.js Module(s) | Renderer | Description |
|---|---|---|---|
| Isoline contours | isolines |
MapLibre / OpenLayers | Elevation contour lines from point data |
| Isoband filled contours | isobands |
MapLibre / OpenLayers | Filled elevation/temperature bands |
| Nearest neighbor analysis | nearest-neighbor-analysis |
Any | Statistical analysis of point distribution |
| Moran's I spatial autocorrelation | moran-index |
Any | Detect clustering patterns in data |
| Quadrat analysis | quadrat-analysis |
MapLibre | Grid-based density analysis |
| Example | Turf.js Module(s) | Renderer | Description |
|---|---|---|---|
| K-Means clustering | clusters-kmeans |
Leaflet / MapLibre | Group points into k clusters |
| DBSCAN clustering | clusters-dbscan |
Leaflet / MapLibre | Density-based spatial clustering |
| Cluster with heatmap | clusters-kmeans |
MapLibre + heatmap layer | Cluster points, show as heatmap |
| Cluster with choropleth | clusters-kmeans, convex |
MapLibre | Cluster points, draw hull per cluster |
| Weighted center median | center-median |
MapLibre | Find optimal facility location |
| Directional mean | directional-mean |
MapLibre | Show average direction of line features |
| Example | Turf.js Module(s) | Renderer | Description |
|---|---|---|---|
| Points along route | along |
Leaflet / MapLibre | Place markers at equal intervals along path |
| Route segment extraction | line-slice-along |
MapLibre | Extract portion of route between distances |
| Route splitting | line-split |
MapLibre | Split route at intersection point |
| Route chunks | line-chunk |
MapLibre | Divide route into equal-length segments |
| Nearest point on route | nearest-point-on-line |
Leaflet / MapLibre | Snap location to nearest point on road |
| Route waypoints from polygon | tag, points-within-polygon |
MapLibre | Find all waypoints inside service zone |
| NECT Route corridor | buffer, line-to-polygon |
MapLibre | Create corridor polygon around route |
| Shortest path | shortest-path |
MapLibre | Path between two points avoiding obstacles |
| Example | Turf.js Module(s) | Renderer | Description |
|---|---|---|---|
| Geofence alert system | boolean-point-in-polygon |
Leaflet / MapLibre | Monitor device location against zone |
| Nearest POI finder | nearest-point |
Leaflet / MapLibre | Find closest marker to user location |
| Proximity alert circles | circle, boolean-intersects |
MapLibre | Alert when points enter radius |
| Service area analysis | buffer, intersect |
MapLibre | Overlap of multiple service radii |
| Drive time polygon | boolean-point-in-polygon + OSRM |
MapLibre | Isochrone from routing API + Turf filter |
| Facility location optimizer | center-median, distance |
MapLibre | Find optimal site using weighted median |
| Example | Turf.js Module(s) | Renderer | Description |
|---|---|---|---|
| Bezier spline curves | bezier-spline |
Leaflet / MapLibre | Smooth curves through waypoints |
| Circle generation | circle |
Leaflet / MapLibre / OpenLayers | Generate circle polygon from center + radius |
| Ellipse generation | ellipse |
MapLibre | Draw ellipse from center + axes + rotation |
| Sector generation | sector |
MapLibre | Draw pie/wedge shape |
| Polygon smoothing | polygon-smooth |
MapLibre | Smooth jagged polygon boundaries |
| Polygon simplification | simplify |
Any | Reduce polygon vertex count |
| Coordinate cleanup | clean-coords |
Any | Remove duplicate vertices |
| Polygon tangent lines | polygon-tangents |
MapLibre | Tangent lines from point to polygon |
| Line offset | line-offset |
Leaflet / MapLibre | Create parallel offset line |
| Line to polygon | line-to-polygon |
MapLibre | Convert closed line to polygon |
| Polygon to line | polygon-to-line |
MapLibre | Extract polygon boundary as line |
| Polygonize from lines | polygonize |
MapLibre | Create polygons from intersecting lines |
| Explode multi-geometry | explode |
Any | Split MultiPolygon into individual polygons |
| Random point generation | random |
Leaflet / MapLibre | Generate random points within bounds |
| Random polygon generation | random |
MapLibre | Generate random polygon features |
| Destination point | destination |
Leaflet / MapLibre | Calculate point at bearing + distance |
| Example | Turf.js Module(s) | Renderer | Description |
|---|---|---|---|
| Line intersection finder | line-intersect |
Leaflet / MapLibre | Find all crossing points of two lines |
| Line segment extraction | line-segment |
MapLibre | Extract individual segments from polyline |
| Line overlap detection | line-overlap |
MapLibre | Find shared segments between two lines |
| Kink detection | kinks |
MapLibre | Find self-intersections in polygon |
| Directional mean lines | directional-mean |
MapLibre | Show average orientation of line set |
| Point on line test | boolean-point-on-line |
Any | Check if point lies exactly on line |
| Point on feature | point-on-feature |
Any | Snap point to nearest feature |
| Example | Turf.js Modules | Renderer | Description |
|---|---|---|---|
| Service area comparison | buffer, intersect, area |
MapLibre | Compare overlapping service areas |
| Delivery zone optimizer | voronoi, intersect, area |
MapLibre | Optimize delivery boundaries |
| Catchment area analysis | buffer, dissolve, area |
MapLibre | Merge buffers, calculate total coverage |
| Route impact assessment | buffer, intersect, tag |
MapLibre | Find features affected by route corridor |
| Spatial join visualization | tag, collect, clusters-kmeans |
Leaflet / MapLibre | Join datasets, cluster, visualize |
| Isochrone from routing + Turf | boolean-point-in-polygon, buffer |
MapLibre | Filter route data by time polygon |
| Heatmap from hex grid | hex-grid, points-within-polygon, collect |
MapLibre + heatmap | Aggregate points into hex cells, show density |
| Land use classifier | intersect, area, dissolve |
MapLibre | Classify zones by area overlap |
| Market area analysis | voronoi, convex, nearest-point |
MapLibre | Service area per store, nearest store lookup |
| Route optimization visualization | along, nearest-point-on-line, buffer |
MapLibre | Show stops along route with service radius |
| Flood zone analysis | isobands, intersect, dissolve |
MapLibre / OpenLayers | Overlay elevation bands with property zones |
- Example: Turf.js Modules - Description
- GeoJSON data validator:
boolean-valid,kinks,clean-coords- Validate and clean GeoJSON features - Batch distance calculator:
distance,bearing,length- Process CSV of coordinates, output distances - Spatial statistics report:
moran-index,nearest-neighbor-analysis,quadrat-analysis- Generate spatial analysis report - GeoJSON optimizer:
simplify,clean-coords,rewind- Reduce file size, fix winding order - Coordinate converter:
projection- Convert between projections - Grid generator:
hex-grid,point-grid,rectangle-grid- Generate grids for analysis or sampling - Random test data generator:
random- Generate random points/polygons for testing - Polygon area calculator:
area- Batch calculate areas of GeoJSON polygons - Line length calculator:
length- Batch calculate lengths of GeoJSON lines - Point classifier:
boolean-point-in-polygon,tag- Classify points by containing polygon
Real-world interactive map applications rarely use a single library. Below are potential examples combining multiple packages into full-featured interfaces, editors, and creation tools.
- Renderer: Map rendering library (Leaflet, MapLibre, OpenLayers, OpenLayers)
- Analysis: Turf.js, D3-geo, deck.gl (non-3D layers)
- Drawing: Leaflet-Geoman, mapbox-gl-draw, terra-draw
- Data: PMTiles, Martin, GeoServer, PostGIS
| Example | Libraries | Description |
|---|---|---|
| 🆕 Full geo editor (create/edit/export) | Leaflet + Leaflet-Geoman + Turf.js + shpwrite | Draw, edit, validate, export to GeoJSON/Shapefile/KML |
| 🆕 Vector tile editor | MapLibre + mapbox-gl-draw + Turf.js | Edit features on vector tile basemap |
| 🆕 Multi-format editor | MapLibre + terra-draw + Turf.js + togeojson | Import KML/GPX, edit, export GeoJSON |
| 🆕 CAD-like map editor | OpenLayers + Turf.js + OpenLayers Draw | Precision drawing with coordinate input |
| 🆕 Collaborative geo editor | MapLibre + terra-draw + Yjs + WebSocket | Real-time collaborative editing |
| 🆕 Satellite imagery digitizer | MapLibre + mapbox-gl-draw + Turf.js + COG raster | Trace features on satellite imagery |
| 🆕 Building footprint editor | MapLibre + mapbox-gl-draw + Turf.js | Edit OSM building polygons with snap-to-grid |
| 🆕 Road network editor | MapLibre + mapbox-gl-draw + OSRM | Edit road network, recompute routing graph |
| Example | Libraries | Description |
|---|---|---|
| 🆕 Vector tile data viz | MapLibre + PMTiles + Martin + PostGIS | Self-hosted vector tile pipeline |
| Example | Libraries | Description |
|---|---|---|
| 🆕 Scroll-driven story map | MapLibre + IntersectionObserver + Turf.js | Fly-to on scroll, data updates |
| 🆕 Guided tour map | MapLibre + Shepherd.js + Turf.js | Step-by-step guided exploration |
| 🆕 Photo essay on map | Leaflet + Lightbox + Turf.js | Geo-tagged photo narrative |
| Example | Libraries | Description |
|---|---|---|
| 🆕 Buffer/intersect tool | MapLibre + Leaflet-Geoman + Turf.js | Create buffers, find intersections |
| 🆕 Voronoi service area tool | MapLibre + Turf.js (voronoi, convex, area) | Generate service areas from points |
| 🆕 Route impact analyzer | MapLibre + Turf.js (buffer, intersect, tag) + OSRM | Find features affected by route |
| 🆕 Coverage gap finder | MapLibre + Turf.js (hex-grid, boolean-point-in-polygon) | Find unserved areas |
| 🆕 Isochrone builder | MapLibre + Valhalla/OSRM + Turf.js (boolean-point-in-polygon) | Drive-time polygons |
| 🆕 Spatial join tool | MapLibre + Turf.js (tag, collect, points-within-polygon) | Join datasets spatially |
| 🆕 Elevation profile tool | MapLibre + Turf.js (along, destination) + DEM tiles | Cross-section elevation along route |
| 🆕 Geofence builder | MapLibre + terra-draw + Turf.js (boolean-point-in-polygon) | Create and test geofences |
| Example | Libraries | Description |
|---|---|---|
| 🆕 GPS trace replay | MapLibre + Leaflet.Marker.SlideTo + Turf.js (along) | Animate historical GPS trace |
| 🆕 Weather radar overlay | MapLibre + OpenWeatherMap tiles + Turf.js | Live weather + spatial filtering |
| 🆕 Traffic flow monitor | MapLibre + TomTom tiles + Turf.js (buffer) | Traffic + incident proximity alerts |
| 🆕 Earthquake monitor | MapLibre + USGS feed + Turf.js (buffer) | Real-time seismic activity |
| Example | Libraries | Description |
|---|---|---|
| 🆕 Offline-first map app | MapLibre + PMTiles + Service Worker + IndexedDB | Full offline vector map |
| 🆕 Field data collector | Leaflet + Leaflet.Offline + Turf.js + IndexedDB | Collect points offline, sync later |
| 🆕 Offline routing app | MapLibre + Valhalla (WASM) + PMTiles | Turn-by-turn without internet |
| 🆕 Offline geofencing | MapLibre + Turf.js (boolean-point-in-polygon) + Service Worker | Geofence alerts offline |
| 🆕 Cached tile manager | MapLibre + Cache API + PMTiles | Intelligent tile caching |
| 🆕 Offline survey tool | Leaflet + Leaflet-Geoman + Turf.js + IndexedDB | Survey form + geometry collection offline |
| Example | Libraries | Description |
|---|---|---|
| 🆕 Map PDF exporter | MapLibre + jsPDF + canvas.toBlob | Export current view as PDF |
| 🆕 High-res map image | MapLibre + html2canvas + Turf.js | Print-quality map export |
| 🆕 GeoJSON report generator | MapLibre + Turf.js + pdfmake | Generate PDF report with map + analysis |
| 🆕 Shapefile exporter | MapLibre + shpwrite + Turf.js | Export drawn features as Shapefile |
| 🆕 KML/GPX exporter | MapLibre + tokml + Turf.js | Export to Google Earth format |
| 🆕 Map series generator | MapLibre + Puppeteer + Turf.js | Batch generate maps for multiple regions |
| Example | Libraries | Description |
|---|---|---|
| 🆕 Convex hull computation | Turf.js (convex) | Smallest convex polygon enclosing points |
| 🆕 Concave hull computation | Turf.js (concave) | Tight-fitting boundary around point clusters |
| 🆕 Voronoi diagram generation | Turf.js (voronoi) | Service areas from seed points |
| 🆕 Delaunay triangulation | Turf.js (voronoi dual) | Triangulate point sets for mesh generation |
| 🆕 Hex grid tessellation | Turf.js (hex-grid) | Generate hexagonal bins for analysis |
| 🆕 Point grid sampling | Turf.js (point-grid) | Regular grid of sample points |
| 🆕 Rectangle grid overlay | Turf.js (rectangle-grid) | Grid cells for spatial aggregation |
| 🆕 K-Means spatial clustering | Turf.js (clusters-kmeans) | Partition points into k groups |
| 🆕 DBSCAN density clustering | Turf.js (clusters-dbscan) | Density-based spatial clustering |
| 🆕 Nearest neighbor analysis | Turf.js (nearest-neighbor-analysis) | Clark-Evans index of point pattern |
| 🆕 Moran's I autocorrelation | Turf.js (moran-index) | Spatial autocorrelation statistic |
| 🆕 Quadrat analysis | Turf.js (quadrat-analysis) | Grid-based density distribution test |
| 🆕 Directional mean | Turf.js (directional-mean) | Average orientation of line features |
| 🆕 Distance weight matrix | Turf.js (distance-weight) | Spatial weight matrix from distances |
| 🆕 IDW interpolation | Turf.js (interpolate) | Inverse distance weighted surface |
| 🆕 Isoline contour generation | Turf.js (isolines) | Contour lines from point values |
| 🆕 Isoband generation | Turf.js (isobands) | Filled contour bands from point values |
| 🆕 Buffer zone generation | Turf.js (buffer) | Proximity zones around features |
| 🆕 Multi-ring buffer | Turf.js (buffer x3) | Concentric proximity rings |
| 🆕 Polygon union | Turf.js (union) | Merge overlapping polygons |
| 🆕 Polygon difference | Turf.js (difference) | Subtract one polygon from another |
| 🆕 Polygon intersection | Turf.js (intersect) | Find overlapping area |
| 🆕 Polygon dissolve | Turf.js (dissolve) | Merge touching polygons |
| 🆕 Polygon mask | Turf.js (mask) | Invert polygon for exclusion zone |
| 🆕 Centroid computation | Turf.js (centroid, center-of-mass) | Geometric center of features |
| 🆕 Weighted center median | Turf.js (center-median) | Optimal facility location |
| 🆕 Center of mean position | Turf.js (center-mean) | Average coordinate position |
| 🆕 Midpoint calculation | Turf.js (midpoint) | Exact midpoint between two points |
| 🆕 Point-on-line snapping | Turf.js (nearest-point-on-line) | Snap point to nearest line position |
| 🆕 Line intersection detection | Turf.js (line-intersect) | Find all crossing points |
| 🆕 Self-intersection detection | Turf.js (kinks) | Find polygon/line self-crossings |
| 🆕 Polygon area calculation | Turf.js (area) | Geodesic area in square meters |
| 🆕 Line length calculation | Turf.js (length) | Geodesic length in meters/km |
| 🆕 Distance matrix | Turf.js (distance) | Pairwise distance between all points |
| 🆕 Bearing calculation | Turf.js (bearing) | Initial bearing between two points |
| 🆕 Destination point | Turf.js (destination) | Point at bearing + distance |
| 🆕 Great circle path | Turf.js (great-circle) | Shortest path on sphere |
| 🆕 Rhumb line path | Turf.js (rhumb-*) | Constant bearing path |
| 🆕 Polygon simplification | Turf.js (simplify) | Douglas-Peucker vertex reduction |
| 🆕 Coordinate cleanup | Turf.js (clean-coords) | Remove duplicate vertices |
| 🆕 Winding order correction | Turf.js (rewind) | Fix polygon winding for rendering |
| 🆕 Point-in-polygon test | Turf.js (boolean-point-in-polygon) | Ray casting containment test |
| 🆕 Point-on-line test | Turf.js (boolean-point-on-line) | Check if point lies on line |
| 🆕 Boolean contains | Turf.js (boolean-contains) | Full containment test |
| 🆕 Boolean overlaps | Turf.js (boolean-overlap) | Partial overlap test |
| 🆕 Boolean crosses | Turf.js (boolean-crosses) | Line-polygon crossing test |
| 🆕 Boolean disjoint | Turf.js (boolean-disjoint) | No-contact test |
| 🆕 Boolean touches | Turf.js (boolean-touches) | Boundary contact test |
| 🆕 Boolean parallel | Turf.js (boolean-parallel) | Line parallelism test |
| 🆕 Spatial join | Turf.js (tag, collect, points-within-polygon) | Join datasets by spatial relationship |
| 🆕 Nearest feature lookup | Turf.js (nearest-point) | Find closest feature to query point |
| 🆕 Point-to-line distance | Turf.js (point-to-line-distance) | Shortest distance to line |
| 🆕 Point-to-polygon distance | Turf.js (point-to-polygon-distance) | Shortest distance to polygon edge |
| 🆕 Route distance calculation | Turf.js (along, length) | Cumulative distance along polyline |
| 🆕 Route segment extraction | Turf.js (line-slice-along) | Extract portion between distances |
| 🆕 Route splitting at point | Turf.js (line-split) | Divide line at intersection |
| 🆕 Equal-interval sampling | Turf.js (line-chunk) | Divide line into equal segments |
| 🆕 Bezier spline smoothing | Turf.js (bezier-spline) | Smooth curve through waypoints |
| 🆕 Polygon smoothing | Turf.js (polygon-smooth) | Smooth jagged polygon edges |
| 🆕 Line offset (parallel) | Turf.js (line-offset) | Create parallel offset line |
| 🆕 Line-to-polygon conversion | Turf.js (line-to-polygon) | Close line into polygon |
| 🆕 Polygon-to-line extraction | Turf.js (polygon-to-line) | Extract boundary as line |
| 🆕 Polygonize from lines | Turf.js (polygonize) | Create polygons from line network |
| 🆕 Explode multi-geometry | Turf.js (explode) | Split MultiPolygon into parts |
| 🆕 Random point generation | Turf.js (random) | Random points within bounds |
| 🆕 Random polygon generation | Turf.js (random) | Random polygon features |
| 🆕 Envelope bounding box | Turf.js (envelope) | Bounding box of feature collection |
| 🆕 Bounding box | Turf.js (bbox) | [minX, minY, maxX, maxY] |
| 🆕 Sector generation | Turf.js (sector) | Pie/wedge shape from center |
| 🆕 Circle polygon generation | Turf.js (circle) | Circle from center + radius |
| 🆕 Ellipse generation | Turf.js (ellipse) | Ellipse from center + axes |
| 🆕 Line arc generation | Turf.js (line-arc) | Arc segment from center + angles |
| 🆕 Tangent lines to polygon | Turf.js (polygon-tangents) | Tangent lines from external point |
| 🆕 Point on surface | Turf.js (point-on-feature) | Guaranteed interior point |
| 🆕 Sample random subset | Turf.js (sample) | Random sample of feature collection |
| 🆕 Planar interpolation | Turf.js (planepoint) | Bilinear interpolation on grid |
| 🆕 Area-weighted interpolation | Turf.js (tobler/Python) | Transfer values between zones |
| 🆕 GeoJSON validation | Turf.js (boolean-valid) | Check geometry validity |
| 🆕 Coordinate projection | Turf.js (projection) | Convert lat/lng to flat plane |
| 🆕 Coordinate flip | Turf.js (flip) | Swap lat/lng coordinates |
| 🆕 Feature cloning | Turf.js (clone) | Deep copy GeoJSON feature |
| Example | Libraries | Description |
|---|---|---|
| 🆕 GeoJSON processor | Turf.js + Node.js + fs | Batch process/transform GeoJSON files |
| 🆕 OSM data extractor | osmium + Turf.js (Node) | Extract features within bounding box |
| 🆕 Shapefile to PMTiles | shpjoin + pmtiles + Node.js | Convert Shapefiles to cloud-native tiles |
| 🆕 CSV to GeoJSON mapper | Turf.js + Papa Parse + Node.js | Geocode CSV, output GeoJSON |
| 🆕 Spatial ETL pipeline | Node.js + Turf.js + GDAL (ogr2ogr) + Martin | Import, transform, serve tiles |
| 🆕 PostGIS tile generator | PostGIS + Martin + TileServer GL | Database to vector tiles |
| 🆕 GeoParquet processor | DuckDB + GeoParquet + Turf.js | Query large geospatial datasets |
| Example | Libraries | Description |
|---|---|---|
| 🆕 Generative map art | MapLibre + D3-geo + Turf.js + Canvas API | Algorithmic map patterns |
| 🆕 Sound map | MapLibre + Tone.js + Turf.js | Audio visualization on map |
| 🆕 Maze generator on map | MapLibre + Terra-draw + Turf.js | Generate and solve mazes from streets |
| 🆕 Timezone visualizer | MapLibre + D3-geo + Turf.js | Interactive timezone boundaries |
| 🆕 Compass rose generator | MapLibre + Turf.js (bearing, destination) + SVG | Beautiful compass overlays |
| 🆕 Historical map overlay | MapLibre + Mapbox Compare + Old Maps API | Compare historical vs modern maps |
| 🆕 Minimap + main map sync | Leaflet + Leaflet.MiniMap + Turf.js | Synchronized dual-map views |
| Combination | Use Case |
|---|---|
| MapLibre + Turf.js + terra-draw | Geometry editor with spatial analysis |
| Leaflet + Leaflet-Geoman + Turf.js | Lightweight geo editor |
| MapLibre + Turf.js (voronoi + convex) | Service area computation |
| MapLibre + Turf.js (hex-grid + collect) | Hex binning and aggregation |
| MapLibre + Turf.js (buffer + intersect) | Proximity and overlap analysis |
| MapLibre + OSRM + Turf.js | Routing + spatial analysis |
| MapLibre + Turf.js (clusters-kmeans) | Point clustering analysis |
| MapLibre + Turf.js (isobands + isolines) | Elevation/temperature contours |
| MapLibre + PMTiles + Martin + PostGIS | Self-hosted vector tile stack |
| MapLibre + Yjs + WebSocket | Collaborative real-time editing |
| MapLibre + Service Worker + IndexedDB | Offline-first map app |
| MapLibre + jsPDF + canvas | Print/export workflow |
| MapLibre + Kepler.gl | Exploratory data analysis |
| Node.js + Turf.js + GDAL + Martin | Server-side ETL pipeline |
| PostGIS + Martin + TileServer GL | Database to vector tiles |
The following OpenLayers examples were inspired by existing Leaflet examples. All 6 examples are now implemented in openlayers-implementation/.
- ✅ Layer Toggle (layer-toggle.html) — A classic Leaflet
L.control.layersstyle control to dynamically switch between base raster layers (e.g., Street, Satellite, Dark mode). - ✅ Sync Maps Comparison (sync-maps-comparison.html) — A split-screen slider (swipe control) to compare two different map layers side-by-side simultaneously.
- ✅ Sync Maps (sync-maps.html) — Two separate map DOM elements placed side-by-side whose panning and zooming are perfectly synchronized.
- ✅ Fly-To Animation (fly-to-animation.html) — Emulate Leaflet's beautiful
map.flyTo()method, combining zooming and panning into a smooth, curved parabolic flight path. - ✅ Mouse Follow (mouse-follow.html) — An interactive marker or overlay that constantly updates its position to follow the user's cursor across the map.
- ✅ Popup & Tooltip (popup-tooltip.html) — Replicate Leaflet's rich popup (clickable) and tooltip (hoverable) behaviors bound directly to vector features.
The following Leaflet examples are inspired by powerful features found in OpenLayers. These represent advanced GIS use-cases that would make excellent additions to the Leaflet collection!
- 🔴 Custom Controls (custom-controls.html) — Build external HTML UI elements (like floating toolbars) that programmatically drive the map view and interact with map features.
- 🔴 Mini Map (minimap.html) — Create a small overview map in the corner that perfectly tracks the viewport bounds of the main map to help with orientation.
- 🟡 Geofence (geofence.html) — Implement an interactive geofencing system that detects and alerts when a movable marker crosses a predefined polygon boundary.
- 🟡 Store Locator (store-locator.html) — Build a classic store locator layout featuring a scrolling sidebar list of locations that dynamically interact with markers on the map.
- 🟡 Weather Mapping (weather.html) — Overlay real-time weather or radar tile layers over the base map to visualize meteorological data.
- 🟢 Image Overlay (image-overlay.html) — Perfectly stretch and lock a static image (like a historical map or floor plan) over a specific set of geographical coordinate bounds.
- 🟢 Polygon Extrusion (3D) (polygon-extrusion.html) — While Leaflet is strictly 2D, this challenges you to use faux-3D plugins (like
leaflet-polygon-fillPattern) or CSS tricks to simulate 3D building height data.
The following OpenLayers examples are inspired by existing MapLibre GL JS examples. These are fantastic opportunities for contribution to achieve full feature parity across the repository!
- 🔴 3D Building (3d-building.html) — Extrude polygon features with height based on data properties to create a 3D city view.
- 🔴 Marker Clustering (cluster-markers.html) — Use Supercluster or native source clustering to group dense point data dynamically based on zoom level.
- 🔴 Geocoding Search (geocoding.html) — Add a search box that queries the Nominatim API and flies the camera to the selected location.
- 🟡 Animate Line (animate-line.html) — Progressively draw a GeoJSON LineString to simulate movement or route progress over time.
- 🟡 Hover Effect (hover-effect.html) — Dynamically update feature styling or highlight polygons instantly when the mouse cursor enters them.
- 🟡 GeoJSON Upload (geojson-upload.html) — Allow users to drag and drop or upload local GeoJSON files and render them client-side.
- 🟡 External Layer Control (external-layer-control.html) — Build a custom HTML UI outside the map canvas to toggle map layers on and off.
- 🟡 Satellite Map (satellite-map.html) — Add a raster satellite imagery base layer (e.g., from Esri or Mapbox) underneath vector data.
- 🟢 Realtime Data (realtime-data.html) — Connect to a live GeoJSON stream (like the ISS tracker or live transit) and update marker positions using
requestAnimationFrame. - 🟢 Time Slider (time-slider.html) — Filter temporal earthquake or historical data using a custom HTML range slider linked to map styling.
All examples below have been implemented in maplibre-implementation/.
- ✅ Context Menu (context-menu.html) — Right-click context menu with zoom and marker actions
- ✅ Custom Controls (custom-controls.html) — Custom rotate-north button
- ✅ Mini Map (minimap.html) — Small overview map synced to the main view
- ✅ Scale Bar (scale-bar.html) — Metric scale bar overlay
- ✅ Geofence (geofence.html) — Interactive geofence detection with Turf.js
- ✅ Store Locator (store-locator.html) — Filterable store list with category search
- ✅ WASD Navigation (wasd-navigation.html) — Game-like keyboard navigation
- ✅ Weather Mapping (weather.html) — NOAA weather radar overlay with opacity toggle
- ✅ Image Overlay (image-overlay.html) — Static image overlay with opacity control
- ✅ Sync Maps (sync-maps.html) — Two maps with synchronized pan/zoom/bearing
- ✅ Sync Maps Comparison (sync-maps-comparison.html) — Side-by-side swipe comparison
- ✅ Popup & Tooltip (popup-tooltip.html) — Rich popup with images and hover tooltip
- ✅ Geolocation (geolocation.html) — Browser geolocation with accuracy tracking
- Drawing toolbar options : Toolbar options
- Drawing tools events : Drawing events
- Drop markers on interval : Interval marker drops
- Drop multiple markers animation : Batch marker drops
- Dynamic legend and layer controls : Dynamic controls
- Fill Address Form with Autocomplete : Form-filling with autocomplete
- Forecasted Air Quality : Forecasted AQ data
- Geofence : Geofence detection
- Get current weather at a location : Current conditions REST API
- Get drawn shapes from drawing manager : Export drawn shapes
- Get map camera details : Camera state access
- HTML marker pulse animation : CSS pulse effect
- HTML marker with custom SVG template : SVG template markers
- Heat map data viz : Heat map for density visualization
- Heat map layer options : All heat map options
- Introduction to Spatial Math : Built-in spatial math functions
- Limit Map to Two Finger Panning : Mobile-friendly panning
- Limit map view with maxBounds : Restrict map view
- Load POIs as the map moves : Dynamic POI loading
- Load data into drawing manager : Programmatic loading
- Load large shapefiles with Web Worker : Worker-based shapefile loading
- Load shapefiles onto the map : Basic shapefile loading
- Map user interaction options : User interaction options
- Merge two polygons together : Polygon union
- Morph shape animation : Geometry morphing
- Multiple routes by mode of travel : Multi-modal route tutorial
- OGC map layer example : OGC WMS/WMTS overlay
- Page through POI results : Paginated POI results
- Polygon extrusion layer options : Extrusion options
- Popup with DOM element content : DOM-element popup content
- Pulse animation with bubble layer : Bubble layer pulse
- Read and write Well Known Text : WKT as GeoJSON
- Search for POIs along route : POIs along a route
- Search for points of interest : POI search tutorial
- Select data in drawn polygon area : Area selection
- Show weather overlays on a map : Radar + infrared overlays
- Simple Cardinal Spline : Simple cardinal spline
- Simple HTML marker animation : Basic marker movement
- Simple MultiPolygon : Render a MultiPolygon
- Simple REST Geocoding Request : Basic geocoding
- Simple Store Locator : Store locator tutorial
- Simple WFS example : Web Feature Service query
- Simple heat map layer : Basic heat map
- Snap drawn line to roads : Road snapping
- Snap points to logical route path : Snap to road network
- Spyglass module options : Spyglass options
- Swipe between two maps : Side-by-side map comparison
- Swipe map with fullscreen support : Swipe with fullscreen
- Update layer based on map style : Style-driven layer updates
- WFS service explorer : WFS explorer tool
- Weighted heat map layer : Property-weighted intensity
Contributions welcome! Feel free to open an issue or submit a pull request. When adding examples, aim to balance coverage across all three libraries within each category. Look for markers to find gaps you can fill.