Mapbox iOS SDK stop updating user position - ios

How to stop updating user position, these to functions no longer exist :
mapView.locationManager.stopUpdatingHeading()
mapView.locationManager.stopUpdatingLocation()
The goal is to use SimulatedLocationManager, to simulate a navigation but the real position keeps updating.
thanks

Related

Why camera doesn't follow the user position

my problem is when I'm in navigation using the Sygic mapView the camera doesn't follow the user position despite that I choose this mode
mapView.cameraMovementMode = .followGpsPositionWithAutozoom
I didn't know if there is an other setting that I should follow the user position after starting the navigation
It should work the way you are using it. Did you try move camera somewhere out of your position and then call mapView.cameraMovementMode = .followGpsPositionWithAutozoom? It should set camera to your position and following your gps.
Are you initializing SYMapView after SDK is initialized?
Do you call SYPositioning.shared().startUpdatingPosition() after SDK is initialized? So SDK will start updating your location
You can register your class to SYPositioningDelegate and implement -(void)positioning:(nonnull SYPositioning*)positioning didUpdatePosition:(nonnull SYPosition*)position; method, so you can print your position.

ARKit Resuming Session

I have an ARKit app which allows the user to add a cube to the scene. This works fine and I can see the cube. But when I push the app to the background and then move the device to another location (by walking to a different room) then ARKit session is unable to determine the correct position of my old nodes.
Is there anyway I can find a workaround this problem so that when the app is resumed from coming to foreground from the background then it still remembers the position of the nodes.
UPDATE: I am looking into saving the lat and long for the user and then somehow converting those lat and long to SCNVector3 to put the node.
You probably won't be able to keep the AR running in the background. Apple does not recommend pausing the session or interrupting it and trying to resume:
Avoid interrupting the AR experience. If the user transitions to another fullscreen UI in your app, the AR view might not be an expected state when coming back.
Use the popover presentation (even on iPhone) for auxiliary view controllers to keep the user in the AR experience while adjusting settings or making a modal selection. In this example, the SettingsViewController and VirtualObjectSelectionViewController classes use popover presentation.
The issue is that once the session gets interrupted, the device stops using it's mechanisms that keep track of AR Nodes as well as your location, might have to set up a mechanism that keeps the app running constantly in the background and running the ARSession through that. You might be able to find projects on github that allow for running in the background. Another issue you might face is Apple's limitations with running apps in the background, which is apparently 3 minutes.
If you're at all interested in restarting the AR Session one you came back in, you can see my answer on this thread.

Location updates issue for iOS 7

I'm developing an iOS map application, so it's essential to receive location data consistently.
What is happening now is that the system allows the to app load the map and that's it!
The location getting instruction seems to freeze, even the network traffic indicator at the top bar disappears. Simply when I go to Settings->Privacy->Location Updates, switch off location updates for my app and then switch it back on. The map loads the current location.
What could be the possible causes to this?, please advice.
Use:
[_mapView setUserTrackingMode:MKUserTrackingModeFollow animated:YES];
This will smoothly follow the users current location. If you drag the map it will even set the tracking mode back to MKUserTrackingModeNone which is usually the behaviour you want.

What is your data loading strategy for pins on the map on the iOS?

I have developed an iOS app with native map showing custom pins on the map? Data behind the pins is loaded on demand and based on the movement around the map. I am setting a radius based on the current position and if the map goes out of this region it will send for data update.
At first new pins are loading smoothly but sometimes I have a feeling they are lagging especially for quick swipes.
So what strategies are you using in this case?
Apps that I have worked on that have maps I normally use the bounding box rather than radius as it is a perfect match for the screen ie rectangular.
As for loading new pois when a user moves, I would wait until they have stopped scrolling the map. If your users are doing quick swipes you could always detect that the map has moved and cancel any existing requests that were being executed until the user stops moving again.

MapKit Changing the User Location Programmatically

I am trying to make a jogging app which will track where the user ran. It will draw a line on the map where the user is running. My problem is that how to test such an app. Is there anyway I can dynamically change the user location which will fire the didUpdateUserLocation delegate method?
The iOS Simulator supports that feature in the current beta version. You can even simulate a dynamically updating location.

Resources