File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
presentation/src/main/java/com/stop/ui Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ class MissionFragment : Fragment(), MissionHandler {
88
88
)
89
89
90
90
tMap.isTracking = true
91
+ tMap.isTransportTracking = false
91
92
}
92
93
93
94
binding.layoutBusCurrent.setOnClickListener {
@@ -98,6 +99,7 @@ class MissionFragment : Fragment(), MissionHandler {
98
99
)
99
100
100
101
tMap.isTracking = false
102
+ tMap.isTransportTracking = true
101
103
}
102
104
103
105
}
@@ -164,6 +166,7 @@ class MissionFragment : Fragment(), MissionHandler {
164
166
Marker .BUS_MARKER_IMG ,
165
167
TMapPoint (nowLocation.latitude.toDouble(), nowLocation.longitude.toDouble())
166
168
)
169
+ tMap.trackingTransport(beforeLocation)
167
170
}
168
171
}
169
172
@@ -223,6 +226,7 @@ class MissionFragment : Fragment(), MissionHandler {
223
226
tMap.apply {
224
227
tMapView.setOnEnableScrollWithZoomLevelListener { _, _ ->
225
228
isTracking = false
229
+ isTransportTracking = false
226
230
}
227
231
}
228
232
}
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ open class TMap(
20
20
lateinit var initLocation: Location
21
21
22
22
var isTracking = true
23
+ var isTransportTracking = false
23
24
24
25
fun init () {
25
26
tMapView = TMapView (context).apply {
@@ -53,6 +54,17 @@ open class TMap(
53
54
manager.setOnLocationChangeListener(onLocationChangeListener)
54
55
}
55
56
57
+ fun trackingTransport (location : Location ) {
58
+ if (isTransportTracking.not ()) {
59
+ return
60
+ }
61
+ tMapView.setCenterPoint(
62
+ location.latitude,
63
+ location.longitude,
64
+ true
65
+ )
66
+ }
67
+
56
68
private val onLocationChangeListener = TMapGpsManager .OnLocationChangedListener { location ->
57
69
if (location != null && checkKoreaLocation(location)) {
58
70
val beforeLocation = tMapView.locationPoint
You can’t perform that action at this time.
0 commit comments