diff options
author | Iván Ávalos <avalos@disroot.org> | 2022-01-11 01:43:54 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2022-01-11 01:43:54 -0600 |
commit | a8deb59dab6cdd1b025dc4b8b1ab85c0376b62d8 (patch) | |
tree | 6226a45f06cf977ad36ac85ac64b11bf751ec359 /androidApp | |
parent | 9c2cdaf961dce0344962b7d87915288db2e89e1e (diff) | |
download | etbsa-trackermap-mobile-a8deb59dab6cdd1b025dc4b8b1ab85c0376b62d8.tar.gz etbsa-trackermap-mobile-a8deb59dab6cdd1b025dc4b8b1ab85c0376b62d8.tar.bz2 etbsa-trackermap-mobile-a8deb59dab6cdd1b025dc4b8b1ab85c0376b62d8.zip |
Center map to bounds even when isReport = false
Diffstat (limited to 'androidApp')
-rw-r--r-- | androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt index 681a21f..41cfd50 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt @@ -133,14 +133,12 @@ class MapFragment : GlobeMapFragment() { ThreadMode.ThreadAny )) - if (isReport && markers.isNotEmpty()) { - Log.d("MapFragment", "Displaying report") - - val points = markers.map { marker -> - Point2d.FromDegrees(marker.longitude, marker.latitude) - }.toTypedArray() + val points = markers.map { marker -> + Point2d.FromDegrees(marker.longitude, marker.latitude) + }.toTypedArray() - // Draw polyline + // Draw polyline for report + if (isReport && markers.isNotEmpty()) { val vector = VectorObject() vector.addAreal(points) @@ -153,8 +151,10 @@ class MapFragment : GlobeMapFragment() { vectorInfo, ThreadMode.ThreadAny )) + } - // Center map to polyline bounds + // Center map to bounds + if (markers.isNotEmpty()) { val mbr = Mbr() points.forEach { mbr.addPoint(it) |