公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ui.Slider
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
一个可拖动的目标,其范围在两个数值之间呈线性变化。滑块的值会显示在旁边的标签中。
用法 | 返回 |
---|
ui.Slider(min, max, value, step, onChange, direction, disabled, style) | ui.Slider |
参数 | 类型 | 详细信息 |
---|
min | 数字,可选 | 最小值。默认值为 0。 |
max | 数字,可选 | 最大值。默认为 1。 |
value | 数字,可选 | 初始值。默认值为 0。 |
step | 数字,可选 | 滑块的步长。默认值为 0.01。 |
onChange | 函数(可选) | 当滑块状态发生变化时要触发的回调。系统会向回调传递滑块的当前值和滑块 widget。 |
direction | 字符串,可选 | 滑块的方向。可以是“horizontal”或“vertical”。默认为“horizontal”。 |
disabled | 布尔值,可选 | 滑块是否处于停用状态。默认值为 false。 |
style | 对象,可选 | 一个对象,包含允许的 CSS 样式及其要为此 widget 设置的值。请参阅 style() 文档。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eThe \u003ccode\u003eui.Slider\u003c/code\u003e widget enables users to interactively select a numeric value within a defined range, visually represented by a draggable slider.\u003c/p\u003e\n"],["\u003cp\u003eIt offers customization options like minimum/maximum values, step size, initial value, orientation, and an onChange callback to respond to user interactions.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can further tailor its appearance using custom CSS styles through the \u003ccode\u003estyle\u003c/code\u003e argument.\u003c/p\u003e\n"]]],["The `ui.Slider` component creates a draggable slider between a minimum (`min`) and maximum (`max`) numeric value. It displays the current `value` with a label, adjustable by a defined `step`. The `direction` can be horizontal or vertical. An optional `onChange` function triggers on value changes, passing the current value. The slider can be `disabled`, and `style` properties are customizable. Default values are provided for `min`, `max`, `value`, and `step`.\n"],null,["# ui.Slider\n\n\u003cbr /\u003e\n\nA draggable target that ranges linearly between two numeric values. The value of the slider is displayed as a label alongside it.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-----------------------------------------------------------------------------------------------------------------|-----------|\n| `ui.Slider(`*min* `, `*max* `, `*value* `, `*step* `, `*onChange* `, `*direction* `, `*disabled* `, `*style*`)` | ui.Slider |\n\n| Argument | Type | Details |\n|-------------|--------------------|------------------------------------------------------------------------------------------------------------------------------|\n| `min` | Number, optional | The minimum value. Defaults to 0. |\n| `max` | Number, optional | The maximum value. Defaults to 1. |\n| `value` | Number, optional | The initial value. Defaults to 0. |\n| `step` | Number, optional | The step size for the slider. Defaults to 0.01. |\n| `onChange` | Function, optional | A callback to fire when the slider's state changes. The callback is passed the slider's current value and the slider widget. |\n| `direction` | String, optional | The direction of the slider. One of 'horizontal' or 'vertical'. Defaults to 'horizontal'. |\n| `disabled` | Boolean, optional | Whether the slider 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. |"]]