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
a1226f0a
Commit
a1226f0a
authored
11 months ago
by
Sara Savanovic Djordjevic
Browse files
Options
Downloads
Patches
Plain Diff
add: transparent OSM overlay
parent
aa0aa5a9
No related branches found
Branches containing commit
No related tags found
1 merge request
!10
Clhp map
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/lib/widgets/main_layout.dart
+39
-17
39 additions, 17 deletions
app/lib/widgets/main_layout.dart
with
39 additions
and
17 deletions
app/lib/widgets/main_layout.dart
+
39
−
17
View file @
a1226f0a
...
...
@@ -33,8 +33,12 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
Measurement
?
selectedTile
;
// Containing data for selected marker
bool
isMinimized
=
true
;
// Quick view box state tacker
bool
satLayer
=
false
;
// Satellite layer visibility tracker
bool
isTapped
=
false
;
// Button tap state tracker
bool
OSMlayer
=
false
;
bool
isSatTapped
=
false
;
// Button tap state tracker, satellite
bool
isMapTapped
=
false
;
// Button tap state tracker, OSmap
// Initialise lastUpdate variable from persistent storage if server fetch fails
Future
<
void
>
checkAndSetLastUpdate
()
async
{
...
...
@@ -98,21 +102,6 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
color:
Colors
.
white12
,
),
),
SizedBox
(
width:
screenWidth
*
boxWidth
,
height:
screenWidth
*
boxHeight
,
child:
Stack
(
children:
[
OSM
(
markerList:
widget
.
markerList
),
// OSM widget as the bottom layer
Positioned
.
fill
(
child:
Container
(
color:
Colors
.
grey
.
shade900
.
withOpacity
(
0.35
),
// Grey box with 50% opacity
// Additional content or widgets can be added here
),
),
],
),
),
SizedBox
(
// Color coded lake polygon
width:
screenWidth
*
boxWidth
,
height:
screenWidth
*
boxHeight
,
...
...
@@ -124,6 +113,17 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
onSelectionChanged:
handleSelection
,),
),
),
SizedBox
(
width:
screenWidth
*
boxWidth
,
height:
screenWidth
*
boxHeight
,
child:
Visibility
(
visible:
OSMlayer
,
child:
Opacity
(
opacity:
0.7
,
child:
OSM
(
markerList:
widget
.
markerList
),
),
),
),
Positioned
(
// Satellite button
top:
10
,
right:
10
,
...
...
@@ -146,6 +146,28 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
),
),
),
Positioned
(
// OSmap button
top:
50
,
right:
10
,
child:
GestureDetector
(
onTap:
()
{
setState
(()
{
OSMlayer
=
!
OSMlayer
;
// Toggle satellite layer state on press
});
},
child:
Container
(
padding:
const
EdgeInsets
.
all
(
8
),
decoration:
OSMlayer
?
const
BoxDecoration
(
// Add decoration only when pressed
shape:
BoxShape
.
circle
,
color:
Colors
.
grey
,
)
:
null
,
child:
const
Icon
(
Icons
.
map
,
color:
Colors
.
white54
,
),
),
),
),
Positioned
(
// No wifi icon
top:
80
,
right:
10
,
...
...
@@ -169,7 +191,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
visible:
!
widget
.
serverConnection
,
child:
Container
(
padding:
const
EdgeInsets
.
all
(
8
),
decoration:
isTapped
?
const
BoxDecoration
(
decoration:
is
Sat
Tapped
?
const
BoxDecoration
(
shape:
BoxShape
.
circle
,
color:
Colors
.
blue
,
)
:
null
,
...
...
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