Polyline is an utility library for encoding and decoding polylines as defined by the Polyline Algorithm.
You can use Swift Package Manager and specify dependency in Package.swift by adding this:
.package(url: "https://https://gitlab.com/panache_team/ios/polyline.git", .upToNextMinor(from: "1.0.0"))
Start by importing the Polyline
library.
import Polyline
To create a Polyline
, define an array of coordinate and call the encode(path:)
method.
let coordinates = [
CLLocationCoodinate2D(38.5, -120.2),
CLLocationCoodinate2D(40.7, -120.95),
CLLocationCoodinate2D(43.252, -126.453)
]
encode(path: coordinates)
To create an array of coordinate, define an Polyline
and call the decode(polyline:)
method.
let polyline: Polyline = "_p~iF~ps|U_ulLnnqC_mqNvxq`@"
decode(polyline: polyline)
See CHANGELOG for details.
Polyline is released under the MIT license. See LICENSE for details.
link |
Stars: 0 |
Last commit: 4 years ago |
This is Polyline's initial release which contains the encoding and decoding capabilities of Polylines.
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics