Skip to content

Instantly share code, notes, and snippets.

@jdbcode
Created May 11, 2022 17:19
Show Gist options
  • Save jdbcode/0c15bbf1fb806ade23dcdf00df316cd2 to your computer and use it in GitHub Desktop.
Save jdbcode/0c15bbf1fb806ade23dcdf00df316cd2 to your computer and use it in GitHub Desktop.
[Medium] FeatureView styling
var styleRules = {
pointSize: 15,
pointFillColor: {
property: 'fuel1',
categories: [
['Coal', '#CD3290'],
['Gas', '#3290CD'],
['Nuclear', '#90CD32'],
]
},
pointFillOpacity: {
property: 'capacitymw',
palette: [0.3, 1],
min: 0,
max: 2000
},
rules: [
{
filter: ee.Filter.expression(
'fuel1 == "Coal" || fuel1 == "Gas" || fuel1 == "Nuclear"').not(),
isVisible: false,
}
]
};
var layer = ui.Map.FeatureViewLayer('WRI/GPPD/power_plants_FeatureView');
layer.setVisParams(styleRules);
layer.setName('Power plants');
Map.add(layer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment