Skip to content

Commit

Permalink
fix: reverse map coord ordering in API
Browse files Browse the repository at this point in the history
  • Loading branch information
annehaley committed Oct 1, 2024
1 parent 513959a commit 744e124
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion uvdat/core/rest/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion web/src/storeFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down

0 comments on commit 744e124

Please sign in to comment.