체류중 배지 낮은 줌 숨김 처리
This commit is contained in:
+14
-1
@@ -487,6 +487,7 @@ const FACE_MARKER_SIZE = 60;
|
||||
const CURRENT_STAY_BADGE_WIDTH = 140;
|
||||
const CURRENT_STAY_BADGE_HEIGHT = 28;
|
||||
const CURRENT_STAY_BADGE_GAP = 8;
|
||||
const CURRENT_STAY_MIN_ZOOM = 13;
|
||||
|
||||
const FALLBACK_BACK_TARGET = 'https://chaegeon.com/';
|
||||
const BACK_HISTORY_KEY = 'chaegeon.backHistory.v1';
|
||||
@@ -1424,6 +1425,18 @@ function initMap(latlng, accuracy = 50) {
|
||||
createMainMarker(latlng);
|
||||
createAccuracyCircle(latlng, accuracy);
|
||||
updateHomeCircles();
|
||||
naver.maps.Event.addListener(mapState.map, 'zoom_changed', () => {
|
||||
if (mapState.map.getZoom() < CURRENT_STAY_MIN_ZOOM) {
|
||||
stopCurrentStayBadge();
|
||||
} else if (hasValidCoords(lastLat, lastLng)) {
|
||||
updateCurrentStayBadge({
|
||||
lat: lastLat,
|
||||
lng: lastLng,
|
||||
latlng: new naver.maps.LatLng(lastLat, lastLng),
|
||||
time: lastUpdateISOTime || new Date().toISOString(),
|
||||
});
|
||||
}
|
||||
});
|
||||
ensureMapTools();
|
||||
}
|
||||
|
||||
@@ -2309,7 +2322,7 @@ function renderCurrentStayBadge() {
|
||||
}
|
||||
|
||||
function updateCurrentStayBadge(point) {
|
||||
if (mapState.playbackTimer || _overrideRange) {
|
||||
if (mapState.playbackTimer || _overrideRange || mapState.map?.getZoom?.() < CURRENT_STAY_MIN_ZOOM) {
|
||||
stopCurrentStayBadge();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user