Annuncio: tutti i progetti non commerciali registrati per l'utilizzo di Earth Engine prima del
15 aprile 2025 devono
verificare l'idoneità non commerciale per mantenere l'accesso a Earth Engine.
ui.Button.onClick
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Registra un callback che viene attivato quando viene fatto clic sul pulsante.
Restituisce un ID che può essere passato a unlisten() per annullare la registrazione del callback.
Utilizzo | Resi |
---|
Button.onClick(callback) | Stringa |
Argomento | Tipo | Dettagli |
---|
questo: ui.button | ui.Button | L'istanza ui.Button. |
callback | Funzione | Il callback da attivare quando viene fatto clic sul pulsante. Il callback viene passato al widget del pulsante. |
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-26 UTC.
[null,null,["Ultimo aggiornamento 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. |"]]