diff --git a/app/lib/server_requests/init_state.dart b/app/lib/server_requests/init_state.dart index 6104fa43ca41a6f4be8f8022f7c22bf706df2855..2a873695cfdaf496bb3c4ebb0d9731ccaf04ac6a 100644 --- a/app/lib/server_requests/init_state.dart +++ b/app/lib/server_requests/init_state.dart @@ -53,10 +53,6 @@ Future<void> initialiseState(bool fetchSearchOptions) async { // Sort the list of SubDiv objects based on each subdivision id selectedSubdivisions.sort((a, b) => int.parse(a.sub_div_id).compareTo(int.parse(b.sub_div_id))); - for (SubDiv subdivision in selectedSubdivisions) { - print("SubdivID: ${subdivision.sub_div_id}"); - } - serverConnection = fetchResult.connected; setLastLake(); // Update persistent value for latest fetched lake @@ -80,7 +76,7 @@ Future<void> initialiseState(bool fetchSearchOptions) async { // Last lake initialised to last persistent variable, or Mjøsa if the variable is not found final prefs = await SharedPreferences.getInstance(); - selectedLake = prefs.getString('lasLake') ?? "Mjøsa"; + selectedLake = prefs.getString('lastLake') ?? "Mjøsa"; // Set the selected relation selectedRelation = await relationFuture; diff --git a/server/map_handler/__pycache__/add_new_lake.cpython-311.pyc b/server/map_handler/__pycache__/add_new_lake.cpython-311.pyc index 42c4746c96c882d8e47b0d11540609bcb0f820b7..346611c286035f70b1ec06e2ddd330bb9026a54b 100644 Binary files a/server/map_handler/__pycache__/add_new_lake.cpython-311.pyc and b/server/map_handler/__pycache__/add_new_lake.cpython-311.pyc differ diff --git a/server/map_handler/add_new_lake.py b/server/map_handler/add_new_lake.py index 0d813022e2731a0f7b43d1ff470baf2bdca98e21..1779150f4c208197e4296babf07e0831a7f0eb23 100644 --- a/server/map_handler/add_new_lake.py +++ b/server/map_handler/add_new_lake.py @@ -161,13 +161,6 @@ def create_grid(poly: Polygon, cell_width: float, cell_height: float) -> list: # List to store all created lines grid_lines = [] - # Create vertical lines while within bounds - x = min_x - while x <= max_x: - line = LineString([(x, min_y), (x, max_y)]) - grid_lines.append(line) - x += cell_width - # Create horizontal lines while within bounds y = min_y while y <= max_y: @@ -175,6 +168,13 @@ def create_grid(poly: Polygon, cell_width: float, cell_height: float) -> list: grid_lines.append(line) y += cell_height + # Create vertical lines while within bounds + x = min_x + while x <= max_x: + line = LineString([(x, min_y), (x, max_y)]) + grid_lines.append(line) + x += cell_width + return grid_lines