Backend-less routing

OMT Router — Fast, accurate client-side routing engine for OpenMapTiles

Client-side JavaScript library for routing and isolines from OpenMapTiles—no routing server required.

Millisecond-scale client-side route computation
Backend-less, pure client-side solution
Privacy-first, no data sent to servers

Fewer servers. Faster interactions. More control.

Reduce hosting and API costs with fully client-side routing, while keeping reliability, deterministic accuracy and fast developer iteration.

Lower cost

Run routing without dedicated servers or 3rd-party APIs and keep your deployment footprint minimal.

Instant UX

Lightning-fast interactions with minimal latency. Fluid animations and responsive controls.

Batteries included

Everything you need to get started, from routing to isolines, all in one package.

Live Demo

Try routing and isolines on real tiles with the included MapLibre control.

Interactive routing and catchment area analysis in a browser-friendly fully-featured demo.

  • Optimal route? Catchment area? Inbound or outbound catchment area?
  • Walking or driving?
  • Optimize distance or time?
Open Demo

Get it running in three lines.

Embed the router with a single import, a tile URL, and a route call. Or just add it as a MapLibre control.

In your code
import { route } from 'omt-router';
const url = 'https://api.maptiler.com/tiles/v3-openmaptiles/{z}/{x}/{y}.pbf?key=YOUR_KEY';
const r = await route([-3.7038, 40.4168], [-3.6937, 40.4101], 'car', url, { costField: 'travelTime' });
console.log(r.found, r.cost);
In your MapLibre GL JS map
import { MapLibreRoutingControl } from 'omt-router';
map.addControl(new MapLibreRoutingControl({ routeFunction: route, tileJsonUrl: 'https://tiles.openfreemap.org/planet' }));

Fast by default — smart when it matters.

Always use the fastest safe engine for each query while preserving deterministic fallback.

Average route latency

7 ms

Engine choices

4

Deterministic

100%

Bleeding edge algorithms

  • Bidirectional A* with geographic heuristic
  • Adaptive Barrier SSSP
  • Delta-Stepping SSSP
  • Ultra Dijkstra
  • IsoPHAST (isolines only)

AI-driven algorithm selector

Light inference engine picks the best algorithm per query without compromising the overall performance.

Analyzes graph metrics and endpoints surrounding properties to ensure optimal selection every time.

From tiles to graph

Highly optimized tile parsing and graph construction for fast and reliable routing.

Fast and robust graph building ensures minimal latency and high accuracy.

GeoJSON-ready

Export routes and isolines as GeoJSON for mapping, analysis, or publishable outputs.

MapLibre Integration

Drop-in MapLibre control — integrate in minutes.

Add client-side routing to your MapLibre GL JS map with the included MapLibreRoutingControl. It’s a plug-and-play solution for interactive maps, prototypes, and geospatial tools.

Just import the control, add it to your map with a tile source, and you’re ready to route.

Multilingual and themeable.

Built with accessibility and customization in mind, the control supports internationalization, light/dark modes, and theming to fit your app’s style.

Out-of-the-box languages include English, Spanish, Catalan, Euskera, Galician, French, German, Russian, Japanese, and Chinese.

Spatial Accuracy

Robust graph building and snapping.

Fine-tuned clipping algorithm and node deduplication prevent seam artifacts at tile boundaries. Spatial-index-based snapping keeps endpoints stable within configurable thresholds.

Read Technical Notes

Using well-known OpenMapTiles data schema, its transportation layer provides all the necessary information for accurate routing and snapping.

Isolines

Usually provided by expensive third-party APIs, isolines are fully integrated and return inner "pretty-breaks" isolines for context.

Friendly API

Inspect engine choice, fallback conditions, snap distances, and missing tile signals for every route.

Built for developers, product teams, and enthusiasts.

Use OMT Router for offline routing prototypes, delivery catchments, reproducible isolines, and low-cost geospatial UX.

Developers: offline routing and custom penalty support.

Product: fast prototypes and cost-conscious delivery UX.

Enthusiasts: easily add advanced functionality to your hobby projects.

FAQ

Short answers for common questions.

Any OpenMapTiles-compatible vector tile source. CORS or proxying might be required for browser fetches. You can use third-party servers like OpenFreeMap or Maptiler or host your own tiles.
It's the fastest route, but weighting by road hierarchy. It's logical to prefer highways for long trips and local roads for short ones, even if the latter are faster in absolute terms. This is a common approach in routing engines to provide more intuitive and practical routes.
It means the endpoint is outside the maximum snap radius or road data is missing at the target location. Choose a different endpoint closer to a road or check the map data.
Fallback occurs when the selected engine cannot return a safe route; deterministic fallback ensures correctness.
Results quality relies on the accuracy and completeness of the underlying OpenStreetMap data. If you feel it lacks detail in certain areas, contributions to OSM are welcome.
There are two steps involved in routing: data preparation and route calculation. Route calculation takes a few milliseconds, but data preparation depends on beeline distance between points and the complexity of the network. To build the graph needed for calculations, the system must fetch the needed tiles and that's the most time-consuming part. So, if you requests the route for points far apart or in areas with dense networks, it may take longer.
You can contribute by improving the underlying OpenStreetMap data, reporting issues, or suggesting enhancements to the OMT Router project.
OMT Router is AGPL-3.0-only. The GNU Affero General Public License version 3 (AGPLv3) lets you use, modify, and share this library for free. However, if you modify the code and run it over a network (like a cloud service or website), you must share your modified source code publicly. If you want to use this library in a closed-source or proprietary product without these open-source obligations, please contact me for a commercial license.
The AGPL-3.0-only license ensures that improvements to the software are shared with the community, promoting transparency and collaboration. It also protects users' freedoms by requiring that modifications made available over a network are shared publicly.