Skip to content

Commit

Permalink
Add legend for IO Global LULC land cover
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadain committed Jul 16, 2024
1 parent fadd31a commit 76f8190
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mmw/mmw/settings/layer_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import json

from django.contrib.gis.geos import GEOSGeometry
from mmw.settings.layer_classmaps import NLCD, SOIL, PROTECTED_LANDS
from mmw.settings.layer_classmaps import NLCD, SOIL, PROTECTED_LANDS, IO_LULC

# [01, 02, ...] style list for layer time sliders
MONTH_CODES = [str(m).zfill(2) for m in range(1, 13)]
Expand Down Expand Up @@ -98,7 +98,7 @@
{
'display': 'IO Global LULC 2023',
'code': 'io-lulc-2023',
'css_class_prefix': 'io-lulc-2023 nlcd',
'css_class_prefix': 'io-lulc-2023 io-lulc',
'short_display': 'IO LULC 2023',
'helptext': 'Global land use/land cover dataset produced by '
'Impact Observatory, Microsoft, and Esri, derived from '
Expand All @@ -108,7 +108,7 @@
'maxZoom': 18,
'opacity': 0.618,
'has_opacity_slider': True,
'legend_mapping': { key: names[1] for key, names in NLCD.items()},
'legend_mapping': { key: names[1] for key, names in IO_LULC.items() },
'big_cz': True,
},
{
Expand Down
18 changes: 18 additions & 0 deletions src/mmw/sass/utils/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,24 @@ $nlcdColors: (
}
}

$ioLulcColors: (
1: #419bdf, // Water
2: #397d49, // Trees
4: #7a87c6, // Flooded vegetation
5: #e49635, // Crops
7: #c4281b, // Built area
8: #a59b8f, // Bare ground
9: #a8ebff, // Snow/ice
10: #616161, // Clouds
11: #e3e2c3, // Rangeland
);

@each $id, $color in $ioLulcColors {
.io-lulc-#{$id} {
background-color: $color;
}
}

$protectedLandsColors: (
pra_f: #AFB42B, /* Park or Recreation Area - Federal */
pra_s: #C0CA33, /* Park or Recreation Area - State */
Expand Down

0 comments on commit 76f8190

Please sign in to comment.