From 744e12452331f7f382f1e48e6aa32d924bf4890a Mon Sep 17 00:00:00 2001 From: Anne Haley Date: Tue, 1 Oct 2024 00:00:47 +0000 Subject: [PATCH] fix: reverse map coord ordering in API --- uvdat/core/rest/serializers.py | 2 +- web/src/storeFunctions.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/uvdat/core/rest/serializers.py b/uvdat/core/rest/serializers.py index 7544c0c6..bf4a438a 100644 --- a/uvdat/core/rest/serializers.py +++ b/uvdat/core/rest/serializers.py @@ -67,7 +67,7 @@ def to_internal_value(self, data): center = data.get('default_map_center') data = super().to_internal_value(data) if isinstance(center, list): - data['default_map_center'] = Point(*center) + data['default_map_center'] = Point(center[1], center[0]) return data class Meta: diff --git a/web/src/storeFunctions.ts b/web/src/storeFunctions.ts index 58d0290f..8b324d25 100644 --- a/web/src/storeFunctions.ts +++ b/web/src/storeFunctions.ts @@ -103,7 +103,7 @@ export function getCurrentMapPosition() { let center = [0, 0]; let zoom = map.getZoom(); const centerLngLat = map.getCenter(); - if (centerLngLat) center = [centerLngLat.lat, centerLngLat.lng]; + if (centerLngLat) center = [centerLngLat.lng, centerLngLat.lat]; if (zoom) zoom = Math.floor(zoom); else zoom = 1; return { center, zoom };