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 polygon, polyline, maptype support
- Loading branch information
Nick Italiano
committed
Oct 24, 2016
1 parent
d183c0f
commit 16f362b
Showing
20 changed files
with
471 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
250 changes: 121 additions & 129 deletions
250
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
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 |
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,64 @@ | ||
// | ||
// AIRGoogleMapPolygon.m | ||
// | ||
// Created by Nick Italiano on 10/22/16. | ||
// | ||
|
||
#import "AIRGoogleMapPolygon.h" | ||
#import <GoogleMaps/GoogleMaps.h> | ||
|
||
@implementation AIRGoogleMapPolygon | ||
|
||
- (instancetype)init | ||
{ | ||
if (self = [super init]) { | ||
_polygon = [[GMSPolygon alloc] init]; | ||
} | ||
|
||
return self; | ||
} | ||
|
||
- (void)setCoordinates:(NSArray<AIRMapCoordinate *> *)coordinates | ||
{ | ||
_coordinates = coordinates; | ||
|
||
GMSMutablePath *path = [GMSMutablePath path]; | ||
for(int i = 0; i < coordinates.count; i++) | ||
{ | ||
[path addCoordinate:coordinates[i].coordinate]; | ||
} | ||
|
||
_polygon.path = path; | ||
} | ||
|
||
-(void)setFillColor:(UIColor *)fillColor | ||
{ | ||
_fillColor = fillColor; | ||
_polygon.fillColor = fillColor; | ||
} | ||
|
||
-(void)setStrokeWidth:(double)strokeWidth | ||
{ | ||
_strokeWidth = strokeWidth; | ||
_polygon.strokeWidth = strokeWidth; | ||
} | ||
|
||
-(void)setStrokeColor:(UIColor *) strokeColor | ||
{ | ||
_strokeColor = strokeColor; | ||
_polygon.strokeColor = strokeColor; | ||
} | ||
|
||
-(void)setGeodesic:(BOOL)geodesic | ||
{ | ||
_geodesic = geodesic; | ||
_polygon.geodesic = geodesic; | ||
} | ||
|
||
-(void)setZIndex:(int)zIndex | ||
{ | ||
_zIndex = zIndex; | ||
_polygon.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 @@ | ||
// | ||
// AIRGoogleMapPolylgoneManager.h | ||
// | ||
// Created by Nick Italiano on 10/22/16. | ||
// | ||
|
||
#import "RCTViewManager.h" | ||
|
||
@interface AIRGoogleMapPolygonManager : 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,38 @@ | ||
// | ||
// AIRGoogleMapPolylgoneManager.m | ||
// | ||
// Created by Nick Italiano on 10/22/16. | ||
// | ||
#import "AIRGoogleMapPolygonManager.h" | ||
|
||
#import "RCTBridge.h" | ||
#import "RCTConvert.h" | ||
#import "RCTConvert+CoreLocation.h" | ||
#import "RCTConvert+MoreMapKit.h" | ||
#import "RCTEventDispatcher.h" | ||
#import "UIView+React.h" | ||
#import "RCTViewManager.h" | ||
#import "AIRGoogleMapPolygon.h" | ||
|
||
@interface AIRGoogleMapPolygonManager() | ||
|
||
@end | ||
|
||
@implementation AIRGoogleMapPolygonManager | ||
|
||
RCT_EXPORT_MODULE() | ||
|
||
- (UIView *)view | ||
{ | ||
AIRGoogleMapPolygon *polygon = [AIRGoogleMapPolygon new]; | ||
return polygon; | ||
} | ||
|
||
RCT_EXPORT_VIEW_PROPERTY(coordinates, AIRMapCoordinateArray) | ||
RCT_EXPORT_VIEW_PROPERTY(fillColor, UIColor) | ||
RCT_EXPORT_VIEW_PROPERTY(strokeWidth, double) | ||
RCT_EXPORT_VIEW_PROPERTY(strokeColor, UIColor) | ||
RCT_EXPORT_VIEW_PROPERTY(geodesic, BOOL) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// AIRGoogleMapPolyline.h | ||
// | ||
// Created by Nick Italiano on 10/22/16. | ||
// | ||
#import <UIKit/UIKit.h> | ||
#import <GoogleMaps/GoogleMaps.h> | ||
#import "AIRMapCoordinate.h" | ||
#import "AIRGoogleMapMarker.h" | ||
|
||
@interface AIRGoogleMapPolyline : UIView | ||
|
||
@property (nonatomic, strong) GMSPolyline* polyline; | ||
@property (nonatomic, strong) NSArray<AIRMapCoordinate *> *coordinates; | ||
@property (nonatomic, strong) UIColor *strokeColor; | ||
@property (nonatomic, assign) double strokeWidth; | ||
@property (nonatomic, assign) UIColor *fillColor; | ||
@property (nonatomic, assign) BOOL geodesic; | ||
@property (nonatomic, assign) NSString *title; | ||
@property (nonatomic, assign) int zIndex; | ||
|
||
@end |
Oops, something went wrong.