summaryrefslogtreecommitdiff
path: root/platform/ios/src/MGLAnnotationContainerView.m
diff options
context:
space:
mode:
Diffstat (limited to 'platform/ios/src/MGLAnnotationContainerView.m')
-rw-r--r--platform/ios/src/MGLAnnotationContainerView.m52
1 files changed, 52 insertions, 0 deletions
diff --git a/platform/ios/src/MGLAnnotationContainerView.m b/platform/ios/src/MGLAnnotationContainerView.m
new file mode 100644
index 0000000000..9a823c839c
--- /dev/null
+++ b/platform/ios/src/MGLAnnotationContainerView.m
@@ -0,0 +1,52 @@
+#import "MGLAnnotationContainerView.h"
+#import "MGLAnnotationView.h"
+
+@interface MGLAnnotationContainerView ()
+
+@property (nonatomic) NS_MUTABLE_ARRAY_OF(MGLAnnotationView *) *annotationViews;
+
+@end
+
+@implementation MGLAnnotationContainerView
+
+- (instancetype)initWithFrame:(CGRect)frame
+{
+ self = [super initWithFrame:frame];
+ if (self)
+ {
+ _annotationViews = [NSMutableArray array];
+ }
+ return self;
+}
+
++ (instancetype)annotationContainerViewWithAnnotationContainerView:(nonnull MGLAnnotationContainerView *)annotationContainerView
+{
+ MGLAnnotationContainerView *newAnnotationContainerView = [[MGLAnnotationContainerView alloc] initWithFrame:annotationContainerView.frame];
+ [newAnnotationContainerView addSubviews:annotationContainerView.subviews];
+ return newAnnotationContainerView;
+}
+
+- (void)addSubviews:(NS_ARRAY_OF(MGLAnnotationView *) *)subviews
+{
+ for (MGLAnnotationView *view in subviews)
+ {
+ [self addSubview:view];
+ [self.annotationViews addObject:view];
+ }
+}
+
+#pragma mark UIAccessibility methods
+
+- (UIAccessibilityTraits)accessibilityTraits {
+ return UIAccessibilityTraitAdjustable;
+}
+
+- (void)accessibilityIncrement {
+ [self.superview.superview accessibilityIncrement];
+}
+
+- (void)accessibilityDecrement {
+ [self.superview.superview accessibilityDecrement];
+}
+
+@end