Why camera doesn't follow the user position - ios

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.

Related

Mapbox iOS SDK stop updating user position

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

Google Street View for iOS with device orientation / gyroscope sensor

Is there an easy way to make in iOS Google Street View GMSPanormaView's camera follow the device's orientation via data from its motion sensors?
If not, has anyone already done it and can share a code snippet that takes data from CoreMotion, maybe manipulates it to create GMSPanoramaCamera, and passes it to the GMSPanoramaView with animateToCamera:animationDuration:?
Any relevant Android code would also be useful.
Upon checking the Maps SDK for iOS:Internal: Street View, there is no built-in function/implementation for the device orientation/ gyroscope sensor.
According to Ziem's answer you can try implement this by yourself(create function). He also give pointers to study the following:
Set the camera orientation point of view
Animate the camera movements
Reference:
Blog
Github
Using a site they have successfully create a function that will let you browse the Google streetview panoramas with your smartphone/tablet like you were inside it, just by moving your phone like a window to the world.

How does the default SceneKit application in Xcode handle the double click?

When I open a game application in Xcode, and go to SceneKit there is already some code written. The code draws an airplane and allows the user to rotate it. When you double tap anywhere on the screen the plane returns to its original position. How can you do that. I looked through the whole application and there is no hint of a double tap gesture or bringing the view back to its position. How does that happen without any code?
There's no code there to allow you to rotate the plane either.
That functionality as well as the double tap to reset the camera functionality is added by the scnView.allowsCameraControl = YES line in the view controller.

MKMapView Loads before LocationManager has got user location - cannot set Region to center on user location

I have an iOS app where Im loading a MKMapView as the app starts. I want to set the center of the "MKCoordinateRegion" to be the user latitude/longitude. However, the CLLocation Manager instance does not update the user location until after the MKMapView has loaded.
For now I am hard coding the map center coordinates into the app. But I was wondering if anyone can suggest a better way to handle this situation.
I can think of 2 approaches but Im not a fan of either of them:
1) Stall launching the MKMapView using an activityindicator
2) Launch the MKMapview with the hard coded location and then as soon as the user location is available animate the mapview region to center on that location
Any suggestions?
Store the last known lat/long when you go to background or when app is closed.
On start center map view to last known position.
As soon as location manager sends an updated location, update the map center.
Set the userTrackingMode property of the mapview to MKUserTrackingModeFollow. You don't need a location manager for this, mapView does it for you. When you later want to relocate the map, set the property to MKUserTrackingModeNone, and relocate your map.
Do what Apple does. Start really far zoomed out, maybe put a message on screen "Scanning for location", then when the location information is available zoom in.

MapKit/CoreLocation/ShowsUserLocation implementation strategy

I'm implementing a map in one of my apps, the user's location needs to be read and then the map zoomed to current location and then pins added for businesses surrounding the user.
I've got it working to a point but i'm confused as to how to implement the current location stuff.
I tried adding a MKMapView and setting showsUserLocation = YES which in the simulator will always annoyingly place you at Apple's HQ in CA, no good to me for testing!
So, I thought i'd implement CoreLocation which works brilliantly and in the simulator, uses the network/WiFi mapping to figure out that i'm at home and returns lat/long for my home.
However, so far, I can only represent the current location with a MKPinAnnotationView setting it to a green dot. This animates nicely onto my map but what i'd really like though is to have the blue dot as my current location annotation with the circle around it similar to showsUserLocation.
Is there a way in a delegate protocol for MKMapView to intercept how the showsUserLocation = YES internals work to accomplish this? Or, can I reset the co-ordinates that it thinks are right to display my actual location?
The simulator is displaying the Apple's HQ because it doesn't have a GPS chip available.
I'd recommend to test your code on a device and use showUserLocation = YES in order to show the user's current location.
The hack you are trying to do is not recommended.

Resources