Scoped out of #219. Documented in EXPLORER_STATE.md §6 "Known pre-existing wrap bug NOT fixed in this PR."
Bug
loadViewportSamples() in the zoomWatcher OJS cell computes its 30% padding as bounds.east - bounds.west and emits a single longitude BETWEEN padded.west AND padded.east clause. For a viewport that wraps the antimeridian (e.g. west=170, east=-170), that math is meaningless and the SQL returns zero matches.
The bug pre-dates PR #219. PR #219 fixed the table by routing through viewerBboxSQL() which correctly handles the post-padding wrap case. But loadViewportSamples() still has its own padding/SQL emission, so at wrapping viewports the two surfaces diverge:
- Table: shows correct row set (via
viewerBboxSQL with split predicate)
- Phase-msg "Samples in View": can undercount or read zero
Right fix
Share the viewerBboxSQL-style normalization with point-mode. The helper would need to return either an SQL string (current shape) or a structured {south, north, west, east, wraps} object so loadViewportSamples() can still use the bounds for its cache-hit check (isWithinCache(bounds)).
How to reproduce
Pan to a viewport that includes the international dateline (e.g. lat 0, lng 180, zoomed in enough to be in point mode). The globe should render some sample points; the phase-msg count may show 0 or far fewer than what's visible.
References
- Helper that does it right:
viewerBboxSQL() in explorer.qmd, post-padding longitude normalization
- Buggy path:
loadViewportSamples() → padded.west / padded.east → WHERE longitude BETWEEN padded.west AND padded.east
Scoped out of #219. Documented in
EXPLORER_STATE.md§6 "Known pre-existing wrap bug NOT fixed in this PR."Bug
loadViewportSamples()in thezoomWatcherOJS cell computes its 30% padding asbounds.east - bounds.westand emits a singlelongitude BETWEEN padded.west AND padded.eastclause. For a viewport that wraps the antimeridian (e.g.west=170, east=-170), that math is meaningless and the SQL returns zero matches.The bug pre-dates PR #219. PR #219 fixed the table by routing through
viewerBboxSQL()which correctly handles the post-padding wrap case. ButloadViewportSamples()still has its own padding/SQL emission, so at wrapping viewports the two surfaces diverge:viewerBboxSQLwith split predicate)Right fix
Share the
viewerBboxSQL-style normalization with point-mode. The helper would need to return either an SQL string (current shape) or a structured{south, north, west, east, wraps}object soloadViewportSamples()can still use the bounds for its cache-hit check (isWithinCache(bounds)).How to reproduce
Pan to a viewport that includes the international dateline (e.g. lat 0, lng 180, zoomed in enough to be in point mode). The globe should render some sample points; the phase-msg count may show 0 or far fewer than what's visible.
References
viewerBboxSQL()inexplorer.qmd, post-padding longitude normalizationloadViewportSamples()→padded.west / padded.east→WHERE longitude BETWEEN padded.west AND padded.east