公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ui.SplitPanel
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
包含两个面板的 widget,这两个面板之间有分隔线。您可以拖动分隔线来调整面板的大小。一个或两个面板可以是 ui.Map 对象。
默认情况下,布局会以 50/50 的分屏比例进行初始化。面板上的 width 和 max/minWidth 样式可控制横向屏幕方向的分屏尺寸。同样,对于垂直方向,请使用 height 和 max/minHeight。这些值可以以像素为单位(例如“{n}px”)或以包含的 SplitPanel 的百分比为单位(例如“{n}%”)给出。
请注意,如果指定了第一个面板的大小,系统会忽略第二个面板的指定大小,因为分屏面板的整体宽度是单独控制的。您可以为两个面板设置最大/最小尺寸。
用法 | 返回 |
---|
ui.SplitPanel(firstPanel, secondPanel, orientation, wipe, style) | ui.SplitPanel |
参数 | 类型 | 详细信息 |
---|
firstPanel | ui.Panel,可选 | 左侧或顶部面板。默认为 ui.Panel 的新实例。 |
secondPanel | ui.Panel,可选 | 底部或右侧面板。默认为 ui.Panel 的新实例。 |
orientation | 字符串,可选 | “horizontal”或“vertical”中的一个。默认为“horizontal”。 |
wipe | 布尔值,可选 | 是否启用擦除效果。启用此模式后,两个面板都会占用所有可用空间,拖动分隔线不会设置面板的大小,而是确定每个面板的显示量。此效果类似于“擦除转场”。此模式有助于比较两张地图。默认值为 false。 |
style | 对象,可选 | 一个包含允许的 CSS 样式及其要为此面板设置的值的对象。默认为空对象。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eThe \u003ccode\u003eui.SplitPanel\u003c/code\u003e widget divides a UI element into two resizable panels, horizontally or vertically.\u003c/p\u003e\n"],["\u003cp\u003ePanel sizes can be customized using width/height and min/max dimensions, expressed in pixels or percentages.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ewipe\u003c/code\u003e option allows for a transition-like effect, ideal for comparing two map panels by overlaying them.\u003c/p\u003e\n"],["\u003cp\u003eThe split panel's default layout divides the space equally between the two panels.\u003c/p\u003e\n"],["\u003cp\u003eUsers can specify custom CSS styles to further customize the appearance of the \u003ccode\u003eui.SplitPanel\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# ui.SplitPanel\n\n\u003cbr /\u003e\n\nA widget containing two panels with a divider between them. The divider can be dragged, allowing the panels to be resized. One or both panels may be ui.Map objects.\n\n\u003cbr /\u003e\n\nBy default the layout initializes with a 50/50 split. The width and max/minWidth styles on the panels control the split sizing for horizontal orientations. Similarly, use height and max/minHeight for vertical. These can be given in pixels as '{n}px' or as a percentage of the containing SplitPanel as '{n}%'.\n\nNote that the given size for the second panel will be ignored if the first panel size is specified, since the overall width of the split panel is controlled independently. Max/min sizes may be set for both panels.\n\n| Usage | Returns |\n|--------------------------------------------------------------------------------------------|---------------|\n| `ui.SplitPanel(`*firstPanel* `, `*secondPanel* `, `*orientation* `, `*wipe* `, `*style*`)` | ui.SplitPanel |\n\n| Argument | Type | Details |\n|---------------|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `firstPanel` | ui.Panel, optional | The left or top panel. Defaults to a new instance of ui.Panel. |\n| `secondPanel` | ui.Panel, optional | The bottom or right panel. Defaults to a new instance of ui.Panel. |\n| `orientation` | String, optional | One of \"horizontal\" or \"vertical\". Defaults to \"horizontal\". |\n| `wipe` | Boolean, optional | Whether to enable the wiping effect. When this mode is enabled, both panels take up all available space, and dragging the divider doesn't set the size of the panels but rather determines how much of each panel is shown. This effect is analogous to a \"wipe transition\". This mode is useful for comparing two maps. Defaults to false. |\n| `style` | Object, optional | An object of allowed CSS styles with their values to be set for this panel. Defaults to an empty object. |"]]