diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2017-02-07 18:26:49 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2017-02-08 16:54:09 -0800 |
commit | 360e5bf631229e2aec71780a515a42e32d4c28e6 (patch) | |
tree | ea53e5f0f96b79418c4edfa1261057f08d8da573 /platform/darwin/test/MGLStyleValueTests.swift | |
parent | bd2f3a28a5d401ad41a5353c662c2f739cb34fc9 (diff) | |
download | qtlocation-mapboxgl-360e5bf631229e2aec71780a515a42e32d4c28e6.tar.gz |
[ios, macos] Fixed runtime styling deprecation warnings
Diffstat (limited to 'platform/darwin/test/MGLStyleValueTests.swift')
-rw-r--r-- | platform/darwin/test/MGLStyleValueTests.swift | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/platform/darwin/test/MGLStyleValueTests.swift b/platform/darwin/test/MGLStyleValueTests.swift index afdc2ef9a3..a8c4aaf71a 100644 --- a/platform/darwin/test/MGLStyleValueTests.swift +++ b/platform/darwin/test/MGLStyleValueTests.swift @@ -35,97 +35,6 @@ extension MGLStyleValueTests { XCTAssertEqual(circleStyleLayer.circleScaleAlignment, expectedCircleScaleAlignmentValue) } - func testDeprecatedFunctions() { - let shapeSource = MGLShapeSource(identifier: "test", shape: nil, options: nil) - let symbolStyleLayer = MGLSymbolStyleLayer(identifier: "symbolLayer", source: shapeSource) - let circleStyleLayer = MGLCircleStyleLayer(identifier: "circleLayer", source: shapeSource) - - // deprecated function, stops with float values - let iconHaloBlurStyleValue = MGLStyleValue<NSNumber>(interpolationBase: 1.0, stops: [1: MGLStyleValue(rawValue: 0), - 2: MGLStyleValue(rawValue: 1), - 3: MGLStyleValue(rawValue: 2), - 4: MGLStyleValue(rawValue: 3)]) - symbolStyleLayer.iconHaloBlur = iconHaloBlurStyleValue - XCTAssertEqual(symbolStyleLayer.iconHaloBlur!, iconHaloBlurStyleValue) - - // deprecated function, stops with boolean values - let stops: [NSNumber: MGLStyleValue<NSNumber>] = [ - 1: MGLStyleValue(rawValue: true), - 2: MGLStyleValue(rawValue: false), - 3: MGLStyleValue(rawValue: true), - 4: MGLStyleValue(rawValue: false), - ] - let iconAllowsOverlapStyleValue = MGLStyleValue<NSNumber>(interpolationBase: 1, stops: stops) - symbolStyleLayer.iconAllowsOverlap = iconAllowsOverlapStyleValue - // iconAllowsOverlap is boolean so mgl and mbgl conversions will coerce the developers stops into interval stops - let expectedIconAllowsOverlapStyleValue = MGLStyleValue<NSNumber>( - interpolationMode: .interval, - cameraStops: stops, - options: nil - ) - XCTAssertEqual(symbolStyleLayer.iconAllowsOverlap, expectedIconAllowsOverlapStyleValue) - - /// - // creating and using MGLStyleFunctions directly - /// - - let circleRadiusStops: [NSNumber: MGLStyleValue<NSNumber>] = [ - 0: MGLStyleValue(rawValue: 10), - 20: MGLStyleValue(rawValue: 5) - ] - let circleRadiusFunction = MGLStyleFunction<NSNumber>( - interpolationBase: 1.0, - stops: circleRadiusStops - ) - circleStyleLayer.circleRadius = circleRadiusFunction - let expectedCircleRadiusFunction = MGLStyleValue<NSNumber>( - interpolationMode: .exponential, - cameraStops: - circleRadiusStops, - options: nil - ) - // setting a data driven property to an MGLStyleFunction should return an exponential camera function - XCTAssertEqual(circleStyleLayer.circleRadius, expectedCircleRadiusFunction) - - var circleTranslationOne = CGVector(dx: 100, dy: 0) - let circleTranslationValueOne = NSValue(bytes: &circleTranslationOne, objCType: "{CGVector=dd}") - var circleTranslationTwo = CGVector(dx: 0, dy: 0) - let circleTranslationValueTwo = NSValue(bytes: &circleTranslationTwo, objCType: "{CGVector=dd}") - - let circleTranslationStops: [NSNumber: MGLStyleValue<NSValue>] = [ - 0: MGLStyleValue<NSValue>(rawValue: circleTranslationValueOne), - 10: MGLStyleValue<NSValue>(rawValue: circleTranslationValueTwo) - ] - let circleTranslationFunction = MGLStyleFunction<NSValue>( - interpolationBase: 1.0, - stops: circleTranslationStops - ) - circleStyleLayer.circleTranslation = circleTranslationFunction - let expectedCircleTranslationFunction = MGLStyleValue<NSValue>( - interpolationMode: .exponential, - cameraStops: circleTranslationStops, - options: nil - ) - // setting a non-data driven, interpolatable property to an MGLStyleFunction should return an exponential camera function - XCTAssertEqual(circleStyleLayer.circleTranslation, expectedCircleTranslationFunction) - - let iconOptionalStops: [NSNumber: MGLStyleValue<NSNumber>] = [ - 0: MGLStyleValue(rawValue: false), - 20: MGLStyleValue(rawValue: true) - ] - let iconOptionalFunction = MGLStyleFunction( - interpolationBase: 1.0, - stops: iconOptionalStops - ) - symbolStyleLayer.iconOptional = iconOptionalFunction - let expectedIconOptionalFunction = MGLStyleValue( - interpolationMode: .interval, - cameraStops: iconOptionalStops, - options: nil - ) - XCTAssertEqual(symbolStyleLayer.iconOptional, expectedIconOptionalFunction) - } - func testFunctionsWithNonDataDrivenProperties() { let shapeSource = MGLShapeSource(identifier: "test", shape: nil, options: nil) let circleStyleLayer = MGLCircleStyleLayer(identifier: "circleLayer", source: shapeSource) |