aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src/main/java
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-01-11 01:43:54 -0600
committerIván Ávalos <avalos@disroot.org>2022-01-11 01:43:54 -0600
commit7629861e4e2b7e52b93f817426cb940c8f075b59 (patch)
treef11ea1a3886d5566a1e0fea7d0f02a39c1b458ba /androidApp/src/main/java
parentbac5d46d07794972de0953100efb79664006c0a8 (diff)
downloadetbsa-trackermap-mobile-7629861e4e2b7e52b93f817426cb940c8f075b59.tar.gz
etbsa-trackermap-mobile-7629861e4e2b7e52b93f817426cb940c8f075b59.tar.bz2
etbsa-trackermap-mobile-7629861e4e2b7e52b93f817426cb940c8f075b59.zip
Center map to bounds even when isReport = false
Diffstat (limited to 'androidApp/src/main/java')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt16
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)