GMaps.js — Routes

With GMaps.js you can draw a route between two points this way:

  origin: [-12.044012922866312, -77.02470665341184],
  destination: [-12.090814532191756, -77.02271108990476],
  travelMode: 'driving',
  strokeColor: '#131540',
  strokeOpacity: 0.6,
  strokeWeight: 6

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