Fixed homepage distance bug

This commit is contained in:
Keannu Bernasol 2023-07-26 12:52:24 +08:00
parent cd85852c9b
commit 283c030b37

View file

@ -19,8 +19,8 @@ export default function Home() {
const ustpCoords = { const ustpCoords = {
latitude: 8.4857, latitude: 8.4857,
longitude: 124.6565, longitude: 124.6565,
latitudeDelta: 0.4, latitudeDelta: 0.000235,
longitudeDelta: 0.4, longitudeDelta: 0.000067,
}; };
async function requestLocation() { async function requestLocation() {
const { status } = await Location.requestForegroundPermissionsAsync(); const { status } = await Location.requestForegroundPermissionsAsync();
@ -62,8 +62,8 @@ export default function Home() {
let dist = GetDistance( let dist = GetDistance(
location.coords.latitude, location.coords.latitude,
location.coords.longitude, location.coords.longitude,
0.4, 8.4857, // LatitudeDelta
0.4 124.6565 // LongitudeDelta
); );
setDist(Math.round(dist)); setDist(Math.round(dist));
} }