From 7629861e4e2b7e52b93f817426cb940c8f075b59 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Tue, 11 Jan 2022 01:43:54 -0600 Subject: Center map to bounds even when isReport = false --- .../mx/trackermap/TrackerMap/android/map/MapFragment.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'androidApp/src/main') 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) -- cgit v1.2.3