pub fn encode<P: Point>(
    path: &[P],
    precision: Option<u32>
) -> Result<String, InvalidLatLngError>
Expand description

Polyline encodes an array of objects having lat and lng properties.

See https://developers.google.com/maps/documentation/utilities/polylinealgorithm

Example
let path = vec![
    (38.5, -120.2),
    (40.7, -120.95),
    (43.252, -126.453),
];
assert_eq!(polyline_codec::encode(&path, None).unwrap(), "_p~iF~ps|U_ulLnnqC_mqNvxq`@");