aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'androidApp/src/main/java')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt22
1 files changed, 15 insertions, 7 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 9bda9d4..1b736d1 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
@@ -7,6 +7,7 @@ import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
+import androidx.core.content.ContextCompat
import androidx.core.content.res.ResourcesCompat
import androidx.core.graphics.drawable.toBitmap
import com.mousebird.maply.*
@@ -126,24 +127,29 @@ class MapFragment : GlobeMapFragment() {
}.toTypedArray()
val vectorInfo = VectorInfo()
- vectorInfo.setColor(Color.GREEN)
+ vectorInfo.setColor(ContextCompat.getColor(context!!, R.color.colorReport))
vectorInfo.setLineWidth(20.0f)
/* Draw markers for positions */
val screenMarkers = markers.mapIndexed { i, marker ->
val screenMarker = ScreenMarker()
- val markerSize = Point2d(144.0, 144.0)
-
screenMarker.loc = Point2d.FromDegrees(marker.longitude, marker.latitude)
screenMarker.image = if (isReport) {
- // For reports, position, start and end markers must be shown differently
+ // For reports, position, start and end, icons must be different
when (i) {
0 -> getIcon(MarkerType.REPORT_START)
markers.size - 1 -> getIcon(MarkerType.REPORT_END)
else -> getIcon(MarkerType.REPORT_POSITION)
}
} else getIcon(marker.type)
- screenMarker.size = markerSize
+ screenMarker.size = if (isReport) {
+ // For reports, position, start and end, size must be different
+ when (i) {
+ 0 -> Point2d(144.0, 144.0)
+ markers.size - 1 -> Point2d(144.0, 144.0)
+ else -> Point2d(82.0, 82.0)
+ }
+ } else Point2d(144.0, 144.0)
screenMarker.userObject = marker.id
screenMarker.selectable = true
if (!isReport) {
@@ -196,12 +202,14 @@ class MapFragment : GlobeMapFragment() {
clear(true)
+ val color = ContextCompat.getColor(context!!, R.color.colorGeofence)
+
val vectorInfo = VectorInfo()
- vectorInfo.setColor(Color.BLUE)
+ vectorInfo.setColor(color)
vectorInfo.setLineWidth(10.0f)
val labelInfo = LabelInfo()
- labelInfo.textColor = Color.BLUE
+ labelInfo.textColor = color
val shapes = mutableListOf<Shape>()
val vectors = mutableListOf<VectorObject>()