Skip to content

Commit

Permalink
Merge pull request #957 from meshtastic/2.5.8
Browse files Browse the repository at this point in the history
Fix map zoom level
  • Loading branch information
garthvh authored Oct 6, 2024
2 parents 63e33cb + cba23fe commit b3735d3
Show file tree
Hide file tree
Showing 3 changed files with 235 additions and 260 deletions.
28 changes: 1 addition & 27 deletions Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -1274,9 +1274,6 @@
}
}
}
},
"Attribution:" : {

},
"automatic.detection" : {
"extractionState" : "migrated",
Expand Down Expand Up @@ -6819,9 +6816,6 @@
},
"Enable Notifications" : {

},
"Enable Offline Maps" : {

},
"enabled" : {
"localizations" : {
Expand Down Expand Up @@ -11542,6 +11536,7 @@
}
},
"map.recentering" : {
"extractionState" : "stale",
"localizations" : {
"de" : {
"stringUnit" : {
Expand Down Expand Up @@ -15870,9 +15865,6 @@
}
}
}
},
"Offline Maps" : {

},
"OK" : {

Expand Down Expand Up @@ -16712,9 +16704,6 @@
},
"PWD" : {

},
"Radar" : {

},
"radio.configuration" : {
"localizations" : {
Expand Down Expand Up @@ -19855,9 +19844,6 @@
},
"Show Alerts" : {

},
"Show Node History" : {

},
"Show nodes" : {

Expand All @@ -19867,15 +19853,9 @@
},
"Show on the mesh map." : {

},
"Show Route Lines" : {

},
"Show Waypoints " : {

},
"Show Weather" : {

},
"Shut Down" : {

Expand Down Expand Up @@ -21129,12 +21109,6 @@
},
"This will send a current position from your phone and enable fixed position." : {

},
"Tile Server" : {

},
"Tiles above Labels" : {

},
"Time" : {

Expand Down
7 changes: 4 additions & 3 deletions Meshtastic/Views/Nodes/Helpers/Map/NodeMapSwiftUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ struct NodeMapSwiftUI: View {
@Namespace var mapScope
@State var mapStyle: MapStyle = MapStyle.hybrid(elevation: .flat, pointsOfInterest: .all, showsTraffic: true)
@State var position = MapCameraPosition.automatic
@State var distance = 0.0
@State var scene: MKLookAroundScene?
@State var isLookingAround = false
@State var isShowingAltitude = false
Expand All @@ -44,7 +45,7 @@ struct NodeMapSwiftUI: View {
if node.hasPositions {
ZStack {
MapReader { _ in
Map(position: $position, bounds: MapCameraBounds(minimumDistance: 3000, maximumDistance: .infinity), scope: mapScope) {
Map(position: $position, bounds: MapCameraBounds(minimumDistance: 0, maximumDistance: .infinity), scope: mapScope) {
NodeMapContent(node: node)
}
.mapScope(mapScope)
Expand Down Expand Up @@ -103,7 +104,7 @@ struct NodeMapSwiftUI: View {
if node.positions?.count ?? 0 > 1 {
position = .automatic
} else {
position = .camera(MapCamera(centerCoordinate: mostRecent!.coordinate, distance: 8000, heading: 0, pitch: 60))
position = .camera(MapCamera(centerCoordinate: mostRecent!.coordinate, distance: distance, heading: 0, pitch: 0))
}
if let mostRecent {
Task {
Expand All @@ -128,7 +129,7 @@ struct NodeMapSwiftUI: View {
position = .automatic
} else {
if let mrCoord = mostRecent?.coordinate {
position = .camera(MapCamera(centerCoordinate: mrCoord, distance: 8000, heading: 0, pitch: 60))
position = .camera(MapCamera(centerCoordinate: mrCoord, distance: distance, heading: 0, pitch: 0))
}
}
if self.scene == nil {
Expand Down
Loading

0 comments on commit b3735d3

Please sign in to comment.