@russss/maplibregl-layer-switcher 1.2.4 → 2.0.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.
@@ -0,0 +1,22 @@
1
+ name: Publish Package to npmjs
2
+ on:
3
+ release:
4
+ types: [published]
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ permissions:
9
+ contents: read
10
+ id-token: write
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: actions/setup-node@v4
14
+ with:
15
+ node-version: '20.x'
16
+ registry-url: 'https://registry.npmjs.org'
17
+ - run: npm ci
18
+ - run: npm run test
19
+ - run: npm run build
20
+ - run: npm publish --provenance --access public
21
+ env:
22
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/.prettierrc CHANGED
@@ -1,4 +1,6 @@
1
1
  {
2
+ "semi": false,
3
+ "trailingComma": "none",
2
4
  "singleQuote": true,
3
- "printWidth": 120
5
+ "printWidth": 110
4
6
  }
package/README.md CHANGED
@@ -11,23 +11,28 @@ This package was formerly called `mapboxgl-layer-switcher` but after renaming it
11
11
  ## Use
12
12
 
13
13
  These steps assume you're using Webpack with css-loader. First, import the layer switcher component:
14
+
14
15
  ```javascript
15
- import LayerSwitcher from '@russss/maplibregl-layer-switcher';
16
+ import { LayerSwitcher } from '@russss/maplibregl-layer-switcher'
16
17
  ```
17
18
 
18
19
  Assuming you are using a build system which supports CSS imports, the CSS should be imported automatically.
19
20
 
20
- Now define your layers as an object mapping the layer name to the prefix of the Mapbox GL layers you
21
- want to switch. We also define a list of layers which will be initially enabled:
21
+ Now define your layers. Each layer has a short identifier which will be used in the URL hash,
22
+ a prefix for the style layers to match, and a boolean for whether it's enabled by default:
23
+
22
24
  ```javascript
23
- const layers = {
24
- Power: 'power_',
25
- 'Solar Generation': 'heatmap_',
26
- Labels: 'place_',
27
- };
28
-
29
- const layers_enabled = ['Power', 'Labels'];
30
- const layer_switcher = new LayerSwitcher(layers, layers_enabled);
25
+ const layers_enabled = ['Power', 'Labels']
26
+ const layer_switcher = new LayerSwitcher([
27
+ new LayerGroup('Artificial', [
28
+ new Layer('b', 'Borders', 'boundary'),
29
+ new Layer('l', 'Landuse', 'landuse_', true),
30
+ new Layer('r', 'Roads', 'road_', true),
31
+ new Layer('B', 'Buildings', 'building', true)
32
+ ]),
33
+ new LayerGroup('Natural', [new Layer('w', 'Water', 'water', true)]),
34
+ new Layer('L', 'Labels', 'label', true)
35
+ ])
31
36
  ```
32
37
 
33
38
  Adding the layer switcher to the map after it's been initialised will result in the hidden layers being briefly
@@ -35,15 +40,14 @@ shown. To avoid this, we need to load the style into JS first (I usually bundle
35
40
  call the `setInitialVisibility` method on the loaded style object.
36
41
 
37
42
  ```javascript
38
- const style = //...load map style JSON into an object
39
- layer_switcher.setInitialVisibility(style);
43
+ const style = layer_switcher.setInitialVisibility(style) //...load map style JSON into an object
40
44
  ```
41
45
 
42
46
  Now we can instantiate our map and add the layer switcher to it:
43
- ```javascript
44
47
 
45
- const map = new maplibregl.Map({style: style, container: 'map'});
46
- map.addControl(layer_switcher, 'top-right');
48
+ ```javascript
49
+ const map = new maplibregl.Map({ style: style, container: 'map' })
50
+ map.addControl(layer_switcher)
47
51
  ```
48
52
 
49
53
  ## URL Hash
@@ -51,23 +55,31 @@ map.addControl(layer_switcher, 'top-right');
51
55
  To include layers in the URL hash, first import and create the `URLHash` object, passing in your `LayerSwitcher`:
52
56
 
53
57
  ```javascript
54
- import URLHash from '@russss/maplibregl-layer-switcher/urlhash';
58
+ import { URLHash } from '@russss/maplibregl-layer-switcher'
55
59
  // ...
56
- const url_hash = new URLHash(layer_switcher);
60
+ const url_hash = new URLHash(layer_switcher)
57
61
  ```
58
62
 
59
63
  When creating the map, you need to call `url_hash.init`, passing in your default map options. The URLHash class will
60
64
  update the `zoom` and `center` options if they're provided in the URL hash. Then call `url_hash.enable` on the map:
65
+
61
66
  ```javascript
62
- var map = new maplibregl.Map(url_hash.init({
63
- container: 'map',
64
- style: style,
65
- minZoom: 2,
66
- maxZoom: 17.9,
67
- center: [12, 26],
68
- }));
69
-
70
- url_hash.enable(map);
67
+ var map = new maplibregl.Map(
68
+ url_hash.init({
69
+ container: 'map',
70
+ style: style,
71
+ minZoom: 2,
72
+ maxZoom: 17.9,
73
+ center: [12, 26]
74
+ })
75
+ )
76
+
77
+ url_hash.enable(map)
71
78
  ```
72
79
 
73
80
  The URLHash object doesn't currently support tilt and rotation parameters.
81
+
82
+ ## Development
83
+
84
+ Vite can be used to test the library (using index.html and index.ts in the root directory) but isn't
85
+ used to build the published version.
package/lib/data.d.ts ADDED
@@ -0,0 +1,35 @@
1
+ /**
2
+ * A layer in the layer switcher.
3
+ */
4
+ export declare class Layer {
5
+ id: string;
6
+ prefix: string;
7
+ title: string;
8
+ enabled: boolean;
9
+ /**
10
+ * An item in the layer switcher.
11
+ *
12
+ * @param id alphanumeric identifier for the layer. This is included in the URL hash so should be as short
13
+ * as possible. Must be unique among all layers, or an error will be thrown.
14
+ * @param title name of the layer as shown in the layer switcher.
15
+ * @param prefix prefix of the layer in the map style to match.
16
+ * @param enabled whether the layer is enabled by default.
17
+ */
18
+ constructor(id: string, title: string, prefix: string, enabled?: boolean);
19
+ }
20
+ /**
21
+ * A group of layers shown in the layer switcher.
22
+ */
23
+ export declare class LayerGroup {
24
+ layers: Layer[];
25
+ title: string;
26
+ id: string;
27
+ /**
28
+ * A group of layers shown in the layer switcher.
29
+ *
30
+ * @param title name of the group to be shown.
31
+ * @param layers list of layers in the group.
32
+ */
33
+ constructor(title: string, layers: Layer[]);
34
+ }
35
+ //# sourceMappingURL=data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../src/data.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,KAAK;IAChB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,OAAO,CAAQ;IAExB;;;;;;;;OAQG;gBACS,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,UAAQ;CAMvE;AAED;;GAEG;AACH,qBAAa,UAAU;IACrB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,EAAE,EAAE,MAAM,CAAA;IAEV;;;;;OAKG;gBACS,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE;CAK3C"}
package/lib/data.js ADDED
@@ -0,0 +1,37 @@
1
+ /**
2
+ * A layer in the layer switcher.
3
+ */
4
+ export class Layer {
5
+ /**
6
+ * An item in the layer switcher.
7
+ *
8
+ * @param id alphanumeric identifier for the layer. This is included in the URL hash so should be as short
9
+ * as possible. Must be unique among all layers, or an error will be thrown.
10
+ * @param title name of the layer as shown in the layer switcher.
11
+ * @param prefix prefix of the layer in the map style to match.
12
+ * @param enabled whether the layer is enabled by default.
13
+ */
14
+ constructor(id, title, prefix, enabled = false) {
15
+ this.enabled = false;
16
+ this.id = id;
17
+ this.prefix = prefix;
18
+ this.title = title;
19
+ this.enabled = enabled;
20
+ }
21
+ }
22
+ /**
23
+ * A group of layers shown in the layer switcher.
24
+ */
25
+ export class LayerGroup {
26
+ /**
27
+ * A group of layers shown in the layer switcher.
28
+ *
29
+ * @param title name of the group to be shown.
30
+ * @param layers list of layers in the group.
31
+ */
32
+ constructor(title, layers) {
33
+ this.title = title;
34
+ this.id = title;
35
+ this.layers = layers;
36
+ }
37
+ }
package/lib/index.d.ts CHANGED
@@ -1,31 +1,5 @@
1
- import { List } from 'redom';
2
- import './layerswitcher.css';
1
+ import LayerSwitcher from './layerswitcher';
3
2
  import URLHash from './urlhash';
4
- declare class LayerSwitcher implements maplibregl.IControl {
5
- _layers: Record<string, string>;
6
- _identifiers: Record<string, string>;
7
- _default_visible: Array<string>;
8
- _container: HTMLElement;
9
- _visible: Array<string>;
10
- _layerList: List;
11
- _map: maplibregl.Map | undefined;
12
- urlhash: URLHash | undefined;
13
- constructor(layers: Record<string, string>, default_visible?: Array<string>);
14
- _initLayerIdentifiers(): Record<string, string>;
15
- _getLayerIdentifiers(): string[];
16
- _updateVisibility(): void;
17
- /**
18
- * Modify a MapLibre GL style object before creating the map to set initial visibility states.
19
- * This prevents flash-of-invisible-layers.
20
- *
21
- * @param style the MapLibre GL style object to modify
22
- */
23
- setInitialVisibility(style: maplibregl.StyleSpecification): void;
24
- getURLString(): string;
25
- setURLString(string: string): void;
26
- onAdd(map: maplibregl.Map): HTMLDivElement;
27
- onRemove(): void;
28
- _updateList(): void;
29
- }
30
- export default LayerSwitcher;
3
+ import { Layer, LayerGroup } from './data';
4
+ export { LayerSwitcher, URLHash, Layer, LayerGroup };
31
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,IAAI,EAAgC,MAAM,OAAO,CAAC;AAGjE,OAAO,qBAAqB,CAAC;AAC7B,OAAO,OAAO,MAAM,WAAW,CAAC;AAGhC,cAAM,aAAc,YAAW,UAAU,CAAC,QAAQ;IAChD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAChC,UAAU,EAAE,WAAW,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACxB,UAAU,EAAE,IAAI,CAAC;IACjB,IAAI,EAAE,UAAU,CAAC,GAAG,GAAG,SAAS,CAAC;IACjC,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;gBAEjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,eAAe,GAAE,KAAK,CAAC,MAAM,CAAM;IAW/E,qBAAqB;IAgBrB,oBAAoB;IASpB,iBAAiB;IAwBjB;;;;;OAKG;IACH,oBAAoB,CAAC,KAAK,EAAE,UAAU,CAAC,kBAAkB;IAezD,YAAY;IAOZ,YAAY,CAAC,MAAM,EAAE,MAAM;IAqB3B,KAAK,CAAC,GAAG,EAAE,UAAU,CAAC,GAAG;IA6BzB,QAAQ;IAKR,WAAW;CAWZ;AA2CD,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAC3C,OAAO,OAAO,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAE1C,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,CAAA"}
package/lib/index.js CHANGED
@@ -1,181 +1,4 @@
1
- import { list, el, mount } from 'redom';
2
- import invert from 'lodash.invert';
3
- import isEqual from 'lodash.isequal';
4
- import './layerswitcher.css';
5
- class LayerSwitcher {
6
- constructor(layers, default_visible = []) {
7
- this._layers = layers;
8
- this._identifiers = this._initLayerIdentifiers();
9
- this._default_visible = default_visible;
10
- this._layerList = list('ul', LayerSwitcherItem, 'name');
11
- this._container = el('div', [el('h3', 'Layers'), this._layerList], { class: 'layer-switcher-list' });
12
- mount(document.body, this._container);
13
- this._visible = [...default_visible];
14
- }
15
- _initLayerIdentifiers() {
16
- let identifiers = {};
17
- Object.keys(this._layers)
18
- .sort()
19
- .forEach((layer_name) => {
20
- let size = 1;
21
- let ident = null;
22
- do {
23
- ident = layer_name.slice(0, size);
24
- size++;
25
- } while (ident in identifiers);
26
- identifiers[ident] = layer_name;
27
- });
28
- return identifiers;
29
- }
30
- _getLayerIdentifiers() {
31
- let identifiers = [];
32
- let id_map = invert(this._identifiers);
33
- this._visible.sort().forEach((layer_name) => {
34
- identifiers.push(id_map[layer_name]);
35
- });
36
- return identifiers;
37
- }
38
- _updateVisibility() {
39
- if (!this._map) {
40
- return;
41
- }
42
- var layers = this._map.getStyle().layers;
43
- for (let layer of layers) {
44
- let name = layer['id'];
45
- for (let layer_name in this._layers) {
46
- let pref = this._layers[layer_name];
47
- if (name.startsWith(pref)) {
48
- if (this._visible.includes(layer_name)) {
49
- this._map.setLayoutProperty(name, 'visibility', 'visible');
50
- }
51
- else {
52
- this._map.setLayoutProperty(name, 'visibility', 'none');
53
- }
54
- }
55
- }
56
- }
57
- if (this.urlhash) {
58
- this.urlhash._updateHash();
59
- }
60
- }
61
- /**
62
- * Modify a MapLibre GL style object before creating the map to set initial visibility states.
63
- * This prevents flash-of-invisible-layers.
64
- *
65
- * @param style the MapLibre GL style object to modify
66
- */
67
- setInitialVisibility(style) {
68
- for (let layer of style['layers']) {
69
- for (let layer_name in this._layers) {
70
- let pref = this._layers[layer_name];
71
- if (layer['id'].startsWith(pref) && !this._visible.includes(layer['id'])) {
72
- if (!layer['layout']) {
73
- layer['layout'] = {};
74
- }
75
- layer['layout']['visibility'] = 'none';
76
- }
77
- }
78
- }
79
- this._updateList();
80
- }
81
- getURLString() {
82
- if (!isEqual(this._visible.sort(), this._default_visible.sort())) {
83
- return this._getLayerIdentifiers().join(',');
84
- }
85
- return '';
86
- }
87
- setURLString(string) {
88
- var _a;
89
- if (string) {
90
- const ids = string.split(',');
91
- if (ids.length == 0) {
92
- this._visible = [...this._default_visible];
93
- }
94
- else {
95
- this._visible = ids.map((id) => this._identifiers[id]).filter((id) => id);
96
- }
97
- }
98
- else {
99
- this._visible = [...this._default_visible];
100
- }
101
- // If the style hasn't been loaded yet, don't update visibility or this causes
102
- // problems with the URLHash. Initial visibility is handled by the
103
- // `setInitialVisibility` method.
104
- if ((_a = this._map) === null || _a === void 0 ? void 0 : _a.isStyleLoaded()) {
105
- this._updateVisibility();
106
- }
107
- this._updateList();
108
- }
109
- onAdd(map) {
110
- this._map = map;
111
- if (map.isStyleLoaded()) {
112
- this._updateVisibility();
113
- }
114
- else {
115
- map.on('load', () => {
116
- this._updateVisibility();
117
- });
118
- }
119
- const button = el('button', {
120
- class: 'layer-switcher-button',
121
- 'aria-label': 'Layer Switcher',
122
- });
123
- button.onmouseover = (e) => {
124
- var button_position = button.getBoundingClientRect();
125
- this._container.style.top = button_position.top + 'px';
126
- this._container.style.right = document.documentElement.clientWidth - button_position.right + 'px';
127
- this._container.style.display = 'block';
128
- };
129
- this._container.onmouseleave = (e) => {
130
- this._container.style.display = 'none';
131
- };
132
- return el('div', button, {
133
- class: 'maplibregl-ctrl maplibregl-ctrl-group layer-switcher',
134
- });
135
- }
136
- onRemove() {
137
- var _a;
138
- (_a = this._container.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(this._container);
139
- this._map = undefined;
140
- }
141
- _updateList() {
142
- this._layerList.update(Object.keys(this._layers).map((name) => {
143
- return {
144
- enabled: this._visible.includes(name),
145
- name: name,
146
- };
147
- }), this);
148
- }
149
- }
150
- class LayerSwitcherItem {
151
- constructor() {
152
- this._checkbox = el('input', {
153
- type: 'checkbox',
154
- });
155
- this._label = el('label');
156
- this.el = el('li', this._label);
157
- this._checkbox.onchange = (e) => this.onChange(e);
158
- }
159
- onChange(e) {
160
- if (!this.layerSwitcher)
161
- return;
162
- const name = this._label.innerText;
163
- if (e.target.checked) {
164
- this.layerSwitcher._visible.push(name);
165
- }
166
- else {
167
- this.layerSwitcher._visible = this.layerSwitcher._visible.filter((item) => item !== name);
168
- }
169
- this.layerSwitcher._updateVisibility();
170
- }
171
- update(data, index, items, context) {
172
- this.layerSwitcher = context;
173
- let label_for = 'layerSwitch' + index;
174
- this._checkbox.id = label_for;
175
- this._label.setAttribute('for', label_for);
176
- this._checkbox.checked = data.enabled;
177
- this._label.innerText = data.name;
178
- mount(this._label, this._checkbox);
179
- }
180
- }
181
- export default LayerSwitcher;
1
+ import LayerSwitcher from './layerswitcher';
2
+ import URLHash from './urlhash';
3
+ import { Layer, LayerGroup } from './data';
4
+ export { LayerSwitcher, URLHash, Layer, LayerGroup };
@@ -10,15 +10,23 @@
10
10
  }
11
11
 
12
12
  .layer-switcher-list {
13
+ display: none;
14
+ user-select: none;
13
15
  background: white;
14
16
  padding-left: 8px;
15
17
  padding-right: 8px;
16
18
  position: absolute;
17
- display: none;
18
19
  margin: 0 !important;
19
20
  font-size: 15px;
20
21
  z-index: 1000;
21
22
  border-radius: 4px;
23
+ box-sizing: content-box;
24
+ min-width: 100px;
25
+ box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2);
26
+ }
27
+
28
+ .layer-switcher-list.visible {
29
+ display: block;
22
30
  }
23
31
 
24
32
  @media screen and (max-width: 900px) {
@@ -36,17 +44,35 @@
36
44
  margin-top: 6px;
37
45
  }
38
46
 
47
+ .layer-switcher-list h4 {
48
+ margin: 0;
49
+ padding: 0;
50
+ display: inline-block;
51
+ width: 100%;
52
+ border-bottom: 1px solid #ccc;
53
+ margin-bottom: 0.5rem;
54
+ }
55
+
39
56
  .layer-switcher-list ul {
40
- list-style: none;
57
+ display: flex;
58
+ flex-direction: column;
59
+ list-style-type: none;
41
60
  padding: 0;
42
- user-select: none;
43
61
  margin-bottom: 4px;
44
62
  }
45
63
 
46
64
  .layer-switcher-list li {
47
- display: block;
48
65
  width: 100%;
49
- height: 1.5em;
66
+ }
67
+
68
+ .layer-switcher-group + li {
69
+ padding-top: 10px;
70
+ }
71
+
72
+ .layer-switcher-list li.layer-switcher-group {
73
+ display: flex;
74
+ flex-direction: column;
75
+ padding-left: 2px;
50
76
  }
51
77
 
52
78
  .layer-switcher-list input {
@@ -57,6 +83,9 @@
57
83
  }
58
84
 
59
85
  .layer-switcher-list label {
60
- display: block;
61
- width: 100%;
62
- }
86
+ display: flex;
87
+ align-items: center;
88
+ justify-content: space-between;
89
+ width: 100%;
90
+ cursor: pointer;
91
+ }
@@ -0,0 +1,42 @@
1
+ import './layerswitcher.css';
2
+ import URLHash from './urlhash';
3
+ import { Layer, LayerGroup } from './data';
4
+ import type maplibregl from 'maplibre-gl';
5
+ /**
6
+ * A layer switcher control for MapLibre GL JS.
7
+ */
8
+ declare class LayerSwitcher implements maplibregl.IControl {
9
+ _layers: (Layer | LayerGroup)[];
10
+ _layerIndex: Record<string, Layer>;
11
+ _container: HTMLElement;
12
+ _visible: string[];
13
+ _default_visible: string[];
14
+ _layerList: HTMLElement;
15
+ _map: maplibregl.Map | undefined;
16
+ urlhash: URLHash | undefined;
17
+ /**
18
+ * A layer switcher control for MapLibre GL JS.
19
+ *
20
+ * @param layers a list of `Layer` or `LayerGroup` objects.
21
+ * @param title the title of the layer switcher (default "Layers").
22
+ */
23
+ constructor(layers: (Layer | LayerGroup)[], title?: string);
24
+ getLayers(): Layer[];
25
+ setVisibility(layerId: string, visible: boolean): void;
26
+ _updateVisibility(): void;
27
+ /**
28
+ * Modify a MapLibre GL style object before creating the map to set initial visibility states.
29
+ * This prevents flash-of-invisible-layers.
30
+ *
31
+ * @param style the MapLibre GL style object to modify
32
+ */
33
+ setInitialVisibility(style: maplibregl.StyleSpecification): void;
34
+ getURLString(): string;
35
+ setURLString(string: string): void;
36
+ onAdd(map: maplibregl.Map): HTMLDivElement;
37
+ onRemove(): void;
38
+ _getLayerElement(item: Layer | LayerGroup): Node;
39
+ _updateList(): void;
40
+ }
41
+ export default LayerSwitcher;
42
+ //# sourceMappingURL=layerswitcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layerswitcher.d.ts","sourceRoot":"","sources":["../src/layerswitcher.ts"],"names":[],"mappings":"AAEA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,OAAO,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAC1C,OAAO,KAAK,UAAU,MAAM,aAAa,CAAA;AAEzC;;GAEG;AACH,cAAM,aAAc,YAAW,UAAU,CAAC,QAAQ;IAChD,OAAO,EAAE,CAAC,KAAK,GAAG,UAAU,CAAC,EAAE,CAAA;IAC/B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IAClC,UAAU,EAAE,WAAW,CAAA;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,UAAU,EAAE,WAAW,CAAA;IACvB,IAAI,EAAE,UAAU,CAAC,GAAG,GAAG,SAAS,CAAA;IAChC,OAAO,EAAE,OAAO,GAAG,SAAS,CAAA;IAE5B;;;;;OAKG;gBACS,MAAM,EAAE,CAAC,KAAK,GAAG,UAAU,CAAC,EAAE,EAAE,KAAK,GAAE,MAAiB;IAmBpE,SAAS,IAAI,KAAK,EAAE;IAYpB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IAY/C,iBAAiB;IAwBjB;;;;;OAKG;IACH,oBAAoB,CAAC,KAAK,EAAE,UAAU,CAAC,kBAAkB;IAezD,YAAY;IAOZ,YAAY,CAAC,MAAM,EAAE,MAAM;IAqB3B,KAAK,CAAC,GAAG,EAAE,UAAU,CAAC,GAAG;IA6BzB,QAAQ;IAKR,gBAAgB,CAAC,IAAI,EAAE,KAAK,GAAG,UAAU,GAAG,IAAI;IAwBhD,WAAW;CAGZ;AAED,eAAe,aAAa,CAAA"}
@@ -0,0 +1,183 @@
1
+ import { el, mount } from 'redom';
2
+ import isEqual from 'lodash.isequal';
3
+ import './layerswitcher.css';
4
+ import { Layer, LayerGroup } from './data';
5
+ /**
6
+ * A layer switcher control for MapLibre GL JS.
7
+ */
8
+ class LayerSwitcher {
9
+ /**
10
+ * A layer switcher control for MapLibre GL JS.
11
+ *
12
+ * @param layers a list of `Layer` or `LayerGroup` objects.
13
+ * @param title the title of the layer switcher (default "Layers").
14
+ */
15
+ constructor(layers, title = 'Layers') {
16
+ this._layers = layers;
17
+ this._layerIndex = {};
18
+ for (let layer of this.getLayers()) {
19
+ if (this._layerIndex[layer.id]) {
20
+ throw new Error(`Duplicate layer ID "${layer.id}". Layer IDs must be unique.`);
21
+ }
22
+ this._layerIndex[layer.id] = layer;
23
+ }
24
+ this._visible = this._default_visible = Object.values(this._layerIndex)
25
+ .filter((layer) => layer.enabled)
26
+ .map((layer) => layer.id);
27
+ this._layerList = el('ul');
28
+ this._container = el('div', [el('h3', title), this._layerList], { class: 'layer-switcher-list' });
29
+ mount(document.body, this._container);
30
+ }
31
+ getLayers() {
32
+ const layers = [];
33
+ for (let layer of this._layers) {
34
+ if (layer instanceof LayerGroup) {
35
+ layers.push(...layer.layers);
36
+ }
37
+ else if (layer instanceof Layer) {
38
+ layers.push(layer);
39
+ }
40
+ }
41
+ return layers;
42
+ }
43
+ setVisibility(layerId, visible) {
44
+ if (visible) {
45
+ if (!this._visible.includes(layerId)) {
46
+ this._visible.push(layerId);
47
+ }
48
+ }
49
+ else {
50
+ this._visible = this._visible.filter((item) => item !== layerId);
51
+ }
52
+ this._updateVisibility();
53
+ }
54
+ _updateVisibility() {
55
+ if (!this._map) {
56
+ return;
57
+ }
58
+ var layers = this._map.getStyle().layers;
59
+ for (let layer of layers) {
60
+ let name = layer['id'];
61
+ for (let layer_name in this._layerIndex) {
62
+ let pref = this._layerIndex[layer_name].prefix;
63
+ if (name.startsWith(pref)) {
64
+ if (this._visible.includes(layer_name)) {
65
+ this._map.setLayoutProperty(name, 'visibility', 'visible');
66
+ }
67
+ else {
68
+ this._map.setLayoutProperty(name, 'visibility', 'none');
69
+ }
70
+ }
71
+ }
72
+ }
73
+ if (this.urlhash) {
74
+ this.urlhash._updateHash();
75
+ }
76
+ }
77
+ /**
78
+ * Modify a MapLibre GL style object before creating the map to set initial visibility states.
79
+ * This prevents flash-of-invisible-layers.
80
+ *
81
+ * @param style the MapLibre GL style object to modify
82
+ */
83
+ setInitialVisibility(style) {
84
+ for (let layer of style['layers']) {
85
+ for (let layer_name in this._layerIndex) {
86
+ let pref = this._layerIndex[layer_name].prefix;
87
+ if (layer['id'].startsWith(pref) && !this._visible.includes(layer['id'])) {
88
+ if (!layer['layout']) {
89
+ layer['layout'] = {};
90
+ }
91
+ layer['layout']['visibility'] = 'none';
92
+ }
93
+ }
94
+ }
95
+ this._updateList();
96
+ }
97
+ getURLString() {
98
+ if (!isEqual(this._visible.sort(), this._default_visible.sort())) {
99
+ return this._visible.sort().join(',');
100
+ }
101
+ return '';
102
+ }
103
+ setURLString(string) {
104
+ var _a;
105
+ if (string) {
106
+ const ids = string.split(',');
107
+ if (ids.length == 0) {
108
+ this._visible = [...this._default_visible];
109
+ }
110
+ else {
111
+ this._visible = ids.filter((id) => this._layerIndex[id]).map((id) => id);
112
+ }
113
+ }
114
+ else {
115
+ this._visible = [...this._default_visible];
116
+ }
117
+ // If the style hasn't been loaded yet, don't update visibility or this causes
118
+ // problems with the URLHash. Initial visibility is handled by the
119
+ // `setInitialVisibility` method.
120
+ if ((_a = this._map) === null || _a === void 0 ? void 0 : _a.isStyleLoaded()) {
121
+ this._updateVisibility();
122
+ }
123
+ this._updateList();
124
+ }
125
+ onAdd(map) {
126
+ this._map = map;
127
+ if (map.isStyleLoaded()) {
128
+ this._updateVisibility();
129
+ }
130
+ else {
131
+ map.on('load', () => {
132
+ this._updateVisibility();
133
+ });
134
+ }
135
+ const button = el('button', {
136
+ class: 'layer-switcher-button',
137
+ 'aria-label': 'Layer Switcher'
138
+ });
139
+ button.onmouseover = () => {
140
+ var button_position = button.getBoundingClientRect();
141
+ this._container.style.top = button_position.top + 'px';
142
+ this._container.style.right = document.documentElement.clientWidth - button_position.right + 'px';
143
+ this._container.classList.add('visible');
144
+ };
145
+ this._container.onmouseleave = () => {
146
+ this._container.classList.remove('visible');
147
+ };
148
+ return el('div', button, {
149
+ class: 'maplibregl-ctrl maplibregl-ctrl-group layer-switcher'
150
+ });
151
+ }
152
+ onRemove() {
153
+ var _a;
154
+ (_a = this._container.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(this._container);
155
+ this._map = undefined;
156
+ }
157
+ _getLayerElement(item) {
158
+ if (item instanceof Layer) {
159
+ const checkbox = el('input', {
160
+ type: 'checkbox',
161
+ checked: item.enabled,
162
+ onchange: (e) => {
163
+ this.setVisibility(item.id, e.target.checked);
164
+ }
165
+ });
166
+ const label = el('label', item.title, checkbox);
167
+ return el('li', label);
168
+ }
169
+ else if (item instanceof LayerGroup) {
170
+ return el('li.layer-switcher-group', [
171
+ el('h4', item.title),
172
+ el('ul', item.layers.map((layer) => this._getLayerElement(layer)))
173
+ ]);
174
+ }
175
+ else {
176
+ throw new Error('Unknown item type: ' + item);
177
+ }
178
+ }
179
+ _updateList() {
180
+ this._layerList.replaceChildren(...this._layers.map((item) => this._getLayerElement(item)));
181
+ }
182
+ }
183
+ export default LayerSwitcher;
@@ -1 +1 @@
1
- {"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2016.intl.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/typescript/lib/lib.es2016.full.d.ts","../node_modules/redom/index.d.ts","../node_modules/@types/lodash/common/common.d.ts","../node_modules/@types/lodash/common/array.d.ts","../node_modules/@types/lodash/common/collection.d.ts","../node_modules/@types/lodash/common/date.d.ts","../node_modules/@types/lodash/common/function.d.ts","../node_modules/@types/lodash/common/lang.d.ts","../node_modules/@types/lodash/common/math.d.ts","../node_modules/@types/lodash/common/number.d.ts","../node_modules/@types/lodash/common/object.d.ts","../node_modules/@types/lodash/common/seq.d.ts","../node_modules/@types/lodash/common/string.d.ts","../node_modules/@types/lodash/common/util.d.ts","../node_modules/@types/lodash/index.d.ts","../node_modules/@types/lodash.invert/index.d.ts","../node_modules/@types/lodash.isequal/index.d.ts","../node_modules/@types/mapbox__point-geometry/index.d.ts","../node_modules/@mapbox/tiny-sdf/index.d.ts","../node_modules/@types/pbf/index.d.ts","../node_modules/@types/geojson/index.d.ts","../node_modules/@types/mapbox__vector-tile/index.d.ts","../node_modules/@maplibre/maplibre-gl-style-spec/dist/index.d.ts","../node_modules/gl-matrix/index.d.ts","../node_modules/kdbush/index.d.ts","../node_modules/potpack/index.d.ts","../node_modules/maplibre-gl/dist/maplibre-gl.d.ts","../src/urlhash.ts","../src/index.ts","../src/urlhash.test.ts","../node_modules/@babel/types/lib/index.d.ts","../node_modules/@types/babel__generator/index.d.ts","../node_modules/@babel/parser/typings/babel-parser.d.ts","../node_modules/@types/babel__template/index.d.ts","../node_modules/@types/babel__traverse/index.d.ts","../node_modules/@types/babel__core/index.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@types/graceful-fs/index.d.ts","../node_modules/@types/istanbul-lib-coverage/index.d.ts","../node_modules/@types/istanbul-lib-report/index.d.ts","../node_modules/@types/istanbul-reports/index.d.ts","../node_modules/@jest/expect-utils/build/index.d.ts","../node_modules/chalk/index.d.ts","../node_modules/@sinclair/typebox/typebox.d.ts","../node_modules/@jest/schemas/build/index.d.ts","../node_modules/pretty-format/build/index.d.ts","../node_modules/jest-diff/build/index.d.ts","../node_modules/jest-matcher-utils/build/index.d.ts","../node_modules/expect/build/index.d.ts","../node_modules/@types/jest/index.d.ts","../node_modules/parse5/dist/common/html.d.ts","../node_modules/parse5/dist/common/token.d.ts","../node_modules/parse5/dist/common/error-codes.d.ts","../node_modules/parse5/dist/tokenizer/preprocessor.d.ts","../node_modules/parse5/dist/tokenizer/index.d.ts","../node_modules/parse5/dist/tree-adapters/interface.d.ts","../node_modules/parse5/dist/parser/open-element-stack.d.ts","../node_modules/parse5/dist/parser/formatting-element-list.d.ts","../node_modules/parse5/dist/parser/index.d.ts","../node_modules/parse5/dist/tree-adapters/default.d.ts","../node_modules/parse5/dist/serializer/index.d.ts","../node_modules/parse5/dist/common/foreign-content.d.ts","../node_modules/parse5/dist/index.d.ts","../node_modules/@types/tough-cookie/index.d.ts","../node_modules/@types/jsdom/base.d.ts","../node_modules/@types/jsdom/index.d.ts","../node_modules/@types/prettier/index.d.ts","../node_modules/@types/stack-utils/index.d.ts","../node_modules/@types/yargs-parser/index.d.ts","../node_modules/@types/yargs/index.d.ts"],"fileInfos":[{"version":"824cb491a40f7e8fdeb56f1df5edf91b23f3e3ee6b4cde84d4a99be32338faee","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4",{"version":"87d693a4920d794a73384b3c779cadcb8548ac6945aa7a925832fe2418c9527a","affectsGlobalScope":true},{"version":"76f838d5d49b65de83bc345c04aa54c62a3cfdb72a477dc0c0fce89a30596c30","affectsGlobalScope":true},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true},{"version":"138fb588d26538783b78d1e3b2c2cc12d55840b97bf5e08bca7f7a174fbe2f17","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"b20fe0eca9a4e405f1a5ae24a2b3290b37cf7f21eba6cbe4fc3fab979237d4f3","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"49ed889be54031e1044af0ad2c603d627b8bda8b50c1a68435fe85583901d072","affectsGlobalScope":true},{"version":"e93d098658ce4f0c8a0779e6cab91d0259efb88a318137f686ad76f8410ca270","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"8073890e29d2f46fdbc19b8d6d2eb9ea58db9a2052f8640af20baff9afbc8640","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"13f6e6380c78e15e140243dc4be2fa546c287c6d61f4729bc2dd7cf449605471","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"807e0e0bdc67605dd28efe18f20ab5fcd75d944ef95936120702335f9379094b","332f8e56efa13b367cb696e2036918d80887b13177c12acda6d49ee145c333ca","675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","458111fc89d11d2151277c822dfdc1a28fa5b6b2493cf942e37d4cd0a6ee5f22","19c816167e076e7c24f074389c6cf3ed87bdbb917d1ea439ca281f9d26db2439","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","98f9d826db9cd99d27a01a59ee5f22863df00ccf1aaf43e1d7db80ebf716f7c3","0aaef8cded245bf5036a7a40b65622dd6c4da71f7a35343112edbe112b348a1e","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","dcd91d3b697cb650b95db5471189b99815af5db2a1cd28760f91e0b12ede8ed5","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3cf0d343c2276842a5b617f22ba82af6322c7cfe8bb52238ffc0c491a3c21019","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9",{"version":"f2eff8704452659641164876c1ef0df4174659ce7311b0665798ea3f556fa9ad","affectsGlobalScope":true},"b578be2890bf15a1a9b3b8177ff0975c99bae05f5422241452fe810eec3bff1c","6bb8d7433a29fbd33df8e9693f1788a273a9eb90b96c8f99c745678c7db623f1","e86cd9c6c99834f8591ed72f08e4ca31570296f081206d0168f58f032cec5b58","bc8b2489bf29fa17cf4e7d5a4447daa456d7caf61455f50aafc34f1f3b915727","2a856615ecd0af49997dfbb38cf94fd787d529062a2e96ce26b84432e61d785d","a3b6c93a9838b8c94c6998e85646d6f2d07c20ecfe1e235dba62158b29451391","ab438f22fa7748112b6b9744b992ab6049d2fa6f46f011c145ff9c90e533856a","e92ff9eccdb74e9bf34e9dcbd3525252b021ff7fd763e63c95d80c9e0eeb8406","6b729c3274f6d4738fe470109bcb08b09ef98a6b356c01da3ca8dc0996b4458b","4dbf094f9d643b74e516779a802d9c5debd2929fb875ccfbc608d61afba064e4","828ea2cf5792eba68ebd41d6dd17ac67d31622b7889965210f8fa50a6eb29eba","41d979b791363582ff485524e0db7d2312207a811d5f08e92566733ab90dde9f",{"version":"38fb200a6eedb5e68b673da82cb31d0e8137eb426e2bd5a694f412163a4c76ef","signature":"a881b9df48e5f910818dfab8ea1e2a74bfdbc51ad638f3fb980c8c86ba023583"},{"version":"eed289cbbadefbe0b5df86b3b148453028e6cbbb8c6f56e9c7afc42dfb750981","signature":"598868f3dd681bf8895043048b33e95d3149d53e00440e3d5762af2fdb1f3301"},{"version":"3234998ed4c3fc9a7e8dee958ac41398fb1ec1883c4b0e107a189102e7eddf3f","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"ac65f04c2df0218cb8e54f012745cbfcc3c0e67c1f6b1e557d88842bbb72e2db","cc957354aa3c94c9961ebf46282cfde1e81d107fc5785a61f62c67f1dd3ac2eb","a2e86df4db576d80704e25293cec6f20fc6101a11f4747440e2eef58fb3c860c","93de1c6dab503f053efe8d304cb522bb3a89feab8c98f307a674a4fae04773e9","6704f0b54df85640baaeebd86c9d4a1dbb661d5a4d57a75bc84162f562f6531d","9d255af1b09c6697089d3c9bf438292a298d8b7a95c68793c9aae80afc9e5ca7","587f13f1e8157bd8cec0adda0de4ef558bb8573daa9d518d1e2af38e87ecc91f","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"bce910d9164785c9f0d4dcea4be359f5f92130c7c7833dea6138ab1db310a1f9","affectsGlobalScope":true},"7a435e0c814f58f23e9a0979045ec0ef5909aac95a70986e8bcce30c27dff228",{"version":"c81c51f43e343b6d89114b17341fb9d381c4ccbb25e0ee77532376052c801ba7","affectsGlobalScope":true},"db71be322f07f769200108aa19b79a75dd19a187c9dca2a30c4537b233aa2863","57135ce61976a8b1dadd01bb412406d1805b90db6e8ecb726d0d78e0b5f76050",{"version":"49479e21a040c0177d1b1bc05a124c0383df7a08a0726ad4d9457619642e875a","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","f302f3a47d7758f67f2afc753b9375d6504dde05d2e6ecdb1df50abbb131fc89","3690133deae19c8127c5505fcb67b04bdc9eb053796008538a9b9abbb70d85aa","5b1c0a23f464f894e7c2b2b6c56df7b9afa60ed48c5345f8618d389a636b2108","be2b092f2765222757c6441b86c53a5ea8dfed47bbc43eab4c5fe37942c866b3","8e6b05abc98adba15e1ac78e137c64576c74002e301d682e66feb77a23907ab8","1ca735bb3d407b2af4fbee7665f3a0a83be52168c728cc209755060ba7ed67bd",{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true},{"version":"b85c02e14ecb2a873dad5a1de72319b265160ba48f1b83661aeb3bba1366c1bc","affectsGlobalScope":true},"7a2ba0c9af860ac3e77b35ed01fd96d15986f17aa22fe40f188ae556fb1070df","fc3764040518a1008dd04bdc80964591b566b896283e00df85c95851c1f46237","55709608060f77965c270ac10ac646286589f1bd1cb174fff1778a2dd9a7ef31","790623a47c5eda62910098884ecb154dc0e5f3a23fc36c1bfb3b5b9ed44e2c2d","42b40e40f2a358cda332456214fad311e1806a6abf3cebaaac72496e07556642","354612fe1d49ecc9551ea3a27d94eef2887b64ef4a71f72ca444efe0f2f0ba80",{"version":"ac0c77cd7db52b3c278bdd1452ce754014835493d05b84535f46854fdc2063b2","affectsGlobalScope":true},"b9f36877501f2ce0e276e993c93cd2cf325e78d0409ec4612b1eb9d6a537e60b","5e2b91328a540a0933ab5c2203f4358918e6f0fe7505d22840a891a6117735f1","3abc3512fa04aa0230f59ea1019311fd8667bd935d28306311dccc8b17e79d5d",{"version":"14a50dafe3f45713f7f27cb6320dff07c6ac31678f07959c2134260061bf91ff","affectsGlobalScope":true},{"version":"19da7150ca062323b1db6311a6ef058c9b0a39cc64d836b5e9b75d301869653b","affectsGlobalScope":true},"1349077576abb41f0e9c78ec30762ff75b710208aff77f5fdcc6a8c8ce6289dd","e2ce82603102b5c0563f59fb40314cc1ff95a4d521a66ad14146e130ea80d89c","a3e0395220255a350aa9c6d56f882bfcb5b85c19fddf5419ec822cf22246a26d","c27b01e8ddff5cd280711af5e13aecd9a3228d1c256ea797dd64f8fdec5f7df5","898840e876dfd21843db9f2aa6ae38ba2eab550eb780ff62b894b9fbfebfae6b","0cab4d7d4edc40cd3af9eea7c3ed6d1016910c0954c49c4297e479bf3822a625","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","785e5be57d4f20f290a20e7b0c6263f6c57fd6e51283050756cef07d6d651c68","44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","164deb2409ac5f4da3cd139dbcee7f7d66753d90363a4d7e2db8d8874f272270",{"version":"ffc62d73b4fa10ca8c59f8802df88efefe447025730a24ee977b60adedc5bf37","affectsGlobalScope":true},{"version":"ab294c4b7279318ee2a8fdf681305457ecc05970c94108d304933f18823eeac1","affectsGlobalScope":true},"ad08154d9602429522cac965a715fde27d421d69b24756c5d291877dda75353e","5bc85813bfcb6907cc3a960fec8734a29d7884e0e372515147720c5991b8bc22","812b25f798033c202baedf386a1ccc41f9191b122f089bffd10fdccce99fba11","993325544790073f77e945bee046d53988c0bc3ac5695c9cf8098166feb82661",{"version":"75dd741ca6a6c8d2437a6ca8349b64b816421dbf9fe82dd026afaba965576962","affectsGlobalScope":true},{"version":"0e08c360c9b5961ecb0537b703e253842b3ded53151ee07024148219b61a8baf","affectsGlobalScope":true},"2ce2210032ccaff7710e2abf6a722e62c54960458e73e356b6a365c93ab6ca66","92db194ef7d208d5e4b6242a3434573fd142a621ff996d84cc9dbba3553277d0","16a3080e885ed52d4017c902227a8d0d8daf723d062bec9e45627c6fdcd6699b",{"version":"0bd9543cd8fc0959c76fb8f4f5a26626c2ed62ef4be98fd857bce268066db0a2","affectsGlobalScope":true},"1ca6858a0cbcd74d7db72d7b14c5360a928d1d16748a55ecfa6bfaff8b83071b",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"ebf3434b09c527078aa74139ff367fffa64fea32a01d6c06fb0a69b0ecadf43e","bf88ef4208a770ca39a844b182b3695df536326ea566893fdc5b8418702a331e","8b06ac3faeacb8484d84ddb44571d8f410697f98d7bfa86c0fda60373a9f5215","7eb06594824ada538b1d8b48c3925a83e7db792f47a081a62cf3e5c4e23cf0ee","f5638f7c2f12a9a1a57b5c41b3c1ea7db3876c003bab68e6a57afd6bcc169af0","6c1e688f95fcaf53b1e41c0fdadf2c1cfc96fa924eaf7f9fdb60f96deb0a4986","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","c085e9aa62d1ae1375794c1fb927a445fa105fed891a7e24edbb1c3300f7384a","f315e1e65a1f80992f0509e84e4ae2df15ecd9ef73df975f7c98813b71e4c8da","5b9586e9b0b6322e5bfbd2c29bd3b8e21ab9d871f82346cb71020e3d84bae73e","3e70a7e67c2cb16f8cd49097360c0309fe9d1e3210ff9222e9dac1f8df9d4fb6","ab68d2a3e3e8767c3fba8f80de099a1cfc18c0de79e42cb02ae66e22dfe14a66","6d969939c4a63f70f2aa49e88da6f64b655c8e6799612807bef41ccff6ea0da9",{"version":"b2fdcc3836d425833af10e536ae5491c34e218bc71870f12a401720f874b6ce4","affectsGlobalScope":true},"3411c785dbe8fd42f7d644d1e05a7e72b624774a08a9356479754999419c3c5a","8fb8fdda477cd7382477ffda92c2bb7d9f7ef583b1aa531eb6b2dc2f0a206c10","66995b0c991b5c5d42eff1d950733f85482c7419f7296ab8952e03718169e379","33f3795a4617f98b1bb8dac36312119d02f31897ae75436a1e109ce042b48ee8","2850c9c5dc28d34ad5f354117d0419f325fc8932d2a62eadc4dc52c018cd569b","c753948f7e0febe7aa1a5b71a714001a127a68861309b2c4127775aa9b6d4f24","3e7a40e023e1d4a9eef1a6f08a3ded8edacb67ae5fce072014205d730f717ba5","a77be6fc44c876bc10c897107f84eaba10790913ebdcad40fcda7e47469b2160","382100b010774614310d994bbf16cc9cd291c14f0d417126c7a7cfad1dc1d3f8","91f5dbcdb25d145a56cffe957ec665256827892d779ef108eb2f3864faff523b","4fdf56315340bd1770eb52e1601c3a98e45b1d207202831357e99ce29c35b55c","927955a3de5857e0a1c575ced5a4245e74e6821d720ed213141347dd1870197f","be6fd74528b32986fbf0cd2cfa9192a5ed7f369060b32a7adcb0c8d055708e61","cc256fd958b33576ed32c7338c64adb0d08fc0c2c6525010202fab83f32745da","fd0589ca571ad090b531d8c095e26caa53d4825c64d3ff2b2b1ab95d72294175",{"version":"669843ecafb89ae1e944df06360e8966219e4c1c34c0d28aa2503272cdd444a7","affectsGlobalScope":true},"d88a5e779faf033be3d52142a04fbe1cb96009868e3bbdd296b2bc6c59e06c0e","b0d10e46cfe3f6c476b69af02eaa38e4ccc7430221ce3109ae84bb9fb8282298","70e9a18da08294f75bf23e46c7d69e67634c0765d355887b9b41f0d959e1426e","e9eb1b173aa166892f3eddab182e49cfe59aa2e14d33aedb6b49d175ed6a3750"],"root":[[77,79]],"options":{"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":5,"outDir":"./","strict":true,"target":3},"fileIdsList":[[80,132],[132],[132,146],[67,132],[80,81,82,83,84,132],[80,82,132],[103,132,139],[132,141],[132,142],[132,148,151],[102,132,134,139,165,166,168],[132,167],[64,132],[52,54,55,56,57,58,59,60,61,62,63,64,132],[52,53,55,56,57,58,59,60,61,62,63,64,132],[53,54,55,56,57,58,59,60,61,62,63,64,132],[52,53,54,56,57,58,59,60,61,62,63,64,132],[52,53,54,55,57,58,59,60,61,62,63,64,132],[52,53,54,55,56,58,59,60,61,62,63,64,132],[52,53,54,55,56,57,59,60,61,62,63,64,132],[52,53,54,55,56,57,58,60,61,62,63,64,132],[52,53,54,55,56,57,58,59,61,62,63,64,132],[52,53,54,55,56,57,58,59,60,62,63,64,132],[52,53,54,55,56,57,58,59,60,61,63,64,132],[52,53,54,55,56,57,58,59,60,61,62,64,132],[52,53,54,55,56,57,58,59,60,61,62,63,132],[67,69,70,132],[86,132],[89,132],[90,95,123,132],[91,102,103,110,120,131,132],[91,92,102,110,132],[93,132],[94,95,103,111,132],[95,120,128,132],[96,98,102,110,132],[97,132],[98,99,132],[102,132],[100,102,132],[102,103,104,120,131,132],[102,103,104,117,120,123,132],[132,136],[98,102,105,110,120,131,132],[102,103,105,106,110,120,128,131,132],[105,107,120,128,131,132],[86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138],[102,108,132],[109,131,132],[98,102,110,120,132],[111,132],[112,132],[89,113,132],[114,130,132,136],[115,132],[116,132],[102,117,118,132],[117,119,132,134],[90,102,120,121,122,123,132],[90,120,122,132],[120,121,132],[123,132],[124,132],[120,132],[102,126,127,132],[126,127,132],[95,110,120,128,132],[129,132],[110,130,132],[90,105,116,131,132],[95,132],[120,132,133],[132,134],[132,135],[90,95,102,104,113,120,131,132,134,136],[120,132,137],[132,171],[89,132,139,144,150],[132,148],[132,145,149],[67,68,71,72,73,74,75,132],[132,154],[132,153,154],[132,153],[132,153,154,155,157,158,161,162,163,164],[132,154,158],[132,153,154,155,157,158,159,160],[132,153,158],[132,158,162],[132,154,155,156],[132,155],[132,153,154,158],[132,147],[51,65,66,76,77,132],[77,78,132],[76,78,132],[51,77],[78]],"referencedMap":[[82,1],[80,2],[144,2],[147,3],[68,2],[72,4],[146,2],[85,5],[81,1],[83,6],[84,1],[70,2],[140,7],[141,2],[142,8],[143,9],[152,10],[167,11],[168,12],[65,13],[66,13],[53,14],[54,15],[52,16],[55,17],[56,18],[57,19],[58,20],[59,21],[60,22],[61,23],[62,24],[63,25],[64,26],[67,2],[71,27],[86,28],[87,28],[89,29],[90,30],[91,31],[92,32],[93,33],[94,34],[95,35],[96,36],[97,37],[98,38],[99,38],[101,39],[100,40],[102,39],[103,41],[104,42],[88,43],[138,2],[105,44],[106,45],[107,46],[139,47],[108,48],[109,49],[110,50],[111,51],[112,52],[113,53],[114,54],[115,55],[116,56],[117,57],[118,57],[119,58],[120,59],[122,60],[121,61],[123,62],[124,63],[125,64],[126,65],[127,66],[128,67],[129,68],[130,69],[131,70],[132,71],[133,72],[134,73],[135,74],[136,75],[137,76],[69,2],[169,2],[170,2],[166,2],[171,2],[172,77],[145,2],[151,78],[73,2],[149,79],[150,80],[74,2],[76,81],[155,82],[164,83],[153,2],[154,84],[165,85],[160,86],[161,87],[159,88],[163,89],[157,90],[156,91],[162,92],[158,83],[75,2],[148,93],[51,2],[48,2],[49,2],[8,2],[9,2],[13,2],[12,2],[2,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[21,2],[3,2],[50,2],[22,2],[4,2],[23,2],[27,2],[24,2],[25,2],[26,2],[28,2],[29,2],[30,2],[5,2],[31,2],[32,2],[33,2],[34,2],[6,2],[38,2],[35,2],[36,2],[37,2],[39,2],[7,2],[40,2],[45,2],[46,2],[41,2],[42,2],[43,2],[44,2],[1,2],[47,2],[11,2],[10,2],[78,94],[79,95],[77,96]],"exportedModulesMap":[[82,1],[80,2],[144,2],[147,3],[68,2],[72,4],[146,2],[85,5],[81,1],[83,6],[84,1],[70,2],[140,7],[141,2],[142,8],[143,9],[152,10],[167,11],[168,12],[65,13],[66,13],[53,14],[54,15],[52,16],[55,17],[56,18],[57,19],[58,20],[59,21],[60,22],[61,23],[62,24],[63,25],[64,26],[67,2],[71,27],[86,28],[87,28],[89,29],[90,30],[91,31],[92,32],[93,33],[94,34],[95,35],[96,36],[97,37],[98,38],[99,38],[101,39],[100,40],[102,39],[103,41],[104,42],[88,43],[138,2],[105,44],[106,45],[107,46],[139,47],[108,48],[109,49],[110,50],[111,51],[112,52],[113,53],[114,54],[115,55],[116,56],[117,57],[118,57],[119,58],[120,59],[122,60],[121,61],[123,62],[124,63],[125,64],[126,65],[127,66],[128,67],[129,68],[130,69],[131,70],[132,71],[133,72],[134,73],[135,74],[136,75],[137,76],[69,2],[169,2],[170,2],[166,2],[171,2],[172,77],[145,2],[151,78],[73,2],[149,79],[150,80],[74,2],[76,81],[155,82],[164,83],[153,2],[154,84],[165,85],[160,86],[161,87],[159,88],[163,89],[157,90],[156,91],[162,92],[158,83],[75,2],[148,93],[51,2],[48,2],[49,2],[8,2],[9,2],[13,2],[12,2],[2,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[21,2],[3,2],[50,2],[22,2],[4,2],[23,2],[27,2],[24,2],[25,2],[26,2],[28,2],[29,2],[30,2],[5,2],[31,2],[32,2],[33,2],[34,2],[6,2],[38,2],[35,2],[36,2],[37,2],[39,2],[7,2],[40,2],[45,2],[46,2],[41,2],[42,2],[43,2],[44,2],[1,2],[47,2],[11,2],[10,2],[78,97],[77,98]],"semanticDiagnosticsPerFile":[82,80,144,147,68,72,146,85,81,83,84,70,140,141,142,143,152,167,168,65,66,53,54,52,55,56,57,58,59,60,61,62,63,64,67,71,86,87,89,90,91,92,93,94,95,96,97,98,99,101,100,102,103,104,88,138,105,106,107,139,108,109,110,111,112,113,114,115,116,117,118,119,120,122,121,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,69,169,170,166,171,172,145,151,73,149,150,74,76,155,164,153,154,165,160,161,159,163,157,156,162,158,75,148,51,48,49,8,9,13,12,2,14,15,16,17,18,19,20,21,3,50,22,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,1,47,11,10,78,79,77]},"version":"5.4.5"}
1
+ {"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2016.intl.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/typescript/lib/lib.es2016.full.d.ts","../src/data.ts","../node_modules/redom/index.d.ts","../node_modules/@types/lodash/common/common.d.ts","../node_modules/@types/lodash/common/array.d.ts","../node_modules/@types/lodash/common/collection.d.ts","../node_modules/@types/lodash/common/date.d.ts","../node_modules/@types/lodash/common/function.d.ts","../node_modules/@types/lodash/common/lang.d.ts","../node_modules/@types/lodash/common/math.d.ts","../node_modules/@types/lodash/common/number.d.ts","../node_modules/@types/lodash/common/object.d.ts","../node_modules/@types/lodash/common/seq.d.ts","../node_modules/@types/lodash/common/string.d.ts","../node_modules/@types/lodash/common/util.d.ts","../node_modules/@types/lodash/index.d.ts","../node_modules/@types/lodash.isequal/index.d.ts","../node_modules/@types/mapbox__point-geometry/index.d.ts","../node_modules/@mapbox/tiny-sdf/index.d.ts","../node_modules/@types/pbf/index.d.ts","../node_modules/@types/geojson/index.d.ts","../node_modules/@types/mapbox__vector-tile/index.d.ts","../node_modules/@maplibre/maplibre-gl-style-spec/dist/index.d.ts","../node_modules/@types/geojson-vt/index.d.ts","../node_modules/gl-matrix/index.d.ts","../node_modules/kdbush/index.d.ts","../node_modules/potpack/index.d.ts","../node_modules/@types/supercluster/index.d.ts","../node_modules/maplibre-gl/dist/maplibre-gl.d.ts","../src/urlhash.ts","../src/layerswitcher.ts","../src/index.ts","../src/urlhash.test.ts","../node_modules/@babel/types/lib/index.d.ts","../node_modules/@types/babel__generator/index.d.ts","../node_modules/@babel/parser/typings/babel-parser.d.ts","../node_modules/@types/babel__template/index.d.ts","../node_modules/@types/babel__traverse/index.d.ts","../node_modules/@types/babel__core/index.d.ts","../node_modules/@types/estree/index.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@types/graceful-fs/index.d.ts","../node_modules/@types/istanbul-lib-coverage/index.d.ts","../node_modules/@types/istanbul-lib-report/index.d.ts","../node_modules/@types/istanbul-reports/index.d.ts","../node_modules/@jest/expect-utils/build/index.d.ts","../node_modules/chalk/index.d.ts","../node_modules/@sinclair/typebox/typebox.d.ts","../node_modules/@jest/schemas/build/index.d.ts","../node_modules/pretty-format/build/index.d.ts","../node_modules/jest-diff/build/index.d.ts","../node_modules/jest-matcher-utils/build/index.d.ts","../node_modules/expect/build/index.d.ts","../node_modules/@types/jest/index.d.ts","../node_modules/parse5/dist/common/html.d.ts","../node_modules/parse5/dist/common/token.d.ts","../node_modules/parse5/dist/common/error-codes.d.ts","../node_modules/parse5/dist/tokenizer/preprocessor.d.ts","../node_modules/parse5/dist/tokenizer/index.d.ts","../node_modules/parse5/dist/tree-adapters/interface.d.ts","../node_modules/parse5/dist/parser/open-element-stack.d.ts","../node_modules/parse5/dist/parser/formatting-element-list.d.ts","../node_modules/parse5/dist/parser/index.d.ts","../node_modules/parse5/dist/tree-adapters/default.d.ts","../node_modules/parse5/dist/serializer/index.d.ts","../node_modules/parse5/dist/common/foreign-content.d.ts","../node_modules/parse5/dist/index.d.ts","../node_modules/@types/tough-cookie/index.d.ts","../node_modules/@types/jsdom/base.d.ts","../node_modules/@types/jsdom/index.d.ts","../node_modules/@types/prettier/index.d.ts","../node_modules/@types/stack-utils/index.d.ts","../node_modules/@types/yargs-parser/index.d.ts","../node_modules/@types/yargs/index.d.ts"],"fileInfos":[{"version":"824cb491a40f7e8fdeb56f1df5edf91b23f3e3ee6b4cde84d4a99be32338faee","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4",{"version":"87d693a4920d794a73384b3c779cadcb8548ac6945aa7a925832fe2418c9527a","affectsGlobalScope":true},{"version":"76f838d5d49b65de83bc345c04aa54c62a3cfdb72a477dc0c0fce89a30596c30","affectsGlobalScope":true},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true},{"version":"138fb588d26538783b78d1e3b2c2cc12d55840b97bf5e08bca7f7a174fbe2f17","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"b20fe0eca9a4e405f1a5ae24a2b3290b37cf7f21eba6cbe4fc3fab979237d4f3","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"49ed889be54031e1044af0ad2c603d627b8bda8b50c1a68435fe85583901d072","affectsGlobalScope":true},{"version":"e93d098658ce4f0c8a0779e6cab91d0259efb88a318137f686ad76f8410ca270","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"8073890e29d2f46fdbc19b8d6d2eb9ea58db9a2052f8640af20baff9afbc8640","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"13f6e6380c78e15e140243dc4be2fa546c287c6d61f4729bc2dd7cf449605471","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"807e0e0bdc67605dd28efe18f20ab5fcd75d944ef95936120702335f9379094b",{"version":"adf70476cffcfe6dcd30f98a1b12a23328592a372c72b50df3d1e42d625ce28e","signature":"9eb2d068482efaa4cf5bbdadaa8753fb5a0fc0b105f4c2e8dd5ffe498acd0fa0"},"332f8e56efa13b367cb696e2036918d80887b13177c12acda6d49ee145c333ca","675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","458111fc89d11d2151277c822dfdc1a28fa5b6b2493cf942e37d4cd0a6ee5f22","19c816167e076e7c24f074389c6cf3ed87bdbb917d1ea439ca281f9d26db2439","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","febf0b2de54781102b00f61653b21377390a048fbf5262718c91860d11ff34a6","98f9d826db9cd99d27a01a59ee5f22863df00ccf1aaf43e1d7db80ebf716f7c3","0aaef8cded245bf5036a7a40b65622dd6c4da71f7a35343112edbe112b348a1e","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","dcd91d3b697cb650b95db5471189b99815af5db2a1cd28760f91e0b12ede8ed5","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3cf0d343c2276842a5b617f22ba82af6322c7cfe8bb52238ffc0c491a3c21019","df996e25faa505f85aeb294d15ebe61b399cf1d1e49959cdfaf2cc0815c203f9",{"version":"f2eff8704452659641164876c1ef0df4174659ce7311b0665798ea3f556fa9ad","affectsGlobalScope":true},"6bb8d7433a29fbd33df8e9693f1788a273a9eb90b96c8f99c745678c7db623f1","ae4cda96b058f20db053c1f57e51257d1cffff9c0880326d2b8129ade5363402","bc8b2489bf29fa17cf4e7d5a4447daa456d7caf61455f50aafc34f1f3b915727","12115a2a03125cb3f600e80e7f43ef57f71a2951bb6e60695fb00ac8e12b27f3","40e9aaa923bacffacfcd4b619b862c023245f03c67df28c49515bccd26e5f9a0","02f7c65c690af708e9da6b09698c86d34b6b39a05acd8288a079859d920aea9f","bee07c40dc144c343de33e95de92136c7797181ee75fd57b910b670c1e255049","37550007de426cbbb418582008deae1a508935eaebbd4d41e22805ad3b485ad4","6b729c3274f6d4738fe470109bcb08b09ef98a6b356c01da3ca8dc0996b4458b","4dbf094f9d643b74e516779a802d9c5debd2929fb875ccfbc608d61afba064e4","828ea2cf5792eba68ebd41d6dd17ac67d31622b7889965210f8fa50a6eb29eba","e3913b35c221b4468658743d6496b83323c895f8e5b566c48d8844c01bf24738","60a5de2e20d5d925ddc58570831c6d849ce9a88f5eb1d190e27d1a52ab7263b0",{"version":"44906fac6e1d10d1901a8fbba7ef79e4c983813bbf512830d7daba3af5f8a6f7","signature":"a2e84d32f0e671959bf6533fa41a86712dbffb6cd5b5deb728fbd8b7d8462a7d"},{"version":"cbdf2e31b569ee1aa29ac08d2a605b4f4bc19abd4fc095d3d2b95288d1838eb1","signature":"af8157056827d109ee1f0d1f520927ccb1f71f0f5871b04a6e167d0059eab223"},{"version":"0f587778e3837c12c2db0fdae52acfbcb9a066b22e9b5f0fec3b12f1916097f7","signature":"9d36206a1dceb3d6b0d64ac55f036ee09ca40cb5085e65fa2c5e861f8bad84e8"},{"version":"059350b514633f4b367cc0194d7f985ae173d2fdf74e8411dc194b427b093d86","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"7983487d0fbefb9b6ccc94390e8c826328d87e21cd4a62ea5b4c6b8f99f32550","cc957354aa3c94c9961ebf46282cfde1e81d107fc5785a61f62c67f1dd3ac2eb","9d16476349353974716bd2ad745830d0542c18c9edad4566d77ccd9d61c6cfb2","93de1c6dab503f053efe8d304cb522bb3a89feab8c98f307a674a4fae04773e9","6704f0b54df85640baaeebd86c9d4a1dbb661d5a4d57a75bc84162f562f6531d","9d255af1b09c6697089d3c9bf438292a298d8b7a95c68793c9aae80afc9e5ca7","785b9d575b49124ce01b46f5b9402157c7611e6532effa562ac6aebec0074dfc","587f13f1e8157bd8cec0adda0de4ef558bb8573daa9d518d1e2af38e87ecc91f","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"bce910d9164785c9f0d4dcea4be359f5f92130c7c7833dea6138ab1db310a1f9","affectsGlobalScope":true},"7a435e0c814f58f23e9a0979045ec0ef5909aac95a70986e8bcce30c27dff228",{"version":"c81c51f43e343b6d89114b17341fb9d381c4ccbb25e0ee77532376052c801ba7","affectsGlobalScope":true},"db71be322f07f769200108aa19b79a75dd19a187c9dca2a30c4537b233aa2863","57135ce61976a8b1dadd01bb412406d1805b90db6e8ecb726d0d78e0b5f76050",{"version":"49479e21a040c0177d1b1bc05a124c0383df7a08a0726ad4d9457619642e875a","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","f302f3a47d7758f67f2afc753b9375d6504dde05d2e6ecdb1df50abbb131fc89","3690133deae19c8127c5505fcb67b04bdc9eb053796008538a9b9abbb70d85aa","5b1c0a23f464f894e7c2b2b6c56df7b9afa60ed48c5345f8618d389a636b2108","be2b092f2765222757c6441b86c53a5ea8dfed47bbc43eab4c5fe37942c866b3","8e6b05abc98adba15e1ac78e137c64576c74002e301d682e66feb77a23907ab8","1ca735bb3d407b2af4fbee7665f3a0a83be52168c728cc209755060ba7ed67bd",{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true},{"version":"b85c02e14ecb2a873dad5a1de72319b265160ba48f1b83661aeb3bba1366c1bc","affectsGlobalScope":true},"7a2ba0c9af860ac3e77b35ed01fd96d15986f17aa22fe40f188ae556fb1070df","fc3764040518a1008dd04bdc80964591b566b896283e00df85c95851c1f46237","55709608060f77965c270ac10ac646286589f1bd1cb174fff1778a2dd9a7ef31","790623a47c5eda62910098884ecb154dc0e5f3a23fc36c1bfb3b5b9ed44e2c2d","42b40e40f2a358cda332456214fad311e1806a6abf3cebaaac72496e07556642","354612fe1d49ecc9551ea3a27d94eef2887b64ef4a71f72ca444efe0f2f0ba80",{"version":"ac0c77cd7db52b3c278bdd1452ce754014835493d05b84535f46854fdc2063b2","affectsGlobalScope":true},"b9f36877501f2ce0e276e993c93cd2cf325e78d0409ec4612b1eb9d6a537e60b","5e2b91328a540a0933ab5c2203f4358918e6f0fe7505d22840a891a6117735f1","3abc3512fa04aa0230f59ea1019311fd8667bd935d28306311dccc8b17e79d5d",{"version":"14a50dafe3f45713f7f27cb6320dff07c6ac31678f07959c2134260061bf91ff","affectsGlobalScope":true},{"version":"19da7150ca062323b1db6311a6ef058c9b0a39cc64d836b5e9b75d301869653b","affectsGlobalScope":true},"1349077576abb41f0e9c78ec30762ff75b710208aff77f5fdcc6a8c8ce6289dd","e2ce82603102b5c0563f59fb40314cc1ff95a4d521a66ad14146e130ea80d89c","a3e0395220255a350aa9c6d56f882bfcb5b85c19fddf5419ec822cf22246a26d","c27b01e8ddff5cd280711af5e13aecd9a3228d1c256ea797dd64f8fdec5f7df5","898840e876dfd21843db9f2aa6ae38ba2eab550eb780ff62b894b9fbfebfae6b","0cab4d7d4edc40cd3af9eea7c3ed6d1016910c0954c49c4297e479bf3822a625","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","785e5be57d4f20f290a20e7b0c6263f6c57fd6e51283050756cef07d6d651c68","44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","164deb2409ac5f4da3cd139dbcee7f7d66753d90363a4d7e2db8d8874f272270",{"version":"ffc62d73b4fa10ca8c59f8802df88efefe447025730a24ee977b60adedc5bf37","affectsGlobalScope":true},{"version":"ab294c4b7279318ee2a8fdf681305457ecc05970c94108d304933f18823eeac1","affectsGlobalScope":true},"ad08154d9602429522cac965a715fde27d421d69b24756c5d291877dda75353e","5bc85813bfcb6907cc3a960fec8734a29d7884e0e372515147720c5991b8bc22","812b25f798033c202baedf386a1ccc41f9191b122f089bffd10fdccce99fba11","993325544790073f77e945bee046d53988c0bc3ac5695c9cf8098166feb82661",{"version":"75dd741ca6a6c8d2437a6ca8349b64b816421dbf9fe82dd026afaba965576962","affectsGlobalScope":true},{"version":"0e08c360c9b5961ecb0537b703e253842b3ded53151ee07024148219b61a8baf","affectsGlobalScope":true},"2ce2210032ccaff7710e2abf6a722e62c54960458e73e356b6a365c93ab6ca66","92db194ef7d208d5e4b6242a3434573fd142a621ff996d84cc9dbba3553277d0","16a3080e885ed52d4017c902227a8d0d8daf723d062bec9e45627c6fdcd6699b",{"version":"0bd9543cd8fc0959c76fb8f4f5a26626c2ed62ef4be98fd857bce268066db0a2","affectsGlobalScope":true},"1ca6858a0cbcd74d7db72d7b14c5360a928d1d16748a55ecfa6bfaff8b83071b",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"ebf3434b09c527078aa74139ff367fffa64fea32a01d6c06fb0a69b0ecadf43e","bf88ef4208a770ca39a844b182b3695df536326ea566893fdc5b8418702a331e","8b06ac3faeacb8484d84ddb44571d8f410697f98d7bfa86c0fda60373a9f5215","7eb06594824ada538b1d8b48c3925a83e7db792f47a081a62cf3e5c4e23cf0ee","f5638f7c2f12a9a1a57b5c41b3c1ea7db3876c003bab68e6a57afd6bcc169af0","6c1e688f95fcaf53b1e41c0fdadf2c1cfc96fa924eaf7f9fdb60f96deb0a4986","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","c085e9aa62d1ae1375794c1fb927a445fa105fed891a7e24edbb1c3300f7384a","f315e1e65a1f80992f0509e84e4ae2df15ecd9ef73df975f7c98813b71e4c8da","5b9586e9b0b6322e5bfbd2c29bd3b8e21ab9d871f82346cb71020e3d84bae73e","3e70a7e67c2cb16f8cd49097360c0309fe9d1e3210ff9222e9dac1f8df9d4fb6","ab68d2a3e3e8767c3fba8f80de099a1cfc18c0de79e42cb02ae66e22dfe14a66","6d969939c4a63f70f2aa49e88da6f64b655c8e6799612807bef41ccff6ea0da9",{"version":"b2fdcc3836d425833af10e536ae5491c34e218bc71870f12a401720f874b6ce4","affectsGlobalScope":true},"3411c785dbe8fd42f7d644d1e05a7e72b624774a08a9356479754999419c3c5a","8fb8fdda477cd7382477ffda92c2bb7d9f7ef583b1aa531eb6b2dc2f0a206c10","66995b0c991b5c5d42eff1d950733f85482c7419f7296ab8952e03718169e379","33f3795a4617f98b1bb8dac36312119d02f31897ae75436a1e109ce042b48ee8","2850c9c5dc28d34ad5f354117d0419f325fc8932d2a62eadc4dc52c018cd569b","c753948f7e0febe7aa1a5b71a714001a127a68861309b2c4127775aa9b6d4f24","3e7a40e023e1d4a9eef1a6f08a3ded8edacb67ae5fce072014205d730f717ba5","a77be6fc44c876bc10c897107f84eaba10790913ebdcad40fcda7e47469b2160","382100b010774614310d994bbf16cc9cd291c14f0d417126c7a7cfad1dc1d3f8","91f5dbcdb25d145a56cffe957ec665256827892d779ef108eb2f3864faff523b","4fdf56315340bd1770eb52e1601c3a98e45b1d207202831357e99ce29c35b55c","927955a3de5857e0a1c575ced5a4245e74e6821d720ed213141347dd1870197f","be6fd74528b32986fbf0cd2cfa9192a5ed7f369060b32a7adcb0c8d055708e61","cc256fd958b33576ed32c7338c64adb0d08fc0c2c6525010202fab83f32745da","fd0589ca571ad090b531d8c095e26caa53d4825c64d3ff2b2b1ab95d72294175",{"version":"669843ecafb89ae1e944df06360e8966219e4c1c34c0d28aa2503272cdd444a7","affectsGlobalScope":true},"d88a5e779faf033be3d52142a04fbe1cb96009868e3bbdd296b2bc6c59e06c0e","b0d10e46cfe3f6c476b69af02eaa38e4ccc7430221ce3109ae84bb9fb8282298","70e9a18da08294f75bf23e46c7d69e67634c0765d355887b9b41f0d959e1426e","e9eb1b173aa166892f3eddab182e49cfe59aa2e14d33aedb6b49d175ed6a3750"],"root":[51,[79,82]],"options":{"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":5,"outDir":"./","strict":true,"target":3},"fileIdsList":[[83,136],[136],[136,150],[83,84,85,86,87,136],[83,85,136],[70,136],[107,136,143],[136,145],[136,146],[136,152,155],[106,136,138,143,169,170,172],[136,171],[65,136],[53,55,56,57,58,59,60,61,62,63,64,65,136],[53,54,56,57,58,59,60,61,62,63,64,65,136],[54,55,56,57,58,59,60,61,62,63,64,65,136],[53,54,55,57,58,59,60,61,62,63,64,65,136],[53,54,55,56,58,59,60,61,62,63,64,65,136],[53,54,55,56,57,59,60,61,62,63,64,65,136],[53,54,55,56,57,58,60,61,62,63,64,65,136],[53,54,55,56,57,58,59,61,62,63,64,65,136],[53,54,55,56,57,58,59,60,62,63,64,65,136],[53,54,55,56,57,58,59,60,61,63,64,65,136],[53,54,55,56,57,58,59,60,61,62,64,65,136],[53,54,55,56,57,58,59,60,61,62,63,65,136],[53,54,55,56,57,58,59,60,61,62,63,64,136],[67,69,70,136],[90,136],[93,136],[94,99,127,136],[95,106,107,114,124,135,136],[95,96,106,114,136],[97,136],[98,99,107,115,136],[99,124,132,136],[100,102,106,114,136],[101,136],[102,103,136],[106,136],[104,106,136],[106,107,108,124,135,136],[106,107,108,121,124,127,136],[136,140],[102,106,109,114,124,135,136],[106,107,109,110,114,124,132,135,136],[109,111,124,132,135,136],[90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142],[106,112,136],[113,135,136],[102,106,114,124,136],[115,136],[116,136],[93,117,136],[118,134,136,140],[119,136],[120,136],[106,121,122,136],[121,123,136,138],[94,106,124,125,126,127,136],[94,124,126,136],[124,125,136],[127,136],[128,136],[124,136],[106,130,131,136],[130,131,136],[99,114,124,132,136],[133,136],[114,134,136],[94,109,120,135,136],[99,136],[124,136,137],[136,138],[136,139],[94,99,106,108,117,124,135,136,138,140],[124,136,141],[136,175],[93,136,143,148,154],[136,152],[136,149,153],[67,68,71,72,73,74,75,76,77,136],[136,158],[136,157,158],[136,157],[136,157,158,159,161,162,165,166,167,168],[136,158,162],[136,157,158,159,161,162,163,164],[136,157,162],[136,162,166],[136,158,159,160],[136,159],[136,157,158,162],[136,151],[51,79,80,136],[51,52,66,78,79,136],[79,80,136],[78,80,136],[51,79,80],[51,78,79],[78,80]],"referencedMap":[[85,1],[83,2],[148,2],[151,3],[68,2],[72,2],[150,2],[88,4],[84,1],[86,5],[87,1],[89,2],[73,6],[70,2],[144,7],[145,2],[146,8],[147,9],[156,10],[171,11],[172,12],[66,13],[54,14],[55,15],[53,16],[56,17],[57,18],[58,19],[59,20],[60,21],[61,22],[62,23],[63,24],[64,25],[65,26],[67,2],[71,27],[90,28],[91,28],[93,29],[94,30],[95,31],[96,32],[97,33],[98,34],[99,35],[100,36],[101,37],[102,38],[103,38],[105,39],[104,40],[106,39],[107,41],[108,42],[92,43],[142,2],[109,44],[110,45],[111,46],[143,47],[112,48],[113,49],[114,50],[115,51],[116,52],[117,53],[118,54],[119,55],[120,56],[121,57],[122,57],[123,58],[124,59],[126,60],[125,61],[127,62],[128,63],[129,64],[130,65],[131,66],[132,67],[133,68],[134,69],[135,70],[136,71],[137,72],[138,73],[139,74],[140,75],[141,76],[69,2],[173,2],[174,2],[77,6],[170,2],[175,2],[176,77],[149,2],[155,78],[74,2],[153,79],[154,80],[75,2],[78,81],[159,82],[168,83],[157,2],[158,84],[169,85],[164,86],[165,87],[163,88],[167,89],[161,90],[160,91],[166,92],[162,83],[76,2],[152,93],[52,2],[48,2],[49,2],[8,2],[9,2],[13,2],[12,2],[2,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[21,2],[3,2],[50,2],[22,2],[4,2],[23,2],[27,2],[24,2],[25,2],[26,2],[28,2],[29,2],[30,2],[5,2],[31,2],[32,2],[33,2],[34,2],[6,2],[38,2],[35,2],[36,2],[37,2],[39,2],[7,2],[40,2],[45,2],[46,2],[41,2],[42,2],[43,2],[44,2],[1,2],[47,2],[11,2],[10,2],[51,2],[81,94],[80,95],[82,96],[79,97]],"exportedModulesMap":[[85,1],[83,2],[148,2],[151,3],[68,2],[72,2],[150,2],[88,4],[84,1],[86,5],[87,1],[89,2],[73,6],[70,2],[144,7],[145,2],[146,8],[147,9],[156,10],[171,11],[172,12],[66,13],[54,14],[55,15],[53,16],[56,17],[57,18],[58,19],[59,20],[60,21],[61,22],[62,23],[63,24],[64,25],[65,26],[67,2],[71,27],[90,28],[91,28],[93,29],[94,30],[95,31],[96,32],[97,33],[98,34],[99,35],[100,36],[101,37],[102,38],[103,38],[105,39],[104,40],[106,39],[107,41],[108,42],[92,43],[142,2],[109,44],[110,45],[111,46],[143,47],[112,48],[113,49],[114,50],[115,51],[116,52],[117,53],[118,54],[119,55],[120,56],[121,57],[122,57],[123,58],[124,59],[126,60],[125,61],[127,62],[128,63],[129,64],[130,65],[131,66],[132,67],[133,68],[134,69],[135,70],[136,71],[137,72],[138,73],[139,74],[140,75],[141,76],[69,2],[173,2],[174,2],[77,6],[170,2],[175,2],[176,77],[149,2],[155,78],[74,2],[153,79],[154,80],[75,2],[78,81],[159,82],[168,83],[157,2],[158,84],[169,85],[164,86],[165,87],[163,88],[167,89],[161,90],[160,91],[166,92],[162,83],[76,2],[152,93],[52,2],[48,2],[49,2],[8,2],[9,2],[13,2],[12,2],[2,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[20,2],[21,2],[3,2],[50,2],[22,2],[4,2],[23,2],[27,2],[24,2],[25,2],[26,2],[28,2],[29,2],[30,2],[5,2],[31,2],[32,2],[33,2],[34,2],[6,2],[38,2],[35,2],[36,2],[37,2],[39,2],[7,2],[40,2],[45,2],[46,2],[41,2],[42,2],[43,2],[44,2],[1,2],[47,2],[11,2],[10,2],[81,98],[80,99],[79,100]],"semanticDiagnosticsPerFile":[85,83,148,151,68,72,150,88,84,86,87,89,73,70,144,145,146,147,156,171,172,66,54,55,53,56,57,58,59,60,61,62,63,64,65,67,71,90,91,93,94,95,96,97,98,99,100,101,102,103,105,104,106,107,108,92,142,109,110,111,143,112,113,114,115,116,117,118,119,120,121,122,123,124,126,125,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,69,173,174,77,170,175,176,149,155,74,153,154,75,78,159,168,157,158,169,164,165,163,167,161,160,166,162,76,152,52,48,49,8,9,13,12,2,14,15,16,17,18,19,20,21,3,50,22,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,1,47,11,10,51,81,80,82,79]},"version":"5.4.5"}
package/lib/urlhash.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import LayerSwitcher from './index';
1
+ import LayerSwitcher from './layerswitcher';
2
+ import type maplibregl from 'maplibre-gl';
2
3
  export interface HashComponents {
3
4
  zoom?: number;
4
5
  center?: [number, number];
@@ -8,6 +9,9 @@ export interface HashComponents {
8
9
  export declare function decodeHash(hash: string): HashComponents;
9
10
  export declare function encodeHash(components: HashComponents): string;
10
11
  type ParameterCallbackFunction = (value: string | null) => void;
12
+ /**
13
+ * Object to manage the URL hash for a Maplibre GL JS map.
14
+ */
11
15
  declare class URLHash {
12
16
  layerSwitcher: LayerSwitcher;
13
17
  _map: maplibregl.Map | undefined;
@@ -39,7 +43,7 @@ declare class URLHash {
39
43
  * Modify MapLibre GL map constructor options to include values from the URL hash.
40
44
  *
41
45
  * @param options the original options passed to the MapLibre GL `Map` constructor.
42
- * You should include defaults for the `center` and `zoom` parameters.
46
+ * You can include defaults for the `center` and `zoom` parameters.
43
47
  * @returns an options object to be passed to the `Map` constructor, with the
44
48
  * `center` and `zoom` parameters updated if necessary. Other options are untouched.
45
49
  */
@@ -1 +1 @@
1
- {"version":3,"file":"urlhash.d.ts","sourceRoot":"","sources":["../src/urlhash.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,SAAS,CAAC;AAGpC,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAsBvD;AAED,wBAAgB,UAAU,CAAC,UAAU,EAAE,cAAc,GAAG,MAAM,CA2B7D;AAED,KAAK,yBAAyB,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;AAEhE,cAAM,OAAO;IACX,aAAa,EAAE,aAAa,CAAC;IAC7B,IAAI,EAAE,UAAU,CAAC,GAAG,GAAG,SAAS,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC;gBAExC,aAAa,EAAE,aAAa;IAMxC,MAAM,CAAC,GAAG,EAAE,UAAU,CAAC,GAAG;IAkB1B;;;;;;OAMG;IACH,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,yBAAyB;IAI/D;;;;;;OAMG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAW9C,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAMtD,aAAa,CAAC,QAAQ,EAAE,MAAM;IA6B9B,WAAW;IASX,aAAa;IAkBb;;;;;;;OAOG;IACH,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU;CAS5D;AAED,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"urlhash.d.ts","sourceRoot":"","sources":["../src/urlhash.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,UAAU,MAAM,aAAa,CAAA;AAEzC,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACzB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACnC;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAsBvD;AAED,wBAAgB,UAAU,CAAC,UAAU,EAAE,cAAc,GAAG,MAAM,CA2B7D;AAED,KAAK,yBAAyB,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;AAE/D;;GAEG;AACH,cAAM,OAAO;IACX,aAAa,EAAE,aAAa,CAAA;IAC5B,IAAI,EAAE,UAAU,CAAC,GAAG,GAAG,SAAS,CAAA;IAChC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAClC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAA;gBAEvC,aAAa,EAAE,aAAa;IAMxC,MAAM,CAAC,GAAG,EAAE,UAAU,CAAC,GAAG;IAmB1B;;;;;;OAMG;IACH,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,yBAAyB;IAI/D;;;;;;OAMG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAW9C,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAMtD,aAAa,CAAC,QAAQ,EAAE,MAAM;IA6B9B,WAAW;IASX,aAAa;IAkBb;;;;;;;OAOG;IACH,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU;CAS5D;AAED,eAAe,OAAO,CAAA"}
package/lib/urlhash.js CHANGED
@@ -40,6 +40,9 @@ export function encodeHash(components) {
40
40
  }
41
41
  return hash;
42
42
  }
43
+ /**
44
+ * Object to manage the URL hash for a Maplibre GL JS map.
45
+ */
43
46
  class URLHash {
44
47
  constructor(layerSwitcher) {
45
48
  this.layerSwitcher = layerSwitcher;
@@ -48,6 +51,7 @@ class URLHash {
48
51
  }
49
52
  enable(map) {
50
53
  this._map = map;
54
+ this.layerSwitcher.urlhash = this;
51
55
  this._onHashChange(window.location.hash);
52
56
  map.on('moveend', () => {
53
57
  this._updateHash();
@@ -109,7 +113,7 @@ class URLHash {
109
113
  if (((_a = this._map) === null || _a === void 0 ? void 0 : _a.isStyleLoaded()) && hash.center && hash.zoom) {
110
114
  this._map.jumpTo({
111
115
  center: hash.center,
112
- zoom: hash.zoom,
116
+ zoom: hash.zoom
113
117
  });
114
118
  }
115
119
  if (this.layerSwitcher && hash.layers !== undefined) {
@@ -133,7 +137,7 @@ class URLHash {
133
137
  const components = {
134
138
  center: [lng, lat],
135
139
  zoom: this._map.getZoom(),
136
- additional: this.additional,
140
+ additional: this.additional
137
141
  };
138
142
  if (this.layerSwitcher) {
139
143
  components.layers = this.layerSwitcher.getURLString();
@@ -144,7 +148,7 @@ class URLHash {
144
148
  * Modify MapLibre GL map constructor options to include values from the URL hash.
145
149
  *
146
150
  * @param options the original options passed to the MapLibre GL `Map` constructor.
147
- * You should include defaults for the `center` and `zoom` parameters.
151
+ * You can include defaults for the `center` and `zoom` parameters.
148
152
  * @returns an options object to be passed to the `Map` constructor, with the
149
153
  * `center` and `zoom` parameters updated if necessary. Other options are untouched.
150
154
  */
@@ -1,17 +1,17 @@
1
- import LayerSwitcher from '.';
1
+ import LayerSwitcher from './layerswitcher';
2
2
  import URLHash, { decodeHash, encodeHash } from './urlhash';
3
3
  test('decodeHash', () => {
4
4
  expect(decodeHash('#10/51.505/-0.09')).toStrictEqual({
5
5
  center: [-0.09, 51.505],
6
6
  zoom: 10,
7
7
  layers: '',
8
- additional: {},
8
+ additional: {}
9
9
  });
10
10
  expect(decodeHash('#10/51.505/-0.09/A,B,C')).toStrictEqual({
11
11
  center: [-0.09, 51.505],
12
12
  zoom: 10,
13
13
  layers: 'A,B,C',
14
- additional: {},
14
+ additional: {}
15
15
  });
16
16
  });
17
17
  test('Test hash encoding round trip', () => {
@@ -27,7 +27,7 @@ test('Test hash encoding round trip', () => {
27
27
  expect(decodeHash(encodeHash(components))).toStrictEqual(components);
28
28
  });
29
29
  test('test URLHash class', () => {
30
- let layer_switcher = new LayerSwitcher({}, []);
30
+ let layer_switcher = new LayerSwitcher([]);
31
31
  let url_hash = new URLHash(layer_switcher);
32
32
  let returned_value = null;
33
33
  url_hash.registerHandler('a', (value) => {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@russss/maplibregl-layer-switcher",
3
- "version": "1.2.4",
3
+ "version": "2.0.0",
4
+ "type": "module",
4
5
  "description": "Layer switcher for Maplibre GL JS based on layer prefixes",
5
6
  "exports": {
6
- ".": "./lib/index.js",
7
- "./urlhash": "./lib/urlhash.js"
7
+ ".": "./lib/index.js"
8
8
  },
9
9
  "types": "./lib/index.d.ts",
10
10
  "scripts": {
@@ -13,20 +13,24 @@
13
13
  },
14
14
  "author": "Russ Garrett",
15
15
  "license": "ISC",
16
+ "repository": {
17
+ "url": "https://github.com/russss/maplibregl-layer-switcher",
18
+ "type": "git"
19
+ },
16
20
  "dependencies": {
17
- "lodash.invert": "^4.3.0",
18
21
  "lodash.isequal": "^4.5.0",
19
22
  "redom": "^3.24.2"
20
23
  },
21
24
  "devDependencies": {
25
+ "ts-node": "^10.9.2",
22
26
  "@types/jest": "^29.5.3",
23
- "@types/lodash.invert": "^4.3.7",
24
27
  "@types/lodash.isequal": "^4.5.6",
25
28
  "jest": "^29.6.1",
26
29
  "jest-environment-jsdom": "^29.6.1",
27
- "maplibre-gl": "^3.1.0",
28
- "prettier": "^3.0.0",
30
+ "maplibre-gl": "^4.7.1",
31
+ "prettier": "^3.3.3",
29
32
  "ts-jest": "^29.1.1",
30
- "typescript": "^5.3.3"
33
+ "typescript": "^5.3.3",
34
+ "vite": "^5.4.8"
31
35
  }
32
36
  }