Basic demo Leaflet Routing Machine

With leaflet control geocoder http://www.liedman.net/leaflet-routing-machine/#getting-started

by jean-philippe janecek

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.2.0/leaflet.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.2.0/leaflet.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet-routing-machine/3.2.5/leaflet-routing-machine.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet-routing-machine/3.2.5/leaflet-routing-machine.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/perliedman-leaflet-control-geocoder/1.5.5/Control.Geocoder.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/perliedman-leaflet-control-geocoder/1.5.5/Control.Geocoder.min.css">
<div style="height: 400px;" id="mapid">
</div>

JavaScript

var mymap = L.map('mapid').setView([50.27264, 7.26469], 13);
console.log(mymap);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png').addTo(mymap);
var control = L.Routing.control({
  waypoints: [
    L.latLng(38.7436056, -9.2304153),
    L.latLng(38.5334477, -0.1312811)
  ],
  router: new L.Routing.osrmv1({
    language: 'fr',
    profile: 'car'
  }),
  geocoder: L.Control.Geocoder.nominatim({})
}).addTo(mymap);