diff options
Diffstat (limited to 'platform/ios/app/MBXAnnotationView.m')
-rw-r--r-- | platform/ios/app/MBXAnnotationView.m | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/platform/ios/app/MBXAnnotationView.m b/platform/ios/app/MBXAnnotationView.m index 890881a316..c181211431 100644 --- a/platform/ios/app/MBXAnnotationView.m +++ b/platform/ios/app/MBXAnnotationView.m @@ -25,4 +25,40 @@ } } +- (void)setSelected:(BOOL)selected animated:(BOOL)animated +{ + [super setSelected:selected animated:animated]; + + self.layer.borderColor = selected ? [UIColor blackColor].CGColor : [UIColor whiteColor].CGColor; + self.layer.borderWidth = selected ? 2.0 : 0; +} + +- (void)setDragState:(MGLAnnotationViewDragState)dragState animated:(BOOL)animated +{ + [super setDragState:dragState animated:NO]; + + switch (dragState) { + case MGLAnnotationViewDragStateNone: + break; + case MGLAnnotationViewDragStateStarting: { + [UIView animateWithDuration:.4 delay:0 usingSpringWithDamping:.4 initialSpringVelocity:.5 options:UIViewAnimationOptionCurveLinear animations:^{ + self.transform = CGAffineTransformScale(CGAffineTransformIdentity, 2, 2); + } completion:nil]; + break; + } + case MGLAnnotationViewDragStateDragging: + break; + case MGLAnnotationViewDragStateCanceling: + break; + case MGLAnnotationViewDragStateEnding: { + [UIView animateWithDuration:.4 delay:0 usingSpringWithDamping:.4 initialSpringVelocity:.5 options:UIViewAnimationOptionCurveLinear animations:^{ + self.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1, 1); + } completion:nil]; + break; + } + } + +} + + @end |