Skip to content

Commit

Permalink
Update README with Swift 3.0 details.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomtaylor committed Sep 21, 2016
1 parent 226b7ca commit ecb8046
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[![Build Status](https://travis-ci.org/raphaelmor/Polyline.svg?branch=master)](https://travis-ci.org/raphaelmor/Polyline)
[![CocoaPods](https://img.shields.io/cocoapods/v/Polyline.svg)](http://cocoadocs.org/docsets/Polyline)
![](https://img.shields.io/badge/Swift-2.0-green.svg)
![](https://img.shields.io/badge/Swift-3.0-green.svg)
[![Licence](http://img.shields.io/badge/Licence-MIT-lightgrey.svg)](https://github.com/raphaelmor/Polyline/blob/master/LICENSE.txt)

Polyline encoder / decoder in Swift
Expand All @@ -29,21 +29,24 @@ Polyline encoder / decoder in Swift
- Continuous integration with [Travis CI](http://travis-ci.org)
- CocoaPod available

### Planned for future releases
### Planned for future releases

- Convert to `MKPolyline`
- Convert to `GMSPolyline`
- Example project
- Filter locations available at a specific level

### Planned when support is available :
- Code Coverage with [Coveralls](https://coveralls.io)

- Code Coverage with [Coveralls](https://coveralls.io)

## Requirements

- Xcode 7+
- Xcode 8+
- iOS 8.0+ / Mac OS X 10.10+ / tvOS 9.0+ / watchOS 2.0+
- Swift 3.0

Note: The last version to support Swift 2.3 is the 3.x series. 4.0 will only support Swift 3.x.

---

Expand All @@ -55,14 +58,14 @@ To use this library in your project you can use CocoaPods, Carthage, and/or inte
You can integrate Polyline in your `Podfile` like this:

```
pod 'Polyline', '~> 3.0'
pod 'Polyline', '~> 4.0'
```

### Carthage
You can integrate Polyline in your `Cartfile` like this:

```
github "raphaelmor/Polyline" ~> 3.0
github "raphaelmor/Polyline" ~> 4.0
```

### Manual
Expand All @@ -75,6 +78,7 @@ github "raphaelmor/Polyline" ~> 3.0
### Polyline Encoding

Using `[CLLocationCoordinate2D]` (recommended) :

```swift
let coordinates = [CLLocationCoordinate2D(latitude: 40.2349727, longitude: -3.7707443),
CLLocationCoordinate2D(latitude: 44.3377999, longitude: 1.2112933)]
Expand All @@ -99,7 +103,7 @@ let encodedPolyline: String = polyline.encodedPolyline
let encodedPolyline: String = encodeLocations(locations)
```

You can encode levels too :
You can encode levels too :

```swift
let levels: [UInt32] = [0,1,2,255]
Expand Down Expand Up @@ -146,15 +150,15 @@ let levels: [UInt32]? = decodeLevels("BA")

### Polyline Precision

Default precision is 1e5 : 0.12345 (5 digit precision used by Google), but you can specify your own precision in all API methods (and functions).
Default precision is 1e5 : 0.12345 (5 digit precision used by Google), but you can specify your own precision in all API methods (and functions).

```swift
// OSRM uses a 6 digit precision
let polyline = Polyline(encodedPolyline: "ak{hRak{hR", precision: 1e6)
```



## Notes
This library tries to have consistent results with polylines generated by the [Google Maps iOS SDK](https://developers.google.com/maps/documentation/ios/).
The online tool for [encoding polylines](https://developers.google.com/maps/documentation/utilities/polylineutility) has some minor inconsistencies regarding rounding (for example, 0.000015 is rounded to 0.00002 for latitudes, but 0.00001 for longitudes).
Expand All @@ -163,8 +167,8 @@ This codes tries to adhere to the [GitHub Swift Style Guide](https://github.com/

## Contributors

- [Raphaël Mor](http://github.com/raphaelmor) ([@raphaelmor](https://twitter.com/raphaelmor)) : Creator
- [Tom Taylor](https://tomtaylor.co.uk) : Maintainer
- [Raphaël Mor](http://github.com/raphaelmor) ([@raphaelmor](https://twitter.com/raphaelmor)): Creator
- [Tom Taylor](https://tomtaylor.co.uk): Maintainer

## License
Polyline is released under an MIT license. See [LICENSE.txt](https://github.com/raphaelmor/Polyline/blob/master/LICENSE.txt) for more information.

0 comments on commit ecb8046

Please sign in to comment.