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.
Merge pull request react-native-maps#722 from unboundfire/google-maps…
…-ios-shapes [iOS] Added Google Maps Circle, Polygon, Polyline, MapType Support
- Loading branch information
Showing
27 changed files
with
631 additions
and
146 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
262 changes: 133 additions & 129 deletions
262
example/ios/AirMapsExplorer.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
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,21 @@ | ||
// | ||
// AIRGoogleMapPolygon.h | ||
// | ||
// Created by Nick Italiano on 10/22/16. | ||
// | ||
|
||
#import <GoogleMaps/GoogleMaps.h> | ||
#import "AIRMapCoordinate.h" | ||
|
||
@interface AIRGoogleMapPolygon : UIView | ||
|
||
@property (nonatomic, strong) GMSPolygon *polygon; | ||
@property (nonatomic, strong) NSArray<AIRMapCoordinate *> *coordinates; | ||
|
||
@property (nonatomic, assign) UIColor *fillColor; | ||
@property (nonatomic, assign) double strokeWidth; | ||
@property (nonatomic, assign) UIColor *strokeColor; | ||
@property (nonatomic, assign) BOOL geodesic; | ||
@property (nonatomic, assign) int zIndex; | ||
|
||
@end |
Oops, something went wrong.