November 2, 2026 — Maplair 4.3.0 has been released, with an easier migration from Leaflet 1 and polished tutorials! 🍁
October 31, 2026 — Maplair 4.2.0 has been released, with rotated and colored markers! 🍁
October 28, 2026 — Maplair 4.1.0 has been released, with marker clustering and a time control! 🍁
October 19, 2026 — Maplair 4.0.0, a fork of Leaflet, has been released! 🍁
Maplair is an open-source JavaScript library for building powerful interactive maps, a fork of Leaflet, the leading library for this. Since Maplair supports tree-shaking, your bundler shakes off the leaves you don't use 🍁 A map with just a tile layer weighs about 34 KB of JS. With everything included, about 63 KB of JS, it has all the mapping features most developers ever need.
Maplair is designed with simplicity, performance and usability in mind. It works efficiently across all major desktop and mobile platforms, is easy to extend, has a beautiful, easy to use and well-documented API and a simple, readable source code that is a joy to contribute to.
Why “Maplair”? The name is a wordplay: a lair for your maps, where they feel at home — and it sounds like maple, whose leaf carries on the leaf of Leaflet, the library Maplair is a fork of. 🍁
Here we create a map in the 'map' div, add tiles of our choice, and then add a marker with some text in a popup:
import {MaplairMap, TileLayer, Marker} from 'maplair';
const map = new MaplairMap('map').setView([51.505, -0.09], 13);
new TileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
new Marker([51.5, -0.09]).addTo(map)
.bindPopup('A pretty CSS popup.<br> Easily customizable.')
.openPopup();
Learn more with the quick start guide, check out other tutorials, or head straight to the API documentation. If you have any questions, take a look at the FAQ first.
Features
Maplair makes the basic things work perfectly, and brings many features which Leaflet apps used plugins for — all of them dropped by your bundler unless you use them.
Layers Out of the Box
- Tile layers, WMS
- Markers, Popups
- Vector layers: polylines, polygons, circles, rectangles
- Image and video overlays
- GeoJSON with classification and legends
- Heatmaps
- Marker clustering
- SVG markers in any color, with a glyph
Interaction Features
- Drag panning with inertia
- Scroll wheel zoom
- Pinch-zoom on mobile and touchpads
- Double click zoom, tap and drag zoom
- Map rotation with two fingers or a compass
- Zoom to area (shift-drag)
- Keyboard navigation
- Events: click, pointerover, etc.
- Marker dragging and animated movement along routes
- Context menus
- The view in the URL and synchronized maps
Visual Features
- Zoom and pan animation and continuous zoom
- Tile and popup fade animation
- Very nice default design for markers, popups and map controls
- Retina resolution support
- Arrowheads, text and animated dashes along lines
Customization Features
- Pure CSS popups and controls themed with CSS variables
- Translations of the built-in texts
- Image- and HTML-based markers
- A simple interface for custom map layers and controls
- Custom map projections (with
EPSG:3857/4326/3395out of the box) - Powerful OOP facilities for extending existing classes
Performance Features
- Hardware acceleration on mobile makes it feel as smooth as native apps
- Utilizing CSS features to make panning and zooming really smooth
- Smart polyline/polygon rendering with dynamic clipping and simplification makes it very fast
- Tree-shaking for leaving out features you don't need
- Marker culling for many markers
Map Controls
- Zoom buttons
- Attribution
- Layer switcher
- Scale
- Fullscreen
- Search with Nominatim or your own geocoder
- Minimap
- Side-by-side comparison
- Legend
- Compass
- Buttons and text
Browser Support
- Chrome
- Firefox
- Safari
- Edge
- All with the web features that are Baseline Widely available
Misc
- Extremely lightweight
- No external dependencies
- Accessible with the keyboard and screen readers
- TypeScript type declarations
If you find some feature really missing in Maplair, first check if it's been discussed before already on GitHub issues. If not, please open a new GitHub issue.
Getting Involved
Let's create the best mapping library in the world! Maplair is developed by Simon Legner, based on Leaflet, which Volodymyr Agafonkin created and a big community of contributors developed. Pull requests are always welcome. However, there are many more ways to get involved with the development of Maplair.
You can help the project tremendously by discovering and reporting bugs, improving documentation, helping others on GIS Stack Exchange and GitHub issues, and spreading the word about Maplair among your colleagues and friends.
Check out the contribution guide for more information on getting involved with Maplair development.
