Summary
Let an editor pick a FairData place model (e.g., one that is not indexed for search, like Marronage's "Colonial Landscape"), generate a geojson FeatureCollection from its records, save the file into the CDP site's static content, and register it as a map layer under layers[] in the site config — all without requiring the model to be added to Typesense.
Use case
Marronage has a "Colonial Landscape" Place model that's useful as a context layer on the Places explore map but isn't something users should filter/search on directly. Today the only ways to get place records on the map are (a) index them into Typesense for an Explore page, or (b) hand-author a geojson file. Both are heavy.
Proposed flow
- Add a "Generate layer" action to the CDP admin (or a CLI / rake task) that:
- Takes a FairData project_id + project_model_id
- Calls the FairData public API for places of that model
- Emits a FeatureCollection (points, or polygons if the model has geometry_json)
- Saves to
content/layers/<slug>.geojson in the content repo (or to public/layers/ in CDP)
- Update TinaCMS schema for
layers[] to accept a geojson type with a relative path
- At build time or runtime, fetch the geojson and render it as a non-interactive overlay on
type: "map" searches
Example
Marronage "Colonial Landscape" places → content/layers/colonial-landscape.geojson → shown as a distinct-colored polygon/point layer beneath settlements and events.
Related
Notes
- Could start as a standalone script in
core-data-scripts that outputs geojson, then plumb the TinaCMS side later
- Needs a decision on whether the geojson lives in the content repo (versioned, human-readable) or fetched on demand (cheaper, always fresh)
Summary
Let an editor pick a FairData place model (e.g., one that is not indexed for search, like Marronage's "Colonial Landscape"), generate a geojson FeatureCollection from its records, save the file into the CDP site's static content, and register it as a map layer under
layers[]in the site config — all without requiring the model to be added to Typesense.Use case
Marronage has a "Colonial Landscape" Place model that's useful as a context layer on the Places explore map but isn't something users should filter/search on directly. Today the only ways to get place records on the map are (a) index them into Typesense for an Explore page, or (b) hand-author a geojson file. Both are heavy.
Proposed flow
content/layers/<slug>.geojsonin the content repo (or topublic/layers/in CDP)layers[]to accept ageojsontype with a relative pathtype: "map"searchesExample
Marronage "Colonial Landscape" places →
content/layers/colonial-landscape.geojson→ shown as a distinct-colored polygon/point layer beneath settlements and events.Related
Notes
core-data-scriptsthat outputs geojson, then plumb the TinaCMS side later