martindholmes / BreezeMap

BreezeMap is a project to create a simple user interface for interactive map and facsimile editing based on TEI XML and OpenLayers 4+.
MIT License
11 stars 3 forks source link

Upcoming projects need a timeline feature #28

Closed martindholmes closed 3 years ago

martindholmes commented 3 years ago

Various upcoming and existing projects have a particular need for a timeline filter, and our discussions in HCMC have come to some consensus about what this should look like. This is an outline of the feature:

  1. Locations in the TEI should be datable using @from and @to. Since historical dates are famously sketchy, we need to allow for ranges within those attributes, using the ISO 8601 slash delimiter for this, and we presumably also need to include times (to plot journeys that may take place within short periods of time). Our schema needs to be extended to support this.
  2. We also need to add support for a method to add definitions of periods of time -- eras, decades, and so on -- which enables them to be named and defined by range.
  3. The build process would convert the @to and @from attributes into properties of the location in the GeoJSON, and additionally, would calculate which of the defined periods a location overlaps with, encoding a list of those as a string array in the properties of the location. (Note: is this too repetitive? Should these periods be encoded somehow globally? It's not clear to me that it's even possible to add custom members to the FeatureCollection object in GeoJSON, though.)

With these two components in place in the schema, we can then provide a slider on the rendered map which when moved, hides and shows features based on whether their time range includes the current slider date/time position. Additionally, in conjunction with the slider, if the second feature is present in the source XML and in the GeoJSON, then a second line control with (potentially overlapping) era/period labels would be created, enabling the user to click on a period and have all the relevant features displayed. However, bearing in mind that it's perfectly possible to construct a taxonomy/category structure for the era/period filtering, it may be less cluttered and more straightforward to treat eras/periods as just another category for location features. So initially, I propose to move forward with the simple timeline slider component, and when that's working, have some discussions about whether the era component is worth realizing in a manner distinct from a regular taxonomy.

martindholmes commented 3 years ago

I've added a bunch of date attributes (@from-iso and @to-iso) to the UVic Campus map test data XML, and tweaked the XSLT to import them into the GeoJSON. Remaining work should take place in a branch.

martindholmes commented 3 years ago

The plan for the HTML generation goes roughly like this:

  1. Create a div container for the control and its associated bits.
  2. Add a checkbox, unchecked, which enables and disables the control.
  3. Add the input control. Its range values are in the range of 1 to 100/101 (depending on JSON), and its change event will be hooked up to a method of the hol map class.
  4. A label control of some kind needs to be added, to display the human-readable datetime-range for each point on the slider.
  5. A play button is required to automate passage through the timeline. It's not clear whether this will need an additional speed control; hopefully not.
martindholmes commented 3 years ago

Now working in branch issue-28-timeline since I'm expecting to break the JS once in a while.