Skip to content

Zero-fill tile buffer on fetch failure to avoid ghosting #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/OpenStreetMap-esp32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,11 @@ void OpenStreetMap::tileFetcherTask(void *param)

String result;
if (!osm->fetchTile(*job.tile, job.x, job.y, job.z, result))
{
const size_t tileByteCount = osm->currentProvider->tileSize * osm->currentProvider->tileSize * 2;
memset(job.tile->buffer, 0, tileByteCount);
log_e("Tile fetch failed: %s", result.c_str());
}
else
log_d("core %i fetched tile z=%u x=%lu, y=%lu in %lu ms", xPortGetCoreID(), job.z, job.x, job.y, millis() - startMS);
--osm->pendingJobs;
Expand Down