Earth Engine
سطوح سهمیه غیرتجاری را برای محافظت از منابع محاسباتی مشترک و تضمین عملکرد قابلاعتماد برای همه معرفی کرده است. پروژههای غیرتجاری بهطور پیشفرض از «سطح انجمن» استفاده میکنند، اما هرزمان بخواهید میتوانید سطح پروژه را تغییر دهید.
Google برای ترجمه محتوا به زبان ترجیحی شما از فناوری هوشواره استفاده میکند. ترجمههای هوشوارهای ممکن است اشتباه داشته باشند.
Map.addLayer
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
شیء EE دادهشده را بهعنوان لایه به نقشه اضافه میکند.
لایه نقشه جدید را برمیگرداند.
| کاربرد | بازگشتیها |
|---|
Map.addLayer(eeObject, visParams, name, shown, opacity) | ui.Map.Layer |
| متغیر مستقل | نوع | جزئیات |
|---|
eeObject | Collection|Feature|Image|RawMapId | شیء برای افزودن به نقشه. |
visParams | FeatureVisualizationParameters|ImageVisualizationParameters، اختیاری | پارامترهای تجسم. برای Images و ImageCollection، پارامترهای معتبر را در ee.data.getMapId ببینید. برای Features و FeatureCollections، تنها کلید پشتیبانیشده «رنگ» است، بهعنوان رشته رنگ CSS 3.0 یا رشته هگزادسیمال در قالب «RRGGBB». وقتی eeObject شناسه نقشه باشد، نادیده گرفته میشود. |
name | رشته، اختیاری | نام لایه. بهطور پیشفرض «لایه N» است. |
shown | بولی، اختیاری | پرچمی که نشان میدهد آیا لایه باید بهطور پیشفرض روشن باشد یا نه. |
opacity | شماره، اختیاری | کدری لایه بهصورت عددی بین ۰ و ۱ نشان داده میشود. پیشفرض ۱ است. |
مثالها
ویرایشگر کد (جاوا اسکریپت)
// A Sentinel-2 surface reflectance image.
var image = ee.Image('COPERNICUS/S2_SR_HARMONIZED/20210109T185751_20210109T185931_T10SEG');
Map.setCenter(-121.87, 37.44, 9);
// Set multi-band RGB image visualization parameters. If the "bands" parameter
// is not defined, the first three bands are used.
var rgbVis = {
bands: ['B11', 'B8', 'B3'],
min: 0,
max: 3000
};
Map.addLayer(image, rgbVis, 'Multi-band RGB image');
// Set band-specific "min" and "max" properties.
var rgbVisBandSpec = {
bands: ['B11', 'B8', 'B3'],
min: [0, 75, 150],
max: [3500, 3000, 2500]
};
Map.addLayer(image, rgbVisBandSpec, 'Band-specific min/max');
// If you don't specify "min" and "max" properties, they will be determined
// from the data type range, often resulting in an ineffective color stretch.
Map.addLayer(image.select('B8'), null, 'Default visParams');
// If an image layer has already been styled, set "visParams" as null.
var imageRgb = image.visualize(rgbVis);
Map.addLayer(imageRgb, null, 'Pre-styled image');
// Use the "palette" parameter with single-band image inputs to define the
// linear color gradient to stretch between the "min" and "max" values.
var singleBandVis = {
min: 0,
max: 3000,
palette: ['blue', 'yellow', 'green']
};
Map.addLayer(image.select('B8'), singleBandVis, 'Single-band palette');
// Images within ImageCollections are automatically mosaicked according to mask
// status and image order. The last image in the collection takes priority,
// invalid pixels are filled by valid pixels in preceding images.
var imageCol = ee.ImageCollection('COPERNICUS/S2_SR_HARMONIZED')
.filterDate('2021-03-01', '2021-04-01');
Map.addLayer(imageCol, rgbVis, 'ImageCollection mosaic');
// FeatureCollection, Feature, and Geometry objects can be styled using the
// "color" parameter.
var featureCol = ee.FeatureCollection('WCMC/WDPA/current/polygons');
Map.addLayer(featureCol, {color: 'purple'}, 'FeatureCollection');
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2026-11-02 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2026-11-02 بهوقت ساعت هماهنگ جهانی."],[],["The `Map.addLayer` function adds an Earth Engine object to a map as a layer, returning the new `ui.Map.Layer`. It accepts an `eeObject` (Collection, Feature, Image, or RawMapId), optional `visParams` for visualization, `name` for the layer's label, `shown` (boolean) to set default visibility, and `opacity` (0-1). Visualization parameters vary by object type; `color` is the only supported parameter for Features, while Images support `bands`, `min`, `max`, and `palette`. ImageCollections are mosaicked, and the last images take precedence.\n"]]