@rcpch/imd-map 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -8,6 +8,14 @@ This project adheres to [Semantic Versioning](https://semver.org/).
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [0.3.0] — 2026-04-27
12
+
13
+ ### Changed
14
+
15
+ - Updated all-UK era resolution so `initialNation: 'all'` honours the requested era instead of always forcing `2011`.
16
+ - Documented the mixed-vintage `uk_master_2021_*` UK tiles, where England uses 2021 LSOA boundaries with 2025 IMD data while Wales, Scotland, and Northern Ireland remain on their current older datasets.
17
+ - Clarified in the public docs that `era` refers to the LSOA boundary year, not the IMD publication year, and documented the England pairings of `2011` → 2011 LSOAs + 2019 IMD and `2021` → 2021 LSOAs + 2025 IMD.
18
+
11
19
  ## [0.2.0] — 2026-04-26
12
20
 
13
21
  ### Changed
package/README.md CHANGED
@@ -69,7 +69,7 @@ The UMD bundle includes MapLibre GL. No separate script tag required.
69
69
  ```html
70
70
  <div id="map" style="height: 600px"></div>
71
71
 
72
- <script src="https://cdn.jsdelivr.net/npm/@rcpch/imd-map@0.1.0/dist/umd/rcpch-imd-map.min.js"></script>
72
+ <script src="https://cdn.jsdelivr.net/npm/@rcpch/imd-map@0.3.0/dist/umd/rcpch-imd-map.min.js"></script>
73
73
  <script>
74
74
  const map = RcpchImdMap.createImdMap({
75
75
  container: 'map',
@@ -216,9 +216,16 @@ Bring your own overlay configuration (custom overlay table/layer names via libra
216
216
 
217
217
  ## Nation and era rules
218
218
 
219
+ The `era` option refers to the boundary year used for the LSOA geography, not the IMD publication year.
220
+
221
+ For England, the supported pairings are:
222
+
223
+ - `2011` era = 2011 LSOA boundaries + 2019 IMD data
224
+ - `2021` era = 2021 LSOA boundaries + 2025 IMD data
225
+
219
226
  | Nation | Requested era | Effective era |
220
227
  |---|---|---|
221
- | `all` | any | always `2011` |
228
+ | `all` | `2011` or `2021` | as requested |
222
229
  | `england` | `2011` or `2021` | as requested |
223
230
  | `wales` | any | always `2011` |
224
231
  | `scotland` | any | always `2011` |
@@ -226,6 +233,31 @@ Bring your own overlay configuration (custom overlay table/layer names via libra
226
233
 
227
234
  When the effective era differs from the requested era, `onWarning` is called with code `ERA_OVERRIDE`.
228
235
 
236
+ For all-UK maps, `initialEra: '2021'` now uses the mixed-vintage `uk_master_2021_*` tables: England renders with 2021 LSOA boundaries and 2025 IMD data, while Wales, Scotland, and Northern Ireland continue to render from their existing older datasets within the same UK tile family. Use `initialEra: '2011'` when you want the older England 2011 LSOA + 2019 IMD view alongside the existing Welsh and other nation data.
237
+
238
+ This means you can instantiate two separate UK maps in the same application, choosing the England boundary/IMD pairing by era:
239
+
240
+ ```js
241
+ const historicalMap = createImdMap({
242
+ container: 'map-2011',
243
+ tilesBaseUrl: 'https://your-tile-server.example.com',
244
+ initialNation: 'all',
245
+ initialEra: '2011',
246
+ });
247
+
248
+ const currentMap = createImdMap({
249
+ container: 'map-2021',
250
+ tilesBaseUrl: 'https://your-tile-server.example.com',
251
+ initialNation: 'all',
252
+ initialEra: '2021',
253
+ });
254
+ ```
255
+
256
+ In a patient-facing application, a common pattern would be:
257
+
258
+ - patients before 2025 or 2026 cutoff: `initialEra: '2011'`
259
+ - patients in the newer cohort: `initialEra: '2021'`
260
+
229
261
  ---
230
262
 
231
263
  ## Styling
package/dist/index.esm.js CHANGED
@@ -6,7 +6,7 @@ import { Map, AttributionControl, Popup, VectorTileSource, GeoJSONSource } from
6
6
  function resolveEffectiveEra(nation, requestedEra) {
7
7
  switch (nation) {
8
8
  case "all":
9
- return "2011";
9
+ return requestedEra;
10
10
  case "england":
11
11
  return requestedEra;
12
12
  case "wales":