├── .gitignore ├── AAMapStudio ├── AAChinaMapPaths.plist ├── AAMapLegendView.h ├── AAMapLegendView.m ├── AAMapTooltipView.h ├── AAMapTooltipView.m ├── AAMarkPointRippleView.h ├── AAMarkPointRippleView.m ├── AAProvinceName.plist ├── AARippleView.h ├── AARippleView.m ├── AAVectorMapView.h └── AAVectorMapView.m ├── AAMapStudioDemo.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── AAMapStudioDemo ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── VectorMapVC.h ├── VectorMapVC.m ├── ViewController.h ├── ViewController.m └── main.m ├── CHINESE-README.md ├── LICENSE ├── README.md └── _config.yml /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /AAMapStudio/AAChinaMapPaths.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAChartModel/AAMapStudio/ac511cebd57e032f1a262b44030520a954ff05b3/AAMapStudio/AAChinaMapPaths.plist -------------------------------------------------------------------------------- /AAMapStudio/AAMapLegendView.h: -------------------------------------------------------------------------------- 1 | // 2 | // AAMapLegendView.h 3 | // AAMapStudioDemo 4 | // 5 | // Created by An An on 2017/11/3. 6 | // Copyright © 2017年 An An. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AAMapLegendView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /AAMapStudio/AAMapLegendView.m: -------------------------------------------------------------------------------- 1 | // 2 | // AAMapLegendView.m 3 | // AAMapStudioDemo 4 | // 5 | // Created by An An on 2017/11/3. 6 | // Copyright © 2017年 An An. All rights reserved. 7 | // 8 | 9 | #import "AAMapLegendView.h" 10 | 11 | @implementation AAMapLegendView 12 | 13 | /* 14 | // Only override drawRect: if you perform custom drawing. 15 | // An empty implementation adversely affects performance during animation. 16 | - (void)drawRect:(CGRect)rect { 17 | // Drawing code 18 | } 19 | */ 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /AAMapStudio/AAMapTooltipView.h: -------------------------------------------------------------------------------- 1 | // 2 | // AAMapTooltipView.h 3 | // AAMapStudioDemo 4 | // 5 | // Created by An An on 2017/8/24. 6 | // Copyright © 2017年 An An. All rights reserved. 7 | // source code ----*** https://github.com/AAChartModel/AAMapStudio ***--- source code 8 | // 9 | 10 | /* 11 | 12 | * ------------------------------------------------------------------------------- 13 | * 14 | * ❀❀❀ WARM TIPS!!! ❀❀❀ 15 | * 16 | * Please contact me on GitHub,if there are any problems encountered in use. 17 | * GitHub Issues : https://github.com/AAChartModel/AAMapStudio/issues 18 | * ------------------------------------------------------------------------------- 19 | * And if you want to contribute for this project, please contact me as well 20 | * GitHub : https://github.com/AAChartModel 21 | * StackOverflow : https://stackoverflow.com/users/7842508/codeforu 22 | * JianShu : http://www.jianshu.com/u/f1e6753d4254 23 | * SegmentFault : https://segmentfault.com/u/huanghunbieguan 24 | * 25 | * ------------------------------------------------------------------------------- 26 | 27 | */ 28 | 29 | #import 30 | 31 | @interface AAMapTooltipView : UIView 32 | 33 | 34 | /** 35 | 标题文本内容 36 | */ 37 | @property (nonatomic, copy) NSString *titleText; 38 | 39 | /** 40 | 值文本内容 41 | */ 42 | @property (nonatomic, copy) NSString *valueText; 43 | 44 | /**************************借用 highchart 的 tooltip 属性列表*************************/ 45 | 46 | /** 47 | 是否启用动画效果 48 | */ 49 | @property (nonatomic, assign) BOOL *animation; 50 | 51 | /** 52 | 边框颜色 53 | */ 54 | @property (nonatomic, strong) UIColor *borderColor; 55 | 56 | /** 57 | 圆角半径 58 | */ 59 | @property (nonatomic, assign) CGFloat borderRadius; 60 | 61 | /** 62 | 边框宽度 63 | */ 64 | @property (nonatomic, assign) CGFloat borderWidth; 65 | 66 | /** 67 | 是否跟随手指移动 68 | */ 69 | @property (nonatomic, assign) BOOL followTouchMove; 70 | 71 | 72 | /** 73 | 浮动提示框隐藏延时时间 74 | */ 75 | @property (nonatomic, assign) CGFloat hideDelay; 76 | 77 | 78 | /** 79 | 是否开启阴影效果 80 | */ 81 | @property (nonatomic, assign) BOOL shadow; 82 | 83 | /**************************借用 highchart 的 tooltip 属性列表*************************/ 84 | 85 | @property (nonatomic, assign) UIEdgeInsets titleLabelPadding; 86 | 87 | @property (nonatomic, assign) UIEdgeInsets valueLabelPadding; 88 | @end 89 | -------------------------------------------------------------------------------- /AAMapStudio/AAMapTooltipView.m: -------------------------------------------------------------------------------- 1 | // 2 | // AAMapTooltipView.m 3 | // AAMapStudioDemo 4 | // 5 | // Created by An An on 2017/8/24. 6 | // Copyright © 2017年 An An. All rights reserved. 7 | // source code ----*** https://github.com/AAChartModel/AAMapStudio ***--- source code 8 | // 9 | 10 | /* 11 | 12 | * ------------------------------------------------------------------------------- 13 | * 14 | * ❀❀❀ WARM TIPS!!! ❀❀❀ 15 | * 16 | * Please contact me on GitHub,if there are any problems encountered in use. 17 | * GitHub Issues : https://github.com/AAChartModel/AAMapStudio/issues 18 | * ------------------------------------------------------------------------------- 19 | * And if you want to contribute for this project, please contact me as well 20 | * GitHub : https://github.com/AAChartModel 21 | * StackOverflow : https://stackoverflow.com/users/7842508/codeforu 22 | * JianShu : http://www.jianshu.com/u/f1e6753d4254 23 | * SegmentFault : https://segmentfault.com/u/huanghunbieguan 24 | * 25 | * ------------------------------------------------------------------------------- 26 | 27 | */ 28 | 29 | #import "AAMapTooltipView.h" 30 | 31 | @implementation AAMapTooltipView { 32 | UILabel *_titleLabel; 33 | UILabel *_valueLabel; 34 | } 35 | 36 | - (instancetype)init { 37 | self = [super init]; 38 | if (self) { 39 | 40 | self.bounds = CGRectMake(0, 0, 100, 61.8); 41 | self.layer.cornerRadius = 3; 42 | self.layer.masksToBounds = YES; 43 | self.alpha = 0.6; 44 | self.backgroundColor = [UIColor blackColor]; 45 | 46 | _titleLabel = [[UILabel alloc]init]; 47 | _titleLabel.textColor = [UIColor whiteColor]; 48 | _titleLabel.font = [UIFont systemFontOfSize:15.f]; 49 | _titleLabel.translatesAutoresizingMaskIntoConstraints = NO; 50 | [self addSubview:_titleLabel]; 51 | 52 | [self addConstraints:@[[NSLayoutConstraint constraintWithItem:_titleLabel 53 | attribute:NSLayoutAttributeLeft 54 | relatedBy:NSLayoutRelationEqual 55 | toItem:self 56 | attribute:NSLayoutAttributeLeft 57 | multiplier:1.0 58 | constant:10], 59 | [NSLayoutConstraint constraintWithItem:_titleLabel 60 | attribute:NSLayoutAttributeRight 61 | relatedBy:NSLayoutRelationEqual 62 | toItem:self 63 | attribute:NSLayoutAttributeRight 64 | multiplier:1.0 65 | constant:-10], 66 | [NSLayoutConstraint constraintWithItem:_titleLabel 67 | attribute:NSLayoutAttributeTop 68 | relatedBy:NSLayoutRelationEqual 69 | toItem:self 70 | attribute:NSLayoutAttributeTop 71 | multiplier:1.0 72 | constant:10]]]; 73 | 74 | 75 | 76 | _valueLabel = [[UILabel alloc]init]; 77 | _valueLabel.textColor = [UIColor whiteColor]; 78 | _valueLabel.font = [UIFont systemFontOfSize:12.f]; 79 | _valueLabel.translatesAutoresizingMaskIntoConstraints = NO; 80 | 81 | [self addSubview:_valueLabel]; 82 | 83 | [self addConstraints:@[[NSLayoutConstraint constraintWithItem:_valueLabel 84 | attribute:NSLayoutAttributeLeft 85 | relatedBy:NSLayoutRelationEqual 86 | toItem:self 87 | attribute:NSLayoutAttributeLeft 88 | multiplier:1.0 89 | constant:10], 90 | [NSLayoutConstraint constraintWithItem:_valueLabel 91 | attribute:NSLayoutAttributeRight 92 | relatedBy:NSLayoutRelationEqual 93 | toItem:self 94 | attribute:NSLayoutAttributeRight 95 | multiplier:1.0 96 | constant:-10], 97 | [NSLayoutConstraint constraintWithItem:_valueLabel 98 | attribute:NSLayoutAttributeTop 99 | relatedBy:NSLayoutRelationEqual 100 | toItem:_titleLabel 101 | attribute:NSLayoutAttributeBottom 102 | multiplier:1.0 103 | constant:10]]]; 104 | 105 | 106 | } 107 | return self; 108 | } 109 | 110 | #pragma mark -- setter method 111 | - (void)setTitleText:(NSString *)titleText { 112 | _titleLabel.text = titleText; 113 | } 114 | 115 | - (void)setValueText:(NSString *)valueText { 116 | _valueLabel.text = valueText; 117 | } 118 | 119 | - (void)setBorderColor:(UIColor *)borderColor { 120 | self.layer.borderColor = borderColor.CGColor; 121 | } 122 | 123 | - (void)setBorderRadius:(CGFloat)borderRadius { 124 | self.layer.cornerRadius = borderRadius; 125 | } 126 | 127 | - (void)setBorderWidth:(CGFloat)borderWidth { 128 | self.layer.borderWidth = borderWidth; 129 | } 130 | 131 | - (void)setShadow:(BOOL)shadow { 132 | _shadow = shadow; 133 | if (_shadow == YES) { 134 | self.layer.shadowOpacity = 0.5;// 阴影透明度 135 | self.layer.shadowColor = [UIColor grayColor].CGColor;// 阴影的颜色 136 | self.layer.shadowRadius = 3;// 阴影扩散的范围控制 137 | self.layer.shadowOffset = CGSizeMake(1, 1);// 阴影的范围 138 | } 139 | } 140 | 141 | 142 | - (void)setTitleLabelPadding:(UIEdgeInsets)titleLabelPadding { 143 | _titleLabelPadding = titleLabelPadding; 144 | 145 | } 146 | 147 | - (void)setValueLabelPadding:(UIEdgeInsets)valueLabelPadding { 148 | _valueLabelPadding = valueLabelPadding; 149 | } 150 | 151 | 152 | @end 153 | -------------------------------------------------------------------------------- /AAMapStudio/AAMarkPointRippleView.h: -------------------------------------------------------------------------------- 1 | // 2 | // AAMarkPointRippleView.h 3 | // Testing 4 | // 5 | // Created by An An on 2017/8/28. 6 | // Copyright © 2017年 An An. All rights reserved. 7 | // source code ----*** https://github.com/AAChartModel/AAMapStudio ***--- source code 8 | // 9 | 10 | /* 11 | 12 | * ------------------------------------------------------------------------------- 13 | * 14 | * ❀❀❀ WARM TIPS!!! ❀❀❀ 15 | * 16 | * Please contact me on GitHub,if there are any problems encountered in use. 17 | * GitHub Issues : https://github.com/AAChartModel/AAMapStudio/issues 18 | * ------------------------------------------------------------------------------- 19 | * And if you want to contribute for this project, please contact me as well 20 | * GitHub : https://github.com/AAChartModel 21 | * StackOverflow : https://stackoverflow.com/users/7842508/codeforu 22 | * JianShu : http://www.jianshu.com/u/f1e6753d4254 23 | * SegmentFault : https://segmentfault.com/u/huanghunbieguan 24 | * 25 | * ------------------------------------------------------------------------------- 26 | 27 | */ 28 | 29 | #import 30 | 31 | @interface AAMarkPointRippleView : UIView 32 | @property (nonatomic, strong) UIColor *visionColor;//视觉色彩 33 | @property (nonatomic, assign) NSUInteger instanceDelay;//复制时间间隔 34 | @property (nonatomic, assign) NSUInteger instanceCount;//复制图层个数 35 | 36 | 37 | - (void)beginAnimation; 38 | 39 | - (void)stopAnimation; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /AAMapStudio/AAMarkPointRippleView.m: -------------------------------------------------------------------------------- 1 | // 2 | // AAMarkPointRippleView.m 3 | // Testing 4 | // 5 | // Created by An An on 2017/8/28. 6 | // Copyright © 2017年 An An. All rights reserved. 7 | // source code ----*** https://github.com/AAChartModel/AAMapStudio ***--- source code 8 | // 9 | 10 | /* 11 | 12 | * ------------------------------------------------------------------------------- 13 | * 14 | * ❀❀❀ WARM TIPS!!! ❀❀❀ 15 | * 16 | * Please contact me on GitHub,if there are any problems encountered in use. 17 | * GitHub Issues : https://github.com/AAChartModel/AAMapStudio/issues 18 | * ------------------------------------------------------------------------------- 19 | * And if you want to contribute for this project, please contact me as well 20 | * GitHub : https://github.com/AAChartModel 21 | * StackOverflow : https://stackoverflow.com/users/7842508/codeforu 22 | * JianShu : http://www.jianshu.com/u/f1e6753d4254 23 | * SegmentFault : https://segmentfault.com/u/huanghunbieguan 24 | * 25 | * ------------------------------------------------------------------------------- 26 | 27 | */ 28 | 29 | #import "AAMarkPointRippleView.h" 30 | @interface AAMarkPointRippleView () 31 | 32 | @property (nonatomic, strong) CAShapeLayer *circleShapeLayer; 33 | 34 | @end 35 | 36 | @implementation AAMarkPointRippleView 37 | 38 | - (instancetype)init { 39 | self = [super init]; 40 | if (self) { 41 | 42 | self.instanceDelay = 1; 43 | self.instanceCount = 6; 44 | } 45 | return self; 46 | } 47 | 48 | - (void)beginAnimation { 49 | [self configureLayers]; 50 | // [self performSelector:@selector(delayMethod) withObject:nil/*可传任意类型参数*/ afterDelay:2.0]; 51 | [self delayMethod]; 52 | } 53 | 54 | - (void)configureLayers { 55 | CGFloat width = self.bounds.size.width; 56 | 57 | self.circleShapeLayer = [CAShapeLayer layer]; 58 | _circleShapeLayer.bounds = CGRectMake(0, 0, width, width); 59 | _circleShapeLayer.position = CGPointMake(width / 2.0, width / 2.0); 60 | _circleShapeLayer.path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(0, 0, width, width)].CGPath; 61 | _circleShapeLayer.fillColor = self.visionColor.CGColor; 62 | _circleShapeLayer.opacity = 0.0; 63 | 64 | CAReplicatorLayer *replicator = [CAReplicatorLayer layer]; 65 | replicator.bounds = CGRectMake(0, 0, width, width); 66 | replicator.position = CGPointMake(width / 2.0, width / 2.0); 67 | replicator.instanceDelay = self.instanceDelay;//复制时间间隔 68 | replicator.instanceCount = self.instanceCount;;//复制图层个数 69 | 70 | [replicator addSublayer:_circleShapeLayer]; 71 | [self.layer addSublayer:replicator]; 72 | } 73 | 74 | - (void)delayMethod { 75 | CABasicAnimation *alphaAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; 76 | alphaAnimation.fromValue = [NSNumber numberWithFloat:0.6]; 77 | alphaAnimation.toValue = [NSNumber numberWithFloat:0.0]; 78 | 79 | CABasicAnimation *scaleAnimation =[CABasicAnimation animationWithKeyPath:@"transform"]; 80 | CATransform3D t = CATransform3DIdentity; 81 | CATransform3D t2 = CATransform3DScale(t, 0.0, 0.0, 0.0); 82 | scaleAnimation.fromValue = [NSValue valueWithCATransform3D:t2]; 83 | CATransform3D t3 = CATransform3DScale(t, 1.0, 1.0, 0.0); 84 | scaleAnimation.toValue = [NSValue valueWithCATransform3D:t3]; 85 | 86 | CAAnimationGroup *animationGroup = [CAAnimationGroup animation]; 87 | animationGroup.animations = @[alphaAnimation, scaleAnimation]; 88 | animationGroup.duration = 4.0; 89 | animationGroup.autoreverses = NO; 90 | animationGroup.repeatCount = HUGE; 91 | 92 | [_circleShapeLayer addAnimation:animationGroup forKey:nil]; 93 | } 94 | 95 | - (void)stopAnimation { 96 | [_circleShapeLayer removeAllAnimations]; 97 | } 98 | 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /AAMapStudio/AAProvinceName.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAChartModel/AAMapStudio/ac511cebd57e032f1a262b44030520a954ff05b3/AAMapStudio/AAProvinceName.plist -------------------------------------------------------------------------------- /AAMapStudio/AARippleView.h: -------------------------------------------------------------------------------- 1 | // 2 | // AARipple.h 3 | // AARipple 4 | // 5 | // Created by An An on 2017/8/24. 6 | // Copyright © 2017年 An An. All rights reserved. 7 | // source code ----*** https://github.com/AAChartModel/AAMapStudio ***--- source code 8 | // 9 | 10 | /* 11 | 12 | * ------------------------------------------------------------------------------- 13 | * 14 | * ❀❀❀ WARM TIPS!!! ❀❀❀ 15 | * 16 | * Please contact me on GitHub,if there are any problems encountered in use. 17 | * GitHub Issues : https://github.com/AAChartModel/AAMapStudio/issues 18 | * ------------------------------------------------------------------------------- 19 | * And if you want to contribute for this project, please contact me as well 20 | * GitHub : https://github.com/AAChartModel 21 | * StackOverflow : https://stackoverflow.com/users/7842508/codeforu 22 | * JianShu : http://www.jianshu.com/u/f1e6753d4254 23 | * SegmentFault : https://segmentfault.com/u/huanghunbieguan 24 | * 25 | * ------------------------------------------------------------------------------- 26 | 27 | */ 28 | 29 | #import 30 | 31 | @interface AARippleView : UIView 32 | 33 | typedef NS_ENUM(NSInteger,AARippleEffect){ 34 | AARippleEffectRing = 0, 35 | AARippleEffectSolidCircle, 36 | AARippleEffectStaticBubble, 37 | AARippleEffectDynamicBubble, 38 | }; 39 | 40 | @property (nonatomic, assign) AARippleEffect effectType; 41 | 42 | - (void)startAnimation; 43 | - (void)stopAnimation; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /AAMapStudio/AARippleView.m: -------------------------------------------------------------------------------- 1 | // 2 | // AARippleView.m 3 | // AARippleView 4 | // 5 | // Created by An An on 2017/8/24. 6 | // Copyright © 2017年 An An. All rights reserved. 7 | // source code ----*** https://github.com/AAChartModel/AAMapStudio ***--- source code 8 | // 9 | 10 | /* 11 | 12 | * ------------------------------------------------------------------------------- 13 | * 14 | * ❀❀❀ WARM TIPS!!! ❀❀❀ 15 | * 16 | * Please contact me on GitHub,if there are any problems encountered in use. 17 | * GitHub Issues : https://github.com/AAChartModel/AAMapStudio/issues 18 | * ------------------------------------------------------------------------------- 19 | * And if you want to contribute for this project, please contact me as well 20 | * GitHub : https://github.com/AAChartModel 21 | * StackOverflow : https://stackoverflow.com/users/7842508/codeforu 22 | * JianShu : http://www.jianshu.com/u/f1e6753d4254 23 | * SegmentFault : https://segmentfault.com/u/huanghunbieguan 24 | * 25 | * ------------------------------------------------------------------------------- 26 | 27 | */ 28 | 29 | #import "AARippleView.h" 30 | 31 | @interface AARippleView() 32 | 33 | @property (nonatomic, strong) CAGradientLayer *gradientLayer; 34 | @property (nonatomic, strong) CAReplicatorLayer *replicatorLayer; 35 | @property (nonatomic, strong) CAShapeLayer *circleLayer; 36 | 37 | 38 | //gradient layer property 39 | @property (nonatomic, copy ) NSArray *colors; 40 | @property (nonatomic, copy ) NSArray *locations; 41 | @property (nonatomic, assign) CGPoint startPoint; 42 | @property (nonatomic, assign) CGPoint endPoint; 43 | 44 | //replicator layer property 45 | @property (nonatomic, assign) NSUInteger count; 46 | @property (nonatomic, assign) CGFloat duration; 47 | 48 | //circle layer property 49 | @property (nonatomic, assign) CGFloat minRadius; 50 | @property (nonatomic, assign) CGFloat maxRadius; 51 | @property (nonatomic, assign) CGFloat lineWidth; 52 | 53 | //animation property 54 | @property (nonatomic, strong) CAMediaTimingFunction *timingFunction; 55 | 56 | 57 | @end 58 | 59 | @implementation AARippleView 60 | 61 | 62 | - (instancetype)init { 63 | self = [super init]; 64 | if (self) { 65 | self.gradientLayer = ({ 66 | CAGradientLayer *layer = [CAGradientLayer new]; 67 | [self.layer addSublayer:layer]; 68 | layer; 69 | }); 70 | 71 | self.replicatorLayer = ({ 72 | CAReplicatorLayer *layer = [CAReplicatorLayer new]; 73 | self.gradientLayer.mask = layer; 74 | layer; 75 | }); 76 | 77 | self.circleLayer = ({ 78 | CAShapeLayer *layer = [CAShapeLayer new]; 79 | layer.strokeColor = [UIColor whiteColor].CGColor; 80 | layer.fillColor = [UIColor clearColor].CGColor; 81 | [self.replicatorLayer addSublayer:layer]; 82 | layer; 83 | }); 84 | 85 | self.minRadius = 10; 86 | self.maxRadius = 100; 87 | self.duration = 3.0f; 88 | self.count = 6; 89 | self.lineWidth = 2.0f; 90 | self.colors = @[(__bridge id)[UIColor orangeColor].CGColor, 91 | (__bridge id)[UIColor orangeColor].CGColor]; 92 | self.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; 93 | } 94 | 95 | return self; 96 | } 97 | 98 | - (void)setColors:(NSArray *)colors { 99 | self.gradientLayer.colors = colors; 100 | } 101 | 102 | - (NSArray *)colors { 103 | return self.gradientLayer.colors; 104 | } 105 | 106 | - (void)setLocations:(NSArray *)locations { 107 | self.gradientLayer.locations = locations; 108 | } 109 | 110 | - (NSArray *)locations { 111 | return self.gradientLayer.locations; 112 | } 113 | 114 | - (void)setStartPoint:(CGPoint)startPoint { 115 | self.gradientLayer.startPoint = startPoint; 116 | } 117 | 118 | - (CGPoint)startPoint { 119 | return self.gradientLayer.startPoint; 120 | } 121 | 122 | - (void)setEndPoint:(CGPoint)endPoint { 123 | self.gradientLayer.endPoint = endPoint; 124 | } 125 | 126 | - (CGPoint)endPoint { 127 | return self.gradientLayer.endPoint; 128 | } 129 | 130 | - (void)setDuration:(CGFloat)duration { 131 | _duration = duration; 132 | 133 | if (_count != 0) { 134 | self.replicatorLayer.instanceCount = _count; 135 | self.replicatorLayer.instanceDelay = self.duration/(CGFloat)_count; 136 | } 137 | } 138 | 139 | - (void)setCount:(NSUInteger)count { 140 | _count = count; 141 | 142 | if (_count != 0) { 143 | self.replicatorLayer.instanceCount = _count; 144 | self.replicatorLayer.instanceDelay = self.duration/(CGFloat)_count; 145 | } 146 | } 147 | 148 | - (void)setLineWidth:(CGFloat)lineWidth { 149 | _lineWidth = lineWidth; 150 | 151 | self.circleLayer.lineWidth = lineWidth; 152 | } 153 | 154 | - (void)layoutSubviews { 155 | [super layoutSubviews]; 156 | 157 | self.gradientLayer.frame = self.bounds; 158 | self.replicatorLayer.frame = self.bounds; 159 | self.circleLayer.frame = self.bounds; 160 | } 161 | 162 | - (void)startAnimation { 163 | if (self.effectType == 1) { 164 | [self launchRippleEffect]; 165 | } else { 166 | CGRect fromRect = CGRectMake(CGRectGetMidX(self.bounds)-self.minRadius, 167 | CGRectGetMidY(self.bounds)-self.minRadius, 168 | self.minRadius*2, 169 | self.minRadius*2); 170 | CGRect toRect = CGRectMake(CGRectGetMidX(self.bounds)-self.maxRadius, 171 | CGRectGetMidY(self.bounds)-self.maxRadius, 172 | self.maxRadius*2, 173 | self.maxRadius*2); 174 | 175 | CABasicAnimation *zoomAnimation = [CABasicAnimation animationWithKeyPath:@"path"]; 176 | zoomAnimation.duration = self.duration; 177 | zoomAnimation.fromValue = (__bridge id)[UIBezierPath bezierPathWithOvalInRect:fromRect].CGPath; 178 | zoomAnimation.toValue = (__bridge id)[UIBezierPath bezierPathWithOvalInRect:toRect].CGPath; 179 | zoomAnimation.repeatCount = HUGE_VAL; 180 | zoomAnimation.timingFunction = self.timingFunction; 181 | [self.circleLayer addAnimation:zoomAnimation forKey:@"zoom"]; 182 | 183 | CABasicAnimation *fadeAnimation = [CABasicAnimation animationWithKeyPath:@"strokeColor"]; 184 | fadeAnimation.duration = self.duration; 185 | fadeAnimation.fromValue = (__bridge id)[UIColor whiteColor].CGColor; 186 | fadeAnimation.toValue = (__bridge id)[UIColor clearColor].CGColor; 187 | fadeAnimation.repeatCount = HUGE_VAL; 188 | fadeAnimation.timingFunction = self.timingFunction; 189 | [self.circleLayer addAnimation:fadeAnimation forKey:@"fade"]; 190 | } 191 | } 192 | 193 | - (void)stopAnimation { 194 | [self.circleLayer removeAllAnimations]; 195 | } 196 | 197 | - (void)setEffectType:(AARippleEffect)effectType { 198 | switch (effectType) { 199 | case 0: { 200 | self.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 201 | self.colors = @[(__bridge id)[UIColor blueColor].CGColor, 202 | (__bridge id)[UIColor blueColor].CGColor]; 203 | self.minRadius = 0; 204 | self.maxRadius = 80; 205 | self.duration = 5; 206 | self.count = 20; 207 | self.lineWidth = 1.0f; 208 | 209 | break; 210 | } 211 | case 1: { 212 | self.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]; 213 | self.colors = @[(__bridge id)[UIColor colorWithRed:0.996 green:0.647 blue:0.008 alpha:1].CGColor, 214 | (__bridge id)[UIColor colorWithRed:1 green:0.31 blue:0.349 alpha:1].CGColor]; 215 | 216 | CGRect screenRect = [UIScreen mainScreen].bounds; 217 | CGFloat posY = (CGRectGetHeight(screenRect)-320)/2/CGRectGetHeight(screenRect); 218 | 219 | self.startPoint = CGPointMake(0.5, posY); 220 | self.endPoint = CGPointMake(0.5, 1.0f - posY); 221 | self.minRadius = 40; 222 | self.maxRadius = 100; 223 | self.duration = 2; 224 | self.count = 4; 225 | self.lineWidth = 2.0f; 226 | 227 | UIView *dotView = [[UIView alloc]init]; 228 | dotView.backgroundColor = [UIColor blueColor]; 229 | dotView.frame = CGRectMake(0, 0, 100, 100); 230 | dotView.layer.cornerRadius = 50; 231 | dotView.clipsToBounds = YES; 232 | [self addSubview:dotView]; 233 | 234 | // UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; 235 | // btn.backgroundColor = [UIColor blueColor]; 236 | // [btn setBackgroundImage:[UIImage imageNamed:@"button"] forState:UIControlStateNormal]; 237 | // [btn setTitle:@"Tap" forState:UIControlStateNormal]; 238 | // btn.frame = CGRectMake(0, 0, 100, 100); 239 | // btn.center = self.center; 240 | // [btn addTarget:self action:@selector(launchRippleEffect) forControlEvents:UIControlEventTouchUpInside]; 241 | // [self addSubview:btn]; 242 | 243 | break; 244 | } 245 | case 2: { 246 | self.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; 247 | self.colors = @[(__bridge id)[UIColor redColor].CGColor, 248 | (__bridge id)[UIColor blueColor].CGColor]; 249 | self.startPoint = CGPointMake(0, 0.5); 250 | self.endPoint = CGPointMake(1, 0.5); 251 | self.minRadius = 0; 252 | self.maxRadius = 60; 253 | self.duration = 5; 254 | self.count = 1; 255 | self.lineWidth = 5.0f; 256 | 257 | break; 258 | } 259 | case 3: { 260 | self.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 261 | self.colors = @[(__bridge id)[UIColor whiteColor].CGColor, 262 | (__bridge id)[UIColor blackColor].CGColor, 263 | (__bridge id)[UIColor whiteColor].CGColor]; 264 | self.locations = @[@(0.3),@(0.5),@(0.7)]; 265 | self.startPoint = CGPointMake(0, 0.5); 266 | self.endPoint = CGPointMake(1, 0.5); 267 | self.minRadius = 0; 268 | self.maxRadius = 100; 269 | self.duration = 3; 270 | self.count = 6; 271 | self.lineWidth = 3.0f; 272 | 273 | break; 274 | } 275 | 276 | default: 277 | break; 278 | } 279 | } 280 | 281 | - (void)launchRippleEffect { 282 | 283 | NSInteger maxI = 2; 284 | NSInteger maxJ = 2; 285 | NSMutableArray *pulseArray = @[].mutableCopy; 286 | for (int i = 0; i < maxI*maxJ ; ++i){ 287 | [pulseArray addObject:[AARippleView new]]; 288 | } 289 | 290 | AARippleView *pulseView = pulseArray[1]; 291 | pulseView.tag = 1 - pulseView.tag; 292 | (pulseView.tag>0)?[pulseView startAnimation]:[pulseView stopAnimation]; 293 | } 294 | 295 | @end 296 | -------------------------------------------------------------------------------- /AAMapStudio/AAVectorMapView.h: -------------------------------------------------------------------------------- 1 | // 2 | // AAVectorMapView.h 3 | // AAMapStudioDemo 4 | // 5 | // Created by An An on 2017/8/24. 6 | // Copyright © 2017年 apple. All rights reserved. 7 | // source code ----*** https://github.com/AAChartModel/AAMapStudio ***--- source code 8 | // 9 | 10 | /* 11 | 12 | * ------------------------------------------------------------------------------- 13 | * 14 | * ❀❀❀ WARM TIPS!!! ❀❀❀ 15 | * 16 | * Please contact me on GitHub,if there are any problems encountered in use. 17 | * GitHub Issues : https://github.com/AAChartModel/AAMapStudio/issues 18 | * ------------------------------------------------------------------------------- 19 | * And if you want to contribute for this project, please contact me as well 20 | * GitHub : https://github.com/AAChartModel 21 | * StackOverflow : https://stackoverflow.com/users/7842508/codeforu 22 | * JianShu : http://www.jianshu.com/u/f1e6753d4254 23 | * SegmentFault : https://segmentfault.com/u/huanghunbieguan 24 | * 25 | * ------------------------------------------------------------------------------- 26 | 27 | */ 28 | 29 | #import 30 | #import "AARippleView.h" 31 | 32 | typedef NS_ENUM(NSInteger,AAMapRippleEffect) { 33 | AAMapRippleEffectRing = 0, //环形涟漪效果 34 | AAMapRippleEffectSolidCircle, //实心圆涟漪效果 35 | AAMapRippleEffectStaticBubble, //静态气泡 36 | AAMapRippleEffectDynamicBubble, //动态气泡 37 | }; 38 | 39 | typedef NS_ENUM(NSInteger,AAMapDataType) { 40 | AAMapDataTypeWithoutLine = 0, //没有连接线效果 41 | AAMapDataTypeWithLineExpand, //有起始点和结束点连线效果(向外扩张) 42 | AAMapDataTypeWithLineShrink, //有起始点结束点连线效果(向内收缩) 43 | }; 44 | 45 | 46 | typedef void (^AAMapViewDidTapBlock)(NSDictionary *tappedElementDic); 47 | 48 | 49 | @protocol AAMapViewDidTapDelegate 50 | 51 | - (void)aaMapViewDidTapWithTappedElementDictionary:(NSDictionary *)tappedElementDic; 52 | 53 | @end 54 | 55 | @interface AAVectorMapView : UIView 56 | @property (nonatomic, assign) AAMapDataType dataType; 57 | @property (nonatomic, strong) NSArray *seriesDataArr; 58 | @property (nonatomic, strong) UIColor *textColor; 59 | @property (nonatomic, assign) CGFloat textFont; 60 | @property (nonatomic, strong) UIColor *defaultBackgroundColor; 61 | @property (nonatomic, assign) BOOL tapEnabled; //用户是否可点击 62 | @property (nonatomic, assign) NSUInteger selectedIdx;//选中的地图块 63 | @property (nonatomic, assign) BOOL tooltipEnabled;//是否启用浮动提示框 64 | @property (nonatomic, assign) AARippleEffect effectType;//涟漪效果样式 65 | 66 | @property (nonatomic, weak ) id didTapDelegate;//代理传值 67 | @property (nonatomic, copy ) AAMapViewDidTapBlock didTapBlock;//block 传值 68 | 69 | @end 70 | 71 | 72 | -------------------------------------------------------------------------------- /AAMapStudio/AAVectorMapView.m: -------------------------------------------------------------------------------- 1 | // 2 | // AAVectorMapView.m 3 | // AAMapStudioDemo 4 | // 5 | // Created by An An on 2017/8/24. 6 | // Copyright © 2017年 An An. All rights reserved. 7 | // source code ----*** https://github.com/AAChartModel/AAMapStudio ***--- source code 8 | // 9 | 10 | /* 11 | 12 | * ------------------------------------------------------------------------------- 13 | * 14 | * ❀❀❀ WARM TIPS!!! ❀❀❀ 15 | * 16 | * Please contact me on GitHub,if there are any problems encountered in use. 17 | * GitHub Issues : https://github.com/AAChartModel/AAMapStudio/issues 18 | * ------------------------------------------------------------------------------- 19 | * And if you want to contribute for this project, please contact me as well 20 | * GitHub : https://github.com/AAChartModel 21 | * StackOverflow : https://stackoverflow.com/users/7842508/codeforu 22 | * JianShu : http://www.jianshu.com/u/f1e6753d4254 23 | * SegmentFault : https://segmentfault.com/u/huanghunbieguan 24 | * 25 | * ------------------------------------------------------------------------------- 26 | 27 | */ 28 | 29 | #import "AAVectorMapView.h" 30 | //#import "YSCRippleView.h" 31 | #import "AAMapTooltipView.h" 32 | //#import "WorldContinentMap.h" 33 | #import "AAMarkPointRippleView.h" 34 | 35 | 36 | 37 | /** 38 | * 固定宽高560*500 39 | */ 40 | #define AABackgroundColor [UIColor colorWithRed:(rand()%256)/256.0 green:(rand()%256)/256.0 blue:(rand()%256)/256.0 alpha:1] 41 | #define AADefaultBackgroundColor [UIColor colorWithRed: 0.777 green: 0.666 blue: 1 alpha: 1] 42 | 43 | @interface AAVectorMapView (){ 44 | NSMutableArray * _ripplePointArr; 45 | 46 | } 47 | @property (nonatomic, strong) NSMutableArray *bezierCurveArr; //地图块贝塞尔曲线数组 48 | @property (nonatomic, strong) NSMutableArray *areaColorArr; //每块地图的颜色数组 49 | @property (nonatomic, strong) NSMutableArray *provinceNameArr; //各个省级行政区名字及位置数组 50 | 51 | @property (nonatomic, strong) AAMarkPointRippleView *rippleView; 52 | @property (nonatomic, assign) CGRect textRect; 53 | @property (nonatomic, strong) UITapGestureRecognizer *tapRecognizer; 54 | @property (nonatomic, strong) AAMapTooltipView *toolTipView; 55 | @property (nonatomic, strong) NSMutableDictionary *provinceNameAndRectDic;//省名称和坐标对应的点 56 | 57 | //@property (nonatomic, strong) WorldContinentMap *worldMap; 58 | 59 | @end 60 | 61 | @implementation AAVectorMapView 62 | 63 | #pragma mark - init 64 | - (instancetype)initWithFrame:(CGRect)frame { 65 | 66 | if (self = [super initWithFrame:CGRectMake(0, 0, 560, 480)]) { 67 | self.backgroundColor = [UIColor whiteColor]; 68 | self.textFont = 11.0f; 69 | self.textColor = [UIColor darkGrayColor]; 70 | self.defaultBackgroundColor = [UIColor colorWithRed:(rand()%256)/256.0 green:(rand()%256)/256.0 blue:(rand()%256)/256.0 alpha:1]; 71 | 72 | // [UIView animateWithDuration:1. animations:^{ 73 | CGFloat scale = frame.size.width/560.; 74 | self.transform = CGAffineTransformMakeScale(scale, scale);//宽高伸缩比例 75 | self.center = CGPointMake(frame.size.width *0.5,frame.size.height *0.5); 76 | // }]; 77 | // self.worldMap = [[WorldContinentMap alloc]init]; 78 | // self.worldMap.frame =CGRectMake(0, 0, self.frame.size.width, self.frame.size.height); 79 | // [self.worldMap drawCanvas1]; 80 | // [self addSubview:self.worldMap]; 81 | 82 | 83 | // //遍历34个地图块.判断点击的是那一块 84 | // for (int i = 0; i <34; i++) { 85 | // 86 | // self.areaColorArr[i] = AABackgroundColor; 87 | // [self setNeedsDisplay]; 88 | // 89 | // 90 | // 91 | // } 92 | 93 | 94 | _ripplePointArr = [[NSMutableArray alloc]init]; 95 | 96 | 97 | } 98 | return self; 99 | } 100 | 101 | 102 | 103 | #pragma mark - render infographic 104 | - (void)drawRect:(CGRect)rect { 105 | //画地图 106 | [self drawTheMapView]; 107 | 108 | //画文字和涟漪动效视图 109 | [self drawTheTextAndRippleView]; 110 | 111 | UIColor *color = [UIColor blueColor]; 112 | [color set]; 113 | 114 | if (self.dataType == AAMapDataTypeWithoutLine) { 115 | [self.seriesDataArr enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 116 | NSValue *rectValue = self.provinceNameAndRectDic[obj[@"name"]]; 117 | CGRect rect = [rectValue CGRectValue]; 118 | // [self configureTheDynamicLineWithStartPoin:CGPointMake(10, 70) toEndPoint:CGPointMake(rect.origin.x, rect.origin.y)]; 119 | // [self configureTheDynamicLineWithStartPoin:startPoint toEndPoint:CGPointMake(rect.origin.x, rect.origin.y)]; 120 | [self configureTheRippleViewWithPointPosition:CGPointMake(rect.origin.x, rect.origin.y)]; 121 | 122 | }]; 123 | 124 | } else if(self.dataType == AAMapDataTypeWithLineExpand) { 125 | [self.seriesDataArr enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 126 | // NSArray *provinceNameArr = @[@"安徽",@"新疆",@"江苏"]; 127 | NSValue *startPointRectValue = self.provinceNameAndRectDic[obj[0][@"name"]]; 128 | CGRect startPointRect = [startPointRectValue CGRectValue]; 129 | CGPoint startPoint = CGPointMake(startPointRect.origin.x, startPointRect.origin.y); 130 | 131 | NSValue *rectValue = self.provinceNameAndRectDic[obj[1][@"name"]]; 132 | CGRect rect = [rectValue CGRectValue]; 133 | // [self configureTheDynamicLineWithStartPoin:CGPointMake(10, 70) toEndPoint:CGPointMake(rect.origin.x, rect.origin.y)]; 134 | [self configureTheDynamicLineWithStartPoin:startPoint toEndPoint:CGPointMake(rect.origin.x, rect.origin.y)]; 135 | 136 | 137 | }]; 138 | } 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | // for (int i=0; i<10; i++) { 147 | // 148 | // NSValue *rectValue= self.provinceNameArr[arc4random()%34][@"rect"]; 149 | // CGRect rect = [rectValue CGRectValue]; 150 | // [self configureTheDynamicLineWithStartPoin:CGPointMake(10, 70) toEndPoint:CGPointMake(rect.origin.x, rect.origin.y)]; 151 | // 152 | // 153 | // } 154 | 155 | [self performSelector:@selector(delayConfigureTheRippleView) withObject:nil/*可传任意类型参数*/ afterDelay:2.0]; 156 | } 157 | 158 | //绘制地图主视图 159 | - (void)drawTheMapView { 160 | 161 | UIColor *strokeColor = [UIColor colorWithRed: 0.976 green: 0.988 blue: 0.996 alpha: 1]; 162 | 163 | [self.bezierCurveArr enumerateObjectsUsingBlock:^(UIBezierPath * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 164 | obj.miterLimit = 4; 165 | obj.lineJoinStyle = kCGLineJoinRound; 166 | [self.areaColorArr[idx] setFill]; 167 | [obj fill]; 168 | [strokeColor setStroke]; 169 | obj.lineWidth = 1; 170 | [obj stroke]; 171 | }]; 172 | } 173 | 174 | - (void)drawTheTextAndRippleView { 175 | // 绘制文字 176 | __weak typeof(self) weakSelf = self; 177 | // [self.provinceNameArr enumerateObjectsUsingBlock:^(NSDictionary * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 178 | // NSString *name = obj[@"name"]; 179 | // NSValue *rectValue = obj[@"rect"]; 180 | // self.textRect = [rectValue CGRectValue]; 181 | // [weakSelf configureTextWithTextContentString:name rect:rectValue]; 182 | // 183 | 184 | // }]; 185 | 186 | [self.provinceNameAndRectDic enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSValue *obj, BOOL * _Nonnull stop) { 187 | [weakSelf configureTextWithTextContentString:key rect:obj]; 188 | }]; 189 | } 190 | 191 | 192 | //绘制贝塞尔动态路径 193 | - (void)configureTheDynamicLineWithStartPoin:(CGPoint)startPoint toEndPoint:(CGPoint)endPoint { 194 | [self drawLineWithStarPoint:startPoint endPoint:endPoint]; 195 | [_ripplePointArr addObject:[NSValue valueWithCGPoint:endPoint]]; 196 | 197 | 198 | 199 | 200 | // UILabel *redDotLabel = [[UILabel alloc]init]; 201 | // redDotLabel.backgroundColor = [UIColor redColor]; 202 | // redDotLabel.center = startPoint; 203 | // redDotLabel.layer.cornerRadius = 10; 204 | // redDotLabel.layer.masksToBounds = YES; 205 | // redDotLabel.bounds = CGRectMake(0, 0, 20, 20); 206 | // [self addSubview:redDotLabel]; 207 | 208 | 209 | 210 | 211 | // [UIView animateWithDuration:2 212 | // delay:0.5 213 | // options:0 214 | // animations:^{ 215 | // redDotLabel.center = endPoint; 216 | // 217 | // } completion:^(BOOL finished) { 218 | // [UIView animateWithDuration:1 219 | // animations:^{ 220 | // redDotLabel.bounds = CGRectMake(0, 0, 0, 0); 221 | // redDotLabel.alpha = 0; 222 | // } completion:^(BOOL finished) { 223 | // 224 | // [self configureTheRippleViewWithPointPosition:endPoint]; 225 | // 226 | // [redDotLabel removeFromSuperview]; 227 | // 228 | // }]; 229 | // 230 | // }]; 231 | 232 | 233 | 234 | 235 | } 236 | 237 | - (void)delayConfigureTheRippleView { 238 | [_ripplePointArr enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 239 | CGPoint p = [obj CGPointValue]; 240 | [self configureTheRippleViewWithPointPosition:p]; 241 | }]; 242 | 243 | 244 | } 245 | 246 | //绘制涟漪视图 247 | - (void)configureTheRippleViewWithPointPosition:(CGPoint )point { 248 | CGFloat randomWidth = arc4random()%110+20; 249 | // self.rippleView = [[AAMarkPointRippleView alloc] init]; 250 | // self.rippleView.center = CGPointMake(point.x, point.y); 251 | // self.rippleView.bounds = CGRectMake(0, 0, randomWidth, randomWidth); 252 | // self.rippleView.visionColor = [UIColor redColor]; 253 | // [self addSubview:_rippleView]; 254 | // 255 | // [_rippleView beginAnimation]; 256 | 257 | 258 | AARippleView *rippleV = [[AARippleView alloc]init]; 259 | rippleV.effectType = self.effectType; 260 | rippleV.center = CGPointMake(point.x, point.y); 261 | rippleV.bounds = CGRectMake(0, 0, randomWidth, randomWidth); 262 | [self addSubview:rippleV]; 263 | [rippleV startAnimation]; 264 | } 265 | 266 | //绘制文字 267 | - (void)configureTextWithTextContentString:(NSString *)name rect:(NSValue *)rect { 268 | CGRect textRect = [rect CGRectValue]; 269 | 270 | NSString *textContent = name; 271 | CGContextRef context = UIGraphicsGetCurrentContext(); 272 | NSMutableParagraphStyle *textStyle = NSMutableParagraphStyle.defaultParagraphStyle.mutableCopy; 273 | textStyle.alignment = NSTextAlignmentLeft; 274 | 275 | NSDictionary *textFontAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:self.textFont], 276 | NSForegroundColorAttributeName:self.textColor, 277 | NSParagraphStyleAttributeName:textStyle 278 | }; 279 | 280 | CGFloat textTextHeight = [textContent boundingRectWithSize:CGSizeMake(textRect.size.width, INFINITY) 281 | options:NSStringDrawingUsesLineFragmentOrigin 282 | attributes:textFontAttributes 283 | context:nil].size.height; 284 | 285 | CGContextSaveGState(context); 286 | CGContextClipToRect(context, textRect); 287 | 288 | [textContent drawInRect:CGRectMake(CGRectGetMinX(textRect), 289 | CGRectGetMinY(textRect) + (CGRectGetHeight(textRect) - textTextHeight)/2, 290 | CGRectGetWidth(textRect), 291 | textTextHeight) 292 | withAttributes: textFontAttributes]; 293 | 294 | CGContextRestoreGState(context); 295 | } 296 | 297 | #pragma mark -- setter 298 | - (void)setTapEnabled:(BOOL)tapEnabled { 299 | if (_tapEnabled != tapEnabled) { 300 | _tapEnabled = tapEnabled; 301 | if (_tapEnabled == YES) { 302 | self.tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(click:)]; 303 | [self addGestureRecognizer:self.tapRecognizer]; 304 | } else { 305 | if (_tapRecognizer) { 306 | [self removeGestureRecognizer:_tapRecognizer]; 307 | } 308 | } 309 | } 310 | } 311 | 312 | #pragma mark -- event action 313 | - (void)click:(UITapGestureRecognizer *)sender { 314 | CGPoint point = [sender locationInView:sender.view]; 315 | [self didTapWithTheSelectedPointPosition:point]; 316 | } 317 | 318 | - (void)didTapWithTheSelectedPointPosition:(CGPoint )point{ 319 | 320 | [self configureTheTooltipViewWithPoinPosition:point]; 321 | 322 | //遍历34个地图块.判断点击的是那一块 323 | for (int i = 0; i <34; i++) { 324 | UIBezierPath *path = self.bezierCurveArr[i]; 325 | BOOL isInPath = [path containsPoint:point]; 326 | if (isInPath) { 327 | //清除之前选中的颜色,fill当前选中的颜色 328 | self.areaColorArr[_selectedIdx] = self.defaultBackgroundColor; 329 | _selectedIdx = i; 330 | self.areaColorArr[_selectedIdx] = AABackgroundColor; 331 | [self setNeedsDisplay];//这一句代码比较关键 332 | 333 | [self respondingToTapEventsWithToBeSendDictionary:[NSMutableDictionary dictionaryWithDictionary:@{@"哈哈哈哈":@"很好成功地进行了传值"}]]; 334 | 335 | 336 | CGFloat randomWidth = arc4random()%20+20; 337 | 338 | UIImageView *redPinImageV = [[UIImageView alloc]init]; 339 | redPinImageV.image = [UIImage imageNamed:@"53c6470c59972"]; 340 | redPinImageV.center = point; 341 | redPinImageV.bounds = CGRectMake(0, 0, randomWidth, randomWidth); 342 | redPinImageV.contentMode = UIViewContentModeScaleAspectFit; 343 | [self addSubview:redPinImageV]; 344 | 345 | } 346 | } 347 | 348 | } 349 | 350 | 351 | - (void)configureTheTooltipViewWithPoinPosition:(CGPoint)point { 352 | 353 | // //点击生成连接线(随机链接五个点) 354 | // for (int i =0 ; i<5; i++) { 355 | // NSValue *rectValue= self.provinceNameArr[arc4random()%34][@"rect"]; 356 | // CGRect rect = [rectValue CGRectValue]; 357 | // [self configureTheDynamicLineWithStartPoin:point toEndPoint:CGPointMake(rect.origin.x, rect.origin.y)]; 358 | // } 359 | // 360 | // for (int i=0; i<10; i++) { 361 | // 362 | // [self drawLineWithStarPoint:CGPointMake(10, 70) endPoint:CGPointMake(200, 80*i+50)]; 363 | // } 364 | 365 | self.toolTipView.alpha = 0.6; 366 | self.toolTipView.titleText = self.provinceNameArr[arc4random()%34][@"name"]; 367 | self.toolTipView.valueText = [NSString stringWithFormat:@"%u摄氏度",arc4random()%99999]; 368 | 369 | 370 | // 弹簧动画,参数分别为:时长,延时,弹性(越小弹性越大),初始速度 371 | [UIView animateWithDuration:1.2 372 | delay:0.1 373 | usingSpringWithDamping:0.6 374 | initialSpringVelocity:0.3 375 | options:0 376 | animations:^{ 377 | self.toolTipView.center = point; 378 | 379 | } completion:^(BOOL finished) { 380 | 381 | [UIView animateWithDuration:0.5 382 | delay:5 383 | options:0 384 | animations:^{ 385 | self.toolTipView.alpha = 0; 386 | } completion:nil]; 387 | }]; 388 | 389 | } 390 | 391 | //相应点击事件后传值(delegate 传值或 block 传值) 392 | - (void)respondingToTapEventsWithToBeSendDictionary:(NSMutableDictionary *)dic { 393 | if (self.didTapBlock) { 394 | self.didTapBlock(dic); 395 | } else { 396 | [self.didTapDelegate aaMapViewDidTapWithTappedElementDictionary:dic]; 397 | } 398 | } 399 | 400 | //以动画的形式画线 401 | - (void)drawLineWithStarPoint:(CGPoint)startPoint endPoint:(CGPoint)endPoint { 402 | // 创建path 403 | UIBezierPath *path = [UIBezierPath bezierPath]; 404 | [path moveToPoint:startPoint]; 405 | [path addLineToPoint:endPoint]; 406 | 407 | CAShapeLayer *trackLayer = [CAShapeLayer new]; 408 | trackLayer.path = path.CGPath; 409 | trackLayer.frame = self.bounds; 410 | trackLayer.lineWidth = 1; 411 | trackLayer.fillColor = nil; 412 | trackLayer.strokeColor = [UIColor blackColor].CGColor; 413 | [self.layer addSublayer:trackLayer]; 414 | 415 | CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:NSStringFromSelector(@selector(strokeEnd))]; 416 | animation.fromValue = @0.0; 417 | animation.toValue = @1.0; 418 | animation.duration = 2; 419 | 420 | [trackLayer addAnimation:animation forKey:NSStringFromSelector(@selector(strokeEnd))]; 421 | } 422 | 423 | 424 | //-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ 425 | // _areaColorArr = nil; 426 | // [self setNeedsDisplay]; 427 | //} 428 | 429 | #pragma mark -- lazy load 430 | - (NSMutableArray *)bezierCurveArr { 431 | if (_bezierCurveArr == nil) { 432 | NSString *sourcePath = [[NSBundle mainBundle] pathForResource:@"AAChinaMapPaths" ofType:@"plist"]; 433 | NSData *pathsData = [NSData dataWithContentsOfFile:sourcePath]; 434 | _bezierCurveArr = [NSKeyedUnarchiver unarchiveObjectWithData:pathsData]; 435 | 436 | } 437 | return _bezierCurveArr; 438 | } 439 | 440 | - (NSMutableArray *)areaColorArr { 441 | if (_areaColorArr == nil) { 442 | _areaColorArr = [NSMutableArray arrayWithCapacity:34]; 443 | for (int i = 0; i < 34; i++) { 444 | UIColor *fillColor = self.defaultBackgroundColor; 445 | [_areaColorArr addObject:fillColor]; 446 | } 447 | } 448 | return _areaColorArr; 449 | } 450 | 451 | - (NSMutableArray *)provinceNameArr { 452 | if (_provinceNameArr != nil) { 453 | return _provinceNameArr; 454 | } 455 | return [self readFromDisk]; 456 | } 457 | 458 | - (NSMutableArray *)readFromDisk { 459 | NSString *sourcePath = [[NSBundle mainBundle] pathForResource:@"AAProvinceName" ofType:@"plist"]; 460 | NSData *data = [NSData dataWithContentsOfFile:sourcePath]; 461 | NSMutableArray *nameArr = [NSKeyedUnarchiver unarchiveObjectWithData:data]; 462 | return nameArr; 463 | } 464 | 465 | - (AAMapTooltipView *)toolTipView { 466 | if (!_toolTipView) { 467 | _toolTipView = [[AAMapTooltipView alloc]init]; 468 | // _toolTipView.shadow = YES; 469 | [self addSubview:_toolTipView]; 470 | } 471 | return _toolTipView; 472 | } 473 | 474 | - (NSMutableDictionary *)provinceNameAndRectDic { 475 | if (!_provinceNameAndRectDic) { 476 | _provinceNameAndRectDic = [[NSMutableDictionary alloc]init]; 477 | [self.provinceNameArr enumerateObjectsUsingBlock:^(NSDictionary * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 478 | NSString *provinceName = obj[@"name"]; 479 | NSValue *provinceRect = obj[@"rect"]; 480 | [_provinceNameAndRectDic setValue:provinceRect forKey:provinceName]; 481 | }]; 482 | } 483 | return _provinceNameAndRectDic; 484 | } 485 | 486 | @end 487 | 488 | 489 | 490 | 491 | 492 | -------------------------------------------------------------------------------- /AAMapStudioDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2751B1281FAC19100019908F /* AAMapLegendView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2751B1271FAC19100019908F /* AAMapLegendView.m */; }; 11 | 278368B31F53F94100E838A8 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 278368B21F53F94100E838A8 /* main.m */; }; 12 | 278368B61F53F94100E838A8 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 278368B51F53F94100E838A8 /* AppDelegate.m */; }; 13 | 278368B91F53F94100E838A8 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 278368B81F53F94100E838A8 /* ViewController.m */; }; 14 | 278368BC1F53F94100E838A8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 278368BA1F53F94100E838A8 /* Main.storyboard */; }; 15 | 278368BE1F53F94100E838A8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 278368BD1F53F94100E838A8 /* Assets.xcassets */; }; 16 | 278368C11F53F94100E838A8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 278368BF1F53F94100E838A8 /* LaunchScreen.storyboard */; }; 17 | 2788A31C1F749C61004D5E11 /* VectorMapVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 2788A31B1F749C61004D5E11 /* VectorMapVC.m */; }; 18 | 27AA76BD1F53FB71002E84C5 /* AAChinaMapPaths.plist in Resources */ = {isa = PBXBuildFile; fileRef = 27AA76B51F53FB71002E84C5 /* AAChinaMapPaths.plist */; }; 19 | 27AA76BE1F53FB71002E84C5 /* AAMapTooltipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 27AA76B71F53FB71002E84C5 /* AAMapTooltipView.m */; }; 20 | 27AA76BF1F53FB71002E84C5 /* AAMarkPointRippleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 27AA76B91F53FB71002E84C5 /* AAMarkPointRippleView.m */; }; 21 | 27AA76C01F53FB71002E84C5 /* AAProvinceName.plist in Resources */ = {isa = PBXBuildFile; fileRef = 27AA76BA1F53FB71002E84C5 /* AAProvinceName.plist */; }; 22 | 27AA76C11F53FB71002E84C5 /* AAVectorMapView.m in Sources */ = {isa = PBXBuildFile; fileRef = 27AA76BC1F53FB71002E84C5 /* AAVectorMapView.m */; }; 23 | 27C3015D1F72431400C1E460 /* AARippleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 27C3015C1F72431400C1E460 /* AARippleView.m */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 2751B1261FAC19100019908F /* AAMapLegendView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AAMapLegendView.h; sourceTree = ""; }; 28 | 2751B1271FAC19100019908F /* AAMapLegendView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AAMapLegendView.m; sourceTree = ""; }; 29 | 278368AE1F53F94100E838A8 /* AAMapStudioDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AAMapStudioDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | 278368B21F53F94100E838A8 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 31 | 278368B41F53F94100E838A8 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 32 | 278368B51F53F94100E838A8 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 33 | 278368B71F53F94100E838A8 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 34 | 278368B81F53F94100E838A8 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 35 | 278368BB1F53F94100E838A8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 36 | 278368BD1F53F94100E838A8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 37 | 278368C01F53F94100E838A8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 38 | 278368C21F53F94100E838A8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 39 | 2788A31A1F749C61004D5E11 /* VectorMapVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VectorMapVC.h; sourceTree = ""; }; 40 | 2788A31B1F749C61004D5E11 /* VectorMapVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VectorMapVC.m; sourceTree = ""; }; 41 | 27AA76B51F53FB71002E84C5 /* AAChinaMapPaths.plist */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = AAChinaMapPaths.plist; sourceTree = ""; }; 42 | 27AA76B61F53FB71002E84C5 /* AAMapTooltipView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AAMapTooltipView.h; sourceTree = ""; }; 43 | 27AA76B71F53FB71002E84C5 /* AAMapTooltipView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AAMapTooltipView.m; sourceTree = ""; }; 44 | 27AA76B81F53FB71002E84C5 /* AAMarkPointRippleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AAMarkPointRippleView.h; sourceTree = ""; }; 45 | 27AA76B91F53FB71002E84C5 /* AAMarkPointRippleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AAMarkPointRippleView.m; sourceTree = ""; }; 46 | 27AA76BA1F53FB71002E84C5 /* AAProvinceName.plist */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = AAProvinceName.plist; sourceTree = ""; }; 47 | 27AA76BB1F53FB71002E84C5 /* AAVectorMapView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AAVectorMapView.h; sourceTree = ""; }; 48 | 27AA76BC1F53FB71002E84C5 /* AAVectorMapView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AAVectorMapView.m; sourceTree = ""; }; 49 | 27C3015B1F72431400C1E460 /* AARippleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AARippleView.h; sourceTree = ""; }; 50 | 27C3015C1F72431400C1E460 /* AARippleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AARippleView.m; sourceTree = ""; }; 51 | /* End PBXFileReference section */ 52 | 53 | /* Begin PBXFrameworksBuildPhase section */ 54 | 278368AB1F53F94100E838A8 /* Frameworks */ = { 55 | isa = PBXFrameworksBuildPhase; 56 | buildActionMask = 2147483647; 57 | files = ( 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXFrameworksBuildPhase section */ 62 | 63 | /* Begin PBXGroup section */ 64 | 278368A51F53F94100E838A8 = { 65 | isa = PBXGroup; 66 | children = ( 67 | 27AA76A71F53FA74002E84C5 /* AAMapStudio */, 68 | 278368B01F53F94100E838A8 /* AAMapStudioDemo */, 69 | 278368AF1F53F94100E838A8 /* Products */, 70 | ); 71 | sourceTree = ""; 72 | }; 73 | 278368AF1F53F94100E838A8 /* Products */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | 278368AE1F53F94100E838A8 /* AAMapStudioDemo.app */, 77 | ); 78 | name = Products; 79 | sourceTree = ""; 80 | }; 81 | 278368B01F53F94100E838A8 /* AAMapStudioDemo */ = { 82 | isa = PBXGroup; 83 | children = ( 84 | 278368B41F53F94100E838A8 /* AppDelegate.h */, 85 | 278368B51F53F94100E838A8 /* AppDelegate.m */, 86 | 278368BA1F53F94100E838A8 /* Main.storyboard */, 87 | 278368B71F53F94100E838A8 /* ViewController.h */, 88 | 278368B81F53F94100E838A8 /* ViewController.m */, 89 | 2788A31A1F749C61004D5E11 /* VectorMapVC.h */, 90 | 2788A31B1F749C61004D5E11 /* VectorMapVC.m */, 91 | 278368BD1F53F94100E838A8 /* Assets.xcassets */, 92 | 278368BF1F53F94100E838A8 /* LaunchScreen.storyboard */, 93 | 278368C21F53F94100E838A8 /* Info.plist */, 94 | 278368B11F53F94100E838A8 /* Supporting Files */, 95 | ); 96 | path = AAMapStudioDemo; 97 | sourceTree = ""; 98 | }; 99 | 278368B11F53F94100E838A8 /* Supporting Files */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 278368B21F53F94100E838A8 /* main.m */, 103 | ); 104 | name = "Supporting Files"; 105 | sourceTree = ""; 106 | }; 107 | 27AA76A71F53FA74002E84C5 /* AAMapStudio */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 27AA76BB1F53FB71002E84C5 /* AAVectorMapView.h */, 111 | 27AA76BC1F53FB71002E84C5 /* AAVectorMapView.m */, 112 | 2751B1261FAC19100019908F /* AAMapLegendView.h */, 113 | 2751B1271FAC19100019908F /* AAMapLegendView.m */, 114 | 27AA76B61F53FB71002E84C5 /* AAMapTooltipView.h */, 115 | 27AA76B71F53FB71002E84C5 /* AAMapTooltipView.m */, 116 | 27C3015B1F72431400C1E460 /* AARippleView.h */, 117 | 27C3015C1F72431400C1E460 /* AARippleView.m */, 118 | 27AA76B81F53FB71002E84C5 /* AAMarkPointRippleView.h */, 119 | 27AA76B91F53FB71002E84C5 /* AAMarkPointRippleView.m */, 120 | 27AA76B51F53FB71002E84C5 /* AAChinaMapPaths.plist */, 121 | 27AA76BA1F53FB71002E84C5 /* AAProvinceName.plist */, 122 | ); 123 | path = AAMapStudio; 124 | sourceTree = ""; 125 | }; 126 | /* End PBXGroup section */ 127 | 128 | /* Begin PBXNativeTarget section */ 129 | 278368AD1F53F94100E838A8 /* AAMapStudioDemo */ = { 130 | isa = PBXNativeTarget; 131 | buildConfigurationList = 278368C51F53F94100E838A8 /* Build configuration list for PBXNativeTarget "AAMapStudioDemo" */; 132 | buildPhases = ( 133 | 278368AA1F53F94100E838A8 /* Sources */, 134 | 278368AB1F53F94100E838A8 /* Frameworks */, 135 | 278368AC1F53F94100E838A8 /* Resources */, 136 | ); 137 | buildRules = ( 138 | ); 139 | dependencies = ( 140 | ); 141 | name = AAMapStudioDemo; 142 | productName = AAMapStudioDemo; 143 | productReference = 278368AE1F53F94100E838A8 /* AAMapStudioDemo.app */; 144 | productType = "com.apple.product-type.application"; 145 | }; 146 | /* End PBXNativeTarget section */ 147 | 148 | /* Begin PBXProject section */ 149 | 278368A61F53F94100E838A8 /* Project object */ = { 150 | isa = PBXProject; 151 | attributes = { 152 | LastUpgradeCheck = 0830; 153 | ORGANIZATIONNAME = "An An"; 154 | TargetAttributes = { 155 | 278368AD1F53F94100E838A8 = { 156 | CreatedOnToolsVersion = 8.3.3; 157 | DevelopmentTeam = BPAYP34L8N; 158 | ProvisioningStyle = Automatic; 159 | }; 160 | }; 161 | }; 162 | buildConfigurationList = 278368A91F53F94100E838A8 /* Build configuration list for PBXProject "AAMapStudioDemo" */; 163 | compatibilityVersion = "Xcode 3.2"; 164 | developmentRegion = English; 165 | hasScannedForEncodings = 0; 166 | knownRegions = ( 167 | en, 168 | Base, 169 | ); 170 | mainGroup = 278368A51F53F94100E838A8; 171 | productRefGroup = 278368AF1F53F94100E838A8 /* Products */; 172 | projectDirPath = ""; 173 | projectRoot = ""; 174 | targets = ( 175 | 278368AD1F53F94100E838A8 /* AAMapStudioDemo */, 176 | ); 177 | }; 178 | /* End PBXProject section */ 179 | 180 | /* Begin PBXResourcesBuildPhase section */ 181 | 278368AC1F53F94100E838A8 /* Resources */ = { 182 | isa = PBXResourcesBuildPhase; 183 | buildActionMask = 2147483647; 184 | files = ( 185 | 278368C11F53F94100E838A8 /* LaunchScreen.storyboard in Resources */, 186 | 278368BE1F53F94100E838A8 /* Assets.xcassets in Resources */, 187 | 27AA76BD1F53FB71002E84C5 /* AAChinaMapPaths.plist in Resources */, 188 | 278368BC1F53F94100E838A8 /* Main.storyboard in Resources */, 189 | 27AA76C01F53FB71002E84C5 /* AAProvinceName.plist in Resources */, 190 | ); 191 | runOnlyForDeploymentPostprocessing = 0; 192 | }; 193 | /* End PBXResourcesBuildPhase section */ 194 | 195 | /* Begin PBXSourcesBuildPhase section */ 196 | 278368AA1F53F94100E838A8 /* Sources */ = { 197 | isa = PBXSourcesBuildPhase; 198 | buildActionMask = 2147483647; 199 | files = ( 200 | 278368B91F53F94100E838A8 /* ViewController.m in Sources */, 201 | 278368B61F53F94100E838A8 /* AppDelegate.m in Sources */, 202 | 2788A31C1F749C61004D5E11 /* VectorMapVC.m in Sources */, 203 | 27C3015D1F72431400C1E460 /* AARippleView.m in Sources */, 204 | 27AA76C11F53FB71002E84C5 /* AAVectorMapView.m in Sources */, 205 | 278368B31F53F94100E838A8 /* main.m in Sources */, 206 | 2751B1281FAC19100019908F /* AAMapLegendView.m in Sources */, 207 | 27AA76BF1F53FB71002E84C5 /* AAMarkPointRippleView.m in Sources */, 208 | 27AA76BE1F53FB71002E84C5 /* AAMapTooltipView.m in Sources */, 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | }; 212 | /* End PBXSourcesBuildPhase section */ 213 | 214 | /* Begin PBXVariantGroup section */ 215 | 278368BA1F53F94100E838A8 /* Main.storyboard */ = { 216 | isa = PBXVariantGroup; 217 | children = ( 218 | 278368BB1F53F94100E838A8 /* Base */, 219 | ); 220 | name = Main.storyboard; 221 | sourceTree = ""; 222 | }; 223 | 278368BF1F53F94100E838A8 /* LaunchScreen.storyboard */ = { 224 | isa = PBXVariantGroup; 225 | children = ( 226 | 278368C01F53F94100E838A8 /* Base */, 227 | ); 228 | name = LaunchScreen.storyboard; 229 | sourceTree = ""; 230 | }; 231 | /* End PBXVariantGroup section */ 232 | 233 | /* Begin XCBuildConfiguration section */ 234 | 278368C31F53F94100E838A8 /* Debug */ = { 235 | isa = XCBuildConfiguration; 236 | buildSettings = { 237 | ALWAYS_SEARCH_USER_PATHS = NO; 238 | CLANG_ANALYZER_NONNULL = YES; 239 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 240 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 241 | CLANG_CXX_LIBRARY = "libc++"; 242 | CLANG_ENABLE_MODULES = YES; 243 | CLANG_ENABLE_OBJC_ARC = YES; 244 | CLANG_WARN_BOOL_CONVERSION = YES; 245 | CLANG_WARN_CONSTANT_CONVERSION = YES; 246 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 247 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 248 | CLANG_WARN_EMPTY_BODY = YES; 249 | CLANG_WARN_ENUM_CONVERSION = YES; 250 | CLANG_WARN_INFINITE_RECURSION = YES; 251 | CLANG_WARN_INT_CONVERSION = YES; 252 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 253 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 254 | CLANG_WARN_UNREACHABLE_CODE = YES; 255 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 256 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 257 | COPY_PHASE_STRIP = NO; 258 | DEBUG_INFORMATION_FORMAT = dwarf; 259 | ENABLE_STRICT_OBJC_MSGSEND = YES; 260 | ENABLE_TESTABILITY = YES; 261 | GCC_C_LANGUAGE_STANDARD = gnu99; 262 | GCC_DYNAMIC_NO_PIC = NO; 263 | GCC_NO_COMMON_BLOCKS = YES; 264 | GCC_OPTIMIZATION_LEVEL = 0; 265 | GCC_PREPROCESSOR_DEFINITIONS = ( 266 | "DEBUG=1", 267 | "$(inherited)", 268 | ); 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 276 | MTL_ENABLE_DEBUG_INFO = YES; 277 | ONLY_ACTIVE_ARCH = YES; 278 | SDKROOT = iphoneos; 279 | TARGETED_DEVICE_FAMILY = "1,2"; 280 | }; 281 | name = Debug; 282 | }; 283 | 278368C41F53F94100E838A8 /* Release */ = { 284 | isa = XCBuildConfiguration; 285 | buildSettings = { 286 | ALWAYS_SEARCH_USER_PATHS = NO; 287 | CLANG_ANALYZER_NONNULL = YES; 288 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 289 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 290 | CLANG_CXX_LIBRARY = "libc++"; 291 | CLANG_ENABLE_MODULES = YES; 292 | CLANG_ENABLE_OBJC_ARC = YES; 293 | CLANG_WARN_BOOL_CONVERSION = YES; 294 | CLANG_WARN_CONSTANT_CONVERSION = YES; 295 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 296 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 297 | CLANG_WARN_EMPTY_BODY = YES; 298 | CLANG_WARN_ENUM_CONVERSION = YES; 299 | CLANG_WARN_INFINITE_RECURSION = YES; 300 | CLANG_WARN_INT_CONVERSION = YES; 301 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 302 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 303 | CLANG_WARN_UNREACHABLE_CODE = YES; 304 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 305 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 306 | COPY_PHASE_STRIP = NO; 307 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 308 | ENABLE_NS_ASSERTIONS = NO; 309 | ENABLE_STRICT_OBJC_MSGSEND = YES; 310 | GCC_C_LANGUAGE_STANDARD = gnu99; 311 | GCC_NO_COMMON_BLOCKS = YES; 312 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 313 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 314 | GCC_WARN_UNDECLARED_SELECTOR = YES; 315 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 316 | GCC_WARN_UNUSED_FUNCTION = YES; 317 | GCC_WARN_UNUSED_VARIABLE = YES; 318 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 319 | MTL_ENABLE_DEBUG_INFO = NO; 320 | SDKROOT = iphoneos; 321 | TARGETED_DEVICE_FAMILY = "1,2"; 322 | VALIDATE_PRODUCT = YES; 323 | }; 324 | name = Release; 325 | }; 326 | 278368C61F53F94100E838A8 /* Debug */ = { 327 | isa = XCBuildConfiguration; 328 | buildSettings = { 329 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 330 | DEVELOPMENT_TEAM = BPAYP34L8N; 331 | INFOPLIST_FILE = AAMapStudioDemo/Info.plist; 332 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 333 | PRODUCT_BUNDLE_IDENTIFIER = Hobbies.AAMapStudioDemo; 334 | PRODUCT_NAME = "$(TARGET_NAME)"; 335 | }; 336 | name = Debug; 337 | }; 338 | 278368C71F53F94100E838A8 /* Release */ = { 339 | isa = XCBuildConfiguration; 340 | buildSettings = { 341 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 342 | DEVELOPMENT_TEAM = BPAYP34L8N; 343 | INFOPLIST_FILE = AAMapStudioDemo/Info.plist; 344 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 345 | PRODUCT_BUNDLE_IDENTIFIER = Hobbies.AAMapStudioDemo; 346 | PRODUCT_NAME = "$(TARGET_NAME)"; 347 | }; 348 | name = Release; 349 | }; 350 | /* End XCBuildConfiguration section */ 351 | 352 | /* Begin XCConfigurationList section */ 353 | 278368A91F53F94100E838A8 /* Build configuration list for PBXProject "AAMapStudioDemo" */ = { 354 | isa = XCConfigurationList; 355 | buildConfigurations = ( 356 | 278368C31F53F94100E838A8 /* Debug */, 357 | 278368C41F53F94100E838A8 /* Release */, 358 | ); 359 | defaultConfigurationIsVisible = 0; 360 | defaultConfigurationName = Release; 361 | }; 362 | 278368C51F53F94100E838A8 /* Build configuration list for PBXNativeTarget "AAMapStudioDemo" */ = { 363 | isa = XCConfigurationList; 364 | buildConfigurations = ( 365 | 278368C61F53F94100E838A8 /* Debug */, 366 | 278368C71F53F94100E838A8 /* Release */, 367 | ); 368 | defaultConfigurationIsVisible = 0; 369 | defaultConfigurationName = Release; 370 | }; 371 | /* End XCConfigurationList section */ 372 | }; 373 | rootObject = 278368A61F53F94100E838A8 /* Project object */; 374 | } 375 | -------------------------------------------------------------------------------- /AAMapStudioDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AAMapStudioDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // AAMapStudioDemo 4 | // 5 | // Created by An An on 2017/8/28. 6 | // Copyright © 2017年 An An. All rights reserved. 7 | // source code ----*** https://github.com/AAChartModel/AAMapStudio ***--- source code 8 | // 9 | 10 | /* 11 | 12 | * ------------------------------------------------------------------------------- 13 | * 14 | * ❀❀❀ WARM TIPS!!! ❀❀❀ 15 | * 16 | * Please contact me on GitHub,if there are any problems encountered in use. 17 | * GitHub Issues : https://github.com/AAChartModel/AAMapStudio/issues 18 | * ------------------------------------------------------------------------------- 19 | * And if you want to contribute for this project, please contact me as well 20 | * GitHub : https://github.com/AAChartModel 21 | * StackOverflow : https://stackoverflow.com/users/7842508/codeforu 22 | * JianShu : http://www.jianshu.com/u/f1e6753d4254 23 | * SegmentFault : https://segmentfault.com/u/huanghunbieguan 24 | * 25 | * ------------------------------------------------------------------------------- 26 | 27 | */ 28 | 29 | #import 30 | 31 | @interface AppDelegate : UIResponder 32 | 33 | @property (strong, nonatomic) UIWindow *window; 34 | 35 | 36 | @end 37 | 38 | -------------------------------------------------------------------------------- /AAMapStudioDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // AAMapStudioDemo 4 | // 5 | // Created by An An on 2017/8/28. 6 | // Copyright © 2017年 An An. All rights reserved. 7 | // source code ----*** https://github.com/AAChartModel/AAMapStudio ***--- source code 8 | // 9 | 10 | /* 11 | 12 | * ------------------------------------------------------------------------------- 13 | * 14 | * ❀❀❀ WARM TIPS!!! ❀❀❀ 15 | * 16 | * Please contact me on GitHub,if there are any problems encountered in use. 17 | * GitHub Issues : https://github.com/AAChartModel/AAMapStudio/issues 18 | * ------------------------------------------------------------------------------- 19 | * And if you want to contribute for this project, please contact me as well 20 | * GitHub : https://github.com/AAChartModel 21 | * StackOverflow : https://stackoverflow.com/users/7842508/codeforu 22 | * JianShu : http://www.jianshu.com/u/f1e6753d4254 23 | * SegmentFault : https://segmentfault.com/u/huanghunbieguan 24 | * 25 | * ------------------------------------------------------------------------------- 26 | 27 | */ 28 | 29 | #import "AppDelegate.h" 30 | 31 | @interface AppDelegate () 32 | 33 | @end 34 | 35 | @implementation AppDelegate 36 | 37 | 38 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 39 | // Override point for customization after application launch. 40 | return YES; 41 | } 42 | 43 | 44 | - (void)applicationWillResignActive:(UIApplication *)application { 45 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 46 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 47 | } 48 | 49 | 50 | - (void)applicationDidEnterBackground:(UIApplication *)application { 51 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 52 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 53 | } 54 | 55 | 56 | - (void)applicationWillEnterForeground:(UIApplication *)application { 57 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 58 | } 59 | 60 | 61 | - (void)applicationDidBecomeActive:(UIApplication *)application { 62 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 63 | } 64 | 65 | 66 | - (void)applicationWillTerminate:(UIApplication *)application { 67 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 68 | } 69 | 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /AAMapStudioDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /AAMapStudioDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 34 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /AAMapStudioDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /AAMapStudioDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /AAMapStudioDemo/VectorMapVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // VectorMapVC.h 3 | // AAMapStudioDemo 4 | // 5 | // Created by An An on 2017/9/22. 6 | // Copyright © 2017年 An An. All rights reserved. 7 | // source code ----*** https://github.com/AAChartModel/AAMapStudio ***--- source code 8 | // 9 | 10 | /* 11 | 12 | * ------------------------------------------------------------------------------- 13 | * 14 | * ❀❀❀ WARM TIPS!!! ❀❀❀ 15 | * 16 | * Please contact me on GitHub,if there are any problems encountered in use. 17 | * GitHub Issues : https://github.com/AAChartModel/AAMapStudio/issues 18 | * ------------------------------------------------------------------------------- 19 | * And if you want to contribute for this project, please contact me as well 20 | * GitHub : https://github.com/AAChartModel 21 | * StackOverflow : https://stackoverflow.com/users/7842508/codeforu 22 | * JianShu : http://www.jianshu.com/u/f1e6753d4254 23 | * SegmentFault : https://segmentfault.com/u/huanghunbieguan 24 | * 25 | * ------------------------------------------------------------------------------- 26 | 27 | */ 28 | 29 | #import 30 | #import "AAVectorMapView.h" 31 | 32 | @interface VectorMapVC : UIViewController 33 | 34 | @property (nonatomic, assign) NSInteger effectType; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /AAMapStudioDemo/VectorMapVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // VectorMapVC.m 3 | // AAMapStudioDemo 4 | // 5 | // Created by An An on 2017/9/22. 6 | // Copyright © 2017年 An An. All rights reserved. 7 | // source code ----*** https://github.com/AAChartModel/AAMapStudio ***--- source code 8 | // 9 | 10 | /* 11 | 12 | * ------------------------------------------------------------------------------- 13 | * 14 | * ❀❀❀ WARM TIPS!!! ❀❀❀ 15 | * 16 | * Please contact me on GitHub,if there are any problems encountered in use. 17 | * GitHub Issues : https://github.com/AAChartModel/AAMapStudio/issues 18 | * ------------------------------------------------------------------------------- 19 | * And if you want to contribute for this project, please contact me as well 20 | * GitHub : https://github.com/AAChartModel 21 | * StackOverflow : https://stackoverflow.com/users/7842508/codeforu 22 | * JianShu : http://www.jianshu.com/u/f1e6753d4254 23 | * SegmentFault : https://segmentfault.com/u/huanghunbieguan 24 | * 25 | * ------------------------------------------------------------------------------- 26 | 27 | */ 28 | 29 | #import "VectorMapVC.h" 30 | @interface VectorMapVC () 31 | 32 | @end 33 | 34 | @implementation VectorMapVC 35 | 36 | - (void)viewDidLoad { 37 | [super viewDidLoad]; 38 | self.view.backgroundColor = [UIColor whiteColor]; 39 | 40 | AAVectorMapView *mapView = [[AAVectorMapView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)]; 41 | // NSArray *seriesDataArr = @[@"湖北",@"黑龙江",@"辽宁",@"浙江",@"江西"]; 42 | 43 | 44 | 45 | 46 | 47 | if (_effectType <=3) { 48 | //用于描述空气质量状况、全国各省人均收入分布等 49 | NSArray *data1 = @[ 50 | @{@"name":@"安徽",@"value":@95}, 51 | @{@"name":@"浙江",@"value":@188}, 52 | @{@"name":@"湖北",@"value":@33}, 53 | @{@"name":@"河南",@"value":@29}, 54 | ]; 55 | mapView.dataType = AAMapDataTypeWithoutLine; 56 | mapView.seriesDataArr = data1; 57 | } else { 58 | //用于描述迁徙路线等 59 | NSArray *data2 = @[ 60 | @[@{@"name":@"西藏"}, @{@"name":@"安徽",@"value":@95}], 61 | @[@{@"name":@"西藏"}, @{@"name":@"浙江",@"value":@188}], 62 | @[@{@"name":@"西藏"}, @{@"name":@"湖北",@"value":@33}], 63 | @[@{@"name":@"西藏"}, @{@"name":@"河南",@"value":@29}], 64 | @[@{@"name":@"西藏"}, @{@"name":@"辽宁",@"value":@29}], 65 | @[@{@"name":@"西藏"}, @{@"name":@"澳门",@"value":@29}], 66 | @[@{@"name":@"西藏"}, @{@"name":@"黑龙江",@"value":@29}], 67 | ]; 68 | mapView.dataType = AAMapDataTypeWithLineExpand; 69 | mapView.seriesDataArr = data2; 70 | } 71 | 72 | mapView.effectType = self.effectType; 73 | mapView.tapEnabled = YES; 74 | mapView.didTapBlock = ^(NSDictionary *tappedElementDic) { 75 | NSLog(@"🌺%@",tappedElementDic); 76 | }; 77 | [self.view addSubview:mapView]; 78 | 79 | 80 | 81 | 82 | //妖艳色彩数组 @[@"#49C1B6", @"#FDC20A", @"#F78320", @"#068E81", @"#EA007B"], 83 | } 84 | 85 | //Add many types of ripple effect sample code 86 | 87 | @end 88 | -------------------------------------------------------------------------------- /AAMapStudioDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // AAMapStudioDemo 4 | // 5 | // Created by An An on 2017/8/28. 6 | // Copyright © 2017年 An An. All rights reserved. 7 | // source code ----*** https://github.com/AAChartModel/AAMapStudio ***--- source code 8 | // 9 | 10 | /* 11 | 12 | * ------------------------------------------------------------------------------- 13 | * 14 | * ❀❀❀ WARM TIPS!!! ❀❀❀ 15 | * 16 | * Please contact me on GitHub,if there are any problems encountered in use. 17 | * GitHub Issues : https://github.com/AAChartModel/AAMapStudio/issues 18 | * ------------------------------------------------------------------------------- 19 | * And if you want to contribute for this project, please contact me as well 20 | * GitHub : https://github.com/AAChartModel 21 | * StackOverflow : https://stackoverflow.com/users/7842508/codeforu 22 | * JianShu : http://www.jianshu.com/u/f1e6753d4254 23 | * SegmentFault : https://segmentfault.com/u/huanghunbieguan 24 | * 25 | * ------------------------------------------------------------------------------- 26 | 27 | */ 28 | 29 | #import 30 | 31 | @interface ViewController : UIViewController 32 | 33 | 34 | @end 35 | 36 | @interface customTableViewCell : UITableViewCell 37 | 38 | @property (nonatomic, strong) UILabel *label; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /AAMapStudioDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // AAMapStudioDemo 4 | // 5 | // Created by An An on 2017/8/28. 6 | // Copyright © 2017年 An An. All rights reserved. 7 | // source code ----*** https://github.com/AAChartModel/AAMapStudio ***--- source code 8 | // 9 | 10 | /* 11 | 12 | * ------------------------------------------------------------------------------- 13 | * 14 | * ❀❀❀ WARM TIPS!!! ❀❀❀ 15 | * 16 | * Please contact me on GitHub,if there are any problems encountered in use. 17 | * GitHub Issues : https://github.com/AAChartModel/AAMapStudio/issues 18 | * ------------------------------------------------------------------------------- 19 | * And if you want to contribute for this project, please contact me as well 20 | * GitHub : https://github.com/AAChartModel 21 | * StackOverflow : https://stackoverflow.com/users/7842508/codeforu 22 | * JianShu : http://www.jianshu.com/u/f1e6753d4254 23 | * SegmentFault : https://segmentfault.com/u/huanghunbieguan 24 | * 25 | * ------------------------------------------------------------------------------- 26 | 27 | */ 28 | 29 | #import "ViewController.h" 30 | #import "VectorMapVC.h" 31 | @interface ViewController () { 32 | UITableView *_tableView; 33 | } 34 | @property (nonatomic, strong) NSArray *cellTitleArr; 35 | 36 | @end 37 | 38 | @implementation ViewController 39 | 40 | - (void)viewDidLoad { 41 | [super viewDidLoad]; 42 | self.title = @"AAMapStudio"; 43 | 44 | _tableView = [[UITableView alloc]init]; 45 | _tableView.delegate = self; 46 | _tableView.dataSource = self; 47 | [self.view addSubview:_tableView]; 48 | 49 | _tableView.translatesAutoresizingMaskIntoConstraints = NO; 50 | [self.view addConstraints:[self configureTheConstraintArrayWithItem:_tableView toItem:self.view]]; 51 | 52 | 53 | 54 | } 55 | 56 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 57 | return 1; 58 | } 59 | 60 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 61 | return 6; 62 | } 63 | 64 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 65 | static NSString *identifier = @"cell"; 66 | customTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier]; 67 | if (!cell) { 68 | cell = [[customTableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier]; 69 | } 70 | cell.label.text = self.cellTitleArr[indexPath.section][indexPath.row]; 71 | return cell; 72 | } 73 | 74 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 75 | VectorMapVC *vc = [[VectorMapVC alloc]init]; 76 | vc.effectType = indexPath.row; 77 | [self.navigationController pushViewController:vc animated:YES]; 78 | } 79 | 80 | - (NSArray *)configureTheConstraintArrayWithItem:(UIView *)view1 toItem:(UIView *)view2 { 81 | return @[[NSLayoutConstraint constraintWithItem:view1 82 | attribute:NSLayoutAttributeLeft 83 | relatedBy:NSLayoutRelationEqual 84 | toItem:view2 85 | attribute:NSLayoutAttributeLeft 86 | multiplier:1.0 87 | constant:0], 88 | [NSLayoutConstraint constraintWithItem:view1 89 | attribute:NSLayoutAttributeRight 90 | relatedBy:NSLayoutRelationEqual 91 | toItem:view2 92 | attribute:NSLayoutAttributeRight 93 | multiplier:1.0 94 | constant:0], 95 | [NSLayoutConstraint constraintWithItem:view1 96 | attribute:NSLayoutAttributeTop 97 | relatedBy:NSLayoutRelationEqual 98 | toItem:view2 99 | attribute:NSLayoutAttributeTop 100 | multiplier:1.0 101 | constant:0], 102 | [NSLayoutConstraint constraintWithItem:view1 103 | attribute:NSLayoutAttributeBottom 104 | relatedBy:NSLayoutRelationEqual 105 | toItem:view2 106 | attribute:NSLayoutAttributeBottom 107 | multiplier:1.0 108 | constant:0], 109 | 110 | ]; 111 | } 112 | 113 | - (NSArray *)cellTitleArr { 114 | if (!_cellTitleArr) { 115 | _cellTitleArr = @[ 116 | @[@"rippleEffectOne",@"rippleEffectTwo",@"rippleEffectThree",@"rippleEffectFour", 117 | @"dataTypeOne",@"dataTypeTwo"]]; 118 | } 119 | return _cellTitleArr; 120 | } 121 | 122 | @end 123 | 124 | @implementation customTableViewCell 125 | 126 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { 127 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 128 | if (self) { 129 | _label = [[UILabel alloc]init]; 130 | _label.frame = CGRectMake(60, 0, self.frame.size.width, 55); 131 | _label.textAlignment = NSTextAlignmentLeft; 132 | _label.font = [UIFont systemFontOfSize:14.f]; 133 | _label.textColor = [UIColor darkGrayColor]; 134 | [self addSubview:_label]; 135 | } 136 | return self; 137 | } 138 | 139 | @end 140 | -------------------------------------------------------------------------------- /AAMapStudioDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // AAMapStudioDemo 4 | // 5 | // Created by An An on 2017/8/28. 6 | // Copyright © 2017年 An An. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /CHINESE-README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | AAMapStudio 4 | ============== 5 | [![](https://jaywcjlove.github.io/sb/lang/english.svg)](https://github.com/AAChartModel/AAMapStudio) 6 | [![](https://jaywcjlove.github.io/sb/lang/chinese.svg)](https://github.com/AAChartModel/AAMapStudio/blob/master/CHINESE-README.md) 7 | [![Support](https://img.shields.io/badge/support-iOS%206%2B%20-blue.svg?style=flat)](https://www.apple.com/nl/ios/) 8 | [![](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/AAChartModel/AAMapStudio/blob/master/LICENSE) 9 | [![](https://img.shields.io/badge/language-OC-green.svg)](https://github.com/AAChartModel/AAMapStudio) 10 | [![](https://img.shields.io/badge/support-Animation-yellow.svg)](https://github.com/AAChartModel/AAMapStudio-Swift) 11 | [![](https://img.shields.io/badge/support-Swift-orange.svg)](https://github.com/AAChartModel/AAMapStudio-Swift) 12 | 13 | 14 | 15 | #### [English Document](https://github.com/AAChartModel/AAMapStudio/blob/master/README.md) | [中文文档](https://github.com/AAChartModel/AAMapStudio/blob/master/CHINESE-README.md) 16 | 17 | 18 | 图形演示 19 | ============== 20 | 21 | 1. 基础中国地图 22 | ![屏幕快照 2017-09-20 上午10.30.12.png](http://upload-images.jianshu.io/upload_images/2412088-88aea29ee640992e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 23 | 24 | 1. 航线指示地图 25 | ![屏幕快照 2017-09-20 上午11.02.05.png](http://upload-images.jianshu.io/upload_images/2412088-e6f24fab946dabee.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 26 | 27 | 28 | 1. 活动热点地图 29 | ![屏幕快照 2017-09-20 上午11.02.38.png](http://upload-images.jianshu.io/upload_images/2412088-8fdf223a62f0e247.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 30 | 31 | 1. 僵尸病毒爆发地图 32 | ![屏幕快照 2017-09-20 上午11.04.23.png](http://upload-images.jianshu.io/upload_images/2412088-df5ea6702431d9f7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 33 | 34 | 1. 世界智商分布地图 35 | ![屏幕快照 2017-09-20 上午11.03.55.png](http://upload-images.jianshu.io/upload_images/2412088-242e856f61c1982f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 36 | 37 | 38 | 特性 39 | ============== 40 | 41 | 42 | 使用方法 43 | ============== 44 | 45 | 46 | 47 | 安装 48 | ============== 49 | 50 | ### CocoaPods 51 | 52 | 1. 在**Podfile**文件中添加 `pod 'AAMapStudio'`. 53 | 2. 执行 `pod install` 或者 `pod update`. 54 | 3. 导入 ``. 55 | 56 | 57 | 58 | 59 | ### 手动安装 60 | 61 | 1. 下载 `AAMapStudio` 文件夹内的所有内容. 62 | 2. 将 `AAMapStudio` 内的源文件拖放至你的工程中. 63 | 3. 导入 `AAMapStudio.h`. 64 | 65 | 66 | 67 | 系统要求 68 | ============== 69 | This library requires `iOS 7.0+` and `Xcode 8.0+`. 70 | 71 | 72 | 许可证 73 | ============== 74 | `AAMapStudio.h` 使用 MIT 许可证,详情可见 LICENSE 文件内容. 75 | 76 | 77 | 贡献者们 78 | ============== 79 | 80 | * [An An](https://github.com/AAChartModel/AAMapStudio) 原作者. 81 | 82 | 贡献 83 | ============== 84 | 85 | 1. Fork it (https://github.com/AAChartModel/AAMapStudio) 86 | 2. 创建你的 `feature` 分支 (`git checkout -b my-new-feature`) 87 | 3. 提交你修改的内容 (`git commit -am 'Add some feature'`) 88 | 4. 推送已修改的内容至你的分支(`branch`)中 (`git push origin my-new-feature`) 89 | 5. 创建一个合并请求(`Pull Request`) 90 | 91 | 版权所有 92 | ============== 93 | An An 94 | 95 | 待办清单 96 | ============== 97 | - [ ] 支持绘制中国各省级(省、直辖市、自治区)地图 98 | - [ ] 支持绘制亚洲地图 99 | - [ ] 支持绘制世界地图 100 | - [ ] 支持3D地图 101 | - [ ] 支持更多炫光特效 102 | - [ ] 支持更多自定义路线图样式 103 | 104 | 感谢 105 | ============== 106 | 107 | 108 | 源代码地址 109 | ============== 110 | ***https://github.com/AAChartModel/AAMapStudio*** 111 | 112 | 113 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 An An 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | AAMapStudio 3 | ============== 4 | 5 | [![](https://jaywcjlove.github.io/sb/lang/english.svg)](https://github.com/AAChartModel/AAMapStudio) 6 | [![](https://jaywcjlove.github.io/sb/lang/chinese.svg)](https://github.com/AAChartModel/AAMapStudio/blob/master/CHINESE-README.md) 7 | [![Support](https://img.shields.io/badge/support-iOS%206%2B%20-blue.svg?style=flat)](https://www.apple.com/nl/ios/) 8 | [![](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/AAChartModel/AAMapStudio/blob/master/LICENSE) 9 | [![](https://img.shields.io/badge/language-OC-green.svg)](https://github.com/AAChartModel/AAMapStudio) 10 | [![](https://img.shields.io/badge/support-Animation-yellow.svg)](https://github.com/AAChartModel/AAMapStudio-Swift) 11 | [![](https://img.shields.io/badge/support-Swift-orange.svg)](https://github.com/AAChartModel/AAMapStudio-Swift) 12 | 13 | 14 | 15 | #### [English Document](https://github.com/AAChartModel/AAMapStudio/blob/master/README.md) | [中文文档](https://github.com/AAChartModel/AAMapStudio/blob/master/CHINESE-README.md) 16 | 17 | 18 | 19 | 20 | 21 | 22 | Performance 23 | ============== 24 | 25 | 1. The China map 26 | ![屏幕快照 2017-09-20 上午10.30.12.png](http://upload-images.jianshu.io/upload_images/2412088-88aea29ee640992e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 27 | 28 | 1. Air route indicator map 29 | ![屏幕快照 2017-09-20 上午11.02.05.png](http://upload-images.jianshu.io/upload_images/2412088-e6f24fab946dabee.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 30 | 31 | 32 | 1. Hot spot map 33 | ![屏幕快照 2017-09-20 上午11.02.38.png](http://upload-images.jianshu.io/upload_images/2412088-8fdf223a62f0e247.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 34 | 35 | 1. Zombie outbreak map 36 | ![屏幕快照 2017-09-20 上午11.04.23.png](http://upload-images.jianshu.io/upload_images/2412088-df5ea6702431d9f7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 37 | 38 | 1. The World intelligence distribution map 39 | ![屏幕快照 2017-09-20 上午11.03.55.png](http://upload-images.jianshu.io/upload_images/2412088-242e856f61c1982f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 40 | 41 | 42 | 43 | Features 44 | ============== 45 | 46 | 47 | Usage 48 | ============== 49 | 50 | 51 | 52 | Installation 53 | ============== 54 | 55 | ### CocoaPods 56 | 57 | 1. Add `pod 'AAMapStudio'` to your **Podfile**. 58 | 2. Run `pod install` or `pod update`. 59 | 3. Import \. 60 | 61 | 62 | 63 | 64 | ### Manually 65 | 66 | 1. Download all the files in the AAMapStudio subdirectory. 67 | 2. Add the source files to your Xcode project. 68 | 3. Import `AAMapStudio.h`. 69 | 70 | 71 | 72 | 73 | 74 | Requirements 75 | ============== 76 | This library requires `iOS 6.0+` and `Xcode 8.0+`. 77 | 78 | 79 | License 80 | ============== 81 | ![](https://upload.wikimedia.org/wikipedia/commons/thumb/f/f8/License_icon-mit-88x31-2.svg/128px-License_icon-mit-88x31-2.svg.png) 82 | AAMapStudio is provided under the MIT license. See LICENSE file for details. 83 | 84 | Contact 85 | ============== 86 | ------------------------------------------------------------------------------- 87 | * ❀❀❀ WARM TIPS!!! ❀❀❀ 88 | * 89 | * Please contact me on GitHub,if there are any problems encountered in use. 90 | * GitHub Issues : https://github.com/AAChartModel/AAChartKit/issues 91 | ------------------------------------------------------------------------------- 92 | * And if you want to contribute for this project, please contact me as well 93 | * GitHub : https://github.com/AAChartModel 94 | * StackOverflow : https://stackoverflow.com/users/7842508/codeforu 95 | * JianShu : http://www.jianshu.com/u/f1e6753d4254 96 | * SegmentFault : https://segmentfault.com/u/huanghunbieguan 97 | ------------------------------------------------------------------------------- 98 | 99 | Contributors 100 | ============== 101 | 102 | * [An An](https://github.com/AAChartModel/AAMapStudio) creator. 103 | 104 | Contributing 105 | ============== 106 | 107 | 1. Fork it (https://github.com/AAChartModel/AAMapStudio) 108 | 2. Create your feature branch (`git checkout -b my-new-feature`) 109 | 3. Commit your changes (`git commit -am 'Add some feature'`) 110 | 4. Push to the branch (`git push origin my-new-feature`) 111 | 5. Create a new Pull Request 112 | 113 | Copyright 114 | ============== 115 | An An 116 | 117 | To-do list 118 | ============== 119 | 120 | 121 | Thanks 122 | ============== 123 | 124 | Source code 125 | ============== 126 | ***https://github.com/AAChartModel/AAMapStudio*** 127 | 128 | 129 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-slate --------------------------------------------------------------------------------