refactor: clean up logs
This commit is contained in:
@ -71,7 +71,6 @@ export function getSnappedLocation() {
|
||||
|
||||
function snapLocation() {
|
||||
const feature = roadFeature.current;
|
||||
console.log("Snapping location to road feature:", feature);
|
||||
if (!feature) return;
|
||||
if (!rawLocation.current) return;
|
||||
if (feature.geometry.type === "LineString") {
|
||||
|
||||
@ -59,24 +59,18 @@ export async function getFeature(
|
||||
let distA = getFeatureDistance(a, [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();
|
||||
|
||||
// TODO: don't bias if feature is continuing straight (split ways vs turn)
|
||||
if (lastId && String(a.id) == lastId) {
|
||||
console.log("Applying stay bias to B");
|
||||
distB += STAY_BIAS;
|
||||
}
|
||||
if (lastId && String(b.id) == lastId) {
|
||||
console.log("Applying stay bias to A");
|
||||
distA += STAY_BIAS;
|
||||
}
|
||||
|
||||
console.log("Distances:", distA, distB);
|
||||
|
||||
return distA < distB ? a : b;
|
||||
});
|
||||
console.log("ID: ", nearest.id);
|
||||
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");
|
||||
const tile = await pmtiles.getZxy(z, x, y);
|
||||
if (!tile) {
|
||||
console.log(tile);
|
||||
throw new Error(`Tile not found: z${z} x${x} y${y}`);
|
||||
}
|
||||
const data = tile.data;
|
||||
|
||||
Reference in New Issue
Block a user