Add method to set user tracking mode with completion handler
-[MGLMapView setUserTrackingMode:animated:] kicks off an animation of undetermined length when animated is YES. The application may need to update its state at the very end of this animation. While it’s possible for the delegate to respond to -mapView:regionDidChangeAnimated:, there are many reasons the region might change, and it can often be difficult to distinguish among different animations. There should be a -[MGLMapView setUserTrackingMode:animated:completionHandler:] method that takes a completion block.
#5839 is a request for a similar completion handler for -showAnnotations:animated:.
/cc @bsudekum
@LukasPaczos I know that you're looking at ways to improve the Location Layer Plugin, this would be a good thing to add too.
/cc: @lilykaiser @chloekraw
Marking as "medium priority" after discussion with internal consumers of the SDK
Ticket tracking the request for Android: https://github.com/mapbox/mapbox-gl-native/issues/13243.
I'd really like this too. Or perhaps a timing function to determine a DispatchQueue's length for waiting until the next animation or logical progression. Currently you cannot fly the camera to a location and setting camera pitch.
/cc @zugaldia for follow up
Hello Team,
My application get crash when i am using SetuserTrackingmode Follow and FollowWithHeading
Crashed: com.apple.main-thread
0 libsystem_malloc.dylib 0x199060b18 nanov2_allocate_from_block$VARIANT$mp + 4
1 libsystem_malloc.dylib 0x19905fecc nanov2_malloc$VARIANT$mp + 60
2 libsystem_malloc.dylib 0x19906e750 malloc_zone_malloc + 156
3 CoreFoundation 0x19932ddd4 __CFStrAllocateMutableContents + 96
4 CoreFoundation 0x19932d624 __CFStringChangeSizeMultiple + 608
5 CoreFoundation 0x199328218 __CFStringAppendBytes + 612
6 CoreFoundation 0x19931a2e4 __CFStringAppendFormatCore + 12820
7 CoreFoundation 0x19931a65c _CFStringCreateWithFormatAndArgumentsAux2 + 152
8 CoreFoundation 0x19931a730 CFStringCreateWithFormat + 60
9 CoreFoundation 0x199277e8c -[_CFXPreferences(PlistSourceAdditions) withManagedSourceForIdentifier:user:perform:] + 104
10 CoreFoundation 0x19927d84c -[_CFXPreferences appValueIsForcedForKey:appIdentifier:] + 160
11 CoreFoundation 0x1993b0e08 CFPreferencesAppValueIsForced + 104
12 GeoServices 0x19edc86e4 ___getValue_block_invoke.llvm.7478192230168857876 + 180
13 MapKit 0x1a6b28834 MapKitConfig_GetPropertiesForKey + 2912
14 GeoServices 0x19edc6e54 GEOConfigGetPropertiesForKey + 84
15 GeoServices 0x19edc85bc _getValue.llvm.7478192230168857876 + 180
16 GeoServices 0x19edc65f0 GEOConfigGetInteger + 28
17 MapKit 0x1a69a7cac -[MKMapView _canShowControls] + 92
18 MapKit 0x1a6986704 -[MKMapView _showOrHideScaleIfNecessary:] + 48
19 MapKit 0x1a697d1a8 -[MKMapView _didChangeRegionMidstream:] + 256
20 MapKit 0x1a69aa420 -[MKMapView mapLayerDidChangeVisibleRegion] + 56
21 VectorKit 0x1a76cd9d4 __77-[VKMapAnnotationTrackingCameraController _rotateToHeadingAnimated:duration:]_block_invoke + 948
22 VectorKit 0x1a76cd5c8 -[VKMapAnnotationTrackingCameraController rotateToHeadingAnimated:duration:] + 664
23 VectorKit 0x1a733cbac -[VKAnnotationTrackingCameraController startTrackingAnnotation:trackHeading:animated:] + 572
24 MapKit 0x1a69a5464 -[MKMapView setUserTrackingMode:animated:fromTrackingButton:] + 836
25 lineinspectionSTG 0x1004f27dc specialized BeginInspectionVC.mapView(:regionDidChangeAnimated:) + 4306380764 (
@rupendrag-ios considering that this ticket was closed a while ago, would you mind opening a new ticket with the issue that you're seeing? Since https://github.com/mapbox/mapbox-gl-native/issues/15971, the right repo for such a ticket would be https://github.com/mapbox/mapbox-gl-native-ios. Thanks!
@rupendrag-ios Also, this appears to be a MapKit issue rather than a Mapbox issue; before creating a new issue, please ensure this bug is Mapbox related.