Skip to content

Commit

Permalink
dashboard map: fix ts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
brmzkw committed Aug 4, 2023
1 parent 99a3698 commit 69fa125
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mesads/templates/webpack/pages/dashboards_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class InfoBox extends L.Control {

constructor() {
super({ position: "topright" });
this._div = L.DomUtil.create("div", "leaflet-info");
}

onAdd = () => {
this._div = L.DomUtil.create("div", "leaflet-info");
this.update(null);
return this._div;
};
Expand Down Expand Up @@ -92,7 +92,7 @@ function displayStatsMap(data: APIResponse) {
.sort((a, b) => a - b)
.reverse();
const key = rsorted.find((e) => pct_filled - e >= 0);
return colors.get(key);
return colors.get(key || 0);
};

const info = new InfoBox().addTo(map);
Expand All @@ -101,8 +101,8 @@ function displayStatsMap(data: APIResponse) {
style: (feature) => {
return {
fillColor: getFillColor(
feature.properties.ads_count,
feature.properties.expected_ads_count
feature?.properties.ads_count,
feature?.properties.expected_ads_count
),
fillOpacity: 0.5,
color: "#777",
Expand Down

0 comments on commit 69fa125

Please sign in to comment.