Add 1° download grid layer and download modal#256
Merged
Conversation
Adds a toggleable 1-degree grid overlay in Global Predictions mode that lets users click any cell to download its field boundaries as a GeoParquet file from Source Cooperative. - `Download-Grid-Layer.ts`: vector layer loading the grid manifest (`ftw-download-grid.geojson`) from Source Cooperative, with normal/hover/selected styles. - `useDownloadGrid.ts`: composable managing layer visibility, hover, click handling, and download modal state; idempotent per-map initialization avoids duplicate listeners across mode switches. - `DownloadModal.vue`: Vuetify dialog showing tile id, bounding box, feature count / size, and a direct download link for the currently selected year. - `useMap.ts`: initializes the grid layer when entering global mode and delegates grid-cell clicks from `handleMapClick`. - `GlobalDataPanel.vue`: adds a "Show 1° download grid" toggle to the side panel. - `MapComponent.vue`: mounts the modal and registers `handleMapClick`. - Unit tests covering URL construction, feature-to-cell mapping, and composable state transitions. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Collaborator
|
Let's merge after #255 and then see whether we have to align the styling etc. |
Collaborator
Author
Collaborator
42b1963 to
ecbfac5
Compare
There was a problem hiding this comment.
Pull request overview
Adds a new “download grid” capability in Global mode, intended to let users identify 1° tiles and download per-tile GeoParquet outputs hosted on Source Cooperative.
Changes:
- Introduces an OpenLayers vector overlay for the 1° download grid plus URL helpers for per-tile GeoParquet downloads.
- Adds settings/permalink support for new
downloadstoggle and renamesfieldBoundariesOpacity→opacity. - Adds initial UI pieces (Global panel toggle + new
DownloadModal.vue) and unit tests for permalink/download-grid helpers.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/layers/Download-Grid-Layer.ts | New OL vector layer sourcing the grid GeoJSON + style and URL helpers. |
| src/composables/useDownloadGrid.ts | Singleton composable for grid layer init, hover/select state, and click handling. |
| src/components/DownloadModal.vue | New modal UI intended to show tile metadata and provide a download link. |
| src/components/GlobalDataPanel.vue | Adds “Download Data” help + toggle; updates opacity binding. |
| src/components/MapComponent.vue | Wires map singleclick handler; initializes download-grid composable. |
| src/composables/useMap.ts | Routes clicks to either results selection or download-grid click handler; initializes grid layer in global mode. |
| src/components/ProcessingResults.vue | Removes per-component map click listener hookup (centralized in MapComponent). |
| src/composables/useSettings.ts | Renames opacity setting and adds downloads flag with defaults. |
| src/composables/usePermalink.ts | Adds downloads + opacity to global permalink; refactors parsing/building helpers. |
| src/composables/tests/useDownloadGrid.test.ts | Unit tests for URL helpers, feature extraction, visibility/mode behavior, and click gating. |
| src/composables/tests/usePermalink.test.ts | Unit tests for global permalink parts + parsing downloads. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
m-mohr
approved these changes
Apr 21, 2026
Collaborator
m-mohr
left a comment
There was a problem hiding this comment.
Made various updates, lgtm.
As I'm the last committer, someone else should do another review and approval.
calebrob6
approved these changes
Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
download-tiles/ftw-download-grid.geojsonmanifest on Source Cooperative.useDownloadGridmanages layer visibility, hover/selected state, and modal state as singleton state; idempotent per-map init viaWeakSetavoids duplicate pointermove listeners across mode switches.Details
src/layers/Download-Grid-Layer.ts— vector layer + URL helpers pointing atdata.source.coop/ftw/global-field-boundaries/download-tiles/....src/composables/useDownloadGrid.ts— visibility/hover/click/modal state; auto-disables when leaving global mode.src/components/DownloadModal.vue— Vuetify dialog; usessettings.year(no year picker), disables download + shows warning when the tile has no data for the selected year.src/components/GlobalDataPanel.vue— adds the "Download Data" switch.src/components/MapComponent.vue/src/composables/useMap.ts— wire click handling to the grid layer and render the modal.src/composables/__tests__/useDownloadGrid.test.tscovers URL builders,featureToGridCelledge cases, singleton state, mode-change auto-disable, and click-gating.Test plan
npm run type-checknpm run lintnpm run test:unit(12 passing)npm run build