diff options
author | Fabian Guerra <fabian.guerra@mapbox.com> | 2018-02-15 11:54:51 -0500 |
---|---|---|
committer | Fabian Guerra <fabian.guerra@mapbox.com> | 2018-02-15 11:54:51 -0500 |
commit | 903e7989ec3438a605bafbf5938de38cdb868e4a (patch) | |
tree | a2f8ba01fd8bf41503396605b993f9e38b77e131 /platform/darwin/test/MGLDocumentationExampleTests.swift | |
parent | c83dc310aa656132638a66e65ba8aa274b5e969f (diff) | |
parent | 82de856c94bbc090ba30186011610da5e233e277 (diff) | |
download | qtlocation-mapboxgl-903e7989ec3438a605bafbf5938de38cdb868e4a.tar.gz |
Merge branch 'master' into release-boba
# Conflicts:
# platform/android/CHANGELOG.md
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java
# platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/CompassView.java
# platform/android/scripts/exclude-activity-gen.json
# platform/ios/CHANGELOG.md
# platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec
# platform/ios/Mapbox-iOS-SDK-symbols.podspec
# platform/ios/Mapbox-iOS-SDK.podspec
# platform/macos/CHANGELOG.md
Diffstat (limited to 'platform/darwin/test/MGLDocumentationExampleTests.swift')
-rw-r--r-- | platform/darwin/test/MGLDocumentationExampleTests.swift | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/platform/darwin/test/MGLDocumentationExampleTests.swift b/platform/darwin/test/MGLDocumentationExampleTests.swift index 9bf9924869..5a6e00bc4e 100644 --- a/platform/darwin/test/MGLDocumentationExampleTests.swift +++ b/platform/darwin/test/MGLDocumentationExampleTests.swift @@ -230,6 +230,24 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { XCTAssertNotNil(mapView.style?.layer(withIdentifier: "buildings")) } + + func testMGLHeatmapStyleLayer() { + let earthquakes = MGLShapeSource(identifier: "earthquakes", url: URL(string: "https://example.com/earthquakes.json")!, options: [:]) + mapView.style?.addSource(earthquakes) + + //#-example-code + let layer = MGLHeatmapStyleLayer(identifier: "earthquake-heat", source: earthquakes) + layer.heatmapWeight = NSExpression(format: "FUNCTION(magnitude, 'mgl_interpolateWithCurveType:parameters:stops:', 'linear', nil, %@)", + [0: 0, + 6: 1]) + layer.heatmapIntensity = NSExpression(format: "FUNCTION($zoomLevel, 'mgl_interpolateWithCurveType:parameters:stops:', 'linear', nil, %@)", + [0: 1, + 9: 3]) + mapView.style?.addLayer(layer) + //#-end-example-code + + XCTAssertNotNil(mapView.style?.layer(withIdentifier: "earthquake-heat")) + } func testMGLSymbolStyleLayer() { let pois = MGLVectorSource(identifier: "pois", configurationURL: URL(string: "https://example.com/style.json")!) |