公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
ee.FeatureCollection.getMapId
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
這項命令式函式會傳回地圖 ID 和選用權杖,適合用於產生地圖疊加層。
傳回可傳遞至 ee.data.getTileUrl 或 ui.Map.addLayer 的物件,包括額外的「image」欄位,其中包含包裝這個 FeatureCollection 的 Collection.draw 圖片。如果指定了回呼,則為未定義。
用量 | 傳回 |
---|
FeatureCollection.getMapId(visParams, callback) | MapId|Object |
引數 | 類型 | 詳細資料 |
---|
這個:featurecollection | FeatureCollection | FeatureCollection 執行個體。 |
visParams | 物件 (選用) | 視覺化參數。目前只允許一個參數,即包含 RGB 顏色字串的「color」。如未指定 visParams,系統會使用黑色 (「000000」)。 |
callback | 函式 (選用) | 非同步回呼。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003e\u003ccode\u003eFeatureCollection.getMapId()\u003c/code\u003e generates a map ID and optional token for creating map overlays using FeatureCollections.\u003c/p\u003e\n"],["\u003cp\u003eIt returns an object usable with \u003ccode\u003eee.data.getTileUrl\u003c/code\u003e or \u003ccode\u003eui.Map.addLayer\u003c/code\u003e for adding the FeatureCollection to a map.\u003c/p\u003e\n"],["\u003cp\u003eVisualization parameters, like color, can be customized; if unspecified, the default color is black.\u003c/p\u003e\n"],["\u003cp\u003eAn optional callback function can be provided for asynchronous operations.\u003c/p\u003e\n"]]],[],null,["# ee.FeatureCollection.getMapId\n\n\u003cbr /\u003e\n\nAn imperative function that returns a map ID and optional token, suitable for generating a Map overlay.\n\n\u003cbr /\u003e\n\nReturns an object which may be passed to ee.data.getTileUrl or ui.Map.addLayer, including an additional 'image' field, containing a Collection.draw image wrapping a FeatureCollection containing this feature. Undefined if a callback was specified.\n\n| Usage | Returns |\n|------------------------------------------------------------|---------------|\n| FeatureCollection.getMapId`(`*visParams* `, `*callback*`)` | MapId\\|Object |\n\n| Argument | Type | Details |\n|---------------------------|--------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `featurecollection` | FeatureCollection | The FeatureCollection instance. |\n| `visParams` | Object, optional | The visualization parameters. Currently only one parameter, 'color', containing an RGB color string is allowed. If visParams is not specified, black (\"000000\") is used. |\n| `callback` | Function, optional | An async callback. |"]]