Map.addLayer

지정된 EE 객체를 지도에 레이어로 추가합니다.

새 지도 레이어를 반환합니다.

사용반환 값
Map.addLayer(eeObject, visParams, name, shown, opacity)ui.Map.Layer
인수유형세부정보
eeObjectCollection|Feature|Image|RawMapId지도에 추가할 객체입니다.
visParamsFeatureVisualizationParameters|ImageVisualizationParameters(선택사항)시각화 매개변수입니다. 이미지 및 ImageCollection의 경우 유효한 매개변수는 ee.data.getMapId를 참고하세요. Features 및 FeatureCollections의 경우 지원되는 키는 CSS 3.0 색상 문자열 또는 'RRGGBB' 형식의 16진수 문자열인 'color'뿐입니다. eeObject가 지도 ID인 경우 무시됩니다.
name문자열, 선택사항레이어의 이름입니다. 기본값은 'Layer N'입니다.
shown불리언, 선택사항레이어가 기본적으로 사용 설정되어야 하는지 여부를 나타내는 플래그입니다.
opacity숫자, 선택사항레이어의 불투명도를 0~1 사이의 숫자로 나타냅니다. 기본값은 1입니다.

코드 편집기 (JavaScript)

// A Sentinel-2 surface reflectance image.
var image = ee.Image('COPERNICUS/S2_SR/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')
                   .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');