Skip to content

Commit 5c8b271

Browse files
committed
fix : 마커 관련 버그 수정
- map이 ready된 다음에 line 그리도록 수정
1 parent 95023a2 commit 5c8b271

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

presentation/src/main/java/com/stop/ui/mission/MissionFragment.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ class MissionFragment : Fragment(), MissionHandler {
5555
initViewModel()
5656
initTMap()
5757
setObserve()
58-
drawPersonLine()
5958
setMissionOver()
6059

6160
}
@@ -151,6 +150,7 @@ class MissionFragment : Fragment(), MissionHandler {
151150
override fun alertTMapReady() {
152151
requestPermissionsLauncher.launch(PERMISSIONS)
153152
getAlarmInfo()
153+
drawPersonLine()
154154
}
155155

156156
override fun setOnEnableScrollWithZoomLevelListener() {
@@ -202,8 +202,7 @@ class MissionFragment : Fragment(), MissionHandler {
202202
addMarker(
203203
Marker.PERSON_MARKER,
204204
Marker.PERSON_MARKER_IMG,
205-
TMapPoint(nowLocation.latitude, nowLocation.longitude),
206-
true
205+
TMapPoint(nowLocation.latitude, nowLocation.longitude)
207206
)
208207
personCurrentLocation = nowLocation
209208
latitudes.add(nowLocation.latitude)

presentation/src/main/java/com/stop/ui/util/TMap.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.stop.ui.util
22

33
import android.content.Context
4-
import android.util.Log
54
import androidx.core.content.ContextCompat
65
import androidx.core.graphics.drawable.toBitmap
76
import com.skt.tmap.TMapGpsManager
@@ -87,18 +86,15 @@ open class TMap(
8786
&& TMapView.MIN_LAT < location.latitude && location.latitude < TMapView.MAX_LAT
8887
}
8988

90-
fun addMarker(id: String, icon: Int, location: TMapPoint, isFirst: Boolean = false) {
89+
fun addMarker(id: String, icon: Int, location: TMapPoint) {
9190
val marker = TMapMarkerItem().apply {
9291
this.id = id
9392
this.icon = ContextCompat.getDrawable(context, icon)?.toBitmap()
9493
tMapPoint = location
9594
isAnimation = false
9695
}
9796

98-
if (isFirst.not()) {
99-
tMapView.removeTMapMarkerItem(id)
100-
}
101-
Log.d("MissionWorker","왜 마커가 null이라고 하는거임 $marker")
97+
tMapView.removeTMapMarkerItem(id)
10298
tMapView.addTMapMarkerItem(marker)
10399
}
104100

0 commit comments

Comments
 (0)