Skip to content

Skip requests for layers with no data in the time window - #421

Open
sandesh-sp wants to merge 5 commits into
developmentfrom
feature/layer-data-coverage-request-gating
Open

Skip requests for layers with no data in the time window#421
sandesh-sp wants to merge 5 commits into
developmentfrom
feature/layer-data-coverage-request-gating

Conversation

@sandesh-sp

Copy link
Copy Markdown
Collaborator

What

Layers can now say when they have data: either a list of dates or a start/end range (the new Data Time Extent fields in the layer config).

Each time the time window changes, we check every time-enabled layer against its coverage:

  • Has data in the window → the layer loads tiles as usual.
  • No data in the window → the layer is hidden and no tiles are requested.
  • When the window moves back into the layer's coverage, it loads and shows again.

Layers that don't declare any coverage behave exactly as before.

Why

Without this, moving the time slider sends tile requests for every time-enabled layer, even ones that have nothing for that date. Those requests are wasted and can show empty or error tiles.

Other changes

  • Each layer's coverage state is published on the event bus (layers:dataCoverageChanged), so plugins can show it (e.g. "no data for this date").
  • In the modern layout, TimeControl now starts before the map, so layers get the right time window the first time they load.

Spec

docs/superpowers/specs/2026-09-09-layer-data-coverage-request-gating-design.md

Testing

  • Unit tests added for coverage parsing, the reload gate, and layer toggling (npx vitest run: all passing).

A time-enabled layer requests tiles for every instant the timeline visits,
including instants its data does not cover, and every one of those requests
comes back empty. The layer configs already declare their coverage through
time.dataStartTime, time.dataEndTime and time.dataDates, but nothing reads
them at request time.

The design gates requests on that coverage: a pure coverage module, three
gate points that take an out-of-coverage layer off the map, a state record
on the layer registry, and a warning icon in the Layers tool whose popover
names the instant asked for and the coverage the layer does have.
The design had the Layers tool reading the coverage registry off L_ and
importing the core's coverage module for its popover wording, and it accepted
two derivations of coverage — the core's and the Timeline's — policed by an
agreement test. All three cross the plugin boundary the wrong way.

The core now derives coverage, holds it and serves it as a complete record
over layers:getDataCoverage and layers:dataCoverageChanged, following the
layers:getCogCapabilities precedent. Consumers read that record and word
themselves; the core ships no prose. A second phase migrates the Timeline off
its own parsing so the core is the single authority rather than one of two
opinions.
Each time-enabled layer can declare when it has data, as a list of
dates or a start/end extent. On every time change, a layer whose
declared coverage does not overlap the requested window is hidden and
makes no tile or URL-replacement requests; it is shown again once the
window moves back into its coverage. Coverage state is published on
the event bus as layers:dataCoverageChanged.

TimeControl now initializes before Map_ in the modern layout, so layers
are built with their time window already set.
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