效果图
实现代码
var legend = ui.Panel({
style: {
position: 'bottom-left',
padding: '8px 15px'
}
});
var legendTitle = ui.Label({
value: 'NDVI',
style: {
fontWeight: 'bold',
fontSize: '18px',
margin: '0 0 9px 0',
padding: '0'
}
});
legend.add(legendTitle);
var makeRow = function(color, name) {
var colorBox = ui.Label({
style: {
backgroundColor: '#' + color,
padding: '8px',
margin: '0 0 4px 0'
}
});
var description = ui.Label({
value: name,
style: {margin: