Skip to content
Snippets Groups Projects
Commit c2163e40 authored by Sara Savanovic Djordjevic's avatar Sara Savanovic Djordjevic
Browse files

update: remove centering & add more text to info layer

parent 9eb60bf3
Branches
No related tags found
1 merge request!20Clhp map, fix unit tests
No preview for this file type
...@@ -28,7 +28,7 @@ Sara Savanovic Djordjevic, and Hoa Ben The Nguyen. ...@@ -28,7 +28,7 @@ Sara Savanovic Djordjevic, and Hoa Ben The Nguyen.
Permission is hereby granted, free of charge, to any person obtaining a Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation to view the Software. copy of this software and associated documentation to view the Software.
Any distribution and modification of the Software requires prior written Any distribution and modification of the Software requires prior written
permission from the authors. permission from the developers of the software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
......
...@@ -28,8 +28,6 @@ class ChoroplethMap extends StatefulWidget { ...@@ -28,8 +28,6 @@ class ChoroplethMap extends StatefulWidget {
} }
class ChoroplethMapState extends State<ChoroplethMap> { class ChoroplethMapState extends State<ChoroplethMap> {
late final GlobalKey<ChoroplethMapState> _choroplethMapKey = GlobalKey();
int selectedIndex = -1; // Subdivision/map tile index int selectedIndex = -1; // Subdivision/map tile index
late MapShapeSource dataSource; late MapShapeSource dataSource;
late final MapZoomPanBehavior _zoomPanBehavior = MapZoomPanBehavior(); late final MapZoomPanBehavior _zoomPanBehavior = MapZoomPanBehavior();
...@@ -38,14 +36,6 @@ class ChoroplethMapState extends State<ChoroplethMap> { ...@@ -38,14 +36,6 @@ class ChoroplethMapState extends State<ChoroplethMap> {
_initDataSource(); _initDataSource();
} }
/// Resets the map zoom level
void resetZoom() {
setState(() {
_zoomPanBehavior.zoomLevel = 1;
_choroplethMapKey.currentState?.resetZoom();
});
}
@override @override
void initState() { void initState() {
super.initState(); super.initState();
......
...@@ -46,13 +46,13 @@ class InfoLayerState extends State<InfoLayer> { ...@@ -46,13 +46,13 @@ class InfoLayerState extends State<InfoLayer> {
Widget _buildLegend() { Widget _buildLegend() {
return Column( return Column(
children: [ children: [
_legendItem(const Color(0xffff0000), "Very unsafe"), _legendItem(const Color(0xffff0000), "Certainly"),
const SizedBox(height: 10), const SizedBox(height: 10),
_legendItem(const Color(0xffff6a00), "Unsafe"), _legendItem(const Color(0xffff6a00), "Very likely"),
const SizedBox(height: 10), const SizedBox(height: 10),
_legendItem(const Color(0xFFb1ff00), "Safe"), _legendItem(const Color(0xFFb1ff00), "Very unlikely"),
const SizedBox(height: 10), const SizedBox(height: 10),
_legendItem(const Color(0xFF00d6ff), "Very safe"), _legendItem(const Color(0xFF00d6ff), "Extremely unlikely"),
const SizedBox(height: 10), const SizedBox(height: 10),
], ],
); );
...@@ -60,8 +60,9 @@ class InfoLayerState extends State<InfoLayer> { ...@@ -60,8 +60,9 @@ class InfoLayerState extends State<InfoLayer> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return SingleChildScrollView(
padding: const EdgeInsets.all(40), child: Container(
padding: const EdgeInsets.all(45),
color: Colors.black.withOpacity(0.8), color: Colors.black.withOpacity(0.8),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, // Align contents vertically centered mainAxisAlignment: MainAxisAlignment.center, // Align contents vertically centered
...@@ -72,7 +73,8 @@ class InfoLayerState extends State<InfoLayer> { ...@@ -72,7 +73,8 @@ class InfoLayerState extends State<InfoLayer> {
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
Text( Text(
'The map shows the safety of applying x kg per y m^2', 'Each category shows the likelihood of the ice breaking '
'under the weight of a single person.',
style: regTextStyle, style: regTextStyle,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
...@@ -80,12 +82,24 @@ class InfoLayerState extends State<InfoLayer> { ...@@ -80,12 +82,24 @@ class InfoLayerState extends State<InfoLayer> {
_buildLegend(), _buildLegend(),
const SizedBox(height: 30), const SizedBox(height: 30),
Text( Text(
'Placeholder for other information...', 'Data accuracy',
style: smallTextStyle, style: subHeadingStyle,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
], const SizedBox(height: 20),
Text(
'The higher the accuracy, the more likely it is that the displayed ice thickness'
'is correct. The accuracy depends on'
'which data sources are used to calculate the thickness.\n\n '
'- 1/4: only API data. \n'
'- 2/4: only sensor data.'
'- 3/4: both API and sensor data. \n'
'- 4/4: both API and sensor data, with a discrepancy of <1.0cm',
style: regTextStyle,
textAlign: TextAlign.center,
), ),
],
), ),
); );
} }
} }
...@@ -42,7 +42,6 @@ class _MapContainerWidgetState extends State<MapContainerWidget> { ...@@ -42,7 +42,6 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
// Initialise selected measurement to arbitrary value // Initialise selected measurement to arbitrary value
Measurement? selectedMeasurement = selectedMeasurements[0]; Measurement? selectedMeasurement = selectedMeasurements[0];
final GlobalKey<ChoroplethMapState> _choroplethMapKey = GlobalKey();
/// Initialise lastUpdate variable from persistent storage if server fetch fails /// Initialise lastUpdate variable from persistent storage if server fetch fails
Future<void> checkAndSetLastUpdate() async { Future<void> checkAndSetLastUpdate() async {
...@@ -108,7 +107,6 @@ class _MapContainerWidgetState extends State<MapContainerWidget> { ...@@ -108,7 +107,6 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), // Padding around map padding: const EdgeInsets.all(15.0), // Padding around map
child: ChoroplethMap( child: ChoroplethMap(
key: _choroplethMapKey,
relation: widget.relation, relation: widget.relation,
measurements: widget.measurements, measurements: widget.measurements,
subdivisions: widget.subdivisions, subdivisions: widget.subdivisions,
...@@ -230,7 +228,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> { ...@@ -230,7 +228,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
), ),
), ),
Positioned( // Color info layer button Positioned( // Color info layer button
top: 170, top: 130,
right: 10, right: 10,
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
...@@ -315,7 +313,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> { ...@@ -315,7 +313,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
), ),
const SizedBox(height: contPadding/3), const SizedBox(height: contPadding/3),
Text( Text(
'Data certainty: ${selectedSubDiv?.accuracy}/4', 'Data accuracy: ${selectedSubDiv?.accuracy}/4',
style: subHeadingStyle, style: subHeadingStyle,
), ),
], ],
......
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-10 06:00:00 tm. Adding avg value -11.049999999999969.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-17 06:00:00 tm. Adding avg value -15.449999999999989.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-17 06:00:00 sdfsw. Adding avg value 15.025000000000002.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-18 06:00:00 sdfsw. Adding avg value 9.662500000000001.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-18 06:00:00 sd. Adding avg value 35.3.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-17 06:00:00 sd. Adding avg value 67.575.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-18 06:00:00 sd. Adding avg value 66.6375.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-10 06:00:00 tm. Adding avg value -11.049999999999969.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-17 06:00:00 tm. Adding avg value -15.449999999999989.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-17 06:00:00 sdfsw. Adding avg value 15.025000000000002.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-18 06:00:00 sdfsw. Adding avg value 9.662500000000001.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-18 06:00:00 sd. Adding avg value 35.3.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-17 06:00:00 sd. Adding avg value 67.575.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-18 06:00:00 sd. Adding avg value 66.6375.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-10 06:00:00 tm. Adding avg value -11.049999999999969.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-17 06:00:00 tm. Adding avg value -15.449999999999989.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-17 06:00:00 sdfsw. Adding avg value 15.025000000000002.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-18 06:00:00 sdfsw. Adding avg value 9.662500000000001.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-18 06:00:00 sd. Adding avg value 35.3.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-17 06:00:00 sd. Adding avg value 67.575.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-18 06:00:00 sd. Adding avg value 66.6375.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-10 06:00:00 tm. Adding avg value -11.049999999999969.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-17 06:00:00 tm. Adding avg value -15.449999999999989.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-17 06:00:00 sdfsw. Adding avg value 15.025000000000002.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-18 06:00:00 sdfsw. Adding avg value 9.662500000000001.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-18 06:00:00 sd. Adding avg value 35.3.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-17 06:00:00 sd. Adding avg value 67.575.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-18 06:00:00 sd. Adding avg value 66.6375.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-10 06:00:00 tm. Adding avg value -11.049999999999969.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-17 06:00:00 tm. Adding avg value -15.449999999999989.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-17 06:00:00 sdfsw. Adding avg value 15.025000000000002.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-18 06:00:00 sdfsw. Adding avg value 9.662500000000001.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-18 06:00:00 sd. Adding avg value 35.3.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-17 06:00:00 sd. Adding avg value 67.575.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-18 06:00:00 sd. Adding avg value 66.6375.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-10 06:00:00 tm. Adding avg value -11.049999999999969.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-17 06:00:00 tm. Adding avg value -15.449999999999989.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-17 06:00:00 sdfsw. Adding avg value 15.025000000000002.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-18 06:00:00 sdfsw. Adding avg value 9.662500000000001.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-18 06:00:00 sd. Adding avg value 35.3.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-17 06:00:00 sd. Adding avg value 67.575.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-18 06:00:00 sd. Adding avg value 66.6375.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-10 06:00:00 tm. Adding avg value -11.049999999999969.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-17 06:00:00 tm. Adding avg value -15.449999999999989.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-17 06:00:00 sdfsw. Adding avg value 15.025000000000002.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-18 06:00:00 sdfsw. Adding avg value 9.662500000000001.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-18 06:00:00 sd. Adding avg value 35.3.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-17 06:00:00 sd. Adding avg value 67.575.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-18 06:00:00 sd. Adding avg value 66.6375.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-10 06:00:00 tm. Adding avg value -11.049999999999969.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-17 06:00:00 tm. Adding avg value -15.449999999999989.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-17 06:00:00 sdfsw. Adding avg value 15.025000000000002.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-18 06:00:00 sdfsw. Adding avg value 9.662500000000001.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-18 06:00:00 sd. Adding avg value 35.3.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-17 06:00:00 sd. Adding avg value 67.575.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-18 06:00:00 sd. Adding avg value 66.6375.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-10 06:00:00 tm. Adding avg value -11.049999999999969.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-17 06:00:00 tm. Adding avg value -15.449999999999989.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-17 06:00:00 sdfsw. Adding avg value 15.025000000000002.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-18 06:00:00 sdfsw. Adding avg value 9.662500000000001.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-18 06:00:00 sd. Adding avg value 35.3.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-17 06:00:00 sd. Adding avg value 67.575.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-18 06:00:00 sd. Adding avg value 66.6375.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-10 06:00:00 tm. Adding avg value -11.049999999999969.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-17 06:00:00 tm. Adding avg value -15.449999999999989.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-17 06:00:00 sdfsw. Adding avg value 15.025000000000002.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-18 06:00:00 sdfsw. Adding avg value 9.662500000000001.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-18 06:00:00 sd. Adding avg value 35.3.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-17 06:00:00 sd. Adding avg value 67.575.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-18 06:00:00 sd. Adding avg value 66.6375.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-10 06:00:00 tm. Adding avg value -11.049999999999969.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-17 06:00:00 tm. Adding avg value -15.449999999999989.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-17 06:00:00 sdfsw. Adding avg value 15.025000000000002.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-18 06:00:00 sdfsw. Adding avg value 9.662500000000001.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-01-18 06:00:00 sd. Adding avg value 35.3.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-17 06:00:00 sd. Adding avg value 67.575.
12:15: weatherelement.py -> patch_novalue_in_weather_element_list: Value missing on UTM33 X266707 Y6749365 2024-02-18 06:00:00 sd. Adding avg value 66.6375.
...@@ -221,7 +221,7 @@ def calculateColor(thickness: float): ...@@ -221,7 +221,7 @@ def calculateColor(thickness: float):
return 2 # Orange return 2 # Orange
elif 8 < thickness <= 10: elif 8 < thickness <= 10:
return 3 # Green return 3 # Green
elif thickness > 10: elif thickness > 12:
return 4 # Blue return 4 # Blue
else: else:
return 0 # Grey return 0 # Grey
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment