공지사항:
2025년 4월 15일 전에 Earth Engine 사용을 위해 등록된 모든 비상업용 프로젝트는 Earth Engine 액세스를 유지하기 위해
비상업용 자격 요건을 인증해야 합니다.
ui.util.throttle
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
함수를 래핑하여 간격당 최대 두 번 호출할 수 있도록 합니다. 지연이 경과하기 전에 래퍼 함수가 여러 번 호출되면 첫 번째 호출과 마지막 호출만 실행됩니다.
사용 예: ui.Slider의 슬라이드 이벤트에 대한 콜백 콜백이 즉시 실행되어 슬라이드 작업이 반응하는 것처럼 느껴집니다. 또한 콜백은 사용자가 슬라이더와의 상호작용을 완료한 후에 실행되므로 최종 콜백 호출이 슬라이더의 최종 값에 액세스할 수 있습니다.
래핑된 함수를 반환합니다.
사용 | 반환 값 |
---|
ui.util.throttle(func, delay, scope) | 함수 |
인수 | 유형 | 세부정보 |
---|
func | 함수 | 호출할 함수입니다. |
delay | 숫자 | 제한의 지연 시간(밀리초)입니다. 이 함수는 초기 호출 후 지연 시간이 경과할 때까지 한 번만 호출할 수 있습니다. |
scope | 객체, 선택사항 | 함수를 호출할 범위의 객체입니다. |
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003eLimits a function's execution to at most twice per specified interval, ensuring responsiveness and capturing the final state.\u003c/p\u003e\n"],["\u003cp\u003eUseful for scenarios like UI slider events where immediate feedback and final value processing are crucial.\u003c/p\u003e\n"],["\u003cp\u003eWraps the original function and returns a new function that manages the throttling behavior.\u003c/p\u003e\n"],["\u003cp\u003eCustomizable with a delay parameter (in milliseconds) and an optional scope for execution context.\u003c/p\u003e\n"]]],[],null,["# ui.util.throttle\n\n\u003cbr /\u003e\n\nWraps a function to allow it to be called, at most, twice per interval. If the wrapper function is called multiple times before the delay elapses, only the first and the last calls will go through.\n\n\u003cbr /\u003e\n\nExample use: For the callback to a slide event on a ui.Slider. The callback will run immediately, making the slide action feel responsive. The callback is also guaranteed to run after the user has finished interacting with the slider, ensuring that the final callback invocation has access to the slider's final value.\n\nReturns the wrapped function.\n\n| Usage | Returns |\n|--------------------------------------------|----------|\n| `ui.util.throttle(func, delay, `*scope*`)` | Function |\n\n| Argument | Type | Details |\n|----------|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|\n| `func` | Function | The function to call. |\n| `delay` | Number | The delay, in milliseconds, for the throttle. The function can only be called once after the initial invocation until after the delay has elapsed. |\n| `scope` | Object, optional | The object in whose scope to call the function. |"]]