Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PROG2900
Manage
Activity
Members
Labels
Plan
Issues
7
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sara Savanovic Djordjevic
PROG2900
Commits
adf8af22
Commit
adf8af22
authored
10 months ago
by
Sara Savanovic Djordjevic
Browse files
Options
Downloads
Patches
Plain Diff
add: info button
parent
1dc90b8c
No related branches found
Branches containing commit
No related tags found
1 merge request
!16
Clhp map into main
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/lib/widgets/main_layout.dart
+66
-2
66 additions, 2 deletions
app/lib/widgets/main_layout.dart
server/map_handler/__pycache__/add_new_lake.cpython-311.pyc
+0
-0
0 additions, 0 deletions
server/map_handler/__pycache__/add_new_lake.cpython-311.pyc
with
66 additions
and
2 deletions
app/lib/widgets/main_layout.dart
+
66
−
2
View file @
adf8af22
...
...
@@ -39,6 +39,8 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
bool
isSatTapped
=
false
;
// Satellite button tap state tracker
bool
isMapTapped
=
false
;
// OSM button tap state tracker
bool
showColorMeanings
=
false
;
// Additional color legend visibility
Measurement
?
selectedMeasurement
=
selectedMeasurements
[
0
];
// Initialise lastUpdate variable from persistent storage if server fetch fails
...
...
@@ -73,6 +75,46 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
});
}
// _buildLegendItem renders a colored circle and text to form a legend
Widget
_legendItem
(
Color
color
,
String
text
)
{
return
Row
(
children:
[
Container
(
width:
20
,
height:
20
,
decoration:
BoxDecoration
(
color:
color
,
shape:
BoxShape
.
circle
,
),
),
const
SizedBox
(
width:
8
),
Text
(
text
,
style:
const
TextStyle
(
fontSize:
14
,
color:
Colors
.
white
,
),
),
],
);
}
/// Builds an additional legend to explain the colors
Widget
_buildLegend
()
{
return
Column
(
children:
[
_legendItem
(
const
Color
(
0xffff0000
),
"Very unsafe"
),
const
SizedBox
(
height:
10
),
_legendItem
(
const
Color
(
0xffff6a00
),
"Unsafe"
),
const
SizedBox
(
height:
10
),
_legendItem
(
const
Color
(
0xFFb1ff00
),
"Safe"
),
const
SizedBox
(
height:
10
),
_legendItem
(
const
Color
(
0xFF00d6ff
),
"Very safe"
),
const
SizedBox
(
height:
10
),
],
);
}
@override
Widget
build
(
BuildContext
context
)
{
// Initialise selectedMarker to first element in markerList
...
...
@@ -216,6 +258,28 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
),
),
),
Positioned
(
// Color info button
top:
130
,
right:
10
,
child:
GestureDetector
(
onTap:
()
{
setState
(()
{
showColorMeanings
=
!
showColorMeanings
;
// Toggle satellite layer state on press
});
},
child:
Container
(
padding:
const
EdgeInsets
.
all
(
8
),
decoration:
showColorMeanings
?
const
BoxDecoration
(
// Add decoration only when pressed
shape:
BoxShape
.
circle
,
color:
Colors
.
grey
,
)
:
null
,
child:
const
Icon
(
Icons
.
info
,
color:
Colors
.
white54
,
),
),
),
),
],
),
),
...
...
@@ -246,7 +310,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
child: Align(
alignment: Alignment.topLeft,
child: Padding(
padding: const EdgeInsets.only(top: 20, left: 30), //
Updated
padding
padding: const EdgeInsets.only(top: 20, left: 30), //
Custom
padding
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
...
...
@@ -255,7 +319,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
style: titleStyle,
),
const Divider(),
const SizedBox(height: 10),
// Reduced padding
const SizedBox(height: 10),
Text(
'
Tile
ID:
$
{
selectedSubDiv
?.
sub_div_id
}
',
style: regTextStyle,
...
...
This diff is collapsed.
Click to expand it.
server/map_handler/__pycache__/add_new_lake.cpython-311.pyc
+
0
−
0
View file @
adf8af22
No preview for this file type
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment