@@ -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