[ios] Add test for code snippet added to MGLPolyline doc change

This commit is contained in:
Nadia Barbosa
2017-08-08 17:16:25 -04:00
parent 2e24562ee8
commit 5d641f4d68
2 changed files with 14 additions and 3 deletions

View File

@@ -43,9 +43,8 @@ NS_ASSUME_NONNULL_BEGIN
CLLocationCoordinate2D(latitude: 35.68476, longitude: -220.24257),
CLLocationCoordinate2D(latitude: 37.78428, longitude: -122.41310)
]
let polyline = MGLPolyline(coordinates: &coordinates, count: UInt(coordinates.count))
```
let polyline = MGLPolyline(coordinates: coordinates, count: UInt(coordinates.count))
```
A polyline is known as a
<a href="https://tools.ietf.org/html/rfc7946#section-3.1.4">LineString</a>

View File

@@ -103,6 +103,18 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate {
XCTAssertNotNil(mapView.style?.source(withIdentifier: "pois"))
}
func testMGLPolyline() {
//#-example-code
let coordinates = [
CLLocationCoordinate2D(latitude: 35.68476, longitude: -220.24257),
CLLocationCoordinate2D(latitude: 37.78428, longitude: -122.41310)
]
let polyline = MGLPolyline(coordinates: coordinates, count: UInt(coordinates.count))
//#-end-example-code
XCTAssertNotNil(polyline)
}
func testMGLCircleStyleLayer() {
let population = MGLVectorSource(identifier: "population", configurationURL: URL(string: "https://example.com/style.json")!)