Skip to content

Commit 8270df8

Browse files
committed
1 parent 21c0877 commit 8270df8

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

react-native-meridian-maps/example/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ PODS:
88
- hermes-engine (0.79.2):
99
- hermes-engine/Pre-built (= 0.79.2)
1010
- hermes-engine/Pre-built (0.79.2)
11-
- MeridianMaps (0.1.19):
11+
- MeridianMaps (0.1.21):
1212
- DoubleConversion
1313
- glog
1414
- hermes-engine
@@ -1913,7 +1913,7 @@ SPEC CHECKSUMS:
19131913
fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd
19141914
glog: 5683914934d5b6e4240e497e0f4a3b42d1854183
19151915
hermes-engine: 314be5250afa5692b57b4dd1705959e1973a8ebe
1916-
MeridianMaps: 3d2e11d0738f596a3fbc1d36b722679f1dcd9100
1916+
MeridianMaps: b02395f5b0c29548d7d452446a55ce8b7e321580
19171917
RCT-Folly: e78785aa9ba2ed998ea4151e314036f6c49e6d82
19181918
RCTDeprecation: 83ffb90c23ee5cea353bd32008a7bca100908f8c
19191919
RCTRequired: eb7c0aba998009f47a540bec9e9d69a54f68136e

react-native-meridian-maps/ios/MeridianMapViewManager.m

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ - (void)setupMap {
154154

155155
self.mapViewController = mapViewController;
156156

157+
// Enable user location display on the map view
158+
if (self.showLocationUpdates) {
159+
self.mapViewController.mapView.showsUserLocation = YES;
160+
NSLog(@"[MeridianMapView] Enabled showsUserLocation on mapView");
161+
}
162+
157163
// Set up location manager
158164
self.appKey = [MREditorKey keyWithIdentifier:self.appId];
159165
self.locationManager = [[MRLocationManager alloc] initWithApp:self.appKey];
@@ -206,6 +212,12 @@ - (void)setMapViewController:(CustomMapViewController *)mapViewController {
206212
UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
207213
[self addSubview:mapViewController.view];
208214

215+
// Enable user location display if needed
216+
if (self.showLocationUpdates) {
217+
mapViewController.mapView.showsUserLocation = YES;
218+
NSLog(@"[MeridianMapView] Enabled showsUserLocation on mapView (setMapViewController)");
219+
}
220+
209221
// Update location updates based on current setting
210222
[self updateLocationUpdates];
211223

@@ -327,6 +339,12 @@ - (void)updateLocationUpdates {
327339
} else if (status == kCLAuthorizationStatusAuthorizedWhenInUse || status == kCLAuthorizationStatusAuthorizedAlways) {
328340
NSLog(@"[MeridianMapView] Starting location updates");
329341
[self.locationManager startUpdatingLocation];
342+
343+
// Also enable map view user location display
344+
if (self.mapViewController.mapView) {
345+
self.mapViewController.mapView.showsUserLocation = YES;
346+
NSLog(@"[MeridianMapView] Enabled showsUserLocation (permission granted)");
347+
}
330348
} else {
331349
NSLog(@"[MeridianMapView] Location permission is denied or restricted. Status: %d", status);
332350
MMEventEmitter *emitter = [self.bridge moduleForClass:[MMEventEmitter class]];
@@ -342,6 +360,12 @@ - (void)updateLocationUpdates {
342360
} else {
343361
NSLog(@"[MeridianMapView] Stopping location updates");
344362
[self.locationManager stopUpdatingLocation];
363+
364+
// Also disable map view user location display
365+
if (self.mapViewController.mapView) {
366+
self.mapViewController.mapView.showsUserLocation = NO;
367+
NSLog(@"[MeridianMapView] Disabled showsUserLocation");
368+
}
345369
}
346370
}
347371

0 commit comments

Comments
 (0)