diff options
author | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2017-05-25 14:36:05 -0700 |
---|---|---|
committer | Asheem Mamoowala <asheem.mamoowala@mapbox.com> | 2017-06-19 09:50:08 -0700 |
commit | ab5b310a9eb7c88935cc457da1af81349fbe8d41 (patch) | |
tree | e1485c8aa2f00e2b50daa0aa7f997ddda59c2562 /platform/darwin/test/MGLDocumentationExampleTests.swift | |
parent | 7b05606464ac4d57b59b64015629e9578cbebac2 (diff) | |
download | qtlocation-mapboxgl-ab5b310a9eb7c88935cc457da1af81349fbe8d41.tar.gz |
[iOS][macOS] Add ImageSource bindings
Diffstat (limited to 'platform/darwin/test/MGLDocumentationExampleTests.swift')
-rw-r--r-- | platform/darwin/test/MGLDocumentationExampleTests.swift | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/platform/darwin/test/MGLDocumentationExampleTests.swift b/platform/darwin/test/MGLDocumentationExampleTests.swift index 48e6b17f44..2a441d2774 100644 --- a/platform/darwin/test/MGLDocumentationExampleTests.swift +++ b/platform/darwin/test/MGLDocumentationExampleTests.swift @@ -104,6 +104,20 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { XCTAssertNotNil(mapView.style?.source(withIdentifier: "pois")) } + func testMGLImageSource() { + //#-example-code + let coordinates: MGLCoordinateQuad = MGLCoordinateQuad( + topLeft: CLLocationCoordinate2D(latitude: 46.437, longitude: -80.425), + topRight: CLLocationCoordinate2D(latitude: 46.437, longitude: -71.516), + bottomRight: CLLocationCoordinate2D(latitude: 37.936, longitude: -71.516), + bottomLeft: CLLocationCoordinate2D(latitude: 37.936, longitude: -80.425)) + let source = MGLImageSource(identifier: "images", coordinates: coordinates, imageURL: URL(string: "https://www.mapbox.com/mapbox-gl-js/assets/radar.gif")!) + mapView.style?.addSource(source) + //#-end-example-code + + XCTAssertNotNil(mapView.style?.source(withIdentifier: "images")) + } + func testMGLCircleStyleLayer() { let population = MGLVectorSource(identifier: "population", configurationURL: URL(string: "https://example.com/style.json")!) mapView.style?.addSource(population) |