
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@myorders/leaflet-routing-machine
Advanced tools
This plugin is barely maintained! It has been a good long while since I had any reason to work with routing or Leaflet, and it does not look like that will change. I do not spend time on maintaining this plugin, and only rarely can I find time to respond to issues. If you want to take over as maintainer, feel free to contact me at per@liedman.net.
Find the way from A to B on a Leaflet map. The plugin supports multiple backends:
L.Routing.MapboxGo to the Leaflet Routing Machine site for more information, demos, tutorials and more.
Update 2020-04-06: Out of the box, Leaflet Routing Machine relies on OSRM's demo server. At this moment, the demo server (which is outside scope of the plugin and outside control of the plugin's author) is no longer maintained, and its SSL certificate has expired. The plugin will not work unless you configure a routing backend yourself. I am sorry to say that, to my knowledge, there is no good default.
Leaflet Routing Machine is in many ways already a feature complete routing UI. Most likely, your requirements are already covered and require very little adaptation.
For questions and discussions, you might want to look at the Leaflet Routing Machine gitter.
yarn bundle
This requires Node and npm, or yarn.
Download latest release, or obtain the latest release via unpkg.com.
<link rel="stylesheet" href="https://unpkg.com/leaflet-routing-machine@3.2.12/dist/leaflet-routing-machine.css" />
<script src="https://unpkg.com/leaflet-routing-machine@3.2.12/dist/leaflet-routing-machine.js"></script>
or via npm/yarn:
npm install --save @myorders/leaflet-routing-machine
yarn add @myorders/leaflet-routing-machine
import * as L from 'leaflet';
import { OSRMv1, Control as RoutingControl } from '@myorders/leaflet-routing-machine';
const map = new L.Map();
const serviceUrl = 'https://routing.myorders.io';
const router = new OSRMv1({ serviceUrl, profile: 'driving' });
const routingControl = new RoutingControl({ waypoints: [...], router }).addTo(leafletMap);
You can now customize waypoint markers with markerOptions option for the RoutingControl.
import * as L from 'leaflet';
import { OSRMv1, Control as RoutingControl } from '@myorders/leaflet-routing-machine';
const map = new L.Map();
const serviceUrl = 'https://routing.myorders.io';
const router = new OSRMv1({ serviceUrl, profile: 'driving' });
const routingControl = new RoutingControl({
waypoints: [...],
markerOptions: {
icon: L.icon({ ... })
},
router
}).addTo(leafletMap);
Go to the Leaflet Routing Machine site for more information, demos, tutorials and more.
FAQs
ESM module Routing for Leaflet
We found that @myorders/leaflet-routing-machine demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.