diff --git a/app/lib/widgets/choropleth_map.dart b/app/lib/widgets/choropleth_map.dart index 655b54adb24e8adc0656added5ee258e5531a3a2..5e043c1542bc994e3dc3fddf29142f004f613fe1 100644 --- a/app/lib/widgets/choropleth_map.dart +++ b/app/lib/widgets/choropleth_map.dart @@ -66,7 +66,29 @@ class _ChoroplethMapState extends State<ChoroplethMap> { shapeDataField: 'sub_div_id', dataCount: count, primaryValueMapper: (int index) => subdivisions[index].sub_div_id, - shapeColorValueMapper: (int index) => subdivisions[index].color, + shapeColorValueMapper: (int index) => subdivisions[index].avgThickness, + shapeColorMappers: const [ + MapColorMapper( + from: 0, + to: 4, + color: Color(0xFFff0000), + text: '{0},{25}'), + MapColorMapper( + from: 4, + to: 7, + color: Color(0xffff6a00), + text: '75'), + MapColorMapper( + from: 7, + to: 10, + color: Color(0xFFb1ff00), + text: '150'), + MapColorMapper( + from: 10, + to: 400, + color: Color(0xff4fa8d7), + text: '400'), + ], ), zoomPanBehavior: _zoomPanBehavior, strokeColor: Colors.blue.shade50, @@ -75,12 +97,13 @@ class _ChoroplethMapState extends State<ChoroplethMap> { onSelectionChanged: (int index) { setState(() { selectedIndex = index; - for (int i = 0; i < subdivisions.length; i++) { - subdivisions[i].color = i == index ? Colors.red : subdivisions[i].savedColor; - } }); widget.onSelectionChanged(selectedIndex); }, + selectionSettings: const MapSelectionSettings( + strokeWidth: 3.0, // Increase stroke width + color: Colors.black, + ), ), ], ),