mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
put compass under mapbuttons
This commit is contained in:
parent
4f28da3240
commit
e4a99510db
2 changed files with 10 additions and 9 deletions
|
|
@ -45,7 +45,8 @@ struct MapButtons: View {
|
|||
.background(Color(UIColor.systemBackground))
|
||||
.cornerRadius(8)
|
||||
.shadow(radius: 1)
|
||||
.offset(x: 2, y: self.tracking == .followWithHeading ? 90 : 25)
|
||||
.offset(x: 3, y: 25)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -78,14 +78,14 @@ struct MapViewSwiftUI: UIViewRepresentable {
|
|||
mapView.showsPitchControl = true
|
||||
#else
|
||||
#if os(iOS)
|
||||
// Hide the default compass that only appears when you are not going north and instead always show the compass in the bottom right corner
|
||||
mapView.showsCompass = true
|
||||
// let compassButton = MKCompassButton(mapView: mapView)
|
||||
// compassButton.compassVisibility = .adaptive
|
||||
// mapView.addSubview(compassButton)
|
||||
// compassButton.translatesAutoresizingMaskIntoConstraints = false
|
||||
// compassButton.trailingAnchor.constraint(equalTo: mapView.trailingAnchor, constant: -5).isActive = true
|
||||
// compassButton.bottomAnchor.constraint(equalTo: mapView.bottomAnchor, constant: -25).isActive = true
|
||||
// Move the default compass under the mapbuttons control
|
||||
mapView.showsCompass = false
|
||||
let compass = MKCompassButton(mapView: mapView)
|
||||
compass.translatesAutoresizingMaskIntoConstraints = false
|
||||
compass.compassVisibility = .adaptive
|
||||
mapView.addSubview(compass)
|
||||
compass.trailingAnchor.constraint(equalTo: mapView.trailingAnchor, constant: -5).isActive = true
|
||||
compass.topAnchor.constraint(equalTo: mapView.topAnchor, constant: 145).isActive = true
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue