microMap.js Small maps. Your rules.
A project by Simon Waldherr · MIT licensed

JavaScript maps. A small core with optional modules.

A dependency-free JavaScript map engine for exploring spatial data, routing and scenarios. Start with the raster core and add vector tiles, GeoJSON or UI controls as needed.

12.6 kBraster core · gzip
56.3 kBcore + MVT · gzip
Your tile sourceMIT · zero runtime dependencies
More sources in the vector tester

Get started

One file to start.
Add only what you need.

Drop the core into your page and choose your tile source. Add-ons can come later, without a bundler or rebuild.

index.html · raster map
<div id="map" style="height: 400px"></div>
<script src="lib/microMap.min.js"></script>
<script>
  microMap('#map', {
    tiles: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
    attribution: '© OpenStreetMap contributors', zoom: 12
  });
</script>
Raster coreRaster tiles and camera12.6 kB
Core + MVTVector tiles and styles56.3 kB

Data, small tools and practical questions

I'm . My work spans data analysis, web development and volunteer firefighting. microMap brings those interests together in a small, inspectable map engine. These examples are a good place to explore it.

Explore data on a map

Filter weighted observations over time, inspect features and compare how a dataset changes.

Explore the heatmap →

Ask routing questions

Compare travel modes, close a road and see how routes and reachable areas change on a local graph.

Try the routing experiment →

Replay a scenario

Move through a timeline, follow simulated units and inject exercise events. An illustrative training demo.

Open the scenario timeline →

See the core API and limitations, module examples and browser playground. Test rendering and performance with your own data and devices.

A small core, optional capabilities

Every capability is an opt-in file. A store locator loads the core and the UI add-on; a full basemap adds the vector renderer. You only ship what you use.

Raster slippy map

Drag, pinch, wheel, keyboard, inertia, bearing and pitch, bounds, zoom snapping and a context menu in the raster core.

Vector tiles

A typed-array MVT decoder in a Web Worker, per-tile style buckets and cached Path2D geometry on Canvas 2D.

MapLibre Style v8 subset

Load selected style.json layers and expressions, with filters, zoom functions, symbol placement and MapLibre zoom semantics.

Building extrusions

fill-extrusion features with cross-tile depth sorting, lighting and picking, drawn with the affine camera.

Markers, popups & controls

MapLibre- and Leaflet-shaped markers, popups and tooltips, plus navigation, scale, geolocation and attribution controls.

GeoJSON & overlays

Dynamic routes, tracks and areas; optional field annotations; extra XYZ/WMS and aerial imagery.

Camera animations

flyTo, easeTo, jumpTo and fitBounds with padding, respecting prefers-reduced-motion.

Queries & layer events

queryRenderedFeatures, click/mouseenter per layer and cursor handling, in MapLibre's event shapes.

Interaction and resource limits

Keyboard and screen-reader support, bounded caches, navigation-aware tile preloading and a device-pixel-ratio cap.

Choose the features you need

Every map needs the core; add only the files for features you use. Each card names its required files and the total size for that combination.

1. Core — required for every map

Raster map, camera gestures, keyboard controls, basic markers and local feature search.

microMap.min.js
Core size · minified + gzip12.6 kB

Vector maps & styles

MVT tiles, light/dark starter palettes, custom colors, a MapLibre Style subset, sprites, patterns, clustering and feature state.

Add this filemicroMap.vector.min.js
+43.4 kB · total with core56.3 kB

Markers, popups & controls

Draggable markers, popups, tooltips and controls with CSS theme variables.

Add this filemicroMap.ui.min.js
+13.5 kB · total with core26.2 kB

Dynamic GeoJSON

Draw and update application data such as routes, areas and points.

Add this filemicroMap.geojson.min.js
+8.2 kB · total with core20.8 kB

Map annotations

Add and edit points, lines or areas. Undo changes and exchange GeoJSON.

Requires core + GeoJSON, then addmicroMap.field.min.js
+2.6 kB · total for all three23.4 kB

Map measurements

Measure air distance, circles and areas, or a shortest path in your graph.

Requires core + GeoJSON, then addmicroMap.measure.min.js
+3.8 kB · total for all three24.6 kB

GeoJSON inspection

Find malformed coordinates, rings and oversized imports before loading data.

Add this file to an upload workflowmicroMap.inspect.min.js
+1.7 kB · total with core14.4 kB

Weighted heatmaps

Explore point density with weights and an optional time filter.

Add this filemicroMap.heatmap.min.js
+2.5 kB · total with core15.2 kB

Scenario timelines

Replay time-based entities and events for simulations, games, logistics and training.

Add this filemicroMap.scenario.min.js
+3.2 kB · total with core15.8 kB

Network routing

Find weighted routes and reachable areas with access modes and closures.

Add this filemicroMap.network.min.js
+3.2 kB · total with core15.8 kB

PNG & print export

Save the current map view with loaded tiles, canvas overlays and attribution.

Add this filemicroMap.export.min.js
+1.8 kB · total with core14.4 kB

PMTiles archives

Read local or hosted PMTiles v3 archives on demand for raster or MVT maps.

Add this file and a renderermicroMap.pmtiles.min.js
+3.3 kB on top of your mapTotal varies

Camera animations

Use flyTo, easeTo, jumpTo and fitBounds.

Add this filemicroMap.camera.min.js
+3.9 kB · total with core16.5 kB

Extra raster layers

Add additional XYZ or WMS sources, for example an aerial photo overlay.

Add this filemicroMap.raster.min.js
+4.0 kB · total with core16.7 kB

WebGL surface

Provide a custom GPU renderer on a WebGL canvas alongside the map.

Add this filemicroMap.webgl.min.js
+1.4 kB · total with core14.1 kB

One combined API

Use one facade to connect the core with whichever optional modules you selected.

Add this filemicroMap.compose.min.js
+5.0 kB on top of your selectionTotal varies

Load only the modules your map needs. Sizes are separate JavaScript files compressed with gzip level 9.

See the API in context

Start with raster tiles, then browse focused examples for styles, controls or Leaflet-shaped helpers.


      

Choose the renderer that fits

All three projects use permissive code licenses. Map tiles and imagery have separate terms. This page bundles only MicroMap code.

MicroMap · MIT

A small raster core with optional Canvas vector tiles and GeoJSON. Rotation and affine pitch suit controlled map views; there is no perspective horizon or terrain.

Leaflet · BSD-2-Clause

A mature 2D map library with raster tiles, GeoJSON, markers and a broad plugin ecosystem. Vector-tile rendering uses plugins.

MapLibre GL JS · BSD-3-Clause

A WebGL renderer for vector maps, broad style support, perspective camera, terrain and globe. It is a stronger fit for demanding 3D and style-heavy maps.

License texts: MicroMap, Leaflet and MapLibre GL JS. Map data and imagery follow their own terms.