From 6a7cae0990924257f153bf0875b9eb3159b59956 Mon Sep 17 00:00:00 2001 From: FaizanMohammed326 Date: Sat, 23 Jul 2022 23:50:26 +0530 Subject: [PATCH] legend for district level fixed --- .../maps/leaflet-map/leaflet-map.component.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/development/ui/front-end/src/app/shared/components/maps/leaflet-map/leaflet-map.component.ts b/development/ui/front-end/src/app/shared/components/maps/leaflet-map/leaflet-map.component.ts index 33012d60..1cf5e0e2 100644 --- a/development/ui/front-end/src/app/shared/components/maps/leaflet-map/leaflet-map.component.ts +++ b/development/ui/front-end/src/app/shared/components/maps/leaflet-map/leaflet-map.component.ts @@ -180,7 +180,6 @@ export class LeafletMapComponent implements OnInit, AfterViewInit, OnChanges { mapData?.data.forEach((state: any) => { if (state.state_code == feature.properties.state_code) { - console.log(max) color = parent.getLayerColor(max-min ? (state.indicator-min) / (max-min) * 100 : state.indicator); } }); @@ -251,11 +250,11 @@ export class LeafletMapComponent implements OnInit, AfterViewInit, OnChanges { let range = max - min; // let partSize = (range / 10 % 1 === 0) ? range / 10 : Number((range / 10).toFixed(2)); let partSize = (range / 4 % 1 === 0) ? range / 4 : Number((range / 4).toFixed(2)); - for (let i = 1; i <= 4; i++) { - // if (i === 4) { - // values.push(min); - // continue; - // } + for (let i = 1; i <= 5; i++) { + if (i === 5) { + values.push(min); + continue; + } if (i === 1) { values.push(max); @@ -269,7 +268,7 @@ export class LeafletMapComponent implements OnInit, AfterViewInit, OnChanges { mapData.data.forEach((data: any) => { let markerIcon = L.circleMarker([data.Latitude, data.Longitude], { color: "gray", - fillColor: this.getZoneColor(reportTypeIndicator, max ? data.indicator / max * 100 : data.indicator), + fillColor: this.getZoneColor(reportTypeIndicator, max-min ? (data.indicator-min) / (max-min) * 100 : data.indicator), fillOpacity: 1, strokeWeight: 0.01, weight: 1 @@ -322,7 +321,6 @@ export class LeafletMapComponent implements OnInit, AfterViewInit, OnChanges { labels.push(` ${values[i]}`); } } else { - console.log(values) values = values && values.length > 0 ? values : [100, 75, 50, 25, 0]; for (let i = values.length; i > 1; i--) { labels.push(