refactor: clean up logs
Some checks failed
TrafficCue CI / check (push) Successful in 1m35s
TrafficCue CI / build-android (push) Has been cancelled
TrafficCue CI / build (push) Has been cancelled

This commit is contained in:
2025-10-25 20:09:46 +02:00
parent 678e52ddd5
commit 729cc22b37
2 changed files with 0 additions and 8 deletions

View File

@ -71,7 +71,6 @@ export function getSnappedLocation() {
function snapLocation() { function snapLocation() {
const feature = roadFeature.current; const feature = roadFeature.current;
console.log("Snapping location to road feature:", feature);
if (!feature) return; if (!feature) return;
if (!rawLocation.current) return; if (!rawLocation.current) return;
if (feature.geometry.type === "LineString") { if (feature.geometry.type === "LineString") {

View File

@ -59,24 +59,18 @@ export async function getFeature(
let distA = getFeatureDistance(a, [coord.lon, coord.lat]); let distA = getFeatureDistance(a, [coord.lon, coord.lat]);
let distB = getFeatureDistance(b, [coord.lon, coord.lat]); let distB = getFeatureDistance(b, [coord.lon, coord.lat]);
console.log("lastId:", lastId, "a.id:", a.id, "b.id:", b.id);
const STAY_BIAS = getBias(); const STAY_BIAS = getBias();
// TODO: don't bias if feature is continuing straight (split ways vs turn) // TODO: don't bias if feature is continuing straight (split ways vs turn)
if (lastId && String(a.id) == lastId) { if (lastId && String(a.id) == lastId) {
console.log("Applying stay bias to B");
distB += STAY_BIAS; distB += STAY_BIAS;
} }
if (lastId && String(b.id) == lastId) { if (lastId && String(b.id) == lastId) {
console.log("Applying stay bias to A");
distA += STAY_BIAS; distA += STAY_BIAS;
} }
console.log("Distances:", distA, distB);
return distA < distB ? a : b; return distA < distB ? a : b;
}); });
console.log("ID: ", nearest.id);
return nearest; return nearest;
} }
@ -168,7 +162,6 @@ export async function fetchTile(z: number, x: number, y: number) {
: new PMTiles("https://trafficcue-tiles.picoscratch.de/germany.pmtiles"); : new PMTiles("https://trafficcue-tiles.picoscratch.de/germany.pmtiles");
const tile = await pmtiles.getZxy(z, x, y); const tile = await pmtiles.getZxy(z, x, y);
if (!tile) { if (!tile) {
console.log(tile);
throw new Error(`Tile not found: z${z} x${x} y${y}`); throw new Error(`Tile not found: z${z} x${x} y${y}`);
} }
const data = tile.data; const data = tile.data;