Skip to content

Limit time controls to those dates that are actually available #4

@christophfriedrich

Description

@christophfriedrich

It would be nice if the date slider and picker wouldn't blindly allow ANY date to be selected, but just those that are listed in the WMS as available. (The ODC WMS explicitly lists EACH date for that it has data, which is often annoying (because it bloats responses), but in this case very helpful.)

Excerpt of the relevant part of such a WMS GetCapabilities response:

<Layer>
  <Title>VI-Differenzen Winterweizen</Title>
  <Name>s2_vi_ndvi_diff_winter_wheat</Name>
  ....
  <KeywordList>
  <Keyword>time-series</Keyword>
  </KeywordList>
  ...
  <Dimension name="time" units="ISO8601" default="2024-08-31">
    2017-01-01,2017-01-03,2017-01-04,2017-01-07,2017-01-10,...,2024-08-28,2024-08-29,2024-08-30,2024-08-31
  </Dimension>
  ...
</Layer>

Skeleton for accessing a WMS GetCapabilities response via OpenLayers:

import WMSCapabilities from 'ol/format/WMSCapabilities';

function initTimeControls() {
  fetch('https://ows.eo2cube.org/wms?request=GetCapabilities')
  .then(function (response) {
    return response.text();
  })
  .then(function (text) {
    const parser = new WMSCapabilities();
    const result = parser.read(text);
    console.log(result);
  });
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions