diff options
author | Lloyd Sheng <i@lloydsheng.com> | 2019-03-11 23:06:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-11 23:06:16 +0800 |
commit | 60ceac5efc3d77199f773f08400fe1d53d5a1b90 (patch) | |
tree | 782c821978c8d4b7da2aff2aef9ab24b3c70e88e /platform/ios/src/MGLMapView.h | |
parent | 5ccc5b7c360827fe58698c28cae4df399310e4d1 (diff) | |
download | qtlocation-mapboxgl-60ceac5efc3d77199f773f08400fe1d53d5a1b90.tar.gz |
[iOS] Enable developers to change position of ornaments (#13911)
* APIs for change position of ornaments
* Use anchors APIs and emove iOS8 layout code
* Add ornaments layout tests
Diffstat (limited to 'platform/ios/src/MGLMapView.h')
-rw-r--r-- | platform/ios/src/MGLMapView.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h index eae48adf0a..1ef64a587b 100644 --- a/platform/ios/src/MGLMapView.h +++ b/platform/ios/src/MGLMapView.h @@ -49,6 +49,24 @@ typedef NS_ENUM(NSUInteger, MGLAnnotationVerticalAlignment) { }; /** + The position of scale bar, compass, logo and attribution in a map view. Used with + `MGLMapView.scaleBarPosition`, + `MGLMapView.compassViewPosition`, + `MGLMapView.logoViewPosition`, + `MGLMapView.attributionButtonPosition`. + */ +typedef NS_ENUM(NSUInteger, MGLOrnamentPosition) { + /** Place the ornament in the top left of the map view. */ + MGLOrnamentPositionTopLeft = 0, + /** Place the ornament in the top right of the map view. */ + MGLOrnamentPositionTopRight, + /** Place the ornament in the bottom left of the map view. */ + MGLOrnamentPositionBottomLeft, + /** Place the ornament in the bottom right of the map view. */ + MGLOrnamentPositionBottomRight, +}; + +/** The mode used to track the user location on the map. Used with `MGLMapView.userTrackingMode`. @@ -287,12 +305,32 @@ MGL_EXPORT IB_DESIGNABLE @property (nonatomic, readonly) UIView *scaleBar; /** + The position of the scale bar. The default value is `MGLOrnamentPositionTopLeft`. + */ +@property (nonatomic, assign) MGLOrnamentPosition scaleBarPosition; + +/** + A `CGPoint` indicating the position offset of the scale bar. + */ +@property (nonatomic, assign) CGPoint scaleBarMargins; + +/** A control indicating the map’s direction and allowing the user to manipulate the direction, positioned in the upper-right corner. */ @property (nonatomic, readonly) UIImageView *compassView; /** + The position of the compass view. The default value is `MGLOrnamentPositionTopRight`. + */ +@property (nonatomic, assign) MGLOrnamentPosition compassViewPosition; + +/** + A `CGPoint` indicating the position offset of the compass. + */ +@property (nonatomic, assign) CGPoint compassViewMargins; + +/** The Mapbox logo, positioned in the lower-left corner. @note The Mapbox terms of service, which governs the use of Mapbox-hosted @@ -304,6 +342,17 @@ MGL_EXPORT IB_DESIGNABLE @property (nonatomic, readonly) UIImageView *logoView; /** + The position of the logo view. The default value is `MGLOrnamentPositionBottomLeft`. + */ +@property (nonatomic, assign) MGLOrnamentPosition logoViewPosition; + +/** + A `CGPoint` indicating the position offset of the logo. + */ +@property (nonatomic, assign) CGPoint logoViewMargins; + + +/** A view showing legally required copyright notices and telemetry settings, positioned at the bottom-right of the map view. @@ -329,6 +378,16 @@ MGL_EXPORT IB_DESIGNABLE @property (nonatomic, readonly) UIButton *attributionButton; /** + The position of the attribution button. The default value is `MGLOrnamentPositionBottomRight`. + */ +@property (nonatomic, assign) MGLOrnamentPosition attributionButtonPosition; + +/** + A `CGPoint` indicating the position offset of the attribution. + */ +@property (nonatomic, assign) CGPoint attributionButtonMargins; + +/** Show the attribution and telemetry action sheet. This action is performed when the user taps on the attribution button provided |