Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[ios] Add test for code snippet added to MGLPolyline doc change
Browse files Browse the repository at this point in the history
  • Loading branch information
captainbarbosa committed Aug 9, 2017
1 parent 2e24562 commit 5d641f4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 2 additions & 3 deletions platform/darwin/src/MGLPolyline.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
12 changes: 12 additions & 0 deletions platform/darwin/test/MGLDocumentationExampleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")!)
Expand Down

0 comments on commit 5d641f4

Please sign in to comment.