公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
ee.data.getMapId
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
取得指定資產的地圖 ID
傳回 mapId 呼叫結果,可傳遞至 ee.data.getTileUrl 或 ui.Map.addLayer。如果指定回呼,則為空值。
用量 | 傳回 |
---|
ee.data.getMapId(params, callback) | RawMapId |
引數 | 類型 | 詳細資料 |
---|
params | ImageVisualizationParameters | 以 (用戶端) JavaScript 物件形式呈現的視覺化參數。圖片和 ImageCollection:
image (JSON 字串):要算繪的圖片。 |
version (數字) 映像檔版本號碼 (或最新版本)。 |
bands (以半形逗號分隔的字串) 以半形逗號分隔的波段名稱清單,用於對應至 RGB。 |
min (以半形逗號分隔的數字) 要對應至 00 的值 (或每個頻帶各一個值)。 |
max (以半形逗號分隔的數字) 要對應至 FF 的值 (或每個頻帶一個值)。 |
gain (以半形逗號分隔的數字):要對應至 00-FF 的增益 (或每個頻帶各一)。 |
bias (以半形逗號分隔的數字) 要對應至 00-FF 的偏移量 (或每個頻帶一個偏移量)。 |
gamma (以半形逗號分隔的數字):Gamma 校正因子 (或每個頻帶各一個)。 |
palette (以半形逗號分隔的字串):CSS 樣式顏色字串清單 (僅限單一波段預覽)。 |
opacity (數字):介於 0 和 1 之間的不透明度數字。 |
format (字串)「jpg」或「png」。 |
|
callback | 函式 (選用) | 選用回呼。如未提供,系統會同步發出呼叫。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003e\u003ccode\u003eee.data.getMapId\u003c/code\u003e retrieves the map ID of a given Earth Engine asset, which can be used to display the asset on a map.\u003c/p\u003e\n"],["\u003cp\u003eThe function requires visualization parameters, including the image, bands, and visualization settings like min, max, and palette.\u003c/p\u003e\n"],["\u003cp\u003eIt can be used synchronously or asynchronously with a callback function.\u003c/p\u003e\n"],["\u003cp\u003eThe returned map ID can be utilized with \u003ccode\u003eee.data.getTileUrl\u003c/code\u003e or \u003ccode\u003eui.Map.addLayer\u003c/code\u003e for further map interactions.\u003c/p\u003e\n"]]],[],null,["# ee.data.getMapId\n\n\u003cbr /\u003e\n\nGet a Map ID for a given asset\n\n\u003cbr /\u003e\n\nReturns the mapId call results, which may be passed to ee.data.getTileUrl or ui.Map.addLayer. Null if a callback is specified.\n\n| Usage | Returns |\n|------------------------------------------|----------|\n| `ee.data.getMapId(params, `*callback*`)` | RawMapId |\n\n| Argument | Type | Details |\n|------------|------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `params` | ImageVisualizationParameters | The visualization parameters as a (client-side) JavaScript object. For Images and ImageCollections: |----------------------------------------------------------------------------------------------------| | ` image ` (JSON string) The image to render. | | ` version ` (number) Version number of image (or latest). | | ` bands ` (comma-separated strings) Comma-delimited list of band names to be mapped to RGB. | | ` min ` (comma-separated numbers) Value (or one per band) to map onto 00. | | ` max ` (comma-separated numbers) Value (or one per band) to map onto FF. | | ` gain ` (comma-separated numbers) Gain (or one per band) to map onto 00-FF. | | ` bias ` (comma-separated numbers) Offset (or one per band) to map onto 00-FF. | | ` gamma ` (comma-separated numbers) Gamma correction factor (or one per band). | | ` palette ` (comma-separated strings) List of CSS-style color strings (single-band previews only). | | ` opacity ` (number) a number between 0 and 1 for opacity. | | ` format ` (string) Either \"jpg\" or \"png\". | |\n| `callback` | Function, optional | An optional callback. If not supplied, the call is made synchronously. |"]]