diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2017-07-05 21:15:54 +0200 |
---|---|---|
committer | Tobrun <tobrun.van.nuland@gmail.com> | 2017-07-05 21:15:54 +0200 |
commit | 79d849dc44e977ca8711adb7a397e5e560cbc80a (patch) | |
tree | 8b6264db5bc4370989b7d1128e2e6e45d6f7558b | |
parent | 9ab04a29655014f1df24e269ce53942c934c8333 (diff) | |
download | qtlocation-mapboxgl-79d849dc44e977ca8711adb7a397e5e560cbc80a.tar.gz |
[darwin] - re-add swift documentation
-rw-r--r-- | platform/darwin/src/MGLCircleStyleLayer.h | 10 | ||||
-rw-r--r-- | platform/darwin/src/MGLFillExtrusionStyleLayer.h | 6 | ||||
-rw-r--r-- | platform/darwin/src/MGLFillStyleLayer.h | 5 | ||||
-rw-r--r-- | platform/darwin/src/MGLLineStyleLayer.h | 10 | ||||
-rw-r--r-- | platform/darwin/src/MGLRasterStyleLayer.h | 3 | ||||
-rw-r--r-- | platform/darwin/src/MGLSymbolStyleLayer.h | 10 |
6 files changed, 44 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLCircleStyleLayer.h b/platform/darwin/src/MGLCircleStyleLayer.h index 823824b50f..789ff7a258 100644 --- a/platform/darwin/src/MGLCircleStyleLayer.h +++ b/platform/darwin/src/MGLCircleStyleLayer.h @@ -64,6 +64,16 @@ typedef NS_ENUM(NSUInteger, MGLCircleTranslationAnchor) { ### Example ```swift + let layer = MGLCircleStyleLayer(identifier: "circles", source: population) + layer.sourceLayerIdentifier = "population" + layer.circleColor = MGLStyleValue(rawValue: .green) + layer.circleRadius = MGLStyleValue(interpolationMode: .exponential, + cameraStops: [12: MGLStyleValue(rawValue: 2), + 22: MGLStyleValue(rawValue: 180)], + options: [.interpolationBase: 1.75]) + layer.circleOpacity = MGLStyleValue(rawValue: 0.7) + layer.predicate = NSPredicate(format: "%K == %@", "marital-status", "married") + mapView.style?.addLayer(layer) ``` */ MGL_EXPORT diff --git a/platform/darwin/src/MGLFillExtrusionStyleLayer.h b/platform/darwin/src/MGLFillExtrusionStyleLayer.h index 443391756d..c4fb9aa77e 100644 --- a/platform/darwin/src/MGLFillExtrusionStyleLayer.h +++ b/platform/darwin/src/MGLFillExtrusionStyleLayer.h @@ -42,6 +42,12 @@ typedef NS_ENUM(NSUInteger, MGLFillExtrusionTranslationAnchor) { ### Example ```swift + let layer = MGLFillExtrusionStyleLayer(identifier: "buildings", source: buildings) + layer.sourceLayerIdentifier = "building" + layer.fillExtrusionHeight = MGLStyleValue(interpolationMode: .identity, sourceStops: nil, attributeName: "height", options: nil) + layer.fillExtrusionBase = MGLStyleValue(interpolationMode: .identity, sourceStops: nil, attributeName: "min_height", options: nil) + layer.predicate = NSPredicate(format: "extrude == 'true'") + mapView.style?.addLayer(layer) ``` */ MGL_EXPORT diff --git a/platform/darwin/src/MGLFillStyleLayer.h b/platform/darwin/src/MGLFillStyleLayer.h index 8776f17bcb..6e3297bdec 100644 --- a/platform/darwin/src/MGLFillStyleLayer.h +++ b/platform/darwin/src/MGLFillStyleLayer.h @@ -42,6 +42,11 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslationAnchor) { ### Example ```swift + let layer = MGLFillStyleLayer(identifier: "parks", source: parks) + layer.sourceLayerIdentifier = "parks" + layer.fillColor = MGLStyleValue(rawValue: .green) + layer.predicate = NSPredicate(format: "type == %@", "national-park") + mapView.style?.addLayer(layer) ``` */ MGL_EXPORT diff --git a/platform/darwin/src/MGLLineStyleLayer.h b/platform/darwin/src/MGLLineStyleLayer.h index 7c5b66a2c2..4a96b11abf 100644 --- a/platform/darwin/src/MGLLineStyleLayer.h +++ b/platform/darwin/src/MGLLineStyleLayer.h @@ -92,6 +92,16 @@ typedef NS_ENUM(NSUInteger, MGLLineTranslationAnchor) { ### Example ```swift + let layer = MGLLineStyleLayer(identifier: "trails-path", source: trails) + layer.sourceLayerIdentifier = "trails" + layer.lineWidth = MGLStyleValue(interpolationMode: .exponential, + cameraStops: [14: MGLStyleValue(rawValue: 2), + 18: MGLStyleValue(rawValue: 20)], + options: [.interpolationBase: 1.5]) + layer.lineColor = MGLStyleValue(rawValue: .brown) + layer.lineCap = MGLStyleValue(rawValue: NSValue(mglLineCap: .round)) + layer.predicate = NSPredicate(format: "%K == %@", "trail-type", "mountain-biking") + mapView.style?.addLayer(layer) ``` */ MGL_EXPORT diff --git a/platform/darwin/src/MGLRasterStyleLayer.h b/platform/darwin/src/MGLRasterStyleLayer.h index 09fafd114d..53a6a98b8a 100644 --- a/platform/darwin/src/MGLRasterStyleLayer.h +++ b/platform/darwin/src/MGLRasterStyleLayer.h @@ -28,6 +28,9 @@ NS_ASSUME_NONNULL_BEGIN ### Example ```swift + let layer = MGLRasterStyleLayer(identifier: "clouds", source: source) + layer.rasterOpacity = MGLStyleValue(rawValue: 0.5) + mapView.style?.addLayer(layer) ``` */ MGL_EXPORT diff --git a/platform/darwin/src/MGLSymbolStyleLayer.h b/platform/darwin/src/MGLSymbolStyleLayer.h index 8512870e1b..5df995aa01 100644 --- a/platform/darwin/src/MGLSymbolStyleLayer.h +++ b/platform/darwin/src/MGLSymbolStyleLayer.h @@ -265,6 +265,16 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslationAnchor) { ### Example ```swift + let layer = MGLSymbolStyleLayer(identifier: "coffeeshops", source: pois) + layer.sourceLayerIdentifier = "pois" + layer.iconImageName = MGLStyleValue(rawValue: "coffee") + layer.iconScale = MGLStyleValue(rawValue: 0.5) + layer.text = MGLStyleValue(rawValue: "{name}") + layer.textTranslation = MGLStyleValue(rawValue: NSValue(cgVector: CGVector(dx: 10, dy: 0))) + layer.textJustification = MGLStyleValue(rawValue: NSValue(mglTextJustification: .left)) + layer.textAnchor = MGLStyleValue(rawValue: NSValue(mglTextAnchor: .left)) + layer.predicate = NSPredicate(format: "%K == %@", "venue-type", "coffee") + mapView.style?.addLayer(layer) ``` */ MGL_EXPORT |