diff options
author | Lauren Budorick <lauren@mapbox.com> | 2017-08-28 13:32:56 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-28 13:32:56 -0700 |
commit | 2de89a99bc86776c8cadedc0ae9b344fb78b8217 (patch) | |
tree | e930ceb8436646e0d6747f2b3e805bd640f2a436 /platform/darwin/src/MGLSymbolStyleLayer.h | |
parent | c6ab20e5c69c3705422e49c3511faf3e5ab79b05 (diff) | |
download | qtlocation-mapboxgl-2de89a99bc86776c8cadedc0ae9b344fb78b8217.tar.gz |
Implement icon-anchor property
Diffstat (limited to 'platform/darwin/src/MGLSymbolStyleLayer.h')
-rw-r--r-- | platform/darwin/src/MGLSymbolStyleLayer.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLSymbolStyleLayer.h b/platform/darwin/src/MGLSymbolStyleLayer.h index d8dded7dbd..bc39df5b16 100644 --- a/platform/darwin/src/MGLSymbolStyleLayer.h +++ b/platform/darwin/src/MGLSymbolStyleLayer.h @@ -8,6 +8,51 @@ NS_ASSUME_NONNULL_BEGIN /** + Part of the icon placed closest to the anchor. + + Values of this type are used in the `MGLSymbolStyleLayer.iconAnchor` + property. + */ +typedef NS_ENUM(NSUInteger, MGLIconAnchor) { + /** + The center of the icon is placed closest to the anchor. + */ + MGLIconAnchorCenter, + /** + The left side of the icon is placed closest to the anchor. + */ + MGLIconAnchorLeft, + /** + The right side of the icon is placed closest to the anchor. + */ + MGLIconAnchorRight, + /** + The top of the icon is placed closest to the anchor. + */ + MGLIconAnchorTop, + /** + The bottom of the icon is placed closest to the anchor. + */ + MGLIconAnchorBottom, + /** + The top left corner of the icon is placed closest to the anchor. + */ + MGLIconAnchorTopLeft, + /** + The top right corner of the icon is placed closest to the anchor. + */ + MGLIconAnchorTopRight, + /** + The bottom left corner of the icon is placed closest to the anchor. + */ + MGLIconAnchorBottomLeft, + /** + The bottom right corner of the icon is placed closest to the anchor. + */ + MGLIconAnchorBottomRight, +}; + +/** Orientation of icon when map is pitched. Values of this type are used in the `MGLSymbolStyleLayer.iconPitchAlignment` @@ -345,6 +390,34 @@ MGL_EXPORT @property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *iconAllowOverlap __attribute__((unavailable("Use iconAllowsOverlap instead."))); /** + Part of the icon placed closest to the anchor. + + The default value of this property is an `MGLStyleValue` object containing an + `NSValue` object containing `MGLIconAnchorCenter`. Set this property to `nil` + to reset it to the default value. + + This property is only applied to the style if `iconImageName` is non-`nil`. + Otherwise, it is ignored. + + You can set this property to an instance of: + + * `MGLConstantStyleValue` + * `MGLCameraStyleFunction` with an interpolation mode of: + * `MGLInterpolationModeExponential` + * `MGLInterpolationModeInterval` + * `MGLSourceStyleFunction` with an interpolation mode of: + * `MGLInterpolationModeExponential` + * `MGLInterpolationModeInterval` + * `MGLInterpolationModeCategorical` + * `MGLInterpolationModeIdentity` + * `MGLCompositeStyleFunction` with an interpolation mode of: + * `MGLInterpolationModeExponential` + * `MGLInterpolationModeInterval` + * `MGLInterpolationModeCategorical` + */ +@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *iconAnchor; + +/** If true, other symbols can be visible even if they collide with the icon. The default value of this property is an `MGLStyleValue` object containing an @@ -1984,6 +2057,19 @@ MGL_EXPORT #pragma mark Working with Symbol Style Layer Attribute Values /** + Creates a new value object containing the given `MGLIconAnchor` enumeration. + + @param iconAnchor The value for the new object. + @return A new value object that contains the enumeration value. + */ ++ (instancetype)valueWithMGLIconAnchor:(MGLIconAnchor)iconAnchor; + +/** + The `MGLIconAnchor` enumeration representation of the value. + */ +@property (readonly) MGLIconAnchor MGLIconAnchorValue; + +/** Creates a new value object containing the given `MGLIconPitchAlignment` enumeration. @param iconPitchAlignment The value for the new object. |