Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PROG2900
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
a9427148
Commit
a9427148
authored
1 year ago
by
Sara Savanovic Djordjevic
Browse files
Options
Downloads
Patches
Plain Diff
update: map appearance
parent
cece41dd
No related branches found
Branches containing commit
No related tags found
2 merge requests
!9
Clhp map
,
!8
Clhp map
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/lib/widgets/choropleth_map.dart
+22
-8
22 additions, 8 deletions
app/lib/widgets/choropleth_map.dart
app/lib/widgets/main_layout.dart
+1
-1
1 addition, 1 deletion
app/lib/widgets/main_layout.dart
server/sql_db/icedb
+0
-0
0 additions, 0 deletions
server/sql_db/icedb
with
23 additions
and
9 deletions
app/lib/widgets/choropleth_map.dart
+
22
−
8
View file @
a9427148
...
...
@@ -3,6 +3,8 @@ import 'dart:typed_data';
import
'package:flutter/material.dart'
;
import
'package:syncfusion_flutter_maps/maps.dart'
;
import
'package:latlong2/latlong.dart'
;
import
'../data_classes.dart'
;
/// A class containing thickness data for each subdivision of the map.
...
...
@@ -38,6 +40,7 @@ class _ChoroplethMapState extends State<ChoroplethMap> {
late
MapShapeSource
mapShapeSource
;
late
final
MapZoomPanBehavior
_zoomPanBehavior
=
MapZoomPanBehavior
();
List
<
SubDiv
>
subdivisions
=
<
SubDiv
>[];
int
count
=
0
;
@override
...
...
@@ -47,8 +50,25 @@ class _ChoroplethMapState extends State<ChoroplethMap> {
for
(
Measurement
measurement
in
widget
.
measurements
)
{
for
(
SubDiv
subdivision
in
measurement
.
subDivs
)
{
subdivisions
.
add
(
subdivision
);
print
(
"SubDivID:
${subdivision.sub_div_id}
"
);
count
++
;
}
};
// NB temporary filler
for
(
var
i
=
count
;
i
<
250
;
i
++
)
{
SubDiv
subdivision
=
SubDiv
(
sub_div_id:
i
.
toString
(),
groupID:
0
,
minThickness:
0.0
,
avgThickness:
0.0
,
center:
LatLng
(
0.0
,
0.0
),
accuracy:
0.0
,
color:
Colors
.
grey
,
savedColor:
Colors
.
grey
,
);
subdivisions
.
add
(
subdivision
);
}
}
@override
...
...
@@ -61,13 +81,12 @@ class _ChoroplethMapState extends State<ChoroplethMap> {
source
:
MapShapeSource
.
memory
(
// Map polygon
widget
.
relation
,
// JSON coordinates from server
shapeDataField:
'sub_div_id'
,
dataCount:
widget
.
measurements
.
length
,
dataCount:
250
,
primaryValueMapper:
(
int
index
)
=
>
subdivisions
[
index
]
.
sub_div_id
,
shapeColorValueMapper:
(
int
index
)
=
>
subdivisions
[
index
]
.
color
,
),
//color: Colors.blue.shade400, // Map color
zoomPanBehavior:
_zoomPanBehavior
,
strokeColor:
Colors
.
bl
ack
,
strokeColor:
Colors
.
bl
ue
.
shade50
,
// Shape selection
selectedIndex:
selectedIndex
,
onSelectionChanged:
(
int
index
)
{
...
...
@@ -79,11 +98,6 @@ class _ChoroplethMapState extends State<ChoroplethMap> {
});
widget
.
onSelectionChanged
(
selectedIndex
);
},
selectionSettings:
MapSelectionSettings
(
color:
Colors
.
orange
,
strokeColor:
Colors
.
red
[
900
],
strokeWidth:
3
,
),
),
],
),
...
...
This diff is collapsed.
Click to expand it.
app/lib/widgets/main_layout.dart
+
1
−
1
View file @
a9427148
...
...
@@ -152,7 +152,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
'${lastUpdate?.hour}
:
${lastUpdate?.minute}
'
:
'
${lastUpdate?.day}
-
${lastUpdate?.month}
-
${lastUpdate?.year}
'
)
:
''
}
',
style: GoogleFonts.dmSans(
fontSize: 1
3
,
fontSize: 1
4
,
color: Colors.black,
),
),
...
...
This diff is collapsed.
Click to expand it.
server/sql_db/icedb
+
0
−
0
View file @
a9427148
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