Draw downloaded patch extent on click (#38)#51
Conversation
A click does not download a single pixel: it pulls the whole native chunk (40x40 cells = 2° x 2°). This outlines that patch on the map so the user can see what was actually fetched. - New geogrid helper `chunkPatchBounds` computes the geographic box of the native chunk containing the clicked cell; the store's chunk footprint is recorded in `ZARR_STORE.nativeChunks`. - The selection overlay draws the patch as a faint fill with a dashed accent outline, beneath the precise cell marker, in both 2D and globe. - A toggle button in the nav (with a pressed/active state) shows or hides the patch; it is on by default when a point is selected.
There was a problem hiding this comment.
Code Review
This pull request introduces a feature to visualize the downloaded on-disk chunk (patch) extent on the map. It adds a toggle button in the navigation bar, calculates the geographic bounds of the 40x40 native chunk containing the selected cell, and renders this patch extent as a faint filled polygon with a dashed outline using MapLibre layers. It also updates the IconButton component to support pressed states and adds corresponding unit tests. I have no feedback to provide as there are no review comments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
🚀 Vercel preview deployed Preview URL: https://earth-prints-2bj67h0i0-anastasiia-s-projects10.vercel.app |
Fixes #38.
A click does not download a single pixel: internally it pulls the whole on-disk chunk, a 40x40 patch (2° x 2°). This PR draws that patch on the map so you can see what was actually fetched, with a button to show or hide it.
What
chunkPatchBounds(geogrid) computes the geographic box of the native chunk that contains the clicked cell. The store's chunk footprint ([1461, 24, 40, 40]) is recorded asZARR_STORE.nativeChunks.Verify
eslint,next build, andvitest(43, including a newchunkPatchBoundstest asserting it spans 40x40 and contains the clicked cell) all pass.