Duyuru:
15 Nisan 2025'ten önce Earth Engine'i kullanmak için kaydedilen tüm ticari olmayan projelerin Earth Engine erişimini sürdürmek için
ticari olmayan uygunluğu doğrulaması gerekir.
ui.Button.onClick
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Düğme tıklandığında tetiklenen bir geri çağırma kaydeder.
Geri çağırma işlemini kaydını silmek için unlisten() işlevine iletilebilecek bir kimlik döndürür.
Kullanım | İadeler |
---|
Button.onClick(callback) | Dize |
Bağımsız Değişken | Tür | Ayrıntılar |
---|
bu: ui.button | ui.Button | ui.Button örneği. |
callback | İşlev | Düğme tıklandığında tetiklenecek geri çağırma. Geri çağırma, düğme widget'ına iletilir. |
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-26 UTC.
[null,null,["Son güncelleme tarihi: 2025-07-26 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eonClick\u003c/code\u003e method registers a callback function that executes when the button is clicked.\u003c/p\u003e\n"],["\u003cp\u003eIt returns a unique ID that can be used with \u003ccode\u003eunlisten()\u003c/code\u003e to remove the registered callback.\u003c/p\u003e\n"],["\u003cp\u003eThe callback function receives the button widget as an argument when triggered.\u003c/p\u003e\n"]]],["The `Button.onClick` method registers a callback function to be executed upon a button click. It accepts a function as an argument, which will be passed the button widget when triggered. The method returns a unique string ID, used to unregister the callback later via `unlisten()`. The function callback is associated with the specific `ui.Button` instance where `onClick` is used.\n"],null,["# ui.Button.onClick\n\n\u003cbr /\u003e\n\nRegisters a callback that's fired when the button is clicked.\n\n\u003cbr /\u003e\n\nReturns an ID which can be passed to unlisten() to unregister the callback.\n\n| Usage | Returns |\n|----------------------------|---------|\n| Button.onClick`(callback)` | String |\n\n| Argument | Type | Details |\n|-------------------|-----------|--------------------------------------------------------------------------------------------|\n| this: `ui.button` | ui.Button | The ui.Button instance. |\n| `callback` | Function | The callback to fire when the button is clicked. The callback is passed the button widget. |"]]