mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Center map for tracking modes.
This commit is contained in:
parent
28e5628c1f
commit
9a4de51281
1 changed files with 4 additions and 0 deletions
|
|
@ -40,6 +40,10 @@ struct MapViewSwiftUI: UIViewRepresentable {
|
|||
mapView.addAnnotations(waypoints)
|
||||
mapView.setUserTrackingMode(UserTrackingModes(rawValue: userTrackingModeId )?.MKUserTrackingModeValue() ?? MKUserTrackingMode.none, animated: true)
|
||||
if UserTrackingModes(rawValue: userTrackingModeId) != UserTrackingModes.none {
|
||||
let span = MKCoordinateSpan(latitudeDelta: 0.003, longitudeDelta: 0.003)
|
||||
let center = LocationHelper.currentLocation
|
||||
let region = MKCoordinateRegion(center: center, span: span)
|
||||
mapView.setRegion(region, animated: true)
|
||||
mapView.showsUserLocation = true
|
||||
} else {
|
||||
mapView.showsUserLocation = false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue