///////////////////////// var geocoder = L.Control.Geocoder.nominatim(), routeControl = L.Routing.control({ geocoder: geocoder, routeWhileDragging: false, reverseWaypoints: true, showAlternatives: true, altLineOptions: { styles: [ {color: 'black', opacity: 0.15, weight: 9}, {color: 'white', opacity: 0.8, weight: 6}, {color: 'blue', opacity: 0.5, weight: 2} ] } }).addTo(map), waypoints = []; geocoder.geocode(', ', function(a, b) { var point = a[0]; var wpt = L.Routing.waypoint(L.latLng(, ), point.name) waypoints.push(wpt); routeControl.setWaypoints(waypoints); }) geocoder.geocode('38.203655318071, -5.3623046875', function(a, b) { var point = a[0]; var wpt = L.Routing.waypoint(L.latLng(38.203655318071, -5.3623046875), point.name) waypoints.push(wpt); routeControl.setWaypoints(waypoints); var marker_second = L.marker([38.203655318071, -5.3623046875], { draggable: false }).addTo(map); marker_second.bindPopup(''); var popup = L.popup() .setLatLng(L.latLng(38.203655318071, -5.3623046875)) .setContent('') .addTo(map); }) //.on('click', function(e) { console.log("hello"); });