Merge branch 'iipbs/common/main' into iipbs/sn/ii
This commit is contained in:
@@ -19,10 +19,11 @@ export default React.memo(function GisTree({
|
||||
onLayerIconClick,
|
||||
imageVisible = false,
|
||||
isPlaying = false,
|
||||
setIsPlaying = () => {},
|
||||
targetLayerTypes = [],
|
||||
orderedLayers = [],
|
||||
checkInterval = 3000,
|
||||
setIsPlaying = () => { },
|
||||
targetLayerTypes = [],
|
||||
orderedLayers = [],
|
||||
checkInterval = 3000,
|
||||
onProgressChange = () => { },
|
||||
}) {
|
||||
const { gisCore, treeData } = useGisContext();
|
||||
const [checked, setChecked] = useState([]);
|
||||
@@ -265,6 +266,7 @@ export default React.memo(function GisTree({
|
||||
isPausedRef.current = false;
|
||||
targetNodesRef.current = [];
|
||||
currentAnimationIndexRef.current = 0;
|
||||
onProgressChange(0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -295,6 +297,9 @@ export default React.memo(function GisTree({
|
||||
|
||||
console.log('자동 체크 대상 노드들 (순서대로):', targetNodes.map(n => ({ id: n.id, name: n.text, type: n.data?.lyrTyNm })));
|
||||
|
||||
// 진행률 초기화 (전체 단계 수 설정)
|
||||
onProgressChange(targetNodes.length, 0);
|
||||
|
||||
// 모든 대상 레이어를 먼저 언체크
|
||||
targetNodes.forEach(node => {
|
||||
checkSpecificNode(node.id, false);
|
||||
@@ -321,6 +326,9 @@ export default React.memo(function GisTree({
|
||||
|
||||
currentAnimationIndexRef.current++;
|
||||
|
||||
// 진행률 업데이트
|
||||
onProgressChange(currentTargetNodes.length, currentAnimationIndexRef.current);
|
||||
|
||||
// 다음 레이어 처리를 위한 타이머 설정
|
||||
timeoutIdRef.current = setTimeout(processNextLayer, interval);
|
||||
} else {
|
||||
@@ -330,13 +338,22 @@ export default React.memo(function GisTree({
|
||||
targetNodesRef.current = [];
|
||||
currentAnimationIndexRef.current = 0;
|
||||
timeoutIdRef.current = null;
|
||||
|
||||
// 진행률 100% 완료
|
||||
onProgressChange(currentTargetNodes.length, currentTargetNodes.length);
|
||||
|
||||
// 잠시 후 진행률 초기화
|
||||
setTimeout(() => {
|
||||
onProgressChange(0, 0);
|
||||
}, 1000);
|
||||
|
||||
setIsPlaying?.(false);
|
||||
}
|
||||
};
|
||||
|
||||
processNextLayer();
|
||||
|
||||
}, [nodes, checkSpecificNode, setIsPlaying, isPlaying]);
|
||||
}, [nodes, checkSpecificNode, setIsPlaying, isPlaying, onProgressChange]);
|
||||
|
||||
// 애니메이션 일시정지 함수
|
||||
const pauseAnimation = useCallback(() => {
|
||||
|
||||
Reference in New Issue
Block a user