Skip to content

Conversation

@Godlisten-Ngatara
Copy link

Summary

This PR introduces a TimeSlider control for DHIS2 maps as an extension to the HISPTZ library. The control is implemented as a custom Leaflet control and rendered using React portals to enable seamless integration with existing map components.

Changes

  • Created TimeSliderControl as a Leaflet control with its own container.
  • Added TimeSliderControlWrapper to render the control in React via a portal.
  • Registered the new control in the map’s controls configuration for easy use in MapArea.
  • Ensured the implementation does not modify HISPTZ core code, maintaining backward compatibility.

Notes

  • periodSelection and orgUnitSelection integration is not yet implemented
  • The feature is currently functional in isolation

Testing

  • Verified that the TimeSlider control renders correctly in Storybook.
  • Confirmed that the control can be positioned using ControlPosition props.

@nnkogift nnkogift self-requested a review August 13, 2025 14:44
nnkogift and others added 5 commits August 13, 2025 18:16
- Replaced static months array with dynamic periods fetched using `useMapPeriods` for improved flexibility.
- Updated slider logic to iterate through dynamic periods instead of a fixed list.
- Enhanced maintainability and usability by leveraging context-provided data instead of hardcoding static values.

Why: To make the TimeSliderLayer more adaptable by dynamically handling periods based on map context.
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.

2 participants