summaryrefslogtreecommitdiff
path: root/platform/darwin/test/MGLDocumentationExampleTests.swift
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2017-10-09 19:50:21 +0300
committerFabian Guerra Soto <fabian.guerra@mapbox.com>2017-11-01 09:23:53 -0400
commitde9098cf99463e433e9e9d6088865bc63948e567 (patch)
tree45669b918e2549e367742cb2e924f69277febf7a /platform/darwin/test/MGLDocumentationExampleTests.swift
parent9c3e78a9b95782e8fbf15cf7a4052f46f27922fd (diff)
downloadqtlocation-mapboxgl-de9098cf99463e433e9e9d6088865bc63948e567.tar.gz
[darwin][ios][macos] map snapshotter - add MGLMapSnapshot wrapper
Diffstat (limited to 'platform/darwin/test/MGLDocumentationExampleTests.swift')
-rw-r--r--platform/darwin/test/MGLDocumentationExampleTests.swift18
1 files changed, 18 insertions, 0 deletions
diff --git a/platform/darwin/test/MGLDocumentationExampleTests.swift b/platform/darwin/test/MGLDocumentationExampleTests.swift
index 42c656f203..8762af9ba4 100644
--- a/platform/darwin/test/MGLDocumentationExampleTests.swift
+++ b/platform/darwin/test/MGLDocumentationExampleTests.swift
@@ -278,6 +278,24 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate {
//#-end-example-code
}
+ func testMGLMapSnapshotter() {
+ //#-example-code
+ let camera = MGLMapCamera(lookingAtCenter: CLLocationCoordinate2D(latitude: 37.7184, longitude: -122.4365), fromDistance: 100, pitch: 20, heading: 0)
+
+ let options = MGLMapSnapshotOptions(styleURL: MGLStyle.satelliteStreetsStyleURL(), camera: camera, size: CGSize(width: 320, height: 480))
+ options.zoomLevel = 10
+
+ let snapshotter = MGLMapSnapshotter(options: options)
+ snapshotter.start { (snapshot, error) in
+ if error != nil {
+ // error handler
+ } else {
+ // image handler
+ }
+ }
+ //#-end-example-code
+ }
+
// For testMGLMapView().
func myCustomFunction() {}
}