Greater-London-Authority / ldn-viz-tools

https://greater-london-authority.github.io/ldn-viz-tools/
1 stars 0 forks source link

Update Map with map cursor #355

Closed PaulioRandall closed 2 weeks ago

PaulioRandall commented 3 weeks ago

What does this change?

  1. Updates the <Map> component with TypeScript.
  2. Renames map context in <Map> to mapStore.
  3. Adds functionality for effective of handling map cursor events such as hovers & clicks including adding mapCursorStore context.
  4. Adds props mapStore and mapCursorStore to <Map> to enable reactivity based map loading.

Why?

The way MapLibre uses JavaScript's event system makes it difficult and verbose to manage propagation of events within project specific code. Specifically, ensuring events for top most features take precedence in controlling the state of the map including current popup, highlights, mouse style, or any other map or app state. For example:

How is it tested?

Storybook and in live applications.

How is it documented?

Storybook.

Are light and dark themes considered?

No.

Is it complete?

PaulioRandall commented 3 weeks ago

@jamesscottbrown I've just noticed a small issue I introduced in the last commit. Hold off on this one.

PaulioRandall commented 3 weeks ago

@jamesscottbrown I've just noticed a small issue I introduced in the last commit. Hold off on this one.

@jamesscottbrown Good to go.