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

fix: functioning markers from server

parent cd048603
No related branches found
No related tags found
1 merge request!1Server
import 'dart:js_interop';
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:latlong2/latlong.dart'; // Import LatLng class from the latlong package
......@@ -37,6 +35,7 @@ class DefaultPage extends StatefulWidget {
_DefaultPageState createState() => _DefaultPageState();
}
// MarkerData holds data for the dynamicllay allocated markers
class MarkerData {
final LatLng location;
final double size;
......@@ -55,6 +54,7 @@ List<MarkerData> parseMarkerData(String jsonString) {
)));
}
// parseColor parses the color strings into Colors types
Color parseColor(String colorString) {
switch (colorString) {
case 'blue':
......@@ -147,7 +147,7 @@ class _DefaultPageState extends State<DefaultPage> {
children: [
TileLayer(
urlTemplate: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
subdomains: ['a', 'b', 'c'],
subdomains: const ['a', 'b', 'c'],
),
MarkerLayer( // Dynamically allocate markers based on a list
markers: markerList
......@@ -170,7 +170,7 @@ class _DefaultPageState extends State<DefaultPage> {
],
),
),
SizedBox(height: 20),
const SizedBox(height: 20),
Container( // Detailed info container
width: screenWidth * boxWidth,
height: screenWidth * boxHeight,
......@@ -186,7 +186,7 @@ class _DefaultPageState extends State<DefaultPage> {
),
),
),
SizedBox(height: 20),
const SizedBox(height: 20),
],
),
),
......
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