pub fn encode<P: Point>(
path: &[P],
precision: 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, 5).unwrap(), "_p~iF~ps|U_ulLnnqC_mqNvxq`@");