findmydevice 히스토리 지도 표시 정리

This commit is contained in:
seo
2026-07-10 19:40:59 +09:00
parent 590b4c1201
commit 6652280915
2 changed files with 21 additions and 28 deletions
+17 -24
View File
@@ -1907,6 +1907,9 @@ function stopHistoryPlayback() {
clearInterval(mapState.playbackTimer);
mapState.playbackTimer = null;
}
if (!_overrideRange) {
setCurrentLocationVisible(true);
}
updateMapToolLabels();
}
@@ -1921,6 +1924,7 @@ function startHistoryPlayback(speed) {
if (!mapState.map || !points?.length) return;
stopHistoryPlayback();
setCurrentLocationVisible(false);
mapState.playbackSpeed = speed;
if (mapState.playbackIndex >= points.length - 1) {
@@ -2105,32 +2109,18 @@ function createAccuracyCircle(latlng, accuracy = 50) {
fillColor: '#007AFF',
fillOpacity: 0.2
});
updateCurrentRangeCircles(latlng);
}
function updateCurrentRangeCircles(latlng) {
if (!mapState.map || !latlng) return;
const ranges = [
{ radius: 500, strokeColor: '#34c759', fillColor: '#34c759' },
{ radius: 1000, strokeColor: '#ff9500', fillColor: '#ff9500' },
];
function clearCurrentRangeCircles() {
if (!mapState.rangeCircles?.length) return;
mapState.rangeCircles.forEach(circle => circle?.setMap?.(null));
mapState.rangeCircles = [];
}
ranges.forEach((range, index) => {
if (!mapState.rangeCircles[index]) {
mapState.rangeCircles[index] = new naver.maps.Circle({
map: mapState.map,
center: latlng,
radius: range.radius,
strokeColor: range.strokeColor,
strokeOpacity: 0.45,
strokeWeight: 1,
fillColor: range.fillColor,
fillOpacity: 0.035
});
} else {
mapState.rangeCircles[index].setCenter(latlng);
}
});
function setCurrentLocationVisible(visible) {
const map = visible ? mapState.map : null;
mapState.marker?.setMap?.(map);
mapState.circle?.setMap?.(map);
}
function applyMarkerEffects(marker) {
@@ -2378,6 +2368,8 @@ function updateDOMWithData(data) {
initMap(baseLatLng, data.accuracy || 50);
}
updateConfiguredHome(data) || updateHomeCenter(data.latitude, data.longitude);
setCurrentLocationVisible(false);
clearCurrentRangeCircles();
// 히스토리 궤적/포인트 업데이트
if (data.history?.length > 0) {
@@ -2413,10 +2405,11 @@ function updateDOMWithData(data) {
}
// 메인 마커 / 정확도 원 업데이트
setCurrentLocationVisible(true);
mapState.marker.setPosition(latlng);
mapState.circle.setCenter(latlng);
animateCircleRadius(Math.max(data.accuracy || 50, 10));
updateCurrentRangeCircles(latlng);
clearCurrentRangeCircles();
// autoPosition
const isChecked = document.getElementById('autoPositionSwitch').checked;