forked from react-native-maps/react-native-maps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ios google maps circle support
- Loading branch information
Nick Italiano
committed
Oct 25, 2016
1 parent
0d62312
commit 09b2330
Showing
11 changed files
with
155 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// AIRGoogleMapsCircle.h | ||
// | ||
// Created by Nick Italiano on 10/24/16. | ||
// | ||
|
||
#import <GoogleMaps/GoogleMaps.h> | ||
#import "AIRMapCoordinate.h" | ||
|
||
@interface AIRGoogleMapCircle : UIView | ||
|
||
@property (nonatomic, strong) GMSCircle *circle; | ||
@property (nonatomic, assign) double radius; | ||
@property (nonatomic, assign) CLLocationCoordinate2D centerCoordinate; | ||
@property (nonatomic, assign) UIColor *strokeColor; | ||
@property (nonatomic, assign) double strokeWidth; | ||
@property (nonatomic, assign) UIColor *fillColor; | ||
@property (nonatomic, assign) int zIndex; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// | ||
// AIRGoogleMapsCircle.m | ||
// | ||
// Created by Nick Italiano on 10/24/16. | ||
// | ||
#import <UIKit/UIKit.h> | ||
#import "AIRGoogleMapCircle.h" | ||
#import <GoogleMaps/GoogleMaps.h> | ||
#import "RCTUtils.h" | ||
|
||
@implementation AIRGoogleMapCircle | ||
|
||
- (instancetype)init | ||
{ | ||
if (self = [super init]) { | ||
_circle = [[GMSCircle alloc] init]; | ||
} | ||
return self; | ||
} | ||
|
||
- (void)setRadius:(double)radius | ||
{ | ||
_radius = radius; | ||
_circle.radius = radius; | ||
} | ||
|
||
- (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate | ||
{ | ||
_centerCoordinate = centerCoordinate; | ||
_circle.position = centerCoordinate; | ||
} | ||
|
||
-(void)setStrokeColor:(UIColor *)strokeColor | ||
{ | ||
_strokeColor = strokeColor; | ||
_circle.strokeColor = strokeColor; | ||
} | ||
|
||
-(void)setStrokeWidth:(double)strokeWidth | ||
{ | ||
_strokeWidth = strokeWidth; | ||
_circle.strokeWidth = strokeWidth; | ||
} | ||
|
||
-(void)setFillColor:(UIColor *)fillColor | ||
{ | ||
_fillColor = fillColor; | ||
_circle.fillColor = fillColor; | ||
} | ||
|
||
-(void)setZIndex:(int)zIndex | ||
{ | ||
_zIndex = zIndex; | ||
_circle.zIndex = zIndex; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// | ||
// AIRGoogleMapCircleManager.h | ||
// | ||
// Created by Nick Italiano on 10/24/16. | ||
// | ||
|
||
#import "RCTViewManager.h" | ||
|
||
@interface AIRGoogleMapCircleManager : RCTViewManager | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// AIRGoogleMapCircleManager.m | ||
// | ||
// Created by Nick Italiano on 10/24/16. | ||
// | ||
|
||
#import "AIRGoogleMapCircleManager.h" | ||
#import "AIRGoogleMapCircle.h" | ||
#import "RCTBridge.h" | ||
#import "UIView+React.h" | ||
|
||
@interface AIRGoogleMapCircleManager() | ||
|
||
@end | ||
|
||
@implementation AIRGoogleMapCircleManager | ||
|
||
RCT_EXPORT_MODULE() | ||
|
||
- (UIView *)view | ||
{ | ||
AIRGoogleMapCircle *circle = [AIRGoogleMapCircle new]; | ||
return circle; | ||
} | ||
|
||
RCT_EXPORT_VIEW_PROPERTY(radius, double) | ||
RCT_REMAP_VIEW_PROPERTY(center, centerCoordinate, CLLocationCoordinate2D) | ||
RCT_EXPORT_VIEW_PROPERTY(strokeColor, UIColor) | ||
RCT_EXPORT_VIEW_PROPERTY(strokeWidth, double) | ||
RCT_EXPORT_VIEW_PROPERTY(fillColor, UIColor) | ||
RCT_EXPORT_VIEW_PROPERTY(zIndex, int) | ||
|
||
@end |