Announcement: All noncommercial projects registered to use Earth Engine before
April 15, 2025 must
verify noncommercial eligibility to maintain Earth Engine access.
ee.data.getMapId
Stay organized with collections
Save and categorize content based on your preferences.
Get a Map ID for a given asset
Returns the mapId call results, which may be passed to ee.data.getTileUrl or ui.Map.addLayer. Null if a callback is specified.
Usage | Returns | ee.data.getMapId(params, callback) | RawMapId |
Argument | Type | Details | 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". |
|
callback | Function, optional | An optional callback. If not supplied, the call is made synchronously. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-02-20 UTC.
[null,null,["Last updated 2024-02-20 UTC."],[[["\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. |"]]