Greater-London-Authority / ldn-viz-tools

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

Add MapSource and MapLayer components #359

Closed PaulioRandall closed 2 weeks ago

PaulioRandall commented 3 weeks ago

What does this change?

Adds:

Why?

So adding data sources and presentation layers to maps quicker and easier without disabling standard MapLibre functionality like some existing libraries do. The avoidance of existing libraries and design of these components was influenced a lot by the difficulties with adding non-trivial layers to the High Streets Map Explorer.

It was noted that the term layer is used differently depending on the context. In MapLibre it refers only to the presentation of data. In ESRI it refers to a dataset, table, or subset of either. The term here is defined from a user's perspective, i.e. a layer is something that may be enabled and disabled. It is something that can be understood and discussed by users and other non-technical stakeholders. There is no single component to represent a layer as they consist of one or more MapLayerSources and one or more MapLayerViews that are data and scenario dependent.

How?

By design, MapLayerSource and MapLayerView are very simple with minimal features but extendable via wrapper components using patterns such as: Adapter, Decorator, and Facade. There's a lot of potential for reactive and non-reactive standardized data source components, layer view components, and combinations of the two e.g. BoroughContextLayer, TfLHexLayer, HeatMapLayer, etc. The latter may accept a URL and a color ramp function for quick heat mapping.

How is it tested?

Storybook & live applications

How is it documented?

Storybook

Are light and dark themes considered?

No

Is it complete?