ui.Map.addLayer

Adds a given EE object to the map as a layer.

Returns the new map layer.

UsageReturns
Map.addLayer(eeObject, visParams, name, shown, opacity)ui.Map.Layer
ArgumentTypeDetails
this: ui.mapui.Map

The ui.Map instance.

eeObjectCollection|Feature|Image|MapId

The object to add to the map.

visParamsFeatureVisualizationParameters|ImageVisualizationParameters, optional

The visualization parameters. For Images and ImageCollection, see ee.data.getMapId for valid parameters. For Features and FeatureCollections, the only supported key is "color", as a 6-character hex string in the RRGGBB format.

nameString, optional

The name of the layer. Defaults to "Layer N".

shownBoolean, optional

A flag indicating whether the layer should be on by default.

opacityNumber, optional

The layer's opacity represented as a number between 0 and 1. Defaults to 1.

Examples

JavaScript

// Your example goes here!

Python

# Your example goes here!