diff --git a/platform/ios/platform/darwin/src/MGLCircleStyleLayer.h b/platform/ios/platform/darwin/src/MGLCircleStyleLayer.h index d96ed5967..540980176 100644 --- a/platform/ios/platform/darwin/src/MGLCircleStyleLayer.h +++ b/platform/ios/platform/darwin/src/MGLCircleStyleLayer.h @@ -91,6 +91,15 @@ typedef NS_ENUM(NSUInteger, MGLCircleTranslationAnchor) { ### Example ```swift + let layer = MGLCircleStyleLayer(identifier: "circles", source: population) + layer.sourceLayerIdentifier = "population" + layer.circleColor = NSExpression(forConstantValue: UIColor.green) + layer.circleRadius = NSExpression(format: "mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'exponential', 1.75, %@)", + [12: 2, + 22: 180]) + layer.circleOpacity = NSExpression(forConstantValue: 0.7) + layer.predicate = NSPredicate(format: "%K == %@", "marital-status", "married") + mapView.style?.addLayer(layer) ``` */ MGL_EXPORT diff --git a/platform/ios/platform/darwin/src/MGLFillExtrusionStyleLayer.h b/platform/ios/platform/darwin/src/MGLFillExtrusionStyleLayer.h index 7a7c8f93c..adb215c41 100644 --- a/platform/ios/platform/darwin/src/MGLFillExtrusionStyleLayer.h +++ b/platform/ios/platform/darwin/src/MGLFillExtrusionStyleLayer.h @@ -47,6 +47,12 @@ typedef NS_ENUM(NSUInteger, MGLFillExtrusionTranslationAnchor) { ### Example ```swift + let layer = MGLFillExtrusionStyleLayer(identifier: "buildings", source: buildings) + layer.sourceLayerIdentifier = "building" + layer.fillExtrusionHeight = NSExpression(forKeyPath: "height") + layer.fillExtrusionBase = NSExpression(forKeyPath: "min_height") + layer.predicate = NSPredicate(format: "extrude == 'true'") + mapView.style?.addLayer(layer) ``` */ MGL_EXPORT diff --git a/platform/ios/platform/darwin/src/MGLFillStyleLayer.h b/platform/ios/platform/darwin/src/MGLFillStyleLayer.h index 26dc31df9..931a0abdd 100644 --- a/platform/ios/platform/darwin/src/MGLFillStyleLayer.h +++ b/platform/ios/platform/darwin/src/MGLFillStyleLayer.h @@ -51,6 +51,11 @@ typedef NS_ENUM(NSUInteger, MGLFillTranslationAnchor) { ### Example ```swift + let layer = MGLFillStyleLayer(identifier: "parks", source: parks) + layer.sourceLayerIdentifier = "parks" + layer.fillColor = NSExpression(forConstantValue: UIColor.green) + layer.predicate = NSPredicate(format: "type == %@", "national-park") + mapView.style?.addLayer(layer) ``` */ MGL_EXPORT diff --git a/platform/ios/platform/darwin/src/MGLHeatmapStyleLayer.h b/platform/ios/platform/darwin/src/MGLHeatmapStyleLayer.h index f73aea5d1..3c6dfbc29 100644 --- a/platform/ios/platform/darwin/src/MGLHeatmapStyleLayer.h +++ b/platform/ios/platform/darwin/src/MGLHeatmapStyleLayer.h @@ -40,6 +40,14 @@ NS_ASSUME_NONNULL_BEGIN ### Example ```swift + let layer = MGLHeatmapStyleLayer(identifier: "earthquake-heat", source: earthquakes) + layer.heatmapWeight = NSExpression(format: "mgl_interpolate:withCurveType:parameters:stops:(magnitude, 'linear', nil, %@)", + [0: 0, + 6: 1]) + layer.heatmapIntensity = NSExpression(format: "mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'linear', nil, %@)", + [0: 1, + 9: 3]) + mapView.style?.addLayer(layer) ``` */ MGL_EXPORT diff --git a/platform/ios/platform/darwin/src/MGLHillshadeStyleLayer.h b/platform/ios/platform/darwin/src/MGLHillshadeStyleLayer.h index d426daa97..1cf379732 100644 --- a/platform/ios/platform/darwin/src/MGLHillshadeStyleLayer.h +++ b/platform/ios/platform/darwin/src/MGLHillshadeStyleLayer.h @@ -48,6 +48,11 @@ typedef NS_ENUM(NSUInteger, MGLHillshadeIlluminationAnchor) { ### Example ```swift + let layer = MGLHillshadeStyleLayer(identifier: "hills", source: source) + layer.hillshadeExaggeration = NSExpression(forConstantValue: 0.6) + if let canalShadowLayer = mapView.style?.layer(withIdentifier: "waterway-river-canal-shadow") { + mapView.style?.insertLayer(layer, below: canalShadowLayer) + } ``` */ MGL_EXPORT diff --git a/platform/ios/platform/darwin/src/MGLLight.h b/platform/ios/platform/darwin/src/MGLLight.h index 3491c126f..281fcc5c6 100644 --- a/platform/ios/platform/darwin/src/MGLLight.h +++ b/platform/ios/platform/darwin/src/MGLLight.h @@ -62,6 +62,11 @@ NS_INLINE MGLSphericalPosition MGLSphericalPositionMake(CGFloat radial, CLLocati ### Example ```swift + let light = MGLLight() + let position = MGLSphericalPosition(radial: 5, azimuthal: 180, polar: 80) + light.position = NSExpression(forConstantValue: NSValue(mglSphericalPosition: position)) + light.anchor = NSExpression(forConstantValue: "map") + mapView.style?.light = light ``` #### Related examples diff --git a/platform/ios/platform/darwin/src/MGLLineStyleLayer.h b/platform/ios/platform/darwin/src/MGLLineStyleLayer.h index 99ce8754e..00856e9d2 100644 --- a/platform/ios/platform/darwin/src/MGLLineStyleLayer.h +++ b/platform/ios/platform/darwin/src/MGLLineStyleLayer.h @@ -101,6 +101,15 @@ typedef NS_ENUM(NSUInteger, MGLLineTranslationAnchor) { ### Example ```swift + let layer = MGLLineStyleLayer(identifier: "trails-path", source: trails) + layer.sourceLayerIdentifier = "trails" + layer.lineWidth = NSExpression(format: "mgl_interpolate:withCurveType:parameters:stops:($zoomLevel, 'exponential', 1.5, %@)", + [14: 2, + 18: 20]) + layer.lineColor = NSExpression(forConstantValue: UIColor.brown) + layer.lineCap = NSExpression(forConstantValue: "round") + layer.predicate = NSPredicate(format: "%K == %@", "trail-type", "mountain-biking") + mapView.style?.addLayer(layer) ``` */ MGL_EXPORT diff --git a/platform/ios/platform/darwin/src/MGLRasterStyleLayer.h b/platform/ios/platform/darwin/src/MGLRasterStyleLayer.h index 5b8543007..87cf5be1b 100644 --- a/platform/ios/platform/darwin/src/MGLRasterStyleLayer.h +++ b/platform/ios/platform/darwin/src/MGLRasterStyleLayer.h @@ -61,6 +61,9 @@ typedef NS_ENUM(NSUInteger, MGLRasterResamplingMode) { ### Example ```swift + let layer = MGLRasterStyleLayer(identifier: "clouds", source: source) + layer.rasterOpacity = NSExpression(forConstantValue: 0.5) + mapView.style?.addLayer(layer) ``` */ MGL_EXPORT diff --git a/platform/ios/platform/darwin/src/MGLSymbolStyleLayer.h b/platform/ios/platform/darwin/src/MGLSymbolStyleLayer.h index 520e1fe9e..d62518c49 100644 --- a/platform/ios/platform/darwin/src/MGLSymbolStyleLayer.h +++ b/platform/ios/platform/darwin/src/MGLSymbolStyleLayer.h @@ -402,6 +402,16 @@ typedef NS_ENUM(NSUInteger, MGLTextTranslationAnchor) { ### Example ```swift + let layer = MGLSymbolStyleLayer(identifier: "coffeeshops", source: pois) + layer.sourceLayerIdentifier = "pois" + layer.iconImageName = NSExpression(forConstantValue: "coffee") + layer.iconScale = NSExpression(forConstantValue: 0.5) + layer.text = NSExpression(forKeyPath: "name") + layer.textTranslation = NSExpression(forConstantValue: NSValue(cgVector: CGVector(dx: 10, dy: 0))) + layer.textJustification = NSExpression(forConstantValue: "left") + layer.textAnchor = NSExpression(forConstantValue: "left") + layer.predicate = NSPredicate(format: "%K == %@", "venue-type", "coffee") + mapView.style?.addLayer(layer) ``` */ MGL_EXPORT