Swiftpack.co - NausJessy/Polyline as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by NausJessy.
NausJessy/Polyline 1.0.0
A micro library written in Swift for encoding and decoding Polylines
⭐️ 0
🕓 4 years ago
iOS macOS tvOS
.package(url: "https://github.com/NausJessy/Polyline.git", from: "1.0.0")

Polyline

Polyline is an utility library for encoding and decoding polylines as defined by the Polyline Algorithm.

Requirements

  • iOS 10.0+ / macOS 10.12+ / tvOS 10.0+
  • Xcode 11.1
  • Swift 5.1

Installation

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"))

Usage

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)

Changelog

See CHANGELOG for details.

License

Polyline is released under the MIT license. See LICENSE for details.

GitHub

link
Stars: 0
Last commit: 4 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

Initial Release
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