Объявление : Все некоммерческие проекты, зарегистрированные для использования Earth Engine до
15 апреля 2025 года, должны
подтвердить некоммерческое право на сохранение доступа к Earth Engine.
ui.Button
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Кнопка с текстовой меткой, на которую можно нажать.
Использование | Возврат | ui.Button( label , onClick , disabled , style , imageUrl ) | ui.Button |
Аргумент | Тип | Подробности | label | Строка, необязательно | Метка кнопки. По умолчанию — пустая строка. |
onClick | Функция, необязательная | Обратный вызов, срабатывающий при нажатии кнопки. Он передаётся виджету кнопки. |
disabled | Булевое значение, необязательное | Отключена ли кнопка. По умолчанию — false. |
style | Объект, необязательный | Объект разрешённых стилей CSS и их значений, которые можно задать для этого виджета. По умолчанию — пустой объект. |
imageUrl | Строка, необязательно | Необязательный URL-адрес изображения. Если он указан, кнопка будет отображаться как изображение, а текстовое значение будет отображаться при наведении курсора мыши. Разрешены только данные: URL-адреса и значки, загруженные с gstatic.com. |
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-24 UTC.
[null,null,["Последнее обновление: 2025-07-24 UTC."],[[["\u003cp\u003eCreates a clickable button widget with customizable text label, click functionality, and appearance.\u003c/p\u003e\n"],["\u003cp\u003eAllows setting an optional image for the button, displaying the label text on hover.\u003c/p\u003e\n"],["\u003cp\u003eCan be disabled to prevent user interaction.\u003c/p\u003e\n"],["\u003cp\u003eProvides flexibility in styling through CSS properties.\u003c/p\u003e\n"],["\u003cp\u003eUtilizes a straightforward constructor function for instantiation with various parameters.\u003c/p\u003e\n"]]],["The `ui.Button` function creates a clickable button. It accepts optional arguments: `label` (text), `onClick` (callback function on click), `disabled` (boolean to disable), `style` (CSS styling), and `imageUrl` (image for the button). When clicked, the `onClick` callback is triggered, receiving the button widget. The button can be customized with a text label or an image, and its appearance can be altered via CSS. Only specific URLs are allowed for the image.\n"],null,["# ui.Button\n\n\u003cbr /\u003e\n\nA clickable button with a text label.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|--------------------------------------------------------------------------------|-----------|\n| `ui.Button(`*label* `, `*onClick* `, `*disabled* `, `*style* `, `*imageUrl*`)` | ui.Button |\n\n| Argument | Type | Details |\n|------------|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `label` | String, optional | The button's label. Defaults to an empty string. |\n| `onClick` | Function, optional | A callback fired when the button is clicked. The callback is passed the button widget. |\n| `disabled` | Boolean, optional | Whether the button is disabled. Defaults to false. |\n| `style` | Object, optional | An object of allowed CSS styles with their values to be set for this widget. Defaults to an empty object. |\n| `imageUrl` | String, optional | Optional image url. If provided, the button will be rendered as an image and the value text will be shown on mouse hover. Only data: urls and icons loaded from gstatic.com are allowed. |"]]