Skip to content

Commit

Permalink
remove HAVE_GOOGLE_MAPS flag
Browse files Browse the repository at this point in the history
  • Loading branch information
tsapeta committed Oct 25, 2018
1 parent ef40dbe commit cb9d9ec
Show file tree
Hide file tree
Showing 40 changed files with 5 additions and 178 deletions.
4 changes: 0 additions & 4 deletions lib/ios/AirGoogleMaps/AIRDummyView.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@
// Created by Gil Birman on 10/4/16.
//

#ifdef HAVE_GOOGLE_MAPS

#import <UIKit/UIKit.h>


@interface AIRDummyView : UIView
@property (nonatomic, weak) UIView *view;
- (instancetype)initWithView:(UIView*)view;
@end

#endif
4 changes: 0 additions & 4 deletions lib/ios/AirGoogleMaps/AIRDummyView.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// Created by Gil Birman on 10/4/16.
//

#ifdef HAVE_GOOGLE_MAPS

#import <Foundation/Foundation.h>
#import "AIRDummyView.h"

Expand All @@ -19,5 +17,3 @@ - (instancetype)initWithView:(UIView*)view
return self;
}
@end

#endif
4 changes: 0 additions & 4 deletions lib/ios/AirGoogleMaps/AIRGMSMarker.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// Created by Gil Birman on 9/5/16.
//

#ifdef HAVE_GOOGLE_MAPS

#import <GoogleMaps/GoogleMaps.h>
#import <React/UIView+React.h>

Expand All @@ -23,5 +21,3 @@
@required
-(void)didTapMarker;
@end

#endif
4 changes: 0 additions & 4 deletions lib/ios/AirGoogleMaps/AIRGMSMarker.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
// Created by Gil Birman on 9/5/16.
//

#ifdef HAVE_GOOGLE_MAPS

#import "AIRGMSMarker.h"

@implementation AIRGMSMarker

@end

#endif
4 changes: 0 additions & 4 deletions lib/ios/AirGoogleMaps/AIRGMSPolygon.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// Created by Gerardo Pacheco 02/05/2017.
//

#ifdef HAVE_GOOGLE_MAPS

#import <GoogleMaps/GoogleMaps.h>
#import <React/UIView+React.h>

Expand All @@ -16,5 +14,3 @@
@property (nonatomic, strong) NSString *identifier;
@property (nonatomic, copy) RCTBubblingEventBlock onPress;
@end

#endif
4 changes: 0 additions & 4 deletions lib/ios/AirGoogleMaps/AIRGMSPolygon.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
// Created by Gerardo Pacheco 02/05/2017.
//

#ifdef HAVE_GOOGLE_MAPS

#import "AIRGMSPolygon.h"

@implementation AIRGMSPolygon

@end

#endif
4 changes: 0 additions & 4 deletions lib/ios/AirGoogleMaps/AIRGMSPolyline.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// Created by Guilherme Pontes 04/05/2017.
//

#ifdef HAVE_GOOGLE_MAPS

#import <GoogleMaps/GoogleMaps.h>
#import <React/UIView+React.h>

Expand All @@ -16,5 +14,3 @@
@property (nonatomic, strong) NSString *identifier;
@property (nonatomic, copy) RCTBubblingEventBlock onPress;
@end

#endif
4 changes: 0 additions & 4 deletions lib/ios/AirGoogleMaps/AIRGMSPolyline.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
// Created by Guilherme Pontes 04/05/2017.
//

#ifdef HAVE_GOOGLE_MAPS

#import "AIRGMSPolyline.h"

@implementation AIRGMSPolyline
@end

#endif
4 changes: 0 additions & 4 deletions lib/ios/AirGoogleMaps/AIRGoogleMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// Created by Gil Birman on 9/1/16.
//

#ifdef HAVE_GOOGLE_MAPS

#import <UIKit/UIKit.h>
#import <React/RCTComponent.h>
#import <React/RCTBridge.h>
Expand Down Expand Up @@ -70,5 +68,3 @@
+ (GMSCameraPosition*)makeGMSCameraPositionFromMap:(GMSMapView *)map andMKCoordinateRegion:(MKCoordinateRegion)region;

@end

#endif
23 changes: 1 addition & 22 deletions lib/ios/AirGoogleMaps/AIRGoogleMap.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// Created by Gil Birman on 9/1/16.
//

#ifdef HAVE_GOOGLE_MAPS

#import "AIRGoogleMap.h"
#import "AIRGoogleMapMarker.h"
#import "AIRGoogleMapMarkerManager.h"
Expand All @@ -21,20 +19,11 @@
#import <React/RCTBridge.h>
#import "RCTConvert+AirMap.h"

#ifdef HAVE_GOOGLE_MAPS_UTILS
#import <Google-Maps-iOS-Utils/GMUKMLParser.h>
#import <Google-Maps-iOS-Utils/GMUPlacemark.h>
#import <Google-Maps-iOS-Utils/GMUPoint.h>
#import <Google-Maps-iOS-Utils/GMUGeometryRenderer.h>
#define REQUIRES_GOOGLE_MAPS_UTILS(feature) do {} while (0)
#else
#define GMUKMLParser void
#define GMUPlacemark void
#define REQUIRES_GOOGLE_MAPS_UTILS(feature) do { \
[NSException raise:@"ReactNativeMapsDependencyMissing" \
format:@"Use of " feature "requires Google-Maps-iOS-Utils, you must install via CocoaPods to use this feature"]; \
} while (0)
#endif


id regionAsJSON(MKCoordinateRegion region) {
Expand Down Expand Up @@ -341,7 +330,7 @@ - (NSString *)paddingAdjustmentBehaviorString
return @"automatic";
case kGMSMapViewPaddingAdjustmentBehaviorAlways:
return @"always";

default:
return @"unknown";
}
Expand Down Expand Up @@ -518,7 +507,6 @@ - (void)observeValueForKeyPath:(NSString *)keyPath
}

+ (NSString *)GetIconUrl:(GMUPlacemark *) marker parser:(GMUKMLParser *) parser {
#ifdef HAVE_GOOGLE_MAPS_UTILS
if (marker.style.styleID != nil) {
for (GMUStyle *style in parser.styles) {
if (style.styleID == marker.style.styleID) {
Expand All @@ -528,17 +516,13 @@ + (NSString *)GetIconUrl:(GMUPlacemark *) marker parser:(GMUKMLParser *) parser
}

return marker.style.iconUrl;
#else
REQUIRES_GOOGLE_MAPS_UTILS("GetIconUrl:parser:"); return @"";
#endif
}

- (NSString *)KmlSrc {
return _kmlSrc;
}

- (void)setKmlSrc:(NSString *)kmlUrl {
#ifdef HAVE_GOOGLE_MAPS_UTILS

_kmlSrc = kmlUrl;

Expand Down Expand Up @@ -590,11 +574,6 @@ - (void)setKmlSrc:(NSString *)kmlUrl {

id event = @{@"markers": markers};
if (self.onKmlReady) self.onKmlReady(event);
#else
REQUIRES_GOOGLE_MAPS_UTILS();
#endif
}

@end

#endif
4 changes: 0 additions & 4 deletions lib/ios/AirGoogleMaps/AIRGoogleMapCallout.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@
//
//

#ifdef HAVE_GOOGLE_MAPS

#import <UIKit/UIKit.h>
#import <React/RCTView.h>

@interface AIRGoogleMapCallout : UIView
@property (nonatomic, assign) BOOL tooltip;
@property (nonatomic, copy) RCTBubblingEventBlock onPress;
@end

#endif
4 changes: 0 additions & 4 deletions lib/ios/AirGoogleMaps/AIRGoogleMapCallout.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@
//
//

#ifdef HAVE_GOOGLE_MAPS

#import "AIRGoogleMapCallout.h"
#import <React/RCTUtils.h>
#import <React/RCTView.h>
#import <React/RCTBridge.h>

@implementation AIRGoogleMapCallout
@end

#endif
4 changes: 0 additions & 4 deletions lib/ios/AirGoogleMaps/AIRGoogleMapCalloutManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@
//
//

#ifdef HAVE_GOOGLE_MAPS

#import <React/RCTViewManager.h>

@interface AIRGoogleMapCalloutManager : RCTViewManager

@end

#endif
4 changes: 0 additions & 4 deletions lib/ios/AirGoogleMaps/AIRGoogleMapCalloutManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
//
//

#ifdef HAVE_GOOGLE_MAPS

#import "AIRGoogleMapCalloutManager.h"
#import "AIRGoogleMapCallout.h"
#import <React/RCTView.h>
Expand All @@ -25,5 +23,3 @@ - (UIView *)view
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)

@end

#endif
4 changes: 0 additions & 4 deletions lib/ios/AirGoogleMaps/AIRGoogleMapCircle.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
// Created by Nick Italiano on 10/24/16.
//

#ifdef HAVE_GOOGLE_MAPS

#import <GoogleMaps/GoogleMaps.h>
#import "AIRMapCoordinate.h"

Expand All @@ -20,5 +18,3 @@
@property (nonatomic, assign) int zIndex;

@end

#endif
3 changes: 0 additions & 3 deletions lib/ios/AirGoogleMaps/AIRGoogleMapCircle.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// Created by Nick Italiano on 10/24/16.
//

#ifdef HAVE_GOOGLE_MAPS
#import <UIKit/UIKit.h>
#import "AIRGoogleMapCircle.h"
#import <GoogleMaps/GoogleMaps.h>
Expand Down Expand Up @@ -57,5 +56,3 @@ -(void)setZIndex:(int)zIndex
}

@end

#endif
4 changes: 0 additions & 4 deletions lib/ios/AirGoogleMaps/AIRGoogleMapCircleManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@
// Created by Nick Italiano on 10/24/16.
//

#ifdef HAVE_GOOGLE_MAPS

#import <React/RCTViewManager.h>

@interface AIRGoogleMapCircleManager : RCTViewManager

@end

#endif
4 changes: 0 additions & 4 deletions lib/ios/AirGoogleMaps/AIRGoogleMapCircleManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
// Created by Nick Italiano on 10/24/16.
//

#ifdef HAVE_GOOGLE_MAPS

#import "AIRGoogleMapCircleManager.h"
#import "AIRGoogleMapCircle.h"
#import <React/RCTBridge.h>
Expand Down Expand Up @@ -33,5 +31,3 @@ - (UIView *)view
RCT_EXPORT_VIEW_PROPERTY(zIndex, int)

@end

#endif
4 changes: 0 additions & 4 deletions lib/ios/AirGoogleMaps/AIRGoogleMapManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@
// Created by Gil Birman on 9/1/16.
//

#ifdef HAVE_GOOGLE_MAPS

#import <React/RCTViewManager.h>
#import "AIRGoogleMap.h"

@interface AIRGoogleMapManager : RCTViewManager
@property (nonatomic, assign) AIRGoogleMap *map;

@end

#endif
8 changes: 2 additions & 6 deletions lib/ios/AirGoogleMaps/AIRGoogleMapManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// Created by Gil Birman on 9/1/16.
//

#ifdef HAVE_GOOGLE_MAPS


#import "AIRGoogleMapManager.h"
#import <React/RCTViewManager.h>
Expand Down Expand Up @@ -355,7 +353,7 @@ - (UIView *)view
AIRGoogleMap *mapView = (AIRGoogleMap *)view;

CGPoint touchPoint = [mapView.projection pointForCoordinate:coord];

resolve(@{
@"x": @(touchPoint.x),
@"y": @(touchPoint.y),
Expand All @@ -382,7 +380,7 @@ - (UIView *)view
AIRGoogleMap *mapView = (AIRGoogleMap *)view;

CLLocationCoordinate2D coordinate = [mapView.projection coordinateForPoint:pt];

resolve(@{
@"latitude": @(coordinate.latitude),
@"longitude": @(coordinate.longitude),
Expand Down Expand Up @@ -565,5 +563,3 @@ - (void)mapView:(GMSMapView *)mapView
[googleMapView didTapPOIWithPlaceID:placeID name:name location:location];
}
@end

#endif
4 changes: 0 additions & 4 deletions lib/ios/AirGoogleMaps/AIRGoogleMapMarker.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// Created by Gil Birman on 9/2/16.
//

#ifdef HAVE_GOOGLE_MAPS

#import <GoogleMaps/GoogleMaps.h>
#import <React/RCTBridge.h>
#import "AIRGMSMarker.h"
Expand Down Expand Up @@ -47,5 +45,3 @@
- (void)didEndDraggingMarker:(AIRGMSMarker *)marker;
- (void)didDragMarker:(AIRGMSMarker *)marker;
@end

#endif
Loading

0 comments on commit cb9d9ec

Please sign in to comment.