Skip to content

Commit ce7a0d3

Browse files
committed
Add missing nuts2jsonBaseURL typings to MapConfig/MapInstance
The runtime setter (map-instance.js) has always supported nuts2jsonBaseURL on the top-level map (and propagates it to insets), and InsetConfig.d.ts already documented it per-inset, but the top-level MapConfig/MapInstance .d.ts files never declared it. TS consumers calling .nuts2jsonBaseURL(...) or passing it in the map config got a compile error even though it worked fine at runtime.
1 parent f978874 commit ce7a0d3

6 files changed

Lines changed: 38 additions & 2 deletions

File tree

‎build/eurostatmap.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎build/eurostatmap.min.js.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎build/types/core/MapConfig.d.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ export interface MapConfig {
3838
nutsLevel?: number | 'mixed'
3939
/** NUTS boundary year. */
4040
nutsYear?: number | string
41+
42+
/**
43+
* Base URL used to fetch NUTS2JSON boundary geometries. Applies to the top-level map and
44+
* (unless a given inset overrides it via `InsetConfig.nuts2jsonBaseURL`) all of its insets.
45+
* @default 'https://raw.githubusercontent.com/eurostat/Nuts2json/master/pub/v2' (or the
46+
* ec.europa.eu cache when running on an ec.europa.eu host)
47+
*/
48+
nuts2jsonBaseURL?: string
4149
/** Geographic center as [longitude, latitude]. */
4250
geoCenter?: [number, number]
4351

‎build/types/core/MapInstance.d.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@ export interface MapInstance {
7777
nutsYear(): number
7878
nutsYear(year: number): this
7979

80+
/**
81+
* Base URL used to fetch NUTS2JSON boundary geometries (and, for insets, whatever
82+
* base URL is set on the owning map, unless overridden per-inset). Setting this on the
83+
* top-level map also propagates it to all insets.
84+
* @default 'https://raw.githubusercontent.com/eurostat/Nuts2json/master/pub/v2' (or the
85+
* ec.europa.eu cache when running on an ec.europa.eu host)
86+
*/
87+
nuts2jsonBaseURL(): string
88+
nuts2jsonBaseURL(url: string): this
89+
8090
/**
8191
* Initial map viewport. x/y in projected coordinates, z is pixel size
8292
* (map units per screen pixel — smaller = more zoomed in).

‎src/types/core/MapConfig.d.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ export interface MapConfig {
3838
nutsLevel?: number | 'mixed'
3939
/** NUTS boundary year. */
4040
nutsYear?: number | string
41+
42+
/**
43+
* Base URL used to fetch NUTS2JSON boundary geometries. Applies to the top-level map and
44+
* (unless a given inset overrides it via `InsetConfig.nuts2jsonBaseURL`) all of its insets.
45+
* @default 'https://raw.githubusercontent.com/eurostat/Nuts2json/master/pub/v2' (or the
46+
* ec.europa.eu cache when running on an ec.europa.eu host)
47+
*/
48+
nuts2jsonBaseURL?: string
4149
/** Geographic center as [longitude, latitude]. */
4250
geoCenter?: [number, number]
4351

‎src/types/core/MapInstance.d.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@ export interface MapInstance {
7777
nutsYear(): number
7878
nutsYear(year: number): this
7979

80+
/**
81+
* Base URL used to fetch NUTS2JSON boundary geometries (and, for insets, whatever
82+
* base URL is set on the owning map, unless overridden per-inset). Setting this on the
83+
* top-level map also propagates it to all insets.
84+
* @default 'https://raw.githubusercontent.com/eurostat/Nuts2json/master/pub/v2' (or the
85+
* ec.europa.eu cache when running on an ec.europa.eu host)
86+
*/
87+
nuts2jsonBaseURL(): string
88+
nuts2jsonBaseURL(url: string): this
89+
8090
/**
8191
* Initial map viewport. x/y in projected coordinates, z is pixel size
8292
* (map units per screen pixel — smaller = more zoomed in).

0 commit comments

Comments
 (0)