Encode and decode the Google Encoded Polyline Algorithm Format.
See the documentation here:
https://developers.google.com/maps/documentation/utilities/polylinealgorithm.
Mostly a translation of http://github.com/mthh/polyline_ggl/ (itself a modest translation (i.g no GeoJSON wrapper, etc.) of other well known available implementations such as Node.js Mapbox one).
encodePolyline, decodePolyline.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.