mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
cleaned up code
This commit is contained in:
parent
062cad189e
commit
b5a09d502a
1 changed files with 7 additions and 6 deletions
|
|
@ -91,7 +91,6 @@ class MapFragment : ScreenFragment("Map"), Logging {
|
|||
nodePositions.featureCollection(getCurrentNodes())
|
||||
}
|
||||
|
||||
//TODO Update camera movements
|
||||
private fun zoomToNodes(map: MapboxMap) {
|
||||
val points: MutableList<Point> = mutableListOf()
|
||||
val nodesWithPosition =
|
||||
|
|
@ -100,10 +99,13 @@ class MapFragment : ScreenFragment("Map"), Logging {
|
|||
val unit = if (nodesWithPosition.size >= 2) {
|
||||
|
||||
// Multiple nodes, make them all fit on the map view
|
||||
for (node in nodesWithPosition) {
|
||||
val point =
|
||||
Point.fromLngLat(node.position!!.longitude, node.position!!.latitude)
|
||||
points.add(point)
|
||||
nodesWithPosition.forEach {
|
||||
points.add(
|
||||
Point.fromLngLat(
|
||||
it.position!!.longitude,
|
||||
it.position!!.latitude
|
||||
)
|
||||
)
|
||||
}
|
||||
map.cameraForCoordinates(points)
|
||||
} else {
|
||||
|
|
@ -115,7 +117,6 @@ class MapFragment : ScreenFragment("Map"), Logging {
|
|||
this.zoom(9.0)
|
||||
this.center(points[0])
|
||||
}
|
||||
|
||||
}
|
||||
map.flyTo(
|
||||
unit,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue