diff options
author | Chris Loer <chris.loer@gmail.com> | 2018-07-20 13:06:01 -0700 |
---|---|---|
committer | Chris Loer <chris.loer@mapbox.com> | 2018-07-23 13:33:27 -0700 |
commit | 0b2221cb74ab79a0610ac44cee2a053da41a3dff (patch) | |
tree | 372e3e3215d70676c4625476889b4d9dbb6cd434 /platform/darwin/src/MGLSymbolStyleLayer.h | |
parent | f9b36f9f5b4cf09e08c2ff0181b339b53e8d0014 (diff) | |
download | qtlocation-mapboxgl-0b2221cb74ab79a0610ac44cee2a053da41a3dff.tar.gz |
[android, ios, macos] Generate symbol-placement: line-center wrappers
Diffstat (limited to 'platform/darwin/src/MGLSymbolStyleLayer.h')
-rw-r--r-- | platform/darwin/src/MGLSymbolStyleLayer.h | 54 |
1 files changed, 34 insertions, 20 deletions
diff --git a/platform/darwin/src/MGLSymbolStyleLayer.h b/platform/darwin/src/MGLSymbolStyleLayer.h index 2c899fe76f..afaea9a74f 100644 --- a/platform/darwin/src/MGLSymbolStyleLayer.h +++ b/platform/darwin/src/MGLSymbolStyleLayer.h @@ -83,8 +83,8 @@ typedef NS_ENUM(NSUInteger, MGLIconPitchAlignment) { typedef NS_ENUM(NSUInteger, MGLIconRotationAlignment) { /** When `symbolPlacement` is set to `MGLSymbolPlacementPoint`, aligns icons - east-west. When `symbolPlacement` is set to `MGLSymbolPlacementLine`, - aligns icon x-axes with the line. + east-west. When `symbolPlacement` is set to `MGLSymbolPlacementLine` or + `MGLSymbolPlacementLineCenter`, aligns icon x-axes with the line. */ MGLIconRotationAlignmentMap, /** @@ -95,8 +95,8 @@ typedef NS_ENUM(NSUInteger, MGLIconRotationAlignment) { /** When `symbolPlacement` is set to `MGLSymbolPlacementPoint`, this is equivalent to `MGLIconRotationAlignmentViewport`. When `symbolPlacement` is - set to `MGLSymbolPlacementLine`, this is equivalent to - `MGLIconRotationAlignmentMap`. + set to `MGLSymbolPlacementLine` or `MGLSymbolPlacementLineCenter`, this is + equivalent to `MGLIconRotationAlignmentMap`. */ MGLIconRotationAlignmentAuto, }; @@ -142,6 +142,12 @@ typedef NS_ENUM(NSUInteger, MGLSymbolPlacement) { `LineString` and `Polygon` geometries. */ MGLSymbolPlacementLine, + /** + The label is placed at the center of the line of the geometry. Can only be + used on `LineString` and `Polygon` geometries. Note that a single feature + in a vector tile may contain multiple line geometries. + */ + MGLSymbolPlacementLineCenter, }; /** @@ -242,8 +248,8 @@ typedef NS_ENUM(NSUInteger, MGLTextPitchAlignment) { typedef NS_ENUM(NSUInteger, MGLTextRotationAlignment) { /** When `symbolPlacement` is set to `MGLSymbolPlacementPoint`, aligns text - east-west. When `symbolPlacement` is set to `MGLSymbolPlacementLine`, - aligns text x-axes with the line. + east-west. When `symbolPlacement` is set to `MGLSymbolPlacementLine` or + `MGLSymbolPlacementLineCenter`, aligns text x-axes with the line. */ MGLTextRotationAlignmentMap, /** @@ -254,8 +260,8 @@ typedef NS_ENUM(NSUInteger, MGLTextRotationAlignment) { /** When `symbolPlacement` is set to `MGLSymbolPlacementPoint`, this is equivalent to `MGLTextRotationAlignmentViewport`. When `symbolPlacement` is - set to `MGLSymbolPlacementLine`, this is equivalent to - `MGLTextRotationAlignmentMap`. + set to `MGLSymbolPlacementLine` or `MGLSymbolPlacementLineCenter`, this is + equivalent to `MGLTextRotationAlignmentMap`. */ MGLTextRotationAlignmentAuto, }; @@ -653,12 +659,13 @@ MGL_EXPORT * Constant `MGLIconRotationAlignment` values * Any of the following constant string values: * `map`: When `symbol-placement` is set to `point`, aligns icons east-west. - When `symbol-placement` is set to `line`, aligns icon x-axes with the line. + When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes + with the line. * `viewport`: Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`. * `auto`: When `symbol-placement` is set to `point`, this is equivalent to - `viewport`. When `symbol-placement` is set to `line`, this is equivalent to - `map`. + `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is + equivalent to `map`. * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -795,8 +802,9 @@ MGL_EXPORT This property is only applied to the style if `iconImageName` is non-`nil`, and `iconRotationAlignment` is set to an expression that evaluates to `map`, and - `symbolPlacement` is set to an expression that evaluates to `line`. Otherwise, - it is ignored. + `symbolPlacement` is set to an expression that evaluates to either + `MGLSymbolPlacementLine` or `MGLSymbolPlacementLineCenter`. Otherwise, it is + ignored. This attribute corresponds to the <a href="https://www.mapbox.com/mapbox-gl-style-spec/#layout-symbol-icon-keep-upright"><code>icon-keep-upright</code></a> @@ -828,8 +836,9 @@ MGL_EXPORT This property is only applied to the style if `text` is non-`nil`, and `textRotationAlignment` is set to an expression that evaluates to `map`, and - `symbolPlacement` is set to an expression that evaluates to `line`. Otherwise, - it is ignored. + `symbolPlacement` is set to an expression that evaluates to either + `MGLSymbolPlacementLine` or `MGLSymbolPlacementLineCenter`. Otherwise, it is + ignored. This attribute corresponds to the <a href="https://www.mapbox.com/mapbox-gl-style-spec/#layout-symbol-text-keep-upright"><code>text-keep-upright</code></a> @@ -861,8 +870,9 @@ MGL_EXPORT `45`. Set this property to `nil` to reset it to the default value. This property is only applied to the style if `text` is non-`nil`, and - `symbolPlacement` is set to an expression that evaluates to `line`. Otherwise, - it is ignored. + `symbolPlacement` is set to an expression that evaluates to either + `MGLSymbolPlacementLine` or `MGLSymbolPlacementLineCenter`. Otherwise, it is + ignored. This attribute corresponds to the <a href="https://www.mapbox.com/mapbox-gl-style-spec/#layout-symbol-text-max-angle"><code>text-max-angle</code></a> @@ -956,6 +966,9 @@ MGL_EXPORT * `point`: The label is placed at the point where the geometry is located. * `line`: The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. + * `line-center`: The label is placed at the center of the line of the + geometry. Can only be used on `LineString` and `Polygon` geometries. Note that + a single feature in a vector tile may contain multiple line geometries. * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables @@ -1427,12 +1440,13 @@ MGL_EXPORT * Constant `MGLTextRotationAlignment` values * Any of the following constant string values: * `map`: When `symbol-placement` is set to `point`, aligns text east-west. - When `symbol-placement` is set to `line`, aligns text x-axes with the line. + When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes + with the line. * `viewport`: Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`. * `auto`: When `symbol-placement` is set to `point`, this is equivalent to - `viewport`. When `symbol-placement` is set to `line`, this is equivalent to - `map`. + `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is + equivalent to `map`. * Predefined functions, including mathematical and string operators * Conditional expressions * Variable assignments and references to assigned variables |