إشعار: يجب
إثبات أهلية جميع المشاريع غير التجارية المسجّلة لاستخدام Earth Engine قبل
15 أبريل 2025 من أجل الحفاظ على إمكانية الوصول إلى Earth Engine.
ui.Map.addLayer
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تضيف هذه الطريقة عنصرًا معيّنًا من عناصر Earth Engine إلى الخريطة كطبقة.
تعرض هذه السمة طبقة الخريطة الجديدة.
الاستخدام | المرتجعات |
---|
Map.addLayer(eeObject, visParams, name, shown, opacity) | ui.Map.Layer |
الوسيطة | النوع | التفاصيل |
---|
هذا: ui.map | ui.Map | مثيل ui.Map. |
eeObject | Collection|Feature|Image|MapId | العنصر المطلوب إضافته إلى الخريطة. |
visParams | FeatureVisualizationParameters|ImageVisualizationParameters، اختياري | مَعلمات العرض المرئي بالنسبة إلى Images وImageCollection، راجِع ee.data.getMapId للاطّلاع على المَعلمات الصالحة. بالنسبة إلى Features وFeatureCollections، المفتاح الوحيد المتوافق هو "color"، كسلسلة سداسية عشرية مكوّنة من 6 أحرف بالتنسيق RRGGBB. |
name | سلسلة، اختياري | تمثّل هذه السمة اسم الطبقة. القيمة التلقائية هي "الطبقة N". |
shown | قيمة منطقية، اختيارية | علامة تشير إلى ما إذا كان يجب أن تكون الطبقة مفعّلة تلقائيًا. |
opacity | رقم، اختياري | تمثّل هذه السمة مستوى عتامة الطبقة كرقم يتراوح بين 0 و1. القيمة التلقائية هي 1. |
أمثلة
محرّر الرموز البرمجية (JavaScript)
// Define a ui.Map widget and add it to the cleared ui.root.
var map = ui.Map();
ui.root.clear();
ui.root.add(map);
map.setCenter(-121.87, 37.44, 9);
// A Sentinel-2 surface reflectance image.
var image = ee.Image('COPERNICUS/S2_SR/20210109T185751_20210109T185931_T10SEG');
// 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')
.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 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,[]]