Lazy-load snaps visible in the current map viewport only
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- go
- Domain
- api, full-stack
Research direction
Start at the GET /snaps backend handler and the map code handling moveend or zoomend; inspect how entries and markers are currently loaded and stored. Add viewport bbox filtering and buffered marker updates, then verify that the endpoint returns only in-bounds snaps and the map refreshes correctly as the viewport changes.
Written by the indexing model from the issue text.
Description
GET /snaps currently returns all snaps regardless of how many exist or what part of the map the user is viewing. With thousands of snaps this will become slow and memory-heavy on both server and client.
What needs to be done
Backend
- Add a bounding-box query parameter to
GET /snaps:?bbox=minLng,minLat,maxLng,maxLat. - Only return snaps whose coordinates fall within the box.
- Consider PostGIS (see related issue) for efficient spatial indexing; a plain
WHERE latitude BETWEEN $1 AND $2 AND longitude BETWEEN $3 AND $4index is a reasonable start.
Frontend
- On map
moveend/zoomend, compute the current viewport bounds (map.getBounds()) and re-fetch with the bbox parameter. - Merge new snaps into the existing
entriesmap; remove markers that have scrolled out of an extended buffer zone (to avoid constant thrash at the edges).
Related
- #8 PostGIS — proper spatial indexing
- Dominant language
- Go
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from williamokano/SentinelSnap
-
enhancement infrastructure security
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
williamokano/SentinelSnap#36 ·
-
enhancement infrastructure
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
williamokano/SentinelSnap#35 ·
-
improvement low priority
Difficulty 5/5 Over a week Newbie friendliness 38/100
williamokano/SentinelSnap#75 ·
-
chore low priority
Difficulty 3/5 1-2 days Newbie friendliness 72/100
williamokano/SentinelSnap#74 ·
-
ci enhancement infrastructure security
Difficulty 4/5 3-5 days Newbie friendliness 48/100
williamokano/SentinelSnap#46 ·
All issues in williamokano/SentinelSnap
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100