Skip to content

feat(map): add datasets as map layer sources#98

Merged
antosubash merged 20 commits intomainfrom
feature/hungry-faraday
Apr 8, 2026
Merged

feat(map): add datasets as map layer sources#98
antosubash merged 20 commits intomainfrom
feature/hungry-faraday

Conversation

@antosubash
Copy link
Copy Markdown
Owner

Summary

  • New LayerSourceType.Dataset lets uploaded Datasets be registered as reusable Map LayerSource entries via POST /api/map/sources/from-dataset.
  • Map editor gets an "Add from dataset…" picker that fetches /api/datasets/, calls the new endpoint, and appends the result as a layer. Dataset layers render via the existing GeoJSON path using /api/datasets/{id}/features as the data URL.
  • Map module now has a contracts-only dependency on SimpleModule.Datasets.Contracts; MapService.CreateLayerSourceFromDatasetAsync copies the dataset's bounding box into Bounds and stores { "datasetId": ... } in metadata.

Test plan

  • dotnet build clean
  • dotnet test modules/Map/tests/SimpleModule.Map.Tests — 22/22 passing, including 4 new tests covering happy path, name default, 404 on unknown dataset, and 403 without ManageSources
  • npm run validate-pages clean
  • Manual: upload a .geojson via /datasets/upload, open a map in edit mode, use "Add from dataset…" to attach it, save, and verify it renders on reload

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 8, 2026

Deploying simplemodule-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: a4f5af4
Status: ✅  Deploy successful!
Preview URL: https://94e7dea9.simplemodule-website.pages.dev
Branch Preview URL: https://feature-hungry-faraday.simplemodule-website.pages.dev

View logs

- DatasetConfiguration no longer sets an anonymous IsDeleted query filter;
  ApplyEntityConventions already installs the named soft-delete filter and
  the two were colliding at OnModelCreating time.
- SimpleModuleWebApplicationFactory now replaces DatasetsDbContext with the
  shared in-memory SQLite connection, matching every other module context.
@antosubash antosubash merged commit d606d64 into main Apr 8, 2026
5 checks passed
@antosubash antosubash deleted the feature/hungry-faraday branch April 8, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant