David Chan Mun POON (SG) commited on
Commit ·
2d25ebd
1
Parent(s): 2f9dee4
cleanup: remove debug console logs
Browse files
app.js
CHANGED
|
@@ -1999,7 +1999,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
| 1999 |
const SG_DEFAULT_LON = 103.8198;
|
| 2000 |
|
| 2001 |
function startWithLocation(lat, lon, name, country) {
|
| 2002 |
-
console.log('[SkyLens] startWithLocation called:', lat, lon, name);
|
| 2003 |
STATE.lat = lat;
|
| 2004 |
STATE.lon = lon;
|
| 2005 |
STATE.locationName = name;
|
|
@@ -2013,17 +2012,14 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
| 2013 |
}
|
| 2014 |
|
| 2015 |
if (navigator.geolocation) {
|
| 2016 |
-
console.log('[SkyLens] Requesting GPS...');
|
| 2017 |
$('heroLocation').textContent = 'Locating…';
|
| 2018 |
$('heroDesc').textContent = 'Getting your location…';
|
| 2019 |
|
| 2020 |
navigator.geolocation.getCurrentPosition(
|
| 2021 |
async pos => {
|
| 2022 |
-
console.log('[SkyLens] GPS success:', pos.coords.latitude, pos.coords.longitude);
|
| 2023 |
const lat = pos.coords.latitude;
|
| 2024 |
const lon = pos.coords.longitude;
|
| 2025 |
const geo = await reverseGeocode(lat, lon);
|
| 2026 |
-
console.log('[SkyLens] reverseGeocode result:', geo);
|
| 2027 |
const name = geo ? geo.display : `${lat.toFixed(2)}, ${lon.toFixed(2)}`;
|
| 2028 |
const country = geo ? geo.country : '';
|
| 2029 |
try {
|
|
@@ -2031,14 +2027,12 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
| 2031 |
} catch {}
|
| 2032 |
startWithLocation(lat, lon, name, country);
|
| 2033 |
},
|
| 2034 |
-
(
|
| 2035 |
-
console.log('[SkyLens] GPS error code:', err.code, err.message);
|
| 2036 |
startWithLocation(SG_DEFAULT_LAT, SG_DEFAULT_LON, 'Singapore', 'SG');
|
| 2037 |
},
|
| 2038 |
{ timeout: 8000, maximumAge: 0, enableHighAccuracy: false }
|
| 2039 |
);
|
| 2040 |
} else {
|
| 2041 |
-
console.log('[SkyLens] Geolocation not available');
|
| 2042 |
startWithLocation(SG_DEFAULT_LAT, SG_DEFAULT_LON, 'Singapore', 'SG');
|
| 2043 |
}
|
| 2044 |
|
|
|
|
| 1999 |
const SG_DEFAULT_LON = 103.8198;
|
| 2000 |
|
| 2001 |
function startWithLocation(lat, lon, name, country) {
|
|
|
|
| 2002 |
STATE.lat = lat;
|
| 2003 |
STATE.lon = lon;
|
| 2004 |
STATE.locationName = name;
|
|
|
|
| 2012 |
}
|
| 2013 |
|
| 2014 |
if (navigator.geolocation) {
|
|
|
|
| 2015 |
$('heroLocation').textContent = 'Locating…';
|
| 2016 |
$('heroDesc').textContent = 'Getting your location…';
|
| 2017 |
|
| 2018 |
navigator.geolocation.getCurrentPosition(
|
| 2019 |
async pos => {
|
|
|
|
| 2020 |
const lat = pos.coords.latitude;
|
| 2021 |
const lon = pos.coords.longitude;
|
| 2022 |
const geo = await reverseGeocode(lat, lon);
|
|
|
|
| 2023 |
const name = geo ? geo.display : `${lat.toFixed(2)}, ${lon.toFixed(2)}`;
|
| 2024 |
const country = geo ? geo.country : '';
|
| 2025 |
try {
|
|
|
|
| 2027 |
} catch {}
|
| 2028 |
startWithLocation(lat, lon, name, country);
|
| 2029 |
},
|
| 2030 |
+
() => {
|
|
|
|
| 2031 |
startWithLocation(SG_DEFAULT_LAT, SG_DEFAULT_LON, 'Singapore', 'SG');
|
| 2032 |
},
|
| 2033 |
{ timeout: 8000, maximumAge: 0, enableHighAccuracy: false }
|
| 2034 |
);
|
| 2035 |
} else {
|
|
|
|
| 2036 |
startWithLocation(SG_DEFAULT_LAT, SG_DEFAULT_LON, 'Singapore', 'SG');
|
| 2037 |
}
|
| 2038 |
|