公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
ui.SplitPanel
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
這個小工具包含兩個面板,中間有分隔線。您可以拖曳分隔線,調整面板大小。其中一個或兩個面板可能是 ui.Map 物件。
根據預設,版面配置會以 50/50 的比例分割。面板上的寬度和 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 樣式物件,以及要為這個面板設定的值。預設為空物件。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間: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. |"]]