This repository has been archived by the owner on Jun 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 122
Expose styling options for the user location annotation. #403
Merged
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
da29a4f
Expose styling options for the user location annotation.
fabian-guerra 0698092
Rename delegate method and document
fabian-guerra d349291
Rename struct to clarify purpose
fabian-guerra 8a0db75
Change style implementation from struct to an object.
fabian-guerra b87f0a2
Update changelog
fabian-guerra f950630
Clarify documentation.
fabian-guerra 0322857
Update documentation
fabian-guerra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Change style implementation from struct to an object.
- Loading branch information
commit 8a0db7531f897d4b9c8ebea12a30e9ff0ebe8142
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#import <UIKit/UIKit.h> | ||
|
||
#import "MGLFoundation.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
/** | ||
A class containing information about the default User Location annotation view style. | ||
*/ | ||
MGL_EXPORT | ||
@interface MGLUserLocationAnnotationViewStyle : NSObject | ||
|
||
/** | ||
The puck's view fill color. | ||
*/ | ||
@property (nonatomic) UIColor *puckFillColor; | ||
/** | ||
The puck's view shadow color. | ||
*/ | ||
@property (nonatomic) UIColor *puckShadowColor; | ||
/** | ||
The puck's view shadow opacity. | ||
Set any value between 0.0 and 1.0. | ||
The default value of this property is equal to `0.25` | ||
*/ | ||
@property (nonatomic, assign) CGFloat puckShadowOpacity; | ||
/** | ||
The puck's arrow fill color. | ||
*/ | ||
@property (nonatomic) UIColor *puckArrowFillColor; | ||
/** | ||
The puck's halo fill color. | ||
*/ | ||
@property (nonatomic) UIColor *haloFillColor; | ||
/** | ||
The approximate's view halo fill color. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think |
||
*/ | ||
@property (nonatomic) UIColor *approximateHaloFillColor; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we note that any properties for the approximate view will only work in iOS 14+ when the user has enabled approximate location? |
||
/** | ||
The approximate's view halo border color. | ||
*/ | ||
@property (nonatomic) UIColor *approximateHaloBorderColor; | ||
/** | ||
The approximate's view halo border width. | ||
The default value of this property is equal to `2.0` | ||
*/ | ||
@property (nonatomic, assign) CGFloat approximateHaloBorderWidth; | ||
/** | ||
The approximate's view halo opacity. | ||
Set any value between 0.0 and 1.0 | ||
The default value of this property is equal to `0.15` | ||
*/ | ||
@property (nonatomic, assign) CGFloat approximateHaloOpacity; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#import "MGLUserLocationAnnotationViewStyle.h" | ||
#import "MGLLoggingConfiguration_Private.h" | ||
|
||
@implementation MGLUserLocationAnnotationViewStyle | ||
|
||
- (instancetype)init { | ||
if ((self = [super init])) { | ||
self.puckShadowOpacity = 0.25; | ||
self.approximateHaloBorderWidth = 2.0; | ||
self.approximateHaloOpacity = 0.15; | ||
} | ||
return self; | ||
} | ||
|
||
- (void)setPuckFillColor:(UIColor *)puckFillColor { | ||
MGLLogDebug(@"Setting puckFillColor: %@", puckFillColor); | ||
_puckFillColor = puckFillColor; | ||
} | ||
|
||
- (void)setPuckShadowColor:(UIColor *)puckShadowColor { | ||
MGLLogDebug(@"Setting puckShadowColor: %@", puckShadowColor); | ||
_puckShadowColor = puckShadowColor; | ||
} | ||
|
||
- (void)setPuckShadowOpacity:(CGFloat)puckShadowOpacity { | ||
MGLLogDebug(@"Setting puckShadowOpacity: %.2f", puckShadowOpacity); | ||
_puckShadowOpacity = puckShadowOpacity; | ||
} | ||
|
||
- (void)setPuckArrowFillColor:(UIColor *)puckArrowFillColor { | ||
MGLLogDebug(@"Setting puckArrowFillColor: %@", puckArrowFillColor); | ||
_puckArrowFillColor = puckArrowFillColor; | ||
} | ||
|
||
- (void)setHaloFillColor:(UIColor *)haloFillColor { | ||
MGLLogDebug(@"Setting haloFillColor: %@", haloFillColor); | ||
_haloFillColor = haloFillColor; | ||
} | ||
|
||
- (void)setApproximateHaloFillColor:(UIColor *)approximateHaloFillColor { | ||
MGLLogDebug(@"Setting approximateHaloFillColor: %@", approximateHaloFillColor); | ||
_approximateHaloFillColor = approximateHaloFillColor; | ||
} | ||
|
||
- (void)setApproximateHaloBorderColor:(UIColor *)approximateHaloBorderColor { | ||
MGLLogDebug(@"Setting approximateHaloBorderColor: %@", approximateHaloBorderColor); | ||
_approximateHaloBorderColor = approximateHaloBorderColor; | ||
} | ||
|
||
- (void)setApproximateHaloBorderWidth:(CGFloat)approximateHaloBorderWidth { | ||
MGLLogDebug(@"Setting approximateHaloBorderWidth: %.2f", approximateHaloBorderWidth); | ||
_approximateHaloBorderWidth = approximateHaloBorderWidth; | ||
} | ||
|
||
- (void)setApproximateHaloOpacity:(CGFloat)approximateHaloOpacity { | ||
MGLLogDebug(@"Setting approximateHaloOpacity: %.2f", approximateHaloOpacity); | ||
_approximateHaloOpacity = approximateHaloOpacity; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or, since the possessive form of "view" feels odd here, maybe: