diff --git a/react-native-meridian-maps/example/ios/Podfile.lock b/react-native-meridian-maps/example/ios/Podfile.lock index e4b9612..37ec419 100644 --- a/react-native-meridian-maps/example/ios/Podfile.lock +++ b/react-native-meridian-maps/example/ios/Podfile.lock @@ -8,7 +8,7 @@ PODS: - hermes-engine (0.79.2): - hermes-engine/Pre-built (= 0.79.2) - hermes-engine/Pre-built (0.79.2) - - MeridianMaps (0.1.19): + - MeridianMaps (0.1.21): - DoubleConversion - glog - hermes-engine @@ -1913,7 +1913,7 @@ SPEC CHECKSUMS: fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd glog: 5683914934d5b6e4240e497e0f4a3b42d1854183 hermes-engine: 314be5250afa5692b57b4dd1705959e1973a8ebe - MeridianMaps: 3d2e11d0738f596a3fbc1d36b722679f1dcd9100 + MeridianMaps: b02395f5b0c29548d7d452446a55ce8b7e321580 RCT-Folly: e78785aa9ba2ed998ea4151e314036f6c49e6d82 RCTDeprecation: 83ffb90c23ee5cea353bd32008a7bca100908f8c RCTRequired: eb7c0aba998009f47a540bec9e9d69a54f68136e diff --git a/react-native-meridian-maps/ios/MeridianMapViewManager.m b/react-native-meridian-maps/ios/MeridianMapViewManager.m index 0049a47..1e07ff1 100644 --- a/react-native-meridian-maps/ios/MeridianMapViewManager.m +++ b/react-native-meridian-maps/ios/MeridianMapViewManager.m @@ -154,6 +154,12 @@ - (void)setupMap { self.mapViewController = mapViewController; + // Enable user location display on the map view + if (self.showLocationUpdates) { + self.mapViewController.mapView.showsUserLocation = YES; + NSLog(@"[MeridianMapView] Enabled showsUserLocation on mapView"); + } + // Set up location manager self.appKey = [MREditorKey keyWithIdentifier:self.appId]; self.locationManager = [[MRLocationManager alloc] initWithApp:self.appKey]; @@ -206,6 +212,12 @@ - (void)setMapViewController:(CustomMapViewController *)mapViewController { UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; [self addSubview:mapViewController.view]; + // Enable user location display if needed + if (self.showLocationUpdates) { + mapViewController.mapView.showsUserLocation = YES; + NSLog(@"[MeridianMapView] Enabled showsUserLocation on mapView (setMapViewController)"); + } + // Update location updates based on current setting [self updateLocationUpdates]; @@ -327,6 +339,12 @@ - (void)updateLocationUpdates { } else if (status == kCLAuthorizationStatusAuthorizedWhenInUse || status == kCLAuthorizationStatusAuthorizedAlways) { NSLog(@"[MeridianMapView] Starting location updates"); [self.locationManager startUpdatingLocation]; + + // Also enable map view user location display + if (self.mapViewController.mapView) { + self.mapViewController.mapView.showsUserLocation = YES; + NSLog(@"[MeridianMapView] Enabled showsUserLocation (permission granted)"); + } } else { NSLog(@"[MeridianMapView] Location permission is denied or restricted. Status: %d", status); MMEventEmitter *emitter = [self.bridge moduleForClass:[MMEventEmitter class]]; @@ -342,6 +360,12 @@ - (void)updateLocationUpdates { } else { NSLog(@"[MeridianMapView] Stopping location updates"); [self.locationManager stopUpdatingLocation]; + + // Also disable map view user location display + if (self.mapViewController.mapView) { + self.mapViewController.mapView.showsUserLocation = NO; + NSLog(@"[MeridianMapView] Disabled showsUserLocation"); + } } }