Fixed distance calculation rounding down to 0 and reduced distance threshhold to 1km

This commit is contained in:
Keannu Bernasol 2023-10-10 22:54:29 +08:00
parent f53056f932
commit 3208c37a86
2 changed files with 2 additions and 2 deletions

View file

@ -15,6 +15,6 @@ export default function GetDistanceFromUSTP(location: LocationType) {
ustpCoords.latitude, ustpCoords.latitude,
ustpCoords.longitude ustpCoords.longitude
); );
dist = Math.round(dist); dist = Math.round(dist * 100) / 100;
return dist; return dist;
} }

View file

@ -345,7 +345,7 @@ export default function Home() {
function CustomMap() { function CustomMap() {
if (dist && location) { if (dist && location) {
if (dist <= 2 || map_distance_override) { if (dist <= 1 || map_distance_override) {
return ( return (
<> <>
<MapView <MapView