MapLayerSource component for specifying MapLibre data sources within a <Map>.
GeoJSONMapLayerSource component which is a special kind of <MapLayerSource> for GeoJSON data due to being so common.
MapLayerView component for specifying MapLibre layers within a <MapLayerSource> or derived component.
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?
[x] Have you included changeset file?
[x] If this adds a new component, is it exported via index.js?
What does this change?
Adds:
MapLayerSource
component for specifying MapLibre data sources within a<Map>
.GeoJSONMapLayerSource
component which is a special kind of<MapLayerSource>
for GeoJSON data due to being so common.MapLayerView
component for specifying MapLibre layers within a<MapLayerSource>
or derived component.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
MapLayerSource
s and one or moreMapLayerView
s that are data and scenario dependent.How?
By design,
MapLayerSource
andMapLayerView
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?
index.js
?