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
645f1211
Commit
645f1211
authored
10 months ago
by
Sara Savanovic Djordjevic
Browse files
Options
Downloads
Patches
Plain Diff
update: make OSM widget stateftul
parent
66a8293d
No related branches found
Branches containing commit
No related tags found
1 merge request
!16
Clhp map into main
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/lib/widgets/osm_layer.dart
+12
-8
12 additions, 8 deletions
app/lib/widgets/osm_layer.dart
with
12 additions
and
8 deletions
app/lib/widgets/osm_layer.dart
+
12
−
8
View file @
645f1211
...
@@ -4,7 +4,7 @@ import 'package:flutter_map/flutter_map.dart';
...
@@ -4,7 +4,7 @@ import 'package:flutter_map/flutter_map.dart';
import
'../data_classes.dart'
;
import
'../data_classes.dart'
;
class
OSM
extends
State
less
Widget
{
class
OSM
extends
State
ful
Widget
{
final
List
<
Measurement
>
markerList
;
final
List
<
Measurement
>
markerList
;
const
OSM
({
const
OSM
({
...
@@ -13,10 +13,17 @@ class OSM extends StatelessWidget {
...
@@ -13,10 +13,17 @@ class OSM extends StatelessWidget {
})
:
super
(
key:
key
);
})
:
super
(
key:
key
);
@override
@override
Widget
build
(
BuildContext
context
)
{
OSMState
createState
()
=
>
OSMState
();
// Init list of polygons
}
List
<
Polygon
>
polygons
=
[];
class
OSMState
extends
State
<
OSM
>
{
@override
void
initState
()
{
super
.
initState
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
FlutterMap
(
return
FlutterMap
(
options:
MapOptions
(
options:
MapOptions
(
bounds:
LatLngBounds
(
bounds:
LatLngBounds
(
...
@@ -26,12 +33,9 @@ class OSM extends StatelessWidget {
...
@@ -26,12 +33,9 @@ class OSM extends StatelessWidget {
),
),
children:
[
children:
[
TileLayer
(
TileLayer
(
urlTemplate:
"https://{s}.tile.openstreetmap.org/{z/{x}/{y}.png"
,
urlTemplate:
"https://{s}.tile.openstreetmap.org/{z
}
/{x}/{y}.png"
,
subdomains:
const
[
'a'
,
'b'
,
'c'
],
subdomains:
const
[
'a'
,
'b'
,
'c'
],
),
),
PolygonLayer
(
polygons:
polygons
,
// Return map with list of polygons included
),
],
],
);
);
}
}
...
...
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