公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ui.Select
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
具有回调的可打印选择菜单。
用法 | 返回 |
---|
ui.Select(items, placeholder, value, onChange, disabled, style) | ui.Select |
参数 | 类型 | 详细信息 |
---|
items | List<Object>,可选 | 要添加到选择中的选项列表。默认为空数组。 |
placeholder | 字符串,可选 | 未选择任何值时显示的占位符。默认值为“选择一个值…”。 |
value | 字符串,可选 | 选择的值。默认值为 null。 |
onChange | 函数(可选) | 在选择某个项时要触发的回调。回调会传递当前所选的值和选择 widget。 |
disabled | 布尔值,可选 | 选择器是否处于停用状态。默认值为 false。 |
style | 对象,可选 | 一个对象,包含允许的 CSS 样式及其要为此 widget 设置的值。请参阅 style() 文档。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eCreate a customizable select menu with \u003ccode\u003eui.Select()\u003c/code\u003e by providing items, placeholder, initial value, and styles.\u003c/p\u003e\n"],["\u003cp\u003eDefine an \u003ccode\u003eonChange\u003c/code\u003e callback function to execute actions when a user selects an item from the menu, receiving the selected value and the select widget.\u003c/p\u003e\n"],["\u003cp\u003eUtilize optional parameters like \u003ccode\u003edisabled\u003c/code\u003e to control interactivity and \u003ccode\u003estyle\u003c/code\u003e to modify the appearance of the select menu.\u003c/p\u003e\n"]]],[],null,["# ui.Select\n\n\u003cbr /\u003e\n\nA printable select menu with a callback.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|------------------------------------------------------------------------------------------------|-----------|\n| `ui.Select(`*items* `, `*placeholder* `, `*value* `, `*onChange* `, `*disabled* `, `*style*`)` | ui.Select |\n\n| Argument | Type | Details |\n|---------------|--------------------------|---------------------------------------------------------------------------------------------------------------------------|\n| `items` | List\\\u003cObject\\\u003e, optional | The list of options to add to the select. Defaults to an empty array. |\n| `placeholder` | String, optional | The placeholder shown when no value is selected. Defaults to \"Select a value...\". |\n| `value` | String, optional | The select's value. Defaults to null. |\n| `onChange` | Function, optional | The callback to fire when an item is selected. The callback is passed the currently selected value and the select widget. |\n| `disabled` | Boolean, optional | Whether the select is disabled. Defaults to false. |\n| `style` | Object, optional | An object of allowed CSS styles with their values to be set for this widget. See style() documentation. |"]]