Pengumuman: Semua project nonkomersial yang terdaftar untuk menggunakan Earth Engine sebelum
15 April 2025 harus
memverifikasi kelayakan nonkomersial untuk mempertahankan akses Earth Engine.
ui.Slider.onChange
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Mendaftarkan callback yang dipicu saat status penggeser berubah. Jika perubahan disebabkan oleh pengguna yang menarik penggeser, peristiwa tidak akan diaktifkan hingga penarikan selesai.
Menampilkan ID yang dapat diteruskan ke unlisten() untuk membatalkan pendaftaran callback.
Penggunaan | Hasil |
---|
Slider.onChange(callback) | String |
Argumen | Jenis | Detail |
---|
ini: ui.slider | ui.Slider | Instance ui.Slider. |
callback | Fungsi | Callback yang akan dipicu saat status penggeser berubah. Callback meneruskan nilai penggeser saat ini dan widget penggeser. |
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-26 UTC.
[null,null,["Terakhir diperbarui pada 2025-07-26 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eonChange\u003c/code\u003e method registers a callback function that is triggered when the slider's value changes, but only after a user completes dragging the slider.\u003c/p\u003e\n"],["\u003cp\u003eIt returns a unique ID that can be used with the \u003ccode\u003eunlisten()\u003c/code\u003e method to remove the registered callback.\u003c/p\u003e\n"],["\u003cp\u003eThe callback function receives the slider's current value and the slider widget itself as arguments when invoked.\u003c/p\u003e\n"]]],["The `Slider.onChange` method registers a callback function to be executed when a slider's state changes. This callback is triggered after a user completes dragging the slider, not during the drag. The method accepts a callback function as an argument, which receives the slider's current value and the slider widget itself. It returns a unique ID (string) that can be used to unregister the callback later using `unlisten()`.\n"],null,["# ui.Slider.onChange\n\n\u003cbr /\u003e\n\nRegisters a callback that's fired when the slider's state changes. If the change is due to the user dragging the slider, the event will not fire until the drag completes.\n\n\u003cbr /\u003e\n\nReturns an ID which can be passed to unlisten() to unregister the callback.\n\n| Usage | Returns |\n|-----------------------------|---------|\n| Slider.onChange`(callback)` | String |\n\n| Argument | Type | Details |\n|-------------------|-----------|--------------------------------------------------------------------------------------------------------------------------------|\n| this: `ui.slider` | ui.Slider | The ui.Slider instance. |\n| `callback` | Function | The callback to fire when the slider's state changes. The callback is passed the slider's current value and the slider widget. |"]]