Skip to content

Commit

Permalink
Fixing long/lat bug - now writing as strings
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffLac committed Mar 9, 2025
1 parent c8923b5 commit 4945a89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/features/schema/fields/location/LocationBased.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@ export default function LocationBased({ field }) {
// Create new state with selected location
const newValue = {
...value,
lat: location.lat,
lng: location.lng,
lat: location.lat.toString(),
lng: location.lng.toString(),
locality: location.locality || location.formattedName,
timezone: location.timezone
};
Expand Down Expand Up @@ -367,7 +367,7 @@ export default function LocationBased({ field }) {
{value && (
<div className="mt-4 p-3 border rounded bg-gray-50">
<Typography variant="body2"><strong>Selected:</strong> {value.locality}</Typography>
<Typography variant="body2"><strong>Coordinates:</strong> {value.lat.toFixed(3)}, {value.lng.toFixed(3)}</Typography>
<Typography variant="body2"><strong>Coordinates:</strong> {value.lat}, {value.lng}</Typography>
<Typography variant="body2"><strong>Timezone:</strong> {value.timezone}</Typography>
</div>
)}
Expand Down
6 changes: 3 additions & 3 deletions src/features/schema/fields/location/LocationForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ export default function LocationForm({ field }) {
// Handler for when user selects a location from the dropdown
const handleLocationSelect = (location) => {
const newValue = {
lat: location.lat,
lng: location.lng,
lat: location.lat.toString(),
lng: location.lng.toString(),
locality: location.locality || location.formattedName,
timezone: location.timezone
};
Expand All @@ -291,7 +291,7 @@ export default function LocationForm({ field }) {
{value && (
<div className="mt-4 p-3 border rounded bg-gray-50">
<Typography variant="body2"><strong>Selected:</strong> {value.locality}</Typography>
<Typography variant="body2"><strong>Coordinates:</strong> {value.lat.toFixed(3)}, {value.lng.toFixed(3)}</Typography>
<Typography variant="body2"><strong>Coordinates:</strong> {value.lat}, {value.lng}</Typography>
<Typography variant="body2"><strong>Timezone:</strong> {value.timezone}</Typography>
</div>
)}
Expand Down

0 comments on commit 4945a89

Please sign in to comment.