@@ -179,44 +179,49 @@ class MissionFragment : Fragment(), MissionHandler {
179
179
first + = 1
180
180
}
181
181
1 -> {
182
+ initMarker(userLocation)
182
183
beforeLocation = userLocation
183
- tMap.addMarker(
184
- Marker .PERSON_MARKER ,
185
- Marker .PERSON_MARKER_IMG ,
186
- TMapPoint (userLocation.latitude, userLocation.longitude),
187
- true
188
- )
189
- personCurrentLocation = userLocation
190
- tMap.latitudes.add(userLocation.latitude)
191
- tMap.longitudes.add(userLocation.longitude)
192
- tMap.setRouteDetailFocus()
193
184
first + = 1
194
- arriveDestination(userLocation.latitude, userLocation.longitude)
195
185
}
196
186
else -> {
197
- Log .d(" MissionWorker" , " 그리는 중 $userLocation $beforeLocation " )
198
- val nowLocation = TMapPoint (userLocation.latitude, userLocation.longitude)
199
- tMap.drawMoveLine(
200
- nowLocation,
201
- TMapPoint (beforeLocation.latitude, beforeLocation.longitude),
202
- Marker .PERSON_LINE + PERSON_LINE_NUM .toString(),
203
- Marker .PERSON_LINE_COLOR
204
- )
205
- tMap.addMarker(Marker .PERSON_MARKER , Marker .PERSON_MARKER_IMG , nowLocation)
206
- personCurrentLocation = userLocation
187
+ drawNowLocationLine(TMapPoint (userLocation.latitude, userLocation.longitude), TMapPoint (beforeLocation.latitude, beforeLocation.longitude))
188
+ missionViewModel.personCurrentLocation = userLocation
207
189
if (tMap.isTracking) {
208
190
tMap.tMapView.setCenterPoint(userLocation.latitude, userLocation.longitude)
209
191
}
210
192
beforeLocation = userLocation
211
- PERSON_LINE_NUM + = 1
212
- arriveDestination(userLocation.latitude, userLocation.longitude)
213
193
}
214
194
}
215
-
216
195
}
217
196
}
218
197
}
219
198
199
+ private fun initMarker (nowLocation : Location ) {
200
+ with (tMap) {
201
+ addMarker(
202
+ Marker .PERSON_MARKER ,
203
+ Marker .PERSON_MARKER_IMG ,
204
+ TMapPoint (nowLocation.latitude, nowLocation.longitude)
205
+ )
206
+ missionViewModel.personCurrentLocation = nowLocation
207
+ latitudes.add(nowLocation.latitude)
208
+ longitudes.add(nowLocation.longitude)
209
+ setRouteDetailFocus()
210
+ }
211
+ }
212
+
213
+ private fun drawNowLocationLine (nowLocation : TMapPoint , beforeLocation : TMapPoint ) {
214
+ tMap.drawMoveLine(
215
+ nowLocation,
216
+ beforeLocation,
217
+ Marker .PERSON_LINE + PERSON_LINE_NUM .toString(),
218
+ Marker .PERSON_LINE_COLOR
219
+ )
220
+ PERSON_LINE_NUM + = 1
221
+
222
+ tMap.addMarker(Marker .PERSON_MARKER , Marker .PERSON_MARKER_IMG , nowLocation)
223
+ }
224
+
220
225
private fun getAlarmInfo () {
221
226
alarmSettingViewModel.getAlarm()
222
227
val linePoints = arrayListOf<TMapPoint >()
0 commit comments