Google Earth Engine – Changing Vector Layer Opacity

google earthgoogle-earth-enginevector-layer

While importing a Shp file in Earth Engine, I want to control or change opacity/transparency of the layer. I have gone through almost all read me files, I find nothing.

This doesn't work:

Map.addLayer (ind_shp, {opacity: 0.5}, 'map');

Best Answer

It works like this:

var shown = true; // true or false, 1 or 0 
var opacity = 0.5; // number [0-1]
var nameLayer = 'map'; // string
var visParams = {color: 'red'}; // dictionary: 
Map.addLayer(ind_shp, visParams, nameLayer, shown, opacity);

Note: For Features and FeatureCollections, the only supported key is "color"

Related Question