With GMaps.js you can render a directions panel using the following code:
map.renderRoute({ origin: [-12.044012922866312, -77.02470665341184], destination: [-12.090814532191756, -77.02271108990476], travelMode: 'driving', strokeColor: '#131540', strokeOpacity: 0.6, strokeWeight: 6 }, { panel: '#directions', draggable: true });
You must define two points (origin and destination) and color, opacity and weight of the route in the map.
Also, you can define a travelMode
: driving
, bicycling
or walking
. Default is walking