Skip to content

Camera animation is very jerky when using realtime location #28

Open
@jdrobert

Description

@jdrobert

Description

Camera animation is very jerky when using realtime location

Steps to Reproduce

Update map position based on current location. The larger the distance between updates (the faster the object is going) the worse the problem shows.

The easiest way to reproduce is to set the location of the simulator to "Freeway Drive". I've also tested this on a device and see the same jerkiness.

Expected behavior: Changes in the current location should be smoothly updated.

Actual behavior: Changes in the current location are not smoothly updated like Apple Maps

Reproduces how often: 100%

Additional Information

Code:

import UIKit
import Wrld

class LocationViewController: UIViewController {
    private let locationManager = CLLocationManager()
    @IBOutlet private weak var mapView: WRLDMapView!

    override func viewDidLoad() {
        super.viewDidLoad()
        locationManager.delegate = self
        locationManager.desiredAccuracy = kCLLocationAccuracyBest
    }
  }

  extension LocationViewController: CLLocationManagerDelegate {
      func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
            if let location = locations.last{
                //The same result happens if animated is false. 
                mapView.setCenter(location.coordinate, zoomLevel: 30, animated: true)
            }
        }
  }

Example:
wrld3d

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions