Skip to content

Commit e536b38

Browse files
Julien Rodriguesgilbox
Julien Rodrigues
authored andcommitted
[iOS] Added showsUserLocation property support for Google Maps (react-native-maps#721)
* Added suppport for the property showsUserLocation on iOS for GoogleMaps * CS fix
1 parent 48e5ca8 commit e536b38

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

ios/AirGoogleMaps/AIRGoogleMap.h

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
@property (nonatomic, assign) BOOL zoomEnabled;
3333
@property (nonatomic, assign) BOOL rotateEnabled;
3434
@property (nonatomic, assign) BOOL pitchEnabled;
35+
@property (nonatomic, assign) BOOL showsUserLocation;
3536

3637
- (BOOL)didTapMarker:(GMSMarker *)marker;
3738
- (void)didTapAtCoordinate:(CLLocationCoordinate2D)coordinate;

ios/AirGoogleMaps/AIRGoogleMap.m

+8
Original file line numberDiff line numberDiff line change
@@ -236,4 +236,12 @@ - (void)setShowsCompass:(BOOL)showsCompass {
236236
- (BOOL)showsCompass {
237237
return self.settings.compassButton;
238238
}
239+
240+
- (void)setShowsUserLocation:(BOOL)showsUserLocation {
241+
self.myLocationEnabled = showsUserLocation;
242+
}
243+
244+
- (BOOL)showsUserLocation {
245+
return self.myLocationEnabled;
246+
}
239247
@end

ios/AirGoogleMaps/AIRGoogleMapManager.m

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ - (UIView *)view
5454
RCT_EXPORT_VIEW_PROPERTY(rotateEnabled, BOOL)
5555
RCT_EXPORT_VIEW_PROPERTY(scrollEnabled, BOOL)
5656
RCT_EXPORT_VIEW_PROPERTY(pitchEnabled, BOOL)
57+
RCT_EXPORT_VIEW_PROPERTY(showsUserLocation, BOOL)
5758
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
5859
RCT_EXPORT_VIEW_PROPERTY(onLongPress, RCTBubblingEventBlock)
5960
RCT_EXPORT_VIEW_PROPERTY(onChange, RCTBubblingEventBlock)

0 commit comments

Comments
 (0)