diff --git a/app/lib/pages/marker_handler/marker_data.dart b/app/lib/pages/marker_handler/marker_data.dart index 902f9f01d33a5dd64f7d2c66992abf9bb4400087..1b045247ae9311de9f80579a7c639723908832b7 100644 --- a/app/lib/pages/marker_handler/marker_data.dart +++ b/app/lib/pages/marker_handler/marker_data.dart @@ -70,4 +70,24 @@ class Data { accuracy: json['Accuracy'], ); } +} + +class Corner { + double cornerID; + double latitude; + double longitude; + + Corner({ + required this.cornerID, + required this.latitude, + required this.longitude, + }); + + factory Corner.fromJson(Map<String, dynamic> json) { + return Corner( + cornerID: json['CornerID'], + latitude: json['CornerLatitude'], + longitude: json['CornerLongitude'], + ); + } } \ No newline at end of file diff --git a/server/map/__pycache__/get_markers.cpython-311.pyc b/server/map/__pycache__/get_markers.cpython-311.pyc index f74b266039fe4266ffa62d64876b10b36f5ecbbd..e706d766955e872e0fdf12271d3831db44d29c99 100644 Binary files a/server/map/__pycache__/get_markers.cpython-311.pyc and b/server/map/__pycache__/get_markers.cpython-311.pyc differ diff --git a/server/map/get_markers.py b/server/map/get_markers.py index ff121d915cd4883a2c04d85d6133f2e21a2b7fc4..3b3ba48eea80d593fca2578ecd27deca25e38847 100644 --- a/server/map/get_markers.py +++ b/server/map/get_markers.py @@ -63,22 +63,22 @@ def get_all_markers(self, cursor): if len(rows) == 0 or len(data) == 0: # Return 500 and empty list if no data is found print(f"An error occurred while querying the database") resp_code = 500 - marker_json = '[]' + marker_data = '[]' else: resp_code = 200 # Convert list of dictionaries to JSON - marker_json = json.dumps(data, indent=4) + marker_data = json.dumps(data, indent=4) except Exception as e: print(f"An error occurred while querying the database: {e}") resp_code = 500 - marker_json = '[]' + marker_data = '[]' # Set headers self.send_response(resp_code) self.send_header("Content-type", "application/json") self.end_headers() - # Write marker_data to the response object - self.wfile.write(marker_json.encode('utf-8')) + # Write marker data to the response object + self.wfile.write(marker_data.encode('utf-8'))