In the starting, I am displaying my current location. But after that, I want to update my current location on the basis of lat-long I get from the API.
How can I update the current location based on the lat long?
In the starting, I am displaying my current location. But after that, I want to update my current location on the basis of lat-long I get from the API.
How can I update the current location based on the lat long?
Unfortunately you cannot do it because mapView.userLocation
is a get-only property.
e.g.
mapView.userLocation.location = CLLocation(latitude: coordinate.latitude,
longitude: coordinate.longitude)
cause error
Cannot assign to property: 'location' is a get-only property