new Maplace({ locations: LocsD, map_div: '#gmap-route', generate_controls: false, show_markers: false, type: 'directions', draggable: true, directions_panel: '#route', afterRoute: function(distance) { $('#km').text(': '+(distance/1000)+'km'); } }).Load();
<h2>Route <strong id="km"></strong></h2> <div id="gmap-route"></div> <div id="route"></div>