@defra/interactive-map 0.0.58-alpha → 0.0.60-alpha

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.
Files changed (140) hide show
  1. package/assets/templates/add-polygons.njk +2 -2
  2. package/assets/templates/add-symbols.njk +2 -2
  3. package/dist/css/index.css +1 -1
  4. package/dist/esm/im-core.js +1 -1
  5. package/dist/esm/im-shell.js +1 -1
  6. package/dist/umd/im-core.js +1 -1
  7. package/dist/umd/index.js +1 -1
  8. package/docs/api/panel-definition.md +30 -0
  9. package/docs/api/symbol-config.md +12 -0
  10. package/docs/api.md +21 -2
  11. package/docs/assets/images/slot-map.svg +3 -3
  12. package/docs/plugins/datasets.md +11 -1
  13. package/docs/plugins/draw.md +95 -13
  14. package/package.json +1 -1
  15. package/plugins/datasets/dist/esm/index.js +1 -1
  16. package/plugins/datasets/dist/esm/layerAdapter.js +1 -1
  17. package/plugins/datasets/dist/umd/im-datasets-ml-adapter.js +1 -1
  18. package/plugins/datasets/dist/umd/im-datasets-ol-adapter.js +1 -1
  19. package/plugins/datasets/dist/umd/im-datasets-plugin.js +1 -1
  20. package/plugins/datasets/dist/umd/index.js +1 -1
  21. package/plugins/datasets/src/index.js +0 -1
  22. package/plugins/datasets/src/index.test.js +2 -8
  23. package/plugins/datasets/src/registry/dataset.test.js +9 -0
  24. package/plugins/draw/dist/esm/im-draw-ml-adapter.js +1 -1
  25. package/plugins/draw/dist/esm/im-draw-ol-adapter.js +1 -1
  26. package/plugins/draw/dist/esm/im-draw-plugin.js +1 -1
  27. package/plugins/draw/dist/esm/index.js +1 -1
  28. package/plugins/draw/dist/esm/liveDrawChecks.js +1 -1
  29. package/plugins/draw/dist/umd/im-draw-ml-adapter.js +1 -1
  30. package/plugins/draw/dist/umd/im-draw-ol-adapter.js +1 -1
  31. package/plugins/draw/dist/umd/im-draw-plugin.js +1 -1
  32. package/plugins/draw/dist/umd/index.js +1 -1
  33. package/plugins/draw/src/adapterEvents.js +2 -0
  34. package/plugins/draw/src/adapters/adapterContract.test.js +1 -0
  35. package/plugins/draw/src/adapters/maplibre/MaplibreDrawAdapter.js +15 -3
  36. package/plugins/draw/src/adapters/maplibre/MaplibreDrawAdapter.test.js +27 -0
  37. package/plugins/draw/src/adapters/maplibre/modes/editPointMode/pointerHandlers.js +8 -19
  38. package/plugins/draw/src/adapters/maplibre/modes/editPointMode/pointerHandlers.test.js +20 -0
  39. package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/pointerHandlers.js +6 -17
  40. package/plugins/draw/src/adapters/maplibre/modes/editVertexMode/pointerHandlers.test.js +19 -0
  41. package/plugins/draw/src/adapters/maplibre/utils/editModeEvents.js +29 -1
  42. package/plugins/draw/src/adapters/openlayers/OLDrawAdapter.js +13 -3
  43. package/plugins/draw/src/adapters/openlayers/OLDrawAdapter.test.js +28 -0
  44. package/plugins/draw/src/api/addFeature.js +9 -6
  45. package/plugins/draw/src/api/addFeature.test.js +37 -10
  46. package/plugins/draw/src/api/editFeature.js +1 -1
  47. package/plugins/draw/src/api/recheckGeometry.js +1 -1
  48. package/plugins/draw/src/api/recheckGeometry.test.js +2 -2
  49. package/plugins/draw/src/api/setProperties.js +39 -0
  50. package/plugins/draw/src/api/setProperties.test.js +74 -0
  51. package/plugins/draw/src/api/setStyle.js +16 -19
  52. package/plugins/draw/src/api/setStyle.test.js +17 -2
  53. package/plugins/draw/src/api/split.js +7 -4
  54. package/plugins/draw/src/api/split.test.js +25 -2
  55. package/plugins/draw/src/events.js +95 -53
  56. package/plugins/draw/src/events.test.js +425 -6
  57. package/plugins/draw/src/manifest.js +6 -4
  58. package/plugins/draw/src/manifest.test.js +20 -26
  59. package/plugins/draw/src/reducer.js +7 -0
  60. package/plugins/draw/src/reducer.test.js +11 -0
  61. package/plugins/draw/src/utils/flattenStyleProperties.js +54 -2
  62. package/plugins/draw/src/utils/flattenStyleProperties.test.js +74 -1
  63. package/plugins/draw/src/utils/isPlainObject.js +14 -0
  64. package/plugins/draw/src/utils/isPlainObject.test.js +24 -0
  65. package/plugins/draw/src/utils/mergeFeatureProperties.js +45 -0
  66. package/plugins/draw/src/utils/mergeFeatureProperties.test.js +48 -0
  67. package/plugins/draw/src/utils/stripInternalProperties.js +3 -2
  68. package/plugins/draw/src/validation/commitChecks.js +29 -11
  69. package/plugins/draw/src/validation/commitChecks.test.js +67 -11
  70. package/plugins/draw/src/validation/validateGeometry.js +12 -5
  71. package/plugins/draw/src/validation/validateGeometry.test.js +18 -0
  72. package/plugins/interact/dist/esm/im-interact-plugin.js +1 -1
  73. package/plugins/interact/dist/umd/im-interact-plugin.js +1 -1
  74. package/plugins/map-key/dist/esm/im-map-key-plugin.js +1 -1
  75. package/plugins/map-key/dist/umd/im-map-key-plugin.js +1 -1
  76. package/plugins/search/dist/css/index.css +1 -1
  77. package/plugins/search/src/components/Form/Form.module.scss +1 -0
  78. package/providers/esri/dist/esm/im-esri-provider.js +1 -1
  79. package/providers/esri/src/esriProvider.js +10 -21
  80. package/providers/esri/src/utils/coords.js +37 -7
  81. package/providers/esri/src/utils/coords.test.js +22 -1
  82. package/providers/esri/src/utils/spatial.js +1 -47
  83. package/providers/maplibre/dist/esm/im-maplibre-provider.js +1 -1
  84. package/providers/maplibre/dist/umd/im-maplibre-provider.js +1 -1
  85. package/providers/maplibre/src/maplibreProvider.js +5 -14
  86. package/providers/maplibre/src/maplibreProvider.test.js +143 -146
  87. package/providers/maplibre/src/utils/spatial.js +0 -40
  88. package/providers/maplibre/src/utils/spatial.test.js +0 -35
  89. package/providers/openlayers/dist/esm/im-openlayers-provider.js +1 -1
  90. package/providers/openlayers/dist/umd/im-openlayers-provider.js +1 -1
  91. package/providers/openlayers/src/openlayersProvider.js +5 -14
  92. package/providers/openlayers/src/openlayersProvider.test.js +12 -10
  93. package/providers/openlayers/src/utils/spatial.js +0 -39
  94. package/providers/openlayers/src/utils/spatial.test.js +1 -26
  95. package/src/App/components/Hints/Hints.jsx +9 -21
  96. package/src/App/components/Hints/Hints.test.jsx +20 -33
  97. package/src/App/components/Panel/Panel.jsx +16 -1
  98. package/src/App/components/Panel/Panel.test.jsx +44 -0
  99. package/src/App/hooks/useCrossHairAPI.js +27 -28
  100. package/src/App/hooks/useCrossHairAPI.test.js +64 -7
  101. package/src/App/hooks/useLayoutMeasurements.js +175 -131
  102. package/src/App/hooks/useLayoutMeasurements.test.js +227 -122
  103. package/src/App/hooks/useMapProviderOverrides.js +114 -35
  104. package/src/App/hooks/useMapProviderOverrides.test.js +188 -5
  105. package/src/App/hooks/useModalPanelBehaviour.js +18 -32
  106. package/src/App/hooks/useModalPanelBehaviour.test.js +45 -33
  107. package/src/App/hooks/useVisibleGeometry.js +35 -45
  108. package/src/App/hooks/useVisibleGeometry.test.js +149 -121
  109. package/src/App/layout/Layout.jsx +4 -4
  110. package/src/App/layout/layout.module.scss +124 -61
  111. package/src/App/store/AppProvider.jsx +3 -0
  112. package/src/App/store/MapProvider.jsx +1 -0
  113. package/src/App/store/MapProvider.test.jsx +25 -0
  114. package/src/App/store/appDispatchMiddleware.js +18 -10
  115. package/src/App/store/appDispatchMiddleware.test.js +42 -4
  116. package/src/App/store/mapActionsMap.js +6 -0
  117. package/src/App/store/mapActionsMap.test.js +7 -0
  118. package/src/App/store/mapReducer.js +2 -0
  119. package/src/App/store/mapReducer.test.js +2 -0
  120. package/src/InteractiveMap/InteractiveMap.js +3 -2
  121. package/src/InteractiveMap/InteractiveMap.test.js +2 -2
  122. package/src/config/events.js +1 -1
  123. package/src/config/mapPanelSlots.js +8 -0
  124. package/src/config/symbolConfig.js +1 -1
  125. package/src/services/symbolRegistry.js +1 -1
  126. package/src/services/symbolRegistry.test.js +19 -0
  127. package/src/types.js +29 -8
  128. package/src/utils/getFitMove.js +73 -0
  129. package/src/utils/getFitMove.test.js +114 -0
  130. package/src/utils/getSafeZoneInset.js +122 -77
  131. package/src/utils/getSafeZoneInset.test.js +241 -54
  132. package/src/utils/getValueForStyle.js +10 -5
  133. package/src/utils/getValueForStyle.test.js +13 -2
  134. package/src/utils/renderedBoxes.js +25 -0
  135. package/src/utils/renderedBoxes.test.js +61 -0
  136. package/src/utils/screenBox.js +70 -0
  137. package/src/utils/screenBox.test.js +69 -0
  138. package/src/utils/symbolUtils.js +9 -9
  139. package/src/utils/symbolUtils.test.js +21 -0
  140. package/providers/esri/src/utils/spatial.test.js +0 -58
@@ -1,6 +1,10 @@
1
1
  # Draw Plugin
2
2
 
3
- The draw plugin lets users draw and edit point, polygon and line features on the map — placing vertices by click, tap, or keyboard, snapping to existing map layers, and validating geometry as it's built. Polygons can also be split and merged. It works identically with both the MapLibre and OpenLayers map providers, determining the correct adapter to use from the `mapProvider` passed to `InteractiveMap` — there's nothing to configure in the plugin itself.
3
+ The draw plugin lets users draw and edit points, lines and polygons on the map. They can place vertices by click, tap or keyboard, and snap to existing map layers. Shapes are checked as they're built. Polygons can also be split and merged.
4
+
5
+ Hooks let you add your own checks at each stage: as vertices are placed, as the shape changes, and when it's finished. Use them to apply your own rules, help users fix or review their shapes, and attach your own data.
6
+
7
+ It works the same with the MapLibre and OpenLayers map providers. The plugin picks the right one from the `mapProvider` you pass to `InteractiveMap`, so there's nothing to configure.
4
8
 
5
9
  > [!IMPORTANT]
6
10
  > **Using a bundler (ESM)?** This plugin includes adapters for more than one map provider, so your bundler needs to ignore the map engines you haven't installed. See [Bundler configuration](../getting-started.md#bundler-configuration-esm).
@@ -153,7 +157,7 @@ While a rule fails, the shape has a dashed outline.
153
157
 
154
158
  Set them at plugin level, `createDrawPlugin({ onGeometryPreview, onGeometryChange, onGeometryFinish })`, or per call in the options of `newPolygon`, `newLine`, `newPoint` and `editFeature`. Each per-call callback replaces only its plugin-level equivalent for that session. The others still apply. To do more than one thing on a change, call each from one callback.
155
159
 
156
- They aren't used by `split`, `merge`, `addFeature` or `setStyle`.
160
+ They aren't used by `split`, `merge`, `addFeature`, `setStyle` or `setProperties`.
157
161
 
158
162
  #### What they return
159
163
 
@@ -165,6 +169,8 @@ They aren't used by `split`, `merge`, `addFeature` or `setStyle`.
165
169
  | `result.valid` | Whether the shape is valid |
166
170
  | `result.reason` | Why the shape is invalid. Shown as a hint and sent with [`draw:geometryinvalid`](#drawgeometryinvalid) |
167
171
  | `result.announcement` | Read out by screen readers instead of draw's own message. When it's set, `reason` isn't shown as a hint, so you can show it yourself. From `onGeometryPreview`, it's only read out for a rejected vertex |
172
+ | `result.properties` | Properties to add to the finished shape. `onGeometryFinish` only, on a passing result. See [Adding properties to the finished shape](#adding-properties-to-the-finished-shape) |
173
+ | `result.reopen` | `true` to reopen a new shape in edit mode, valid, instead of creating it. `onGeometryFinish` only, on a passing result for phase `'create'`. See [Reopening a shape that passes](#reopening-a-shape-that-passes) |
168
174
 
169
175
  #### What they receive
170
176
 
@@ -232,6 +238,8 @@ Called after each change to a shape.
232
238
 
233
239
  It's only called once the built-in rules pass, and only the result for the latest change counts. If it fails, throws or rejects, the shape can't be finished: call `recheckGeometry()` to retry. If the shape is finished while a check is running, draw waits for the result.
234
240
 
241
+ While a check is running, Done stays as the last result of `onGeometryChange` or `onGeometryFinish` left it: disabled if that result failed, otherwise enabled. When `editFeature` opens a shape, Done is disabled until its `'edit-start'` check passes.
242
+
235
243
  ## `onGeometryFinish(event, context)`
236
244
 
237
245
  **Signature:** `onGeometryFinish(event, context) => result | Promise<result>`
@@ -243,7 +251,7 @@ Called when a shape is finished, to check the whole shape once. Without it, fini
243
251
  | `'create'` | A new shape or point was finished |
244
252
  | `'edit-finish'` | Done was pressed on an edit |
245
253
 
246
- Draw waits for the result. A new shape that fails reopens in edit mode ([`draw:reopened`](#drawreopened)), where Undo starts empty and Cancel discards it. An edit that fails stays open. If the latest `onGeometryChange` result failed, the shape can't be finished, so `onGeometryFinish` isn't called.
254
+ Draw waits for the result. A new shape that fails, or passes with [`reopen`](#reopening-a-shape-that-passes), reopens in edit mode ([`draw:reopened`](#drawreopened)), where Undo starts empty and Cancel discards it. An edit that fails stays open. If the latest `onGeometryChange` result failed, the shape can't be finished, so `onGeometryFinish` isn't called. If an `onGeometryChange` check is still running when the shape is finished, it's cancelled and `onGeometryFinish` decides.
247
255
 
248
256
  This updates a panel on every change, and validates the shape once it's finished:
249
257
 
@@ -257,11 +265,46 @@ createDrawPlugin({
257
265
  })
258
266
  ```
259
267
 
260
- Don't `await` the panel update. `onGeometryChange` would then be pending until the panel replies, and finishing would wait for it.
268
+ Don't `await` the panel update. `onGeometryChange` would then be pending until the panel replies: a slow reply is announced as "Checking shape", and finishing the shape cancels it.
269
+
270
+ #### Adding properties to the finished shape
271
+
272
+ A passing result can include `properties` to store with the shape, such as what the check found. Draw adds them before the shape is created or the edit finishes, so they're in [`draw:created`](#drawcreated) and [`draw:edited`](#drawedited). They follow the same rules as [`setProperties`](#setpropertiesfeatureid-properties).
273
+
274
+ ```js
275
+ createDrawPlugin({
276
+ onGeometryFinish: async ({ feature }, { signal }) => {
277
+ try {
278
+ return await validateWithService(feature, { signal })
279
+ } catch {
280
+ // Let the user finish, but record that the shape wasn't checked
281
+ return { valid: true, properties: { drawRules: { checked: false, reason: 'error' } } }
282
+ }
283
+ }
284
+ })
285
+ ```
286
+
287
+ Keep them under one key of your own, such as `drawRules`, so they don't clash with other properties. `properties` is ignored on a failing result, and from `onGeometryPreview` and `onGeometryChange`.
288
+
289
+ #### Reopening a shape that passes
290
+
291
+ A passing result for a new shape can include `reopen: true`, to show the user something before the shape is created, such as suggestions, without blocking it. The shape reopens in edit mode with Done enabled, and [`draw:reopened`](#drawreopened) is sent with `status: 'valid'`.
292
+
293
+ Pressing Done on the unchanged shape creates it from that same result, including its `properties`, without calling `onGeometryFinish` again. If the user changes the shape first, `onGeometryFinish` is called with phase `'edit-finish'`.
294
+
295
+ ```js
296
+ createDrawPlugin({
297
+ onGeometryFinish: async ({ feature, phase }) => phase === 'create' && hasSuggestions(feature)
298
+ ? { valid: true, reopen: true, announcement: '1 suggestion for your shape. Check the issues panel' }
299
+ : { valid: true }
300
+ })
301
+ ```
302
+
303
+ `reopen` is ignored on a failing result, which reopens the shape anyway, on `'edit-finish'`, and from `onGeometryPreview` and `onGeometryChange`.
261
304
 
262
305
  ## Methods
263
306
 
264
- Methods are called on the plugin instance. `newPolygon`, `newLine`, `newPoint`, `editFeature`, `addFeature`, `setStyle`, `deleteFeature`, `split`, `merge`, `setGeometry` and `recheckGeometry` all need `mapProvider.draw` to be ready — call them after [`draw:ready`](#drawready).
307
+ Methods are called on the plugin instance. `newPolygon`, `newLine`, `newPoint`, `editFeature`, `addFeature`, `setStyle`, `setProperties`, `deleteFeature`, `split`, `merge`, `setGeometry` and `recheckGeometry` all need `mapProvider.draw` to be ready — call them after [`draw:ready`](#drawready).
265
308
 
266
309
  ---
267
310
 
@@ -366,11 +409,13 @@ Add a `Point`, `LineString`, or `Polygon` feature directly to the map without a
366
409
  | `feature.id` | **Type:** `string`<br />**Required**<br />Feature ID |
367
410
  | `feature.type` | **Type:** `string`<br />Defaults to `'Feature'` if omitted |
368
411
  | `feature.geometry` | **Type:** `GeoJSON.Geometry`<br />**Required**<br />`Point`, `LineString`, or `Polygon` geometry |
369
- | `feature.stroke` | **Type:** `string \| Record<string, string>`<br />Stroke colour (`LineString`/`Polygon`) |
370
- | `feature.fill` | **Type:** `string \| Record<string, string>`<br />Fill colour (`Polygon`) |
371
- | `feature.strokeWidth` | **Type:** `number`<br />Stroke width in pixels (`LineString`/`Polygon`) |
412
+ | `feature.stroke` | **Type:** `string \| Record<string, string>`<br />Stroke colour (`LineString`/`Polygon`). Replaces any stroke colours in `properties` |
413
+ | `feature.fill` | **Type:** `string \| Record<string, string>`<br />Fill colour (`Polygon`). Replaces any fill colours in `properties` |
414
+ | `feature.strokeWidth` | **Type:** `number`<br />Stroke width in pixels (`LineString`/`Polygon`). Replaces any stroke widths in `properties` |
372
415
  | `feature.properties` | **Type:** `Object`<br />Custom GeoJSON properties — a `Point`'s `symbol`-family properties go here (see `newPoint` above) |
373
416
 
417
+ A feature saved from [`draw:created`](#drawcreated) or [`draw:edited`](#drawedited) keeps its style in `properties`, so it can be added back as it is.
418
+
374
419
  A feature with a missing/unsupported `geometry.type` or no `geometry.coordinates` is logged as a warning and ignored.
375
420
 
376
421
  ```js
@@ -399,6 +444,8 @@ interactiveMap.on('draw:ready', () => {
399
444
 
400
445
  Update an existing feature's style — stroke/fill/strokeWidth or, for a `Point`, its `symbol`-family properties (see `newPoint` above). Only the keys you pass are changed; anything else the feature already has is left alone. Returns `false` if the feature doesn't exist.
401
446
 
447
+ Setting `stroke`, `fill` or `strokeWidth` replaces all of its values, including colours set for each map style: `setStyle(id, { stroke: '#d4351c' })` shows the new colour in every map style. Colours for each style are stored as properties named after the style, such as `strokeDark` for a style with the ID `dark`, so avoid giving your own properties names like these.
448
+
402
449
  | Argument | Description |
403
450
  |----------|-------------|
404
451
  | `featureId` | **Type:** `string`<br />**Required**<br />ID of the feature to update |
@@ -410,6 +457,28 @@ drawPlugin.setStyle('monument1', { symbolBackgroundColor: { outdoor: '#1d70b8',
410
457
 
411
458
  ---
412
459
 
460
+ ### `setProperties(featureId, properties)`
461
+
462
+ Add or change a feature's own properties, such as details from a form or an ID from your backend. They're kept on the feature, so later [`draw:edited`](#drawedited) events include them. Returns `false` if the feature doesn't exist.
463
+
464
+ | Argument | Description |
465
+ |----------|-------------|
466
+ | `featureId` | **Type:** `string`<br />**Required**<br />ID of the feature to update |
467
+ | `properties` | **Type:** `Object`<br />**Required**<br />Properties to add or change |
468
+
469
+ - New values replace old ones with the same name. Objects are replaced, not merged.
470
+ - `undefined` values are skipped. `null` is kept, to clear a property.
471
+ - Style properties are ignored with a warning: use [`setStyle`](#setstylefeatureid-stylechanges). So are draw's internal properties.
472
+ - If the feature is being edited, cancelling the edit keeps the properties.
473
+
474
+ ```js
475
+ detailsForm.addEventListener('submit', () => {
476
+ drawPlugin.setProperties('field-1', { name: form.name.value, landUse: form.landUse.value })
477
+ })
478
+ ```
479
+
480
+ ---
481
+
413
482
  ### `deleteFeature(featureIds)`
414
483
 
415
484
  Remove one or more features from the map.
@@ -615,7 +684,7 @@ Emitted when `editFeature` opens an existing feature for editing.
615
684
 
616
685
  ### `draw:created`
617
686
 
618
- Emitted when a new shape finishes drawing and passes its checks. Also fires for a shape that finished invalid, was automatically reopened in edit mode, and was then fixed and finished — from the caller's perspective it's still a creation, not an edit.
687
+ Emitted when a new shape finishes drawing and passes its checks. Also fires for a new shape that was reopened in edit mode ([`draw:reopened`](#drawreopened)) and then finished — from the caller's perspective it's still a creation, not an edit.
619
688
 
620
689
  **Payload:** the finished `GeoJSON.Feature`
621
690
 
@@ -631,15 +700,15 @@ Emitted when an existing feature finishes an edit session (via `editFeature`).
631
700
 
632
701
  ### `draw:reopened`
633
702
 
634
- Emitted when a new shape is finished, its check fails, and it reopens in edit mode. See [Validation](#validation).
703
+ Emitted when a new shape is finished and reopens in edit mode: because its check failed, or because a passing `onGeometryFinish` result asked to reopen it (see [Reopening a shape that passes](#reopening-a-shape-that-passes)). See [Validation](#validation).
635
704
 
636
705
  **Payload:**
637
706
 
638
707
  | Property | Description |
639
708
  |----------|-------------|
640
709
  | `payload.feature` | **Type:** `GeoJSON.Feature`<br />The reopened shape |
641
- | `payload.status` | **Type:** `'invalid' \| 'error'`<br />`'invalid'` if the check failed, `'error'` if it threw or rejected |
642
- | `payload.reason` | **Type:** `string \| null`<br />Why the check failed, or `null` if the result gave no reason |
710
+ | `payload.status` | **Type:** `'valid' \| 'invalid' \| 'error'`<br />`'valid'` if a passing result asked to reopen it, `'invalid'` if the check failed, `'error'` if it threw or rejected |
711
+ | `payload.reason` | **Type:** `string \| null`<br />Why the check failed, or `null` if it passed or the result gave no reason |
643
712
 
644
713
  ---
645
714
 
@@ -730,7 +799,20 @@ Emitted after `setStyle` updates a feature's style.
730
799
  | Property | Description |
731
800
  |----------|-------------|
732
801
  | `payload.featureId` | **Type:** `string`<br />ID of the updated feature |
733
- | `payload.properties` | **Type:** `Object`<br />The style and symbol properties that were applied |
802
+ | `payload.properties` | **Type:** `Object`<br />The style properties that changed. A removed colour is `null`, so you can merge this into your saved copy of the feature |
803
+
804
+ ---
805
+
806
+ ### `draw:propertieschange`
807
+
808
+ Emitted after `setProperties` updates a feature's properties.
809
+
810
+ **Payload:**
811
+
812
+ | Property | Description |
813
+ |----------|-------------|
814
+ | `payload.featureId` | **Type:** `string`<br />ID of the updated feature |
815
+ | `payload.properties` | **Type:** `Object`<br />The properties that were changed |
734
816
 
735
817
  ---
736
818
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/interactive-map",
3
- "version": "0.0.58-alpha",
3
+ "version": "0.0.60-alpha",
4
4
  "description": "An accessible map component",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/regenerator";import r from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/objectSpread2";function n(){var n,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=t(t({noKeyItemText:"No features displayed"},a),{},{id:"datasets",load:(n=r(e().m(function r(){var t,n;return e().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,import(/* webpackChunkName: "im-datasets-plugin" */ "./im-datasets-plugin.js").then(function(e){return e.m});case 1:return t=e.v,n=t.createManifest,e.a(2,n(a))}},r)})),function(){return n.apply(this,arguments)})});return o}export{n as default};
1
+ import e from"@babel/runtime/helpers/regenerator";import r from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/objectSpread2";function n(){var n,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=t(t({},a),{},{id:"datasets",load:(n=r(e().m(function r(){var t,n;return e().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,import(/* webpackChunkName: "im-datasets-plugin" */ "./im-datasets-plugin.js").then(function(e){return e.m});case 1:return t=e.v,n=t.createManifest,e.a(2,n(a))}},r)})),function(){return n.apply(this,arguments)})});return o}export{n as default};
@@ -1 +1 @@
1
- const r=(r,t)=>{if(!r)return null;if("string"==typeof r)return r.trim();if("object"==typeof r){if(t&&r[t])return r[t];return Object.values(r)[0]??null}return null};class t{attachDynamicSources(r){this._dynamicSources=r}get dynamicSources(){return this._dynamicSources}}export{t as L,r as g};
1
+ const r=(r,t)=>{if("number"==typeof r)return r;if(!r)return null;if("string"==typeof r)return r.trim();if("object"==typeof r){if(t&&null!=r[t])return r[t];return Object.values(r)[0]??null}return null};class t{attachDynamicSources(r){this._dynamicSources=r}get dynamicSources(){return this._dynamicSources}}export{t as L,r as g};
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see im-datasets-ml-adapter.js.LICENSE.txt */
2
- "use strict";(Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap||[]).push([[563],{913:function(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function i(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function u(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof c?n:c,l=Object.create(u.prototype);return s(l,"_invoke",function(r,n,o){var i,u,s,c=0,l=o||[],f=!1,y={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return i=e,u=0,s=t,y.n=r,a}};function p(r,n){for(u=r,s=n,e=0;!f&&c&&!o&&e<l.length;e++){var o,i=l[e],p=y.p,h=i[2];r>3?(o=h===n)&&(s=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=r<2&&p<i[1])?(u=0,y.v=n,y.n=i[1]):p<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,y.n=h,u=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,h),u=l,s=h;(e=u<2?t:s)||!f;){i||(u?u<3?(u>1&&(y.n=-1),p(u,s)):y.n=s:y.v=s);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(f=y.n<0)?s:r.call(n,y))!==a)break}catch(e){i=t,u=1,s=e}finally{c=1}}return{value:e,done:f}}}(r,o,i),!0),l}var a={};function c(){}function l(){}function f(){}e=Object.getPrototypeOf;var y=[][n]?e(e([][n]())):(s(e={},n,function(){return this}),e),p=f.prototype=c.prototype=Object.create(y);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,s(t,o,"GeneratorFunction")),t.prototype=Object.create(p),t}return l.prototype=f,s(p,"constructor",f),s(f,"constructor",l),l.displayName="GeneratorFunction",s(f,o,"GeneratorFunction"),s(p),s(p,o,"Generator"),s(p,n,function(){return this}),s(p,"toString",function(){return"[object Generator]"}),(u=function(){return{w:i,m:h}})()}function s(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}s=function(t,e,r,n){function i(e,r){s(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},s(t,e,r,n)}function c(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,o)}function l(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,f(n.key),n)}}function f(t){var e=function(t){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:e+""}function y(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(y=function(){return!!t})()}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}function h(t,e){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},h(t,e)}r.d(e,{h:function(){return b}});var b=function(t){function e(t,r,n,o){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(i=function(t,e,r){return e=p(e),function(t,e){if(e&&("object"==a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,y()?Reflect.construct(e,r||[],p(t).constructor):e.apply(t,r))}(this,e))._mapProvider=t,i._map=t.map,i._symbolRegistry=r,i._patternRegistry=n,i._datasetRegistry=o,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&h(t,e)}(e,t),r=e,n=[{key:"_pixelRatio",get:function(){return this._map.getPixelRatio()}},{key:"addDataset",value:(o=u().m(function t(e){var r;return u().w(function(t){for(;;)switch(t.n){case 0:if(r=this._datasetRegistry.getDataset(e)){t.n=1;break}return t.a(2);case 1:return t.n=2,this._registerPatternsAndSymbols(r);case 2:this._addLayers(r);case 3:return t.a(2)}},t,this)}),i=function(){var t=this,e=arguments;return new Promise(function(r,n){var i=o.apply(t,e);function a(t){c(i,r,n,a,u,"next",t)}function u(t){c(i,r,n,a,u,"throw",t)}a(void 0)})},function(t){return i.apply(this,arguments)})},{key:"applyDatasetOpacity",value:function(t){var e=this._datasetRegistry.getDataset(t);e&&this._applyRegistryDatasetOpacity(e)}},{key:"_applyRegistryDatasetOpacity",value:function(t){var e=this;t.getLayersWithOpacity().forEach(function(t){var r=t.layerIds,n=t.opacity;r.forEach(function(t){return e._setLayerOpacity(t,n)})})}},{key:"applyGlobalOpacity",value:function(){var t=this;this._datasetRegistry.forEachDataset(function(e){return t._applyRegistryDatasetOpacity(e)})}},{key:"applyDatasetVisibility",value:function(t){var e=this._datasetRegistry.getDataset(t);e&&this._applyRegistryDatasetVisibility(e)}},{key:"_applyRegistryDatasetVisibility",value:function(t){var e=this;t.getLayersWithVisibility().forEach(function(t){var r=t.layerIds,n=t.visibility;r.forEach(function(t){return e._setLayerVisibility(t,n)})})}},{key:"applyGlobalVisibility",value:function(){var t=this;this._datasetRegistry.forEachDataset(function(e){return t._applyRegistryDatasetVisibility(e)})}}],n&&l(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,i}(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},(e=[{key:"attachDynamicSources",value:function(t){this._dynamicSources=t}},{key:"dynamicSources",get:function(){return this._dynamicSources}}])&&o(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}())},291:function(t,e,r){r.r(e),r.d(e,{default:function(){return D}});var n=r(247);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function a(t,e,r){return(e=function(t){var e=function(t){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var u=function(t,e,r,o,s,c){var l,f=t.map,y=e.sourceId,p=e.source;p&&!f.getSource(y)&&f.addSource(y,p);var h=r.id;return function(t,e,r,n,o){var i=t.map,a=e.hasSymbol,u=e.symbolLayerId;if(a&&n&&u&&!i.getLayer(u)){var s=n.getSymbolDef(e.style);if(s){var c=n.getSymbolImageId(e.style,r,"normal",o);c&&i.addLayer(e.getSymbolSource(c,t.getSymbolIconLayout(s)))}}}(t,e,r,o,c),function(t,e,r,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=e.hasFill,u=e.fillLayerId;if(a&&u&&!t.getLayer(u)){var s=o.getPatternImageId(e.style,r,i),c=s?{"fill-pattern":s,"fill-opacity":e.opacity}:{"fill-color":(0,n.o)(e.style.fill,r),"fill-opacity":e.opacity};t.addLayer(e.getFillSource(c))}}(f,e,h,s,c),function(t,e,r){var o=e.hasStroke,u=e.strokeLayerId;if(o&&!t.getLayer(u)){var s=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach(function(e){a(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({"line-color":(0,n.o)(e.style.stroke,r),"line-width":e.style.strokeWidth,"line-opacity":e.opacity},e.style.strokeDashArray?{"line-dasharray":e.style.strokeDashArray}:{}),c=e.getStrokeSource(s);t.addLayer(c)}}(f,e,h),null!==(l=e.sublayers)&&void 0!==l&&l.length?(e.sublayers.forEach(function(e){u(t,e,r,o,s,c)}),y):e.isSublayer?void 0:y},s=r(416),c=r(619);function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(Object(r),!0).forEach(function(e){p(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function p(t,e,r){return(e=b(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,b(n.key),n)}}function b(t){var e=function(t){if("object"!=l(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==l(e)?e:e+""}function d(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(d=function(){return!!t})()}function m(t){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},m(t)}function v(t,e){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},v(t,e)}var g=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=m(e),function(t,e){if(e&&("object"==l(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,d()?Reflect.construct(e,r||[],m(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v(t,e)}(e,t),r=e,(n=[{key:"fillLayerId",get:function(){return this.hasSublayers||this.hasSymbol?null:this.hasFill?this.id:null}},{key:"strokeLayerId",get:function(){return this.hasSublayers||this.hasSymbol?null:this.hasStroke?this.hasFill?"".concat(this.id,"-stroke"):this.id:null}},{key:"symbolLayerId",get:function(){return this.hasSublayers?null:this.hasSymbol?this.id:null}},{key:"leafLayerIds",get:function(){return[this.symbolLayerId,this.fillLayerId,this.strokeLayerId].filter(Boolean)}},{key:"_geojsonIdStrategy",value:function(){var t;return this.idProperty?{promoteId:this.idProperty}:this.generateIds?{generateId:!0}:(null!==(t=this.geojson)&&void 0!==t&&null!==(t=t.features)&&void 0!==t&&t.some(function(t){return"string"==typeof t.id})&&c.v.warn('Dataset "'.concat(this.id,'" has GeoJSON features with string native IDs. MapLibre only surfaces integer native feature IDs through queryRenderedFeatures. Use idProperty to promote a string property instead.')),{})}},{key:"source",get:function(){if(this.hasDynamicGeoJSON)return this.dynamicGeoJSON.source;if(this.tiles){var t={type:"vector",tiles:this.tiles,minzoom:this.minZoom||0,maxzoom:this.maxZoom||22};return this.idProperty&&this.sourceLayer&&(t.promoteId=p({},this.sourceLayer,this.idProperty)),t}return this.geojson?y({type:"geojson",data:this.geojson},this._geojsonIdStrategy()):null}},{key:"getSymbolSource",value:function(t,e){return y({id:this.symbolLayerId,type:"symbol",source:this.sourceId,"source-layer":this.sourceLayer,minzoom:this.minZoom,maxzoom:this.maxZoom,layout:y(y({visibility:this.visibility,"icon-image":t},e),{},{"icon-allow-overlap":!0})},this.filter?{filter:this.filter}:{})}},{key:"getFillSource",value:function(t){return y({id:this.fillLayerId,type:"fill",source:this.sourceId,"source-layer":this.sourceLayer,minzoom:this.minZoom,maxzoom:this.maxZoom,layout:{visibility:this.visibility},paint:t},this.filter?{filter:this.filter}:{})}},{key:"getStrokeSource",value:function(t){return y({id:this.strokeLayerId,type:"line",source:this.sourceId,"source-layer":this.sourceLayer,minzoom:this.minZoom,maxzoom:this.maxZoom,layout:{visibility:this.visibility},paint:t},this.filter?{filter:this.filter}:{})}}])&&h(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(s.f);function S(t){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(t)}function _(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var s=n&&n.prototype instanceof u?n:u,c=Object.create(s.prototype);return O(c,"_invoke",function(r,n,o){var i,u,s,c=0,l=o||[],f=!1,y={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return i=e,u=0,s=t,y.n=r,a}};function p(r,n){for(u=r,s=n,e=0;!f&&c&&!o&&e<l.length;e++){var o,i=l[e],p=y.p,h=i[2];r>3?(o=h===n)&&(s=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=r<2&&p<i[1])?(u=0,y.v=n,y.n=i[1]):p<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,y.n=h,u=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,h),u=l,s=h;(e=u<2?t:s)||!f;){i||(u?u<3?(u>1&&(y.n=-1),p(u,s)):y.n=s:y.v=s);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(f=y.n<0)?s:r.call(n,y))!==a)break}catch(e){i=t,u=1,s=e}finally{c=1}}return{value:e,done:f}}}(r,o,i),!0),c}var a={};function u(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(O(e={},n,function(){return this}),e),f=c.prototype=u.prototype=Object.create(l);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,O(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return s.prototype=c,O(f,"constructor",c),O(c,"constructor",s),s.displayName="GeneratorFunction",O(c,o,"GeneratorFunction"),O(f),O(f,o,"Generator"),O(f,n,function(){return this}),O(f,"toString",function(){return"[object Generator]"}),(_=function(){return{w:i,m:y}})()}function O(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}O=function(t,e,r,n){function i(e,r){O(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},O(t,e,r,n)}function w(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,o)}function j(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){w(i,n,o,a,u,"next",t)}function u(t){w(i,n,o,a,u,"throw",t)}a(void 0)})}}function P(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,L(n.key),n)}}function L(t){var e=function(t){if("object"!=S(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=S(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==S(e)?e:e+""}function k(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(k=function(){return!!t})()}function I(t){return I=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},I(t)}function E(t,e){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},E(t,e)}var D=function(t){function e(t,r,n,o){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(i=function(t,e,r){return e=I(e),function(t,e){if(e&&("object"==S(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,k()?Reflect.construct(e,r||[],I(t).constructor):e.apply(t,r))}(this,e,[t,r,n,o]))._datasetSourceMap=new Map,window._datasetSourceMap=i._datasetSourceMap,i._symbolLayerIds=new Set,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&E(t,e)}(e,t),r=e,n=[{key:"createDataset",value:function(t,e){return new g(t,e)}},{key:"init",value:(c=j(_().m(function t(){var e,r,n,o=this;return _().w(function(t){for(;;)switch(t.n){case 0:return e=this._datasetRegistry.getPatternAndSymbolConfigs(),r=e.patternConfigs,n=e.symbolConfigs,t.n=1,this.addPatternsAndSymbolsToMap(r,n);case 1:return this._symbolLayerIds.clear(),this._datasetRegistry.forEachDataset(function(t){return o._addLayers(t)}),t.n=2,new Promise(function(t){return o._map.once("idle",t)});case 2:return t.a(2)}},t,this)})),function(){return c.apply(this,arguments)})},{key:"removeLayer",value:function(t){this._map.getLayer(t)&&this._map.removeLayer(t),this._symbolLayerIds.delete(t)}},{key:"addPatternsAndSymbolsToMap",value:(s=j(_().m(function t(e,r){var n,o;return _().w(function(t){for(;;)if(0===t.n)return n=this._datasetRegistry.mapStyle,o=n.id,t.a(2,Promise.all([this._mapProvider.addPatternsToMap(e,o,this._patternRegistry),this._mapProvider.addSymbolsToMap(r,n,this._symbolRegistry)]))},t,this)})),function(t,e){return s.apply(this,arguments)})},{key:"destroy",value:function(){var t=this,e=new Set;this._datasetRegistry.forEachDataset(function(r){var n=r.sourceId;t._getLayersUsingSource(n).forEach(function(e){return t.removeLayer(e)}),!e.has(n)&&t._map.getSource(n)&&(t._map.removeSource(n),e.add(n))}),this._datasetSourceMap.clear()}},{key:"onMapStyleChange",value:(a=j(_().m(function t(){var e,r,n,o=this;return _().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,new Promise(function(t){return o._map.once("idle",t)});case 1:return e=this._datasetRegistry.getPatternAndSymbolConfigs(),r=e.patternConfigs,n=e.symbolConfigs,t.n=2,this.addPatternsAndSymbolsToMap(r,n);case 2:this._symbolLayerIds.clear(),this._datasetRegistry.forEachDataset(function(t){o._addLayers(t),o._applyFeatureFilter(t)}),this.dynamicSources.forEach(function(t){return t.reapply()});case 3:return t.a(2)}},t,this)})),function(){return a.apply(this,arguments)})},{key:"onMapSizeChange",value:(i=j(_().m(function t(){var e,r,n,o,i,a=this;return _().w(function(t){for(;;)switch(t.n){case 0:return e=this._datasetRegistry.mapStyle,r=this._pixelRatio,n=this._datasetRegistry.getPatternAndSymbolConfigs(),o=n.patternConfigs,i=n.symbolConfigs,t.n=1,this.addPatternsAndSymbolsToMap(o,i);case 1:if(this._pixelRatio===r){t.n=2;break}return t.a(2);case 2:this._datasetRegistry.forEach(function(t){var n=t.fillLayerId,o=t.symbolLayerId;if(o&&a._symbolLayerIds.has(o)&&a._map.getLayer(o)){var i=a._symbolRegistry.getSymbolImageId(t.style,e,"normal",r);i&&a._map.setLayoutProperty(o,"icon-image",i)}else if(n&&a._map.getLayer(n)){var u=a._patternRegistry.getPatternImageId(t.style,e.id,r);u&&a._map.setPaintProperty(n,"fill-pattern",u)}});case 3:return t.a(2)}},t,this)})),function(){return i.apply(this,arguments)})},{key:"_registerPatternsAndSymbols",value:function(t){return this.addPatternsAndSymbolsToMap(t.patternConfigs,t.symbolConfigs)}},{key:"removeDataset",value:function(t){var e=this,r=this._datasetRegistry.getDataset(t);if(r){var n=r.sourceId;r.layerIds.forEach(function(t){return e.removeLayer(t)}),!this._datasetRegistry.topLevelDatasets().some(function(e){return e.id!==t&&e.sourceId===n})&&this._map.getSource(n)&&this._map.removeSource(n),this._datasetSourceMap.delete(t)}}},{key:"applyFeatureFilter",value:function(t){var e=this._datasetRegistry.getDataset(t);e&&this._applyFeatureFilter(e)}},{key:"applyStyle",value:(o=j(_().m(function t(e){var r,n=this;return _().w(function(t){for(;;)switch(t.n){case 0:return(r=this._datasetRegistry.getDataset(e)).layerIds.forEach(function(t){return n.removeLayer(t)}),t.n=1,this._registerPatternsAndSymbols(r);case 1:this._addLayers(r);case 2:return t.a(2)}},t,this)})),function(t){return o.apply(this,arguments)})},{key:"setData",value:function(t,e){var r=this._datasetSourceMap.get(t);if(r){var n=this._map.getSource(r);n&&"function"==typeof n.setData&&n.setData(e)}}},{key:"_addLayers",value:function(t){var e=this._datasetRegistry.mapStyle,r=u(this._mapProvider,t,e,this._symbolRegistry,this._patternRegistry,this._pixelRatio);this._datasetSourceMap.set(t.id,r),this._maintainSymbolOrdering(t)}},{key:"_getFirstSymbolLayerId",value:function(){var t,e=this,r=this._map.getStyle();if(null==r||!r.layers)return null;var n=r.layers.find(function(t){return e._symbolLayerIds.has(t.id)});return null!==(t=null==n?void 0:n.id)&&void 0!==t?t:null}},{key:"_maintainSymbolOrdering",value:function(t){var e=this,r=(t=t.isSublayer?t.parent:t).layerIds.filter(function(t){return t&&e._map.getLayer(t)});r.forEach(function(t){var r;"symbol"===(null===(r=e._map.getLayer(t))||void 0===r?void 0:r.type)?e._symbolLayerIds.add(t):e._symbolLayerIds.delete(t)});var n=this._getFirstSymbolLayerId();n&&r.forEach(function(t){e._symbolLayerIds.has(t)||e._map.moveLayer(t,n)})}},{key:"_setLayerVisibility",value:function(t,e){this._map.getLayer(t)&&this._map.setLayoutProperty(t,"visibility",e)}},{key:"_applyFeatureFilter",value:function(t){var e=this;t.getLayersWithFilters().forEach(function(t){var r=t.layerIds,n=t.filter;r.forEach(function(t){e._map.getLayer(t)&&e._map.setFilter(t,n)})})}},{key:"_setLayerOpacity",value:function(t,e){var r=this._map.getLayer(t);if(r){var n={line:"line-opacity",symbol:"icon-opacity"}[r.type]||"fill-opacity";this._map.setPaintProperty(t,n,e)}}},{key:"_getLayersUsingSource",value:function(t){var e=this._map.getStyle();return null!=e&&e.layers?e.layers.filter(function(e){return e.source===t}).map(function(t){return t.id}):[]}}],n&&P(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,i,a,s,c}(r(913).h)},416:function(t,e,r){r.d(e,{f:function(){return p}});var n=r(428);function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var i=function(t){var e,r=0,n=2166136261,i=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return u=t.done,t},e:function(t){s=!0,a=t},f:function(){try{u||null==r.return||r.return()}finally{if(s)throw a}}}}(t);try{for(i.s();!(e=i.n()).done;){var a=e.value.codePointAt(0);r=Math.imul(r,31)+a,n=Math.imul(n^a,16777619)}}catch(t){i.e(t)}finally{i.f()}return(r>>>0).toString(36)+(n>>>0).toString(36)};function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,c(n.key),n)}}function c(t){var e=function(t){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:e+""}function l(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(l=function(){return!!t})()}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}function y(t,e){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},y(t,e)}var p=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=f(e),function(t,e){if(e&&("object"==a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,l()?Reflect.construct(e,r||[],f(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&y(t,e)}(e,t),r=e,n=[{key:"_hiddenFeaturesIdExpression",get:function(){return this.hasDynamicGeoJSON?this.dynamicGeoJSON.hiddenFeaturesIdExpression:this.idProperty?["to-string",["get",this.idProperty]]:["to-string",["id"]]}},{key:"_hiddenFeaturesFilter",get:function(){var t,e=null===(t=this.hiddenFeatures)||void 0===t?void 0:t.filter(function(t){return-1!==t});return null!=e&&e.length?["!",["in",this._hiddenFeaturesIdExpression,["literal",e.map(String)]]]:null}},{key:"filter",get:function(){var t,e=["all"];null!==(t=this.parent)&&void 0!==t&&t.filter&&e.push(this.parent.filter),this._datasetDefinition.filter&&e.push(this._datasetDefinition.filter);var r=this._hiddenFeaturesFilter;return r&&e.push(r),1===e.length?null:e.length>2?e:e[1]}},{key:"leafLayerIds",get:function(){return[]}},{key:"layerIds",get:function(){return this.hasSublayers?this.sublayers.flatMap(function(t){return t.layerIds}).filter(Boolean):this.leafLayerIds}},{key:"getLayersWithValue",value:function(t){var e,r,n,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[];if(!1===o||this[o]){var a=this.leafLayerIds;if(a.length){var s=this[t];i.push((e={layerIds:a},n=s,(r=c(r=t))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e))}}return this.hasSublayers&&this.sublayers.forEach(function(e){if(!1===o||e[o]){var r=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return u(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.getLayersWithValue(t),1)[0];r&&i.push(r)}}),i}},{key:"getLayersWithVisibility",value:function(){return this.getLayersWithValue("visibility")}},{key:"getLayersWithOpacity",value:function(){return this.getLayersWithValue("opacity")}},{key:"getLayersWithFilters",value:function(){return this.getLayersWithValue("filter","hasHiddenFeatures")}},{key:"sourceId",get:function(){if(this.isSublayer)return this.parent.sourceId;if(this.hasDynamicGeoJSON)return this.dynamicGeoJSON.sourceId;if(this.tiles){var t=Array.isArray(this.tiles)?this.tiles.join(","):this.tiles;return"tiles-".concat(i(t))}return this.geojson?"string"==typeof this.geojson?"geojson-".concat(i(this.geojson)):"geojson-".concat(this.id):"source-".concat(this.id)}}],n&&s(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(n.j)},247:function(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}r.d(e,{o:function(){return o}});var o=function(t,e){if(!t)return null;if("string"==typeof t)return t.trim();if("object"===n(t)){if(e&&t[e])return t[e];var r=Object.values(t)[0];return null!=r?r:null}return null}}}]);
2
+ "use strict";(Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap||[]).push([[563],{913:function(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function i(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function u(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof c?n:c,l=Object.create(u.prototype);return s(l,"_invoke",function(r,n,o){var i,u,s,c=0,l=o||[],f=!1,y={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return i=e,u=0,s=t,y.n=r,a}};function p(r,n){for(u=r,s=n,e=0;!f&&c&&!o&&e<l.length;e++){var o,i=l[e],p=y.p,h=i[2];r>3?(o=h===n)&&(s=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=r<2&&p<i[1])?(u=0,y.v=n,y.n=i[1]):p<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,y.n=h,u=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,h),u=l,s=h;(e=u<2?t:s)||!f;){i||(u?u<3?(u>1&&(y.n=-1),p(u,s)):y.n=s:y.v=s);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(f=y.n<0)?s:r.call(n,y))!==a)break}catch(e){i=t,u=1,s=e}finally{c=1}}return{value:e,done:f}}}(r,o,i),!0),l}var a={};function c(){}function l(){}function f(){}e=Object.getPrototypeOf;var y=[][n]?e(e([][n]())):(s(e={},n,function(){return this}),e),p=f.prototype=c.prototype=Object.create(y);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,s(t,o,"GeneratorFunction")),t.prototype=Object.create(p),t}return l.prototype=f,s(p,"constructor",f),s(f,"constructor",l),l.displayName="GeneratorFunction",s(f,o,"GeneratorFunction"),s(p),s(p,o,"Generator"),s(p,n,function(){return this}),s(p,"toString",function(){return"[object Generator]"}),(u=function(){return{w:i,m:h}})()}function s(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}s=function(t,e,r,n){function i(e,r){s(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},s(t,e,r,n)}function c(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,o)}function l(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,f(n.key),n)}}function f(t){var e=function(t){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:e+""}function y(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(y=function(){return!!t})()}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}function h(t,e){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},h(t,e)}r.d(e,{h:function(){return b}});var b=function(t){function e(t,r,n,o){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(i=function(t,e,r){return e=p(e),function(t,e){if(e&&("object"==a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,y()?Reflect.construct(e,r||[],p(t).constructor):e.apply(t,r))}(this,e))._mapProvider=t,i._map=t.map,i._symbolRegistry=r,i._patternRegistry=n,i._datasetRegistry=o,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&h(t,e)}(e,t),r=e,n=[{key:"_pixelRatio",get:function(){return this._map.getPixelRatio()}},{key:"addDataset",value:(o=u().m(function t(e){var r;return u().w(function(t){for(;;)switch(t.n){case 0:if(r=this._datasetRegistry.getDataset(e)){t.n=1;break}return t.a(2);case 1:return t.n=2,this._registerPatternsAndSymbols(r);case 2:this._addLayers(r);case 3:return t.a(2)}},t,this)}),i=function(){var t=this,e=arguments;return new Promise(function(r,n){var i=o.apply(t,e);function a(t){c(i,r,n,a,u,"next",t)}function u(t){c(i,r,n,a,u,"throw",t)}a(void 0)})},function(t){return i.apply(this,arguments)})},{key:"applyDatasetOpacity",value:function(t){var e=this._datasetRegistry.getDataset(t);e&&this._applyRegistryDatasetOpacity(e)}},{key:"_applyRegistryDatasetOpacity",value:function(t){var e=this;t.getLayersWithOpacity().forEach(function(t){var r=t.layerIds,n=t.opacity;r.forEach(function(t){return e._setLayerOpacity(t,n)})})}},{key:"applyGlobalOpacity",value:function(){var t=this;this._datasetRegistry.forEachDataset(function(e){return t._applyRegistryDatasetOpacity(e)})}},{key:"applyDatasetVisibility",value:function(t){var e=this._datasetRegistry.getDataset(t);e&&this._applyRegistryDatasetVisibility(e)}},{key:"_applyRegistryDatasetVisibility",value:function(t){var e=this;t.getLayersWithVisibility().forEach(function(t){var r=t.layerIds,n=t.visibility;r.forEach(function(t){return e._setLayerVisibility(t,n)})})}},{key:"applyGlobalVisibility",value:function(){var t=this;this._datasetRegistry.forEachDataset(function(e){return t._applyRegistryDatasetVisibility(e)})}}],n&&l(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,i}(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},(e=[{key:"attachDynamicSources",value:function(t){this._dynamicSources=t}},{key:"dynamicSources",get:function(){return this._dynamicSources}}])&&o(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}())},291:function(t,e,r){r.r(e),r.d(e,{default:function(){return D}});var n=r(247);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function a(t,e,r){return(e=function(t){var e=function(t){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var u=function(t,e,r,o,s,c){var l,f=t.map,y=e.sourceId,p=e.source;p&&!f.getSource(y)&&f.addSource(y,p);var h=r.id;return function(t,e,r,n,o){var i=t.map,a=e.hasSymbol,u=e.symbolLayerId;if(a&&n&&u&&!i.getLayer(u)){var s=n.getSymbolDef(e.style);if(s){var c=n.getSymbolImageId(e.style,r,"normal",o);c&&i.addLayer(e.getSymbolSource(c,t.getSymbolIconLayout(s)))}}}(t,e,r,o,c),function(t,e,r,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=e.hasFill,u=e.fillLayerId;if(a&&u&&!t.getLayer(u)){var s=o.getPatternImageId(e.style,r,i),c=s?{"fill-pattern":s,"fill-opacity":e.opacity}:{"fill-color":(0,n.o)(e.style.fill,r),"fill-opacity":e.opacity};t.addLayer(e.getFillSource(c))}}(f,e,h,s,c),function(t,e,r){var o=e.hasStroke,u=e.strokeLayerId;if(o&&!t.getLayer(u)){var s=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach(function(e){a(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({"line-color":(0,n.o)(e.style.stroke,r),"line-width":e.style.strokeWidth,"line-opacity":e.opacity},e.style.strokeDashArray?{"line-dasharray":e.style.strokeDashArray}:{}),c=e.getStrokeSource(s);t.addLayer(c)}}(f,e,h),null!==(l=e.sublayers)&&void 0!==l&&l.length?(e.sublayers.forEach(function(e){u(t,e,r,o,s,c)}),y):e.isSublayer?void 0:y},s=r(416),c=r(619);function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(Object(r),!0).forEach(function(e){p(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function p(t,e,r){return(e=b(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,b(n.key),n)}}function b(t){var e=function(t){if("object"!=l(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==l(e)?e:e+""}function d(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(d=function(){return!!t})()}function m(t){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},m(t)}function v(t,e){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},v(t,e)}var g=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=m(e),function(t,e){if(e&&("object"==l(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,d()?Reflect.construct(e,r||[],m(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v(t,e)}(e,t),r=e,(n=[{key:"fillLayerId",get:function(){return this.hasSublayers||this.hasSymbol?null:this.hasFill?this.id:null}},{key:"strokeLayerId",get:function(){return this.hasSublayers||this.hasSymbol?null:this.hasStroke?this.hasFill?"".concat(this.id,"-stroke"):this.id:null}},{key:"symbolLayerId",get:function(){return this.hasSublayers?null:this.hasSymbol?this.id:null}},{key:"leafLayerIds",get:function(){return[this.symbolLayerId,this.fillLayerId,this.strokeLayerId].filter(Boolean)}},{key:"_geojsonIdStrategy",value:function(){var t;return this.idProperty?{promoteId:this.idProperty}:this.generateIds?{generateId:!0}:(null!==(t=this.geojson)&&void 0!==t&&null!==(t=t.features)&&void 0!==t&&t.some(function(t){return"string"==typeof t.id})&&c.v.warn('Dataset "'.concat(this.id,'" has GeoJSON features with string native IDs. MapLibre only surfaces integer native feature IDs through queryRenderedFeatures. Use idProperty to promote a string property instead.')),{})}},{key:"source",get:function(){if(this.hasDynamicGeoJSON)return this.dynamicGeoJSON.source;if(this.tiles){var t={type:"vector",tiles:this.tiles,minzoom:this.minZoom||0,maxzoom:this.maxZoom||22};return this.idProperty&&this.sourceLayer&&(t.promoteId=p({},this.sourceLayer,this.idProperty)),t}return this.geojson?y({type:"geojson",data:this.geojson},this._geojsonIdStrategy()):null}},{key:"getSymbolSource",value:function(t,e){return y({id:this.symbolLayerId,type:"symbol",source:this.sourceId,"source-layer":this.sourceLayer,minzoom:this.minZoom,maxzoom:this.maxZoom,layout:y(y({visibility:this.visibility,"icon-image":t},e),{},{"icon-allow-overlap":!0})},this.filter?{filter:this.filter}:{})}},{key:"getFillSource",value:function(t){return y({id:this.fillLayerId,type:"fill",source:this.sourceId,"source-layer":this.sourceLayer,minzoom:this.minZoom,maxzoom:this.maxZoom,layout:{visibility:this.visibility},paint:t},this.filter?{filter:this.filter}:{})}},{key:"getStrokeSource",value:function(t){return y({id:this.strokeLayerId,type:"line",source:this.sourceId,"source-layer":this.sourceLayer,minzoom:this.minZoom,maxzoom:this.maxZoom,layout:{visibility:this.visibility},paint:t},this.filter?{filter:this.filter}:{})}}])&&h(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(s.f);function S(t){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(t)}function _(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var s=n&&n.prototype instanceof u?n:u,c=Object.create(s.prototype);return O(c,"_invoke",function(r,n,o){var i,u,s,c=0,l=o||[],f=!1,y={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return i=e,u=0,s=t,y.n=r,a}};function p(r,n){for(u=r,s=n,e=0;!f&&c&&!o&&e<l.length;e++){var o,i=l[e],p=y.p,h=i[2];r>3?(o=h===n)&&(s=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=r<2&&p<i[1])?(u=0,y.v=n,y.n=i[1]):p<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,y.n=h,u=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,h),u=l,s=h;(e=u<2?t:s)||!f;){i||(u?u<3?(u>1&&(y.n=-1),p(u,s)):y.n=s:y.v=s);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(f=y.n<0)?s:r.call(n,y))!==a)break}catch(e){i=t,u=1,s=e}finally{c=1}}return{value:e,done:f}}}(r,o,i),!0),c}var a={};function u(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(O(e={},n,function(){return this}),e),f=c.prototype=u.prototype=Object.create(l);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,O(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return s.prototype=c,O(f,"constructor",c),O(c,"constructor",s),s.displayName="GeneratorFunction",O(c,o,"GeneratorFunction"),O(f),O(f,o,"Generator"),O(f,n,function(){return this}),O(f,"toString",function(){return"[object Generator]"}),(_=function(){return{w:i,m:y}})()}function O(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}O=function(t,e,r,n){function i(e,r){O(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},O(t,e,r,n)}function w(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,o)}function j(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){w(i,n,o,a,u,"next",t)}function u(t){w(i,n,o,a,u,"throw",t)}a(void 0)})}}function P(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,L(n.key),n)}}function L(t){var e=function(t){if("object"!=S(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=S(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==S(e)?e:e+""}function k(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(k=function(){return!!t})()}function I(t){return I=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},I(t)}function E(t,e){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},E(t,e)}var D=function(t){function e(t,r,n,o){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(i=function(t,e,r){return e=I(e),function(t,e){if(e&&("object"==S(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,k()?Reflect.construct(e,r||[],I(t).constructor):e.apply(t,r))}(this,e,[t,r,n,o]))._datasetSourceMap=new Map,window._datasetSourceMap=i._datasetSourceMap,i._symbolLayerIds=new Set,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&E(t,e)}(e,t),r=e,n=[{key:"createDataset",value:function(t,e){return new g(t,e)}},{key:"init",value:(c=j(_().m(function t(){var e,r,n,o=this;return _().w(function(t){for(;;)switch(t.n){case 0:return e=this._datasetRegistry.getPatternAndSymbolConfigs(),r=e.patternConfigs,n=e.symbolConfigs,t.n=1,this.addPatternsAndSymbolsToMap(r,n);case 1:return this._symbolLayerIds.clear(),this._datasetRegistry.forEachDataset(function(t){return o._addLayers(t)}),t.n=2,new Promise(function(t){return o._map.once("idle",t)});case 2:return t.a(2)}},t,this)})),function(){return c.apply(this,arguments)})},{key:"removeLayer",value:function(t){this._map.getLayer(t)&&this._map.removeLayer(t),this._symbolLayerIds.delete(t)}},{key:"addPatternsAndSymbolsToMap",value:(s=j(_().m(function t(e,r){var n,o;return _().w(function(t){for(;;)if(0===t.n)return n=this._datasetRegistry.mapStyle,o=n.id,t.a(2,Promise.all([this._mapProvider.addPatternsToMap(e,o,this._patternRegistry),this._mapProvider.addSymbolsToMap(r,n,this._symbolRegistry)]))},t,this)})),function(t,e){return s.apply(this,arguments)})},{key:"destroy",value:function(){var t=this,e=new Set;this._datasetRegistry.forEachDataset(function(r){var n=r.sourceId;t._getLayersUsingSource(n).forEach(function(e){return t.removeLayer(e)}),!e.has(n)&&t._map.getSource(n)&&(t._map.removeSource(n),e.add(n))}),this._datasetSourceMap.clear()}},{key:"onMapStyleChange",value:(a=j(_().m(function t(){var e,r,n,o=this;return _().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,new Promise(function(t){return o._map.once("idle",t)});case 1:return e=this._datasetRegistry.getPatternAndSymbolConfigs(),r=e.patternConfigs,n=e.symbolConfigs,t.n=2,this.addPatternsAndSymbolsToMap(r,n);case 2:this._symbolLayerIds.clear(),this._datasetRegistry.forEachDataset(function(t){o._addLayers(t),o._applyFeatureFilter(t)}),this.dynamicSources.forEach(function(t){return t.reapply()});case 3:return t.a(2)}},t,this)})),function(){return a.apply(this,arguments)})},{key:"onMapSizeChange",value:(i=j(_().m(function t(){var e,r,n,o,i,a=this;return _().w(function(t){for(;;)switch(t.n){case 0:return e=this._datasetRegistry.mapStyle,r=this._pixelRatio,n=this._datasetRegistry.getPatternAndSymbolConfigs(),o=n.patternConfigs,i=n.symbolConfigs,t.n=1,this.addPatternsAndSymbolsToMap(o,i);case 1:if(this._pixelRatio===r){t.n=2;break}return t.a(2);case 2:this._datasetRegistry.forEach(function(t){var n=t.fillLayerId,o=t.symbolLayerId;if(o&&a._symbolLayerIds.has(o)&&a._map.getLayer(o)){var i=a._symbolRegistry.getSymbolImageId(t.style,e,"normal",r);i&&a._map.setLayoutProperty(o,"icon-image",i)}else if(n&&a._map.getLayer(n)){var u=a._patternRegistry.getPatternImageId(t.style,e.id,r);u&&a._map.setPaintProperty(n,"fill-pattern",u)}});case 3:return t.a(2)}},t,this)})),function(){return i.apply(this,arguments)})},{key:"_registerPatternsAndSymbols",value:function(t){return this.addPatternsAndSymbolsToMap(t.patternConfigs,t.symbolConfigs)}},{key:"removeDataset",value:function(t){var e=this,r=this._datasetRegistry.getDataset(t);if(r){var n=r.sourceId;r.layerIds.forEach(function(t){return e.removeLayer(t)}),!this._datasetRegistry.topLevelDatasets().some(function(e){return e.id!==t&&e.sourceId===n})&&this._map.getSource(n)&&this._map.removeSource(n),this._datasetSourceMap.delete(t)}}},{key:"applyFeatureFilter",value:function(t){var e=this._datasetRegistry.getDataset(t);e&&this._applyFeatureFilter(e)}},{key:"applyStyle",value:(o=j(_().m(function t(e){var r,n=this;return _().w(function(t){for(;;)switch(t.n){case 0:return(r=this._datasetRegistry.getDataset(e)).layerIds.forEach(function(t){return n.removeLayer(t)}),t.n=1,this._registerPatternsAndSymbols(r);case 1:this._addLayers(r);case 2:return t.a(2)}},t,this)})),function(t){return o.apply(this,arguments)})},{key:"setData",value:function(t,e){var r=this._datasetSourceMap.get(t);if(r){var n=this._map.getSource(r);n&&"function"==typeof n.setData&&n.setData(e)}}},{key:"_addLayers",value:function(t){var e=this._datasetRegistry.mapStyle,r=u(this._mapProvider,t,e,this._symbolRegistry,this._patternRegistry,this._pixelRatio);this._datasetSourceMap.set(t.id,r),this._maintainSymbolOrdering(t)}},{key:"_getFirstSymbolLayerId",value:function(){var t,e=this,r=this._map.getStyle();if(null==r||!r.layers)return null;var n=r.layers.find(function(t){return e._symbolLayerIds.has(t.id)});return null!==(t=null==n?void 0:n.id)&&void 0!==t?t:null}},{key:"_maintainSymbolOrdering",value:function(t){var e=this,r=(t=t.isSublayer?t.parent:t).layerIds.filter(function(t){return t&&e._map.getLayer(t)});r.forEach(function(t){var r;"symbol"===(null===(r=e._map.getLayer(t))||void 0===r?void 0:r.type)?e._symbolLayerIds.add(t):e._symbolLayerIds.delete(t)});var n=this._getFirstSymbolLayerId();n&&r.forEach(function(t){e._symbolLayerIds.has(t)||e._map.moveLayer(t,n)})}},{key:"_setLayerVisibility",value:function(t,e){this._map.getLayer(t)&&this._map.setLayoutProperty(t,"visibility",e)}},{key:"_applyFeatureFilter",value:function(t){var e=this;t.getLayersWithFilters().forEach(function(t){var r=t.layerIds,n=t.filter;r.forEach(function(t){e._map.getLayer(t)&&e._map.setFilter(t,n)})})}},{key:"_setLayerOpacity",value:function(t,e){var r=this._map.getLayer(t);if(r){var n={line:"line-opacity",symbol:"icon-opacity"}[r.type]||"fill-opacity";this._map.setPaintProperty(t,n,e)}}},{key:"_getLayersUsingSource",value:function(t){var e=this._map.getStyle();return null!=e&&e.layers?e.layers.filter(function(e){return e.source===t}).map(function(t){return t.id}):[]}}],n&&P(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,i,a,s,c}(r(913).h)},416:function(t,e,r){r.d(e,{f:function(){return p}});var n=r(428);function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var i=function(t){var e,r=0,n=2166136261,i=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return u=t.done,t},e:function(t){s=!0,a=t},f:function(){try{u||null==r.return||r.return()}finally{if(s)throw a}}}}(t);try{for(i.s();!(e=i.n()).done;){var a=e.value.codePointAt(0);r=Math.imul(r,31)+a,n=Math.imul(n^a,16777619)}}catch(t){i.e(t)}finally{i.f()}return(r>>>0).toString(36)+(n>>>0).toString(36)};function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,c(n.key),n)}}function c(t){var e=function(t){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:e+""}function l(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(l=function(){return!!t})()}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}function y(t,e){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},y(t,e)}var p=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=f(e),function(t,e){if(e&&("object"==a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,l()?Reflect.construct(e,r||[],f(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&y(t,e)}(e,t),r=e,n=[{key:"_hiddenFeaturesIdExpression",get:function(){return this.hasDynamicGeoJSON?this.dynamicGeoJSON.hiddenFeaturesIdExpression:this.idProperty?["to-string",["get",this.idProperty]]:["to-string",["id"]]}},{key:"_hiddenFeaturesFilter",get:function(){var t,e=null===(t=this.hiddenFeatures)||void 0===t?void 0:t.filter(function(t){return-1!==t});return null!=e&&e.length?["!",["in",this._hiddenFeaturesIdExpression,["literal",e.map(String)]]]:null}},{key:"filter",get:function(){var t,e=["all"];null!==(t=this.parent)&&void 0!==t&&t.filter&&e.push(this.parent.filter),this._datasetDefinition.filter&&e.push(this._datasetDefinition.filter);var r=this._hiddenFeaturesFilter;return r&&e.push(r),1===e.length?null:e.length>2?e:e[1]}},{key:"leafLayerIds",get:function(){return[]}},{key:"layerIds",get:function(){return this.hasSublayers?this.sublayers.flatMap(function(t){return t.layerIds}).filter(Boolean):this.leafLayerIds}},{key:"getLayersWithValue",value:function(t){var e,r,n,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[];if(!1===o||this[o]){var a=this.leafLayerIds;if(a.length){var s=this[t];i.push((e={layerIds:a},n=s,(r=c(r=t))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e))}}return this.hasSublayers&&this.sublayers.forEach(function(e){if(!1===o||e[o]){var r=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return u(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.getLayersWithValue(t),1)[0];r&&i.push(r)}}),i}},{key:"getLayersWithVisibility",value:function(){return this.getLayersWithValue("visibility")}},{key:"getLayersWithOpacity",value:function(){return this.getLayersWithValue("opacity")}},{key:"getLayersWithFilters",value:function(){return this.getLayersWithValue("filter","hasHiddenFeatures")}},{key:"sourceId",get:function(){if(this.isSublayer)return this.parent.sourceId;if(this.hasDynamicGeoJSON)return this.dynamicGeoJSON.sourceId;if(this.tiles){var t=Array.isArray(this.tiles)?this.tiles.join(","):this.tiles;return"tiles-".concat(i(t))}return this.geojson?"string"==typeof this.geojson?"geojson-".concat(i(this.geojson)):"geojson-".concat(this.id):"source-".concat(this.id)}}],n&&s(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(n.j)},247:function(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}r.d(e,{o:function(){return o}});var o=function(t,e){if("number"==typeof t)return t;if(!t)return null;if("string"==typeof t)return t.trim();if("object"===n(t)){if(e&&null!=t[e])return t[e];var r=Object.values(t)[0];return null!=r?r:null}return null}}}]);