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

update: dynamic alloction of markers

parent 86c32bf6
No related branches found
No related tags found
1 merge request!1Server
......@@ -52,6 +52,11 @@ class DefaultPage extends StatefulWidget {
class _DefaultPageState extends State<DefaultPage> {
late Timer _timer;
final List<LatLng> locations = [
LatLng(60.8366, 10.8171),
LatLng(60.7366, 10.8471),
LatLng(60.7266, 10.9771),
];
// Timer initializer
@override
......@@ -81,6 +86,7 @@ class _DefaultPageState extends State<DefaultPage> {
double screenWidth = MediaQuery.of(context).size.width;
double boxWidth = 0.9;
double boxHeight = 1.5;
const double markerSize = 40;
return Scaffold(
appBar: AppBar(
......@@ -105,6 +111,24 @@ class _DefaultPageState extends State<DefaultPage> {
urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
subdomains: ['a', 'b', 'c'],
),
MarkerLayer(
markers: locations
.map(
(LatLng location) => Marker(
width: 80.0,
height: 80.0,
point: location,
builder: (ctx) => Container(
child: Icon(
Icons.location_on,
color: Colors.blue,
size: 50.0,
),
),
),
)
.toList(),
),
],
),
),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment