公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.data.getMapId
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
获取给定资产的地图 ID
返回 mapId 调用结果,该结果可传递给 ee.data.getTileUrl 或 ui.Map.addLayer。如果指定了回调,则为 null。
用法 | 返回 |
---|
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 (以英文逗号分隔的数字)伽玛校正系数(或每个频段一个系数)。 |
palette (以英文逗号分隔的字符串)CSS 样式颜色字符串列表(仅限单波段预览)。 |
opacity (数字)介于 0 到 1 之间的不透明度值。 |
format (字符串)“jpg”或“png”。 |
|
callback | 函数(可选) | 可选的回调。如果未提供,则以同步方式进行调用。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):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. |"]]