mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-08-31 15:43:25 +00:00
* Add support for nautical units * Make panel reactive to unit changes even after pushing down conversions into utility functions. * Fix issue: km->mph conversion was not done right. * Add support for nautical units to the Time dialog. * Add support for nautical units to the embedding view and embedding playground. * add missing parameter and rename * "npx prettier" pass on the files changed in this PR Does not include changes to `website/src/lib/db.ts`, because there would otherwise be lots of unrelated formatting changes * Change elevation unit to meters for 'nautical' distances. * hide elevation decimals --------- Co-authored-by: bdbkun <1308709+mbof@users.noreply.github.com> Co-authored-by: vcoppe <vianney.coppe@gmail.com>
This commit is contained in:
@@ -10,7 +10,8 @@
|
||||
import {
|
||||
distancePerHourToSecondsPerDistance,
|
||||
getConvertedVelocity,
|
||||
milesToKilometers
|
||||
milesToKilometers,
|
||||
nauticalMilesToKilometers
|
||||
} from '$lib/units';
|
||||
import { CalendarDate, type DateValue } from '@internationalized/date';
|
||||
import { CalendarClock, CirclePlay, CircleStop, CircleX, Timer, Zap } from 'lucide-svelte';
|
||||
@@ -129,6 +130,8 @@
|
||||
}
|
||||
if ($distanceUnits === 'imperial') {
|
||||
speedValue = milesToKilometers(speedValue);
|
||||
} else if ($distanceUnits === 'nautical') {
|
||||
speedValue = nauticalMilesToKilometers(speedValue);
|
||||
}
|
||||
return speedValue;
|
||||
}
|
||||
@@ -190,8 +193,10 @@
|
||||
<span class="text-sm shrink-0">
|
||||
{#if $distanceUnits === 'imperial'}
|
||||
{$_('units.miles_per_hour')}
|
||||
{:else}
|
||||
{:else if $distanceUnits === 'metric'}
|
||||
{$_('units.kilometers_per_hour')}
|
||||
{:else if $distanceUnits === 'nautical'}
|
||||
{$_('units.knots')}
|
||||
{/if}
|
||||
</span>
|
||||
{:else}
|
||||
@@ -204,8 +209,10 @@
|
||||
<span class="text-sm shrink-0">
|
||||
{#if $distanceUnits === 'imperial'}
|
||||
{$_('units.minutes_per_mile')}
|
||||
{:else}
|
||||
{:else if $distanceUnits === 'metric'}
|
||||
{$_('units.minutes_per_kilometer')}
|
||||
{:else if $distanceUnits === 'nautical'}
|
||||
{$_('units.minutes_per_nautical_mile')}
|
||||
{/if}
|
||||
</span>
|
||||
{/if}
|
||||
|
Reference in New Issue
Block a user