Skip to content
Rodrigo E. Principe edited this page Oct 4, 2019 · 11 revisions

map

addImageCollection(collection, options)

Adds all images from an ee.ImageCollection to the Map. Argument options:

https://code.earthengine.google.com/dc0504810a77c87d4be2acd232ed36f9

removeLayerByName(name, map)

Remove a layer from a map by its name. If argument map is not passed, it will use the default Map. If the name is duplicated it will be removed in all instances. Returns a list with the indexes of the replaced layers.

removeLayer(layer, map)

Remove a layer (ui.Map.Layer) from a map. If argument map is not passed, it will use the default Map. Returns a list with the indexes of the replaced layers.

removeObject(eeobject, map)

Remove an Earth Engine object (ee.Image, ee.Geometry, etc) from the map. If argument map is not passed, it will use the default Map. Returns a list with the indexes of the replaced layers.

replaceLayer(layer, newlayer, map)

Replace a layer (ui.Map.Layer) for newlayer in the map. If argument map is not passed, it will use the default Map. Returns a list with the indexes of the replaced layers.

getLayer(name, map)

Get a layer by its name. Return the layer (not the eeObject)

var image = ee.Image(0) // test image
Map.addLayer(image, {min:0, max:1}, 'layer_name')

var layer = tools.map.getLayer('layer_name')

var layer_object = layer.getEeObject() // the image
var layer_name = layer.getName()
var layer_vis = layer.getVisParams()
// etc..

https://code.earthengine.google.com/024ee27e25be6439e3f0b81d674019f4

Clone this wiki locally