公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
ui.Map.DrawingTools.addLayer
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
將指定 ee.Geometry 物件清單新增至繪圖工具,做為幾何圖層。
傳回新的幾何圖層。
用量 | 傳回 |
---|
DrawingTools.addLayer(geometries, name, color, shown, locked) | ui.Map.GeometryLayer |
引數 | 類型 | 詳細資料 |
---|
這個:ui.map.drawingtools | ui.Map.DrawingTools | ui.Map.DrawingTools 執行個體。 |
geometries | List<Geometry> | 用於初始化圖層的幾何圖形。 |
name | 字串 (選用) | 圖層名稱。 |
color | 字串 (選用) | 圖層中形狀的 CSS 顏色,例如「white」或「#FFFFFF」。 |
shown | 布林值 (選填) | 是否要在圖層中顯示形狀。預設為 true。 |
locked | 布林值 (選填) | 是否要鎖定圖層中的形狀編輯作業。預設值為 false。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003eThe \u003ccode\u003eDrawingTools.addLayer()\u003c/code\u003e function adds a list of Earth Engine Geometry objects to the drawing tools as a new layer.\u003c/p\u003e\n"],["\u003cp\u003eThe function allows customization of the layer's name, color, visibility, and editability.\u003c/p\u003e\n"],["\u003cp\u003eUsers receive the newly created \u003ccode\u003eui.Map.GeometryLayer\u003c/code\u003e object, enabling further interaction with it.\u003c/p\u003e\n"],["\u003cp\u003eBy default, the added layer is visible and unlocked for editing.\u003c/p\u003e\n"]]],["The `DrawingTools.addLayer` method adds a list of `ee.Geometry` objects to the drawing tools, creating a new geometry layer. It accepts a list of geometries, an optional layer name, an optional CSS color for the shapes, a boolean to control visibility (default true), and a boolean to lock shape editing (default false). It returns a `ui.Map.GeometryLayer` representing the newly created layer.\n"],null,["# ui.Map.DrawingTools.addLayer\n\n\u003cbr /\u003e\n\nAdds a given list of ee.Geometry objects to the drawing tools as a geometry layer.\n\n\u003cbr /\u003e\n\nReturns the new geometry layer.\n\n| Usage | Returns |\n|------------------------------------------------------------------------------------|----------------------|\n| DrawingTools.addLayer`(geometries, `*name* `, `*color* `, `*shown* `, `*locked*`)` | ui.Map.GeometryLayer |\n\n| Argument | Type | Details |\n|-----------------------------|---------------------|--------------------------------------------------------------------------|\n| this: `ui.map.drawingtools` | ui.Map.DrawingTools | The ui.Map.DrawingTools instance. |\n| `geometries` | List\\\u003cGeometry\\\u003e | The geometries with which to initialize the layer. |\n| `name` | String, optional | The name of the layer. |\n| `color` | String, optional | The CSS color of shapes in the layer, for instance \"white\" or \"#FFFFFF\". |\n| `shown` | Boolean, optional | Whether to show the shapes in the layer. Defaults to true. |\n| `locked` | Boolean, optional | Whether to lock shape editing in the layer. Defaults to false. |"]]