@provoly/dashboard 0.13.0 → 0.13.2

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 (133) hide show
  1. package/admin/admin.module.d.ts +12 -11
  2. package/admin/components/admin-classes/admin-classes-view/admin-attributes-select/admin-attributes-select.component.d.ts +3 -1
  3. package/admin/components/association/association.component.d.ts +9 -0
  4. package/admin/i18n/en.translations.d.ts +10 -0
  5. package/admin/i18n/fr.translations.d.ts +10 -0
  6. package/components/sinceDate/sinceDate.pipe.d.ts +1 -1
  7. package/dataset/components/dataset-detail/dataset-detail.component.d.ts +8 -1
  8. package/dataset/i18n/en.translations.d.ts +21 -1
  9. package/dataset/i18n/fr.translations.d.ts +21 -3
  10. package/dataset/style/_o-pry-dataset-detail.scss +21 -19
  11. package/dataset/style/_o-pry-dataset.scss +8 -1
  12. package/esm2022/admin/admin.module.mjs +6 -3
  13. package/esm2022/admin/components/admin-classes/admin-classes-select/admin-classes-select.component.mjs +4 -3
  14. package/esm2022/admin/components/admin-classes/admin-classes-view/admin-attributes-select/admin-attributes-select.component.mjs +9 -3
  15. package/esm2022/admin/components/admin-classes/admin-classes-view/admin-classes-view.component.mjs +2 -1
  16. package/esm2022/admin/components/admin-dataset/admin-select-dataset/admin-select-dataset.component.mjs +5 -4
  17. package/esm2022/admin/components/admin-fields/admin-fields-select/admin-fields-select.component.mjs +4 -3
  18. package/esm2022/admin/components/association/association.component.mjs +18 -0
  19. package/esm2022/admin/i18n/en.translations.mjs +11 -1
  20. package/esm2022/admin/i18n/fr.translations.mjs +11 -1
  21. package/esm2022/admin/store/admin.service.mjs +5 -5
  22. package/esm2022/components/sinceDate/sinceDate.pipe.mjs +7 -9
  23. package/esm2022/dataset/components/dataset-detail/dataset-detail.component.mjs +32 -9
  24. package/esm2022/dataset/components/dataset.component.mjs +9 -5
  25. package/esm2022/dataset/i18n/en.translations.mjs +23 -3
  26. package/esm2022/dataset/i18n/fr.translations.mjs +24 -6
  27. package/esm2022/dataset/style/css.component.mjs +2 -2
  28. package/esm2022/filters/date/date-filter.component.mjs +3 -3
  29. package/esm2022/filters/number/number-filter.component.mjs +3 -3
  30. package/esm2022/filters/text/text-filter.component.mjs +3 -3
  31. package/esm2022/import/components/import.component.mjs +5 -16
  32. package/esm2022/import/store/import.actions.mjs +1 -1
  33. package/esm2022/import/store/import.effects.mjs +3 -3
  34. package/esm2022/import/store/import.reducer.mjs +5 -13
  35. package/esm2022/import/store/import.selectors.mjs +5 -7
  36. package/esm2022/import/store/import.service.mjs +1 -1
  37. package/esm2022/lib/core/components/accordion/accordion-item/accordion-item.component.mjs +42 -0
  38. package/esm2022/lib/core/components/accordion/accordion.component.mjs +13 -0
  39. package/esm2022/lib/core/components/modal-status/modal-status.component.mjs +16 -6
  40. package/esm2022/lib/core/components/select/select.component.mjs +3 -3
  41. package/esm2022/lib/core/core.module.mjs +26 -8
  42. package/esm2022/lib/core/i18n/en.translations.mjs +3 -2
  43. package/esm2022/lib/core/i18n/fr.translations.mjs +3 -2
  44. package/esm2022/lib/core/model/dataset.interface.mjs +1 -1
  45. package/esm2022/lib/core/model/widget-map-manifest.interface.mjs +1 -2
  46. package/esm2022/lib/core/public-api.mjs +3 -1
  47. package/esm2022/lib/core/store/data-source/data-source.model.mjs +1 -1
  48. package/esm2022/lib/core/store/field/field.interface.mjs +3 -1
  49. package/esm2022/lib/core/symbol/symbol.service.mjs +53 -15
  50. package/esm2022/lib/core/toolbox/toolbox-manifest.service.mjs +4 -4
  51. package/esm2022/lib/dashboard/components/widgets/base-widget.component.mjs +1 -1
  52. package/esm2022/lib/dashboard/components/widgets/header/widget-header.component.mjs +3 -2
  53. package/esm2022/lib/dashboard/components/widgets/widget-instanciator/widget-instanciator.component.mjs +6 -4
  54. package/esm2022/pipeline/components/pipeline-editor/pipeline-editor.component.mjs +6 -11
  55. package/esm2022/pipeline/style/css.component.mjs +2 -2
  56. package/esm2022/presentation/components/presentation.component.mjs +3 -3
  57. package/esm2022/restitution/components/restitution-list/restitution-list.component.mjs +3 -7
  58. package/esm2022/restitution/style/css.component.mjs +2 -2
  59. package/esm2022/widgets/widget-map/component/widget-map.component.mjs +55 -195
  60. package/esm2022/widgets/widget-map/i18n/en.translations.mjs +2 -2
  61. package/esm2022/widgets/widget-map/i18n/fr.translations.mjs +2 -2
  62. package/esm2022/widgets/widget-map/interaction/interaction-manager.class.mjs +146 -0
  63. package/esm2022/widgets/widget-map/public-api.mjs +3 -1
  64. package/fesm2022/provoly-dashboard-admin.mjs +56 -15
  65. package/fesm2022/provoly-dashboard-admin.mjs.map +1 -1
  66. package/fesm2022/provoly-dashboard-components-sinceDate.mjs +6 -8
  67. package/fesm2022/provoly-dashboard-components-sinceDate.mjs.map +1 -1
  68. package/fesm2022/provoly-dashboard-dataset.mjs +86 -21
  69. package/fesm2022/provoly-dashboard-dataset.mjs.map +1 -1
  70. package/fesm2022/provoly-dashboard-filters-date.mjs +2 -2
  71. package/fesm2022/provoly-dashboard-filters-date.mjs.map +1 -1
  72. package/fesm2022/provoly-dashboard-filters-number.mjs +2 -2
  73. package/fesm2022/provoly-dashboard-filters-number.mjs.map +1 -1
  74. package/fesm2022/provoly-dashboard-filters-text.mjs +2 -2
  75. package/fesm2022/provoly-dashboard-filters-text.mjs.map +1 -1
  76. package/fesm2022/provoly-dashboard-import.mjs +14 -35
  77. package/fesm2022/provoly-dashboard-import.mjs.map +1 -1
  78. package/fesm2022/provoly-dashboard-pipeline.mjs +15 -19
  79. package/fesm2022/provoly-dashboard-pipeline.mjs.map +1 -1
  80. package/fesm2022/provoly-dashboard-presentation.mjs +2 -2
  81. package/fesm2022/provoly-dashboard-presentation.mjs.map +1 -1
  82. package/fesm2022/provoly-dashboard-restitution.mjs +4 -8
  83. package/fesm2022/provoly-dashboard-restitution.mjs.map +1 -1
  84. package/fesm2022/provoly-dashboard-widgets-widget-map.mjs +260 -260
  85. package/fesm2022/provoly-dashboard-widgets-widget-map.mjs.map +1 -1
  86. package/fesm2022/provoly-dashboard.mjs +200 -48
  87. package/fesm2022/provoly-dashboard.mjs.map +1 -1
  88. package/import/components/import.component.d.ts +3 -9
  89. package/import/store/import.actions.d.ts +3 -16
  90. package/import/store/import.effects.d.ts +1 -1
  91. package/import/store/import.reducer.d.ts +2 -5
  92. package/import/store/import.selectors.d.ts +2 -7
  93. package/import/store/import.service.d.ts +2 -2
  94. package/lib/core/components/accordion/accordion-item/accordion-item.component.d.ts +17 -0
  95. package/lib/core/components/accordion/accordion.component.d.ts +6 -0
  96. package/lib/core/components/modal-status/modal-status.component.d.ts +10 -1
  97. package/lib/core/core.module.d.ts +15 -11
  98. package/lib/core/i18n/en.translations.d.ts +1 -0
  99. package/lib/core/i18n/fr.translations.d.ts +1 -0
  100. package/lib/core/model/dataset.interface.d.ts +2 -1
  101. package/lib/core/model/widget-map-manifest.interface.d.ts +0 -1
  102. package/lib/core/public-api.d.ts +2 -0
  103. package/lib/core/store/data-source/data-source.model.d.ts +1 -0
  104. package/lib/core/store/field/field.interface.d.ts +3 -1
  105. package/lib/core/symbol/symbol.service.d.ts +18 -2
  106. package/lib/dashboard/components/widgets/base-widget.component.d.ts +1 -1
  107. package/package.json +11 -7
  108. package/pipeline/components/pipeline-editor/pipeline-editor.component.d.ts +1 -3
  109. package/pipeline/style/_o-pipeline.scss +0 -108
  110. package/restitution/components/restitution-list/restitution-list.component.d.ts +0 -2
  111. package/restitution/style/_o-restitution-list.scss +2 -24
  112. package/schematics/migration.json +10 -0
  113. package/schematics/ng-add/index.spec.js +33 -1
  114. package/schematics/ng-add/index.spec.js.map +1 -1
  115. package/schematics/ng-update/utils/complete.function.d.ts +2 -0
  116. package/schematics/ng-update/utils/complete.function.js +10 -0
  117. package/schematics/ng-update/utils/complete.function.js.map +1 -0
  118. package/schematics/ng-update/version-0-13/index.d.ts +2 -0
  119. package/schematics/ng-update/version-0-13/index.js +30 -0
  120. package/schematics/ng-update/version-0-13/index.js.map +1 -0
  121. package/schematics/ng-update/version-0-13/index.spec.d.ts +1 -0
  122. package/schematics/ng-update/version-0-13/index.spec.js +167 -0
  123. package/schematics/ng-update/version-0-13/index.spec.js.map +1 -0
  124. package/styles/abstracts/_mixins.scss +14 -0
  125. package/styles/components/_m-filter.scss +0 -1
  126. package/styles/components/_o-accordion.scss +91 -0
  127. package/styles/components/_o-panel.scss +46 -0
  128. package/styles-theme/components-theme/_o-accordion.theme.scss +30 -0
  129. package/styles-theme/components-theme/_o-pipeline.theme.scss +0 -26
  130. package/styles-theme/main-theme.scss +1 -0
  131. package/widgets/widget-map/component/widget-map.component.d.ts +14 -25
  132. package/widgets/widget-map/interaction/interaction-manager.class.d.ts +27 -0
  133. package/widgets/widget-map/public-api.d.ts +2 -0
@@ -7,27 +7,28 @@ import { Injectable, Component, ViewEncapsulation, Pipe, ViewContainerRef, Templ
7
7
  import * as i6 from '@angular/forms';
8
8
  import { FormsModule } from '@angular/forms';
9
9
  import * as i2 from '@provoly/dashboard';
10
- import { widgetMapConfig, DashboardActions, FieldType, ItemUtils, ClassSelectors, FieldSelectors, DataWidgetComponent, WIDGET_HEADER_HEIGHT, ConfigSelectors, DashboardSelectors, GeoMetadata, TooltipMode, DataSourceSelectors, ResultsetUtils, ContextMenuActions, ConfigActions, BaseWidgetModule, PryCoreModule, PryDashboardModule, PrySelectModule, PryIconModule, PryToggleModule, PryOverlayModule, PryI18nModule, PryRangeModule } from '@provoly/dashboard';
10
+ import { widgetMapConfig, DashboardActions, ContextMenuActions, TooltipMode, FieldType, ItemUtils, ClassSelectors, FieldSelectors, DataWidgetComponent, WIDGET_HEADER_HEIGHT, ConfigSelectors, DashboardSelectors, GeoMetadata, DataSourceSelectors, ResultsetUtils, ConfigActions, BaseWidgetModule, PryCoreModule, PryDashboardModule, PrySelectModule, PryIconModule, PryToggleModule, PryOverlayModule, PryI18nModule, PryRangeModule } from '@provoly/dashboard';
11
11
  import * as i7 from '@provoly/dashboard/components/checkbox';
12
12
  import { PryCheckboxModule } from '@provoly/dashboard/components/checkbox';
13
13
  import { TemplatePortal } from '@angular/cdk/portal';
14
14
  import equal from 'fast-deep-equal/es6';
15
- import { Feature, Map, View, Overlay } from 'ol';
16
- import LayerSwitcher from 'ol-layerswitcher';
17
- import { apply } from 'ol-mapbox-style';
18
- import { Control, Attribution, ScaleLine } from 'ol/control';
15
+ import { Feature, Overlay, Map, View } from 'ol';
16
+ import { applyStyle, applyBackground } from 'ol-mapbox-style';
19
17
  import { getWidth, getTopLeft, createEmpty, boundingExtent } from 'ol/extent';
20
18
  import { Heatmap, Tile } from 'ol/layer';
19
+ import VectorTileLayer from 'ol/layer/VectorTile';
21
20
  import { fromLonLat, toLonLat, get, transform } from 'ol/proj';
22
21
  import { register } from 'ol/proj/proj4';
23
22
  import { Vector, TileWMS, WMTS, XYZ, Cluster } from 'ol/source';
24
23
  import proj4 from 'proj4';
25
- import { map, combineLatest, filter, BehaviorSubject, startWith, debounceTime, delay, mergeMap, of, from, tap, distinctUntilChanged } from 'rxjs';
24
+ import { map, combineLatest, filter, BehaviorSubject, startWith, debounceTime, delay, mergeMap, of, from, distinctUntilChanged } from 'rxjs';
25
+ import LayerSwitcher from 'ol-layerswitcher';
26
+ import { Control, ScaleLine } from 'ol/control';
27
+ import BaseEvent from 'ol/events/Event';
26
28
  import { Polygon, GeometryCollection, Circle, MultiPolygon, MultiLineString, LineString, MultiPoint, Point } from 'ol/geom';
27
29
  import PointerInteraction from 'ol/interaction/Pointer';
28
30
  import TileLayer from 'ol/layer/Tile';
29
31
  import VectorLayer from 'ol/layer/Vector';
30
- import VectorTileLayer from 'ol/layer/VectorTile';
31
32
  import RenderBox from 'ol/render/Box';
32
33
  import VectorSource from 'ol/source/Vector';
33
34
  import { Style, Fill, Stroke, Circle as Circle$1, Text } from 'ol/style';
@@ -37,12 +38,74 @@ import CircleStyle from 'ol/style/Circle';
37
38
  import FeatureFormat from 'ol/format/Feature';
38
39
  import { parseZip } from 'shpjs';
39
40
  import { Buffer } from 'buffer';
40
- import BaseEvent from 'ol/events/Event';
41
41
  import tokml from 'geojson-to-kml';
42
42
  import * as i1 from '@ngrx/store';
43
43
  import VectorTile from 'ol/source/VectorTile';
44
44
  import WMTSTileGrid from 'ol/tilegrid/WMTS';
45
45
 
46
+ class AddressSearchedEvent extends BaseEvent {
47
+ // @ts-ignore
48
+ constructor({ type, coordinates, address, latLon, query }) {
49
+ super(type);
50
+ this.coordinates = coordinates;
51
+ this.address = address;
52
+ this.latLon = latLon;
53
+ this.query = query;
54
+ }
55
+ }
56
+ class SearchBarControl extends Control {
57
+ constructor(opt_options) {
58
+ const options = opt_options || {};
59
+ const button = document.createElement('button');
60
+ button.innerHTML = '<div></div>';
61
+ const element = document.createElement('div');
62
+ element.className = 'ol-searchbar ol-unselectable ol-control';
63
+ element.appendChild(button);
64
+ const input = document.createElement('input');
65
+ input.type = 'text';
66
+ input.placeholder = '1 rue de la Paix...';
67
+ input.style.display = 'none';
68
+ element.appendChild(input);
69
+ super({
70
+ element: element,
71
+ target: options.target
72
+ });
73
+ this.button = button;
74
+ button.addEventListener('click', this.toggleInputVisible.bind(this), false);
75
+ this.input = input;
76
+ input.addEventListener('keypress', this.keyPress.bind(this), false);
77
+ }
78
+ toggleInputVisible() {
79
+ if (this.inputVisible) {
80
+ this.input.style.display = 'none';
81
+ }
82
+ else {
83
+ this.input.style.display = 'block';
84
+ }
85
+ }
86
+ get inputVisible() {
87
+ return this.input.style.display === 'block';
88
+ }
89
+ keyPress(e) {
90
+ if (e.key === 'Enter') {
91
+ this.geocodingService?.fromAddress(this.input.value).subscribe((result) => {
92
+ this.getMap()?.dispatchEvent(new AddressSearchedEvent({
93
+ type: 'searched-address',
94
+ latLon: result.latLon,
95
+ coordinates: fromLonLat(result.latLon.reverse(), this.getMap()?.getView().getProjection()),
96
+ query: this.input.value,
97
+ address: result.pointAddress
98
+ }));
99
+ this.toggleInputVisible();
100
+ });
101
+ }
102
+ }
103
+ withGeocodingService(geocodingService) {
104
+ this.geocodingService = geocodingService;
105
+ return this;
106
+ }
107
+ }
108
+
46
109
  class SelectionInteraction extends PointerInteraction {
47
110
  constructor() {
48
111
  super({});
@@ -203,6 +266,145 @@ class SelectionInteraction extends PointerInteraction {
203
266
  }
204
267
  }
205
268
 
269
+ class InteractionManager {
270
+ constructor() {
271
+ this.selectionInteraction = new SelectionInteraction();
272
+ this.listeners = {
273
+ contextMenu: (e) => {
274
+ if (this.component.manifest.contextMenu !== false) {
275
+ const mapCoordinates = this.component.map.getEventPixel(e);
276
+ const itemId = this.component.map.forEachFeatureAtPixel(mapCoordinates, (feature) => feature.get('id'));
277
+ this.component.store.dispatch(ContextMenuActions.open({
278
+ itemId,
279
+ clientX: e.clientX,
280
+ clientY: e.clientY,
281
+ resultSet: Array.isArray(this.component.manifest.datasource)
282
+ ? this.component.manifest.datasource[0]
283
+ : this.component.manifest.datasource,
284
+ from: 'map',
285
+ coordinates: toLonLat(this.component.map.getCoordinateFromPixel(mapCoordinates), this.component.map.getView().getProjection()).reverse()
286
+ }));
287
+ e.preventDefault();
288
+ }
289
+ },
290
+ drop: (e) => {
291
+ this.component.import(e);
292
+ e.preventDefault();
293
+ },
294
+ popup: (event) => {
295
+ const values = this.component.map.getFeaturesAtPixel(event.pixel, { hitTolerance: 5 });
296
+ const valuesToDisplay = [
297
+ ...new Set(values
298
+ .map((value) => value.get('id'))
299
+ .filter((id) => !!id)
300
+ .map((id) => values.find((value) => value.get('id') === id))
301
+ .map((value) => ({
302
+ oClass: value?.get('oClass'),
303
+ coordinates: event.coordinate,
304
+ values: value?.getKeys().reduce((p, c) => ({ ...p, [c]: value.get(c) }), {})
305
+ })))
306
+ ];
307
+ this.component.classicFeatures$.next(valuesToDisplay);
308
+ const wmsLayers = this.component.getWMSLayers();
309
+ if (wmsLayers) {
310
+ this.component.getFeatureFromServer(wmsLayers, event.coordinate);
311
+ }
312
+ }
313
+ };
314
+ }
315
+ init(component) {
316
+ this.component = component;
317
+ this.addContextMenuInteraction();
318
+ this.addDropInteraction();
319
+ this.addOverlayOnInteraction();
320
+ this.addSearchBarControl();
321
+ this.addLayerSwitcher();
322
+ this.addScaleControl();
323
+ this.addUpdateZoomAndCenter();
324
+ this.component.map.addInteraction(this.selectionInteraction.init(this.component.store));
325
+ return this;
326
+ }
327
+ addContextMenuInteraction() {
328
+ this.component.map.getViewport().addEventListener('contextmenu', this.listeners.contextMenu);
329
+ }
330
+ addDropInteraction() {
331
+ this.component.map.getViewport().addEventListener('drop', this.listeners.drop);
332
+ }
333
+ addOverlayOnInteraction() {
334
+ if (!this.interactionPopupOverlay) {
335
+ this.interactionPopupOverlay = new Overlay({
336
+ element: this.component.popup.nativeElement,
337
+ offset: [9, 9]
338
+ });
339
+ this.component.map.addOverlay(this.interactionPopupOverlay);
340
+ }
341
+ if (this.component.optionsCopy.tooltipMode !== TooltipMode.NONE) {
342
+ this.component.map.un('singleclick', this.listeners.popup);
343
+ this.component.map.on('singleclick', this.listeners.popup);
344
+ }
345
+ }
346
+ addScaleControl() {
347
+ if (!this.scaleControl) {
348
+ this.scaleControl = new ScaleLine({
349
+ units: 'metric',
350
+ bar: true,
351
+ steps: 4,
352
+ text: true,
353
+ minWidth: 140
354
+ });
355
+ this.component.map.addControl(this.scaleControl);
356
+ }
357
+ }
358
+ addSearchBarControl() {
359
+ this.searchBarControl = new SearchBarControl({}).withGeocodingService(this.component.geocodingService);
360
+ this.component.map.addControl(this.searchBarControl);
361
+ const addressOverlay = new Overlay({
362
+ element: this.component.address.nativeElement,
363
+ offset: [9, 9]
364
+ });
365
+ this.component.map.addOverlay(addressOverlay);
366
+ // @ts-ignore
367
+ this.component.map.on('searched-address', (evt) => {
368
+ this.component.address.nativeElement.innerHTML = `<div>
369
+ <div>${this.component.translateService.instant('@pry.widget.map.address')}: ${evt.address}</div>
370
+ <div>${this.component.translateService.instant('@pry.widget.map.addressCoords')}: ${evt.latLon}</div>
371
+ </div>`;
372
+ this.component.address.nativeElement.style.display = '';
373
+ addressOverlay.setPosition(evt.coordinates);
374
+ this.component.map.getView().setCenter(evt.coordinates);
375
+ this.component.map.getView().setZoom(this.component.map.getView().getMaxZoom());
376
+ });
377
+ }
378
+ addLayerSwitcher() {
379
+ this.layerSwitchControl = new LayerSwitcher({
380
+ activationMode: 'click',
381
+ reverse: false
382
+ });
383
+ this.component.map.addControl(this.layerSwitchControl);
384
+ // @ts-ignore
385
+ this.layerSwitchControl.on('show', () => {
386
+ this.component.legendTabOpen = false;
387
+ });
388
+ }
389
+ addUpdateZoomAndCenter() {
390
+ this.component.map.on('moveend', () => {
391
+ this.component.optionsCopy.zoom = {
392
+ start: this.component.map.getView().getZoom() ??
393
+ this.component.optionsCopy.zoom?.start ??
394
+ this.component.map.getView().getMinZoom(),
395
+ min: this.component.map.getView().getMinZoom(),
396
+ max: this.component.map.getView().getMaxZoom()
397
+ };
398
+ this.component.optionsCopy.center =
399
+ toLonLat(this.component.map.getView().getCenter() ?? [0, 0]) ?? this.component.optionsCopy.center;
400
+ this.component.zoomAndCenter$.next({
401
+ zoom: this.component.optionsCopy.zoom,
402
+ center: this.component.optionsCopy.center
403
+ });
404
+ });
405
+ }
406
+ }
407
+
206
408
  class KmzZipReader {
207
409
  constructor() {
208
410
  this.reader = new JSZip();
@@ -374,69 +576,6 @@ class MapFormatsReader {
374
576
  }
375
577
  }
376
578
 
377
- class AddressSearchedEvent extends BaseEvent {
378
- // @ts-ignore
379
- constructor({ type, coordinates, address, latLon, query }) {
380
- super(type);
381
- this.coordinates = coordinates;
382
- this.address = address;
383
- this.latLon = latLon;
384
- this.query = query;
385
- }
386
- }
387
- class SearchBarControl extends Control {
388
- constructor(opt_options) {
389
- const options = opt_options || {};
390
- const button = document.createElement('button');
391
- button.innerHTML = '<div></div>';
392
- const element = document.createElement('div');
393
- element.className = 'ol-searchbar ol-unselectable ol-control';
394
- element.appendChild(button);
395
- const input = document.createElement('input');
396
- input.type = 'text';
397
- input.placeholder = '1 rue de la Paix...';
398
- input.style.display = 'none';
399
- element.appendChild(input);
400
- super({
401
- element: element,
402
- target: options.target
403
- });
404
- this.button = button;
405
- button.addEventListener('click', this.toggleInputVisible.bind(this), false);
406
- this.input = input;
407
- input.addEventListener('keypress', this.keyPress.bind(this), false);
408
- }
409
- toggleInputVisible() {
410
- if (this.inputVisible) {
411
- this.input.style.display = 'none';
412
- }
413
- else {
414
- this.input.style.display = 'block';
415
- }
416
- }
417
- get inputVisible() {
418
- return this.input.style.display === 'block';
419
- }
420
- keyPress(e) {
421
- if (e.key === 'Enter') {
422
- this.geocodingService?.fromAddress(this.input.value).subscribe((result) => {
423
- this.getMap()?.dispatchEvent(new AddressSearchedEvent({
424
- type: 'searched-address',
425
- latLon: result.latLon,
426
- coordinates: fromLonLat(result.latLon.reverse(), this.getMap()?.getView().getProjection()),
427
- query: this.input.value,
428
- address: result.pointAddress
429
- }));
430
- this.toggleInputVisible();
431
- });
432
- }
433
- }
434
- withGeocodingService(geocodingService) {
435
- this.geocodingService = geocodingService;
436
- return this;
437
- }
438
- }
439
-
440
579
  const populateLocationAttribute = (layer, resultSet, classesNotFiltered, fields) => {
441
580
  if (['heatmap', 'marker', 'bubble', 'point', 'line', 'polygon', 'multi-line', 'multi-polygon'].includes(layer.type) &&
442
581
  !!resultSet &&
@@ -1052,7 +1191,6 @@ class WidgetMapComponent extends DataWidgetComponent {
1052
1191
  .instant('@pry.widget.map.layerType.' + a)
1053
1192
  .localeCompare(this.translateService.instant('@pry.widget.map.layerType.' + b)));
1054
1193
  this.optionsCopy = {};
1055
- this.selectionInteraction = new SelectionInteraction();
1056
1194
  this.additionalLayers$ = new BehaviorSubject([]);
1057
1195
  this.WIDGET_HEADER_HEIGHT = WIDGET_HEADER_HEIGHT;
1058
1196
  this.i = 0;
@@ -1062,6 +1200,7 @@ class WidgetMapComponent extends DataWidgetComponent {
1062
1200
  this.legendTab = 0;
1063
1201
  this.imageNotProvided = [];
1064
1202
  this.zoomAndCenter$ = new BehaviorSubject({});
1203
+ this.interactionManager = new InteractionManager();
1065
1204
  this.basicActions$ = this.actions$.pipe(map((actions) => actions.filter((action) => action !== 'export' && action !== 'upload')));
1066
1205
  this.classes$ = this.store
1067
1206
  .select(ClassSelectors.classes)
@@ -1108,9 +1247,6 @@ class WidgetMapComponent extends DataWidgetComponent {
1108
1247
  // auto determine layers parameters to provide a working view
1109
1248
  const autoOptions = JSON.parse(JSON.stringify({ relations: true, ...manifest.options }));
1110
1249
  if (!autoOptions.tooltipMode) {
1111
- autoOptions.tooltipMode = TooltipMode.HOVER;
1112
- }
1113
- if (geoLayers.length > 0) {
1114
1250
  autoOptions.tooltipMode = TooltipMode.CLICK;
1115
1251
  }
1116
1252
  autoOptions.layers?.forEach((layer, i) => {
@@ -1177,7 +1313,7 @@ class WidgetMapComponent extends DataWidgetComponent {
1177
1313
  Object.values(rs.items).forEach((items) => {
1178
1314
  items.forEach((item) => Promise.all([
1179
1315
  this.symbolService.getSymbolAsIconStyle(item),
1180
- this.symbolService.getSymbolAsIconStyle(item, '#8cd560')
1316
+ this.symbolService.getSymbolAsIconStyle(item, true)
1181
1317
  ]).then(([style, bStyle]) => {
1182
1318
  result[item.id] = { classic: style, bordered: bStyle };
1183
1319
  if (Object.keys(result).length >= total) {
@@ -1194,56 +1330,40 @@ class WidgetMapComponent extends DataWidgetComponent {
1194
1330
  return (size.height ?? 100) - WIDGET_HEADER_HEIGHT - top - 56; // 56px is the tooltip height + margin
1195
1331
  }), delay(10));
1196
1332
  }
1333
+ initInteractionManager() {
1334
+ return this.interactionManager.init(this);
1335
+ }
1197
1336
  ngAfterViewInit() {
1198
- this.map$ = combineLatest([this.mapUrl$, this.options$, this.itemStyles$, this.widgetSize$]).pipe(debounceTime(300), mergeMap(([mapUrl, options, rs]) => {
1199
- if (!this.map) {
1200
- this.map = new Map({ target: this.mapRef.nativeElement });
1201
- }
1202
- this.map.setTarget(undefined);
1203
- const rect = this.mapRef.nativeElement.getBoundingClientRect();
1204
- if (rect.height === 0 || rect.width === 0) {
1205
- console.warn('Map size problem. Resize map');
1206
- }
1207
- let mapPromise = new Promise((resolve) => resolve(this.map));
1208
- if (options.style !== 'none') {
1209
- mapPromise = apply(this.map, `${mapUrl}/styles/${options.style}/style.json`);
1337
+ this.map = new Map({ target: this.mapRef.nativeElement });
1338
+ this.interactionManager = this.initInteractionManager();
1339
+ this.mapStyle$ = this.options$.pipe(map((options) => options.style), distinctUntilChanged());
1340
+ this.mapStyleLayer$ = combineLatest([this.mapStyle$, this.mapUrl$]).pipe(map(([style, url]) => {
1341
+ if (!style || style === 'none') {
1342
+ return [];
1210
1343
  }
1211
- return from(mapPromise).pipe(tap((map) => {
1212
- this.map.setTarget(this.mapRef.nativeElement);
1213
- this.map.setView(new View({
1214
- center: fromLonLat(options.center ?? DEFAULT_MAP_CENTER),
1215
- maxZoom: options.zoom?.max ?? DEFAULT_ZOOM_MAX,
1216
- minZoom: options.zoom?.min ?? DEFAULT_ZOOM_MIN,
1217
- zoom: options.zoom?.start ?? DEFAULT_ZOOM_START
1218
- }));
1219
- if (!options.attributions) {
1220
- this.map.getControls().forEach((control) => {
1221
- if (control instanceof Attribution) {
1222
- this.map.removeControl(control);
1223
- }
1224
- });
1225
- }
1226
- this.map.addInteraction(this.selectionInteraction.init(this.store));
1227
- this.addContextMenuInteraction();
1228
- this.addDropInteraction();
1229
- this.addOverlayOnInteraction();
1230
- this.addSearchBarControl();
1231
- this.addLayerSwitcher();
1232
- this.addScaleControl();
1233
- this.addUpdateZoomAndCenter();
1234
- this.fitMapForObjects(options);
1235
- }));
1344
+ const layer = new VectorTileLayer({ declutter: true });
1345
+ applyStyle(layer, `${url}/styles/${style}/style.json`).catch((err) => console.warn('Style application problem', err));
1346
+ applyBackground(layer, `${url}/styles/${style}/style.json`).catch((err) => console.warn('Background application problem', err));
1347
+ return [layer];
1236
1348
  }));
1349
+ this.options$
1350
+ .pipe(map((options) => ({
1351
+ center: fromLonLat(options.center ?? DEFAULT_MAP_CENTER),
1352
+ maxZoom: options.zoom?.max ?? DEFAULT_ZOOM_MAX,
1353
+ minZoom: options.zoom?.min ?? DEFAULT_ZOOM_MIN,
1354
+ zoom: options.zoom?.start ?? DEFAULT_ZOOM_START
1355
+ })), distinctUntilChanged())
1356
+ .subscribe((view) => this.map.setView(new View(view)));
1357
+ this.fitOption$ = this.options$.pipe(map((options) => !!options.fit), distinctUntilChanged());
1358
+ this.fitOption$.subscribe((fit) => this.fitMapForObjects(fit));
1237
1359
  this.layers$ = combineLatest([
1238
1360
  this.resultSet$,
1239
- this.usedDatasources$,
1240
1361
  this.options$,
1241
1362
  this.classes$,
1242
1363
  this.additionalLayers$,
1243
1364
  this.itemStyles$,
1244
- this.store.select(ConfigSelectors.geoServerUrl),
1245
- this.map$
1246
- ]).pipe(filter(([resultSet, dataSources, options, classes, additionalLayers, itemStyles, geoServerUrl, map]) => !!resultSet && !!options && !!classes && !!map), map(([resultSet, dataSources, options, classes, additionalLayers, itemStyles, geoServerUrl]) => {
1365
+ this.store.select(ConfigSelectors.geoServerUrl)
1366
+ ]).pipe(filter(([resultSet, options, classes, additionalLayers, itemStyles, geoServerUrl]) => !!resultSet && !!options && !!classes), map(([resultSet, options, classes, additionalLayers, itemStyles, geoServerUrl]) => {
1247
1367
  let hasRelationLayer = null;
1248
1368
  const layers = (options?.layers || [])
1249
1369
  .filter(
@@ -1315,33 +1435,25 @@ class WidgetMapComponent extends DataWidgetComponent {
1315
1435
  return layers;
1316
1436
  }));
1317
1437
  this.legendLayers$ = this.options$.pipe(map((options) => (options.layers ?? []).filter((layer) => ['geoserver', 'wms'].includes(layer.type))), delay(10));
1318
- this.subscriptions.add(combineLatest([
1319
- this.mapUrl$,
1320
- this.map$,
1321
- this.layers$,
1322
- this.options$,
1323
- this.selectedIds$,
1324
- this.additionalLayers$
1325
- ]).subscribe(([mapUrl, map, layers, options, selectedIds]) => {
1326
- this.map.setLayers(layers);
1438
+ this.subscriptions.add(combineLatest([this.mapStyleLayer$, this.layers$, this.fitOption$, this.selectedIds$]).subscribe(([mapStyleLayer, layers, fit, selectedIds]) => {
1439
+ const toApplyLayers = [...layers, ...mapStyleLayer];
1440
+ this.map.setLayers(toApplyLayers);
1327
1441
  this.map
1328
1442
  .getAllLayers()
1329
1443
  .filter((layer) => !(layer instanceof Tile))
1330
1444
  .forEach((layer) => {
1331
- layer.getSource()?.getFeatures().forEach((feature) => {
1332
- const type = feature.get('type');
1333
- if (['bubble', 'marker', 'point', 'line', 'polygon', 'multi-line', 'multi-polygon'].includes(type)) {
1334
- feature.setStyle(feature.get(selectedIds.includes(feature.get('id')) ? 'selectedStyle' : 'classicStyle'));
1335
- }
1336
- });
1337
- });
1338
- setTimeout(() => {
1339
- if (options.style !== 'none') {
1340
- apply(this.map, `${mapUrl}/styles/${options.style}/style.json`).then((map) => {
1341
- this.map.setTarget(this.mapRef.nativeElement);
1445
+ const getFeatures = layer.getSource()?.getFeatures;
1446
+ if (typeof getFeatures === 'function') {
1447
+ layer.getSource()?.getFeatures().forEach((feature) => {
1448
+ const type = feature.get('type');
1449
+ if (['bubble', 'marker', 'point', 'line', 'polygon', 'multi-line', 'multi-polygon'].includes(type)) {
1450
+ feature.setStyle(feature.get(selectedIds.includes(feature.get('id')) ? 'selectedStyle' : 'classicStyle'));
1451
+ }
1342
1452
  });
1343
1453
  }
1344
- this.fitMapForObjects(options, selectedIds);
1454
+ });
1455
+ setTimeout(() => {
1456
+ this.fitMapForObjects(fit, selectedIds);
1345
1457
  this.map.updateSize();
1346
1458
  }, 200);
1347
1459
  }));
@@ -1412,10 +1524,11 @@ class WidgetMapComponent extends DataWidgetComponent {
1412
1524
  });
1413
1525
  }
1414
1526
  setDefaultLayerTitle(layer, idx) {
1415
- layer.title = idx + 1 + ' - ' + this.translateService.instant(`@pry.widget.map.layerType.${layer.type}`);
1527
+ layer.title =
1528
+ idx + 1 + ' - ' + this.translateService.instant(`@pry.widget.map.layerType.${layer.type}`, { ...layer });
1416
1529
  }
1417
- fitMapForObjects(options, selectedIds) {
1418
- if (!!options?.fit) {
1530
+ fitMapForObjects(fit, selectedIds) {
1531
+ if (fit) {
1419
1532
  let extent = createEmpty();
1420
1533
  const listOfMarkers = [];
1421
1534
  this.map
@@ -1460,59 +1573,6 @@ class WidgetMapComponent extends DataWidgetComponent {
1460
1573
  }
1461
1574
  }
1462
1575
  }
1463
- addOverlayOnInteraction() {
1464
- if (!this.interactionPopupOverlay) {
1465
- this.interactionPopupOverlay = new Overlay({
1466
- element: this.popup.nativeElement,
1467
- offset: [9, 9]
1468
- });
1469
- this.map.addOverlay(this.interactionPopupOverlay);
1470
- }
1471
- if (this.optionsCopy.tooltipMode !== TooltipMode.NONE) {
1472
- const tooltip = this.optionsCopy.tooltipMode === TooltipMode.CLICK ? 'singleclick' : 'pointermove';
1473
- if (!!this.interactionPopupMode && !!this.interactionPopupListener) {
1474
- this.map.un(this.interactionPopupMode, this.interactionPopupListener);
1475
- }
1476
- this.interactionPopupListener = (event) => {
1477
- const values = this.map.getFeaturesAtPixel(event.pixel, { hitTolerance: 5 });
1478
- const valuesToDisplay = [
1479
- ...new Set(values
1480
- .map((value) => value.get('id'))
1481
- .filter((id) => !!id)
1482
- .map((id) => values.find((value) => value.get('id') === id))
1483
- .map((value) => ({
1484
- oClass: value?.get('oClass'),
1485
- coordinates: event.coordinate,
1486
- values: value?.getKeys().reduce((p, c) => ({ ...p, [c]: value.get(c) }), {})
1487
- })))
1488
- ];
1489
- this.classicFeatures$.next(valuesToDisplay);
1490
- const wmsLayers = this.getWMSLayers();
1491
- if (wmsLayers) {
1492
- this.getFeatureFromServer(wmsLayers, event.coordinate);
1493
- }
1494
- };
1495
- this.map.on(tooltip, this.interactionPopupListener);
1496
- this.interactionPopupMode = tooltip;
1497
- }
1498
- }
1499
- addContextMenuInteraction() {
1500
- if (this.manifest.contextMenu !== false) {
1501
- this.map.getViewport().addEventListener('contextmenu', (e) => {
1502
- const mapCoordinates = this.map.getEventPixel(e);
1503
- const itemId = this.map.forEachFeatureAtPixel(mapCoordinates, (feature) => feature.get('id'));
1504
- this.store.dispatch(ContextMenuActions.open({
1505
- itemId,
1506
- clientX: e.clientX,
1507
- clientY: e.clientY,
1508
- resultSet: Array.isArray(this.manifest.datasource) ? this.manifest.datasource[0] : this.manifest.datasource,
1509
- from: 'map',
1510
- coordinates: toLonLat(this.map.getCoordinateFromPixel(mapCoordinates), this.map.getView().getProjection()).reverse()
1511
- }));
1512
- e.preventDefault();
1513
- });
1514
- }
1515
- }
1516
1576
  getAttributesForDrawing(classes, classId, layer) {
1517
1577
  const classObj = classes.find((cl) => cl.id === classId) ?? { attributes: [] };
1518
1578
  const locationAttribute = this.getLocationAttribute(classObj, layer);
@@ -1543,9 +1603,6 @@ class WidgetMapComponent extends DataWidgetComponent {
1543
1603
  this.optionsCopy.layers?.forEach((layer) => delete layer.attribution);
1544
1604
  }
1545
1605
  }
1546
- changeTooltipMode($event) {
1547
- this.optionsCopy.tooltipMode = $event === 'hover' ? TooltipMode.HOVER : TooltipMode.CLICK;
1548
- }
1549
1606
  addLayer() {
1550
1607
  if (!this.optionsCopy.layers) {
1551
1608
  this.optionsCopy.layers = [];
@@ -1677,12 +1734,6 @@ class WidgetMapComponent extends DataWidgetComponent {
1677
1734
  input.value = null;
1678
1735
  }
1679
1736
  }
1680
- addDropInteraction() {
1681
- this.map.getViewport().addEventListener('drop', (e) => {
1682
- this.import(e);
1683
- e.preventDefault();
1684
- });
1685
- }
1686
1737
  changeClustered(layer, $event) {
1687
1738
  layer.clustered = $event;
1688
1739
  if (layer.clustered) {
@@ -1693,60 +1744,9 @@ class WidgetMapComponent extends DataWidgetComponent {
1693
1744
  // @ts-ignore
1694
1745
  layer.clusterDistance = $event.currentTarget?.value;
1695
1746
  }
1696
- addScaleControl() {
1697
- this.map.addControl(new ScaleLine({
1698
- units: 'metric',
1699
- bar: true,
1700
- steps: 4,
1701
- text: true,
1702
- minWidth: 140
1703
- }));
1704
- }
1705
- addSearchBarControl() {
1706
- this.searchBarControl = new SearchBarControl({}).withGeocodingService(this.geocodingService);
1707
- this.map.addControl(this.searchBarControl);
1708
- const addressOverlay = new Overlay({
1709
- element: this.address.nativeElement,
1710
- offset: [9, 9]
1711
- });
1712
- this.map.addOverlay(addressOverlay);
1713
- // @ts-ignore
1714
- this.map.on('searched-address', (evt) => {
1715
- this.address.nativeElement.innerHTML = `<div>
1716
- <div>${this.translateService.instant('@pry.widget.map.address')}: ${evt.address}</div>
1717
- <div>${this.translateService.instant('@pry.widget.map.addressCoords')}: ${evt.latLon}</div>
1718
- </div>`;
1719
- this.address.nativeElement.style.display = '';
1720
- addressOverlay.setPosition(evt.coordinates);
1721
- this.map.getView().setCenter(evt.coordinates);
1722
- this.map.getView().setZoom(this.map.getView().getMaxZoom());
1723
- });
1724
- }
1725
- addLayerSwitcher() {
1726
- this.layerSwitchControl = new LayerSwitcher({
1727
- activationMode: 'click',
1728
- reverse: false
1729
- });
1730
- this.map.addControl(this.layerSwitchControl);
1731
- // @ts-ignore
1732
- this.layerSwitchControl.on('show', () => {
1733
- this.legendTabOpen = false;
1734
- });
1735
- }
1736
1747
  hideAddress() {
1737
1748
  this.address.nativeElement.style.display = 'none';
1738
1749
  }
1739
- addUpdateZoomAndCenter() {
1740
- this.map.on('moveend', () => {
1741
- this.optionsCopy.zoom = {
1742
- start: this.map.getView().getZoom() ?? this.optionsCopy.zoom?.start ?? this.map.getView().getMinZoom(),
1743
- min: this.map.getView().getMinZoom(),
1744
- max: this.map.getView().getMaxZoom()
1745
- };
1746
- this.optionsCopy.center = toLonLat(this.map.getView().getCenter() ?? [0, 0]) ?? this.optionsCopy.center;
1747
- this.zoomAndCenter$.next({ zoom: this.optionsCopy.zoom, center: this.optionsCopy.center });
1748
- });
1749
- }
1750
1750
  changeOpacity(layer, $event) {
1751
1751
  // @ts-ignore
1752
1752
  layer.opacity = parseInt($event, 10);
@@ -1813,14 +1813,14 @@ class WidgetMapComponent extends DataWidgetComponent {
1813
1813
  }
1814
1814
  toggleLegendWindow() {
1815
1815
  this.legendTabOpen = !this.legendTabOpen;
1816
- this.layerSwitchControl?.hidePanel();
1816
+ this.interactionManager.layerSwitchControl?.hidePanel();
1817
1817
  }
1818
1818
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: WidgetMapComponent, deps: [{ token: i1.Store }, { token: i2.PrySnackbarService }, { token: i2.PryI18nService }, { token: i2.TooltipFactoryService }, { token: i2.GeocodingService }, { token: i3.Overlay }, { token: i0.ViewContainerRef }, { token: i2.SymbolService }, { token: i0.Injector }, { token: WidgetMapLayerService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
1819
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.6", type: WidgetMapComponent, selector: "pry-widget-map", viewQueries: [{ propertyName: "mapRef", first: true, predicate: ["map"], descendants: true }, { propertyName: "popup", first: true, predicate: ["popup"], descendants: true }, { propertyName: "popupContent", first: true, predicate: ["popupContent"], descendants: true, read: ViewContainerRef }, { propertyName: "exportTypeTemplate", first: true, predicate: ["exportTypeTemplate"], descendants: true, read: TemplateRef }, { propertyName: "address", first: true, predicate: ["address"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<pry-widget-map-css></pry-widget-map-css>\n<div class=\"o-widget o-widget--map\">\n <pry-widget-header\n [datasourceIds]=\"(datasourceIds$ | async) ?? []\"\n *ngIf=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [manifest]=\"manifest\"\n (manifestModified)=\"manifestModified.emit($event)\"\n [headerOptions]=\"(displayHeader$ | async) ?? {}\"\n #header\n >\n <pry-settings\n (saveTriggered)=\"emitManifest()\"\n [headerPresent]=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [header]=\"header\"\n [open$]=\"open$\"\n class=\"o-settings\"\n >\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"map_style\">{{ '@pry.widget.map.style' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeStyle($event)\"\n [itemsAsOption]=\"true\"\n [items]=\"styles$ | async\"\n [ngModel]=\"optionsCopy.style\"\n bindLabel=\"label\"\n bindValue=\"identifier\"\n id=\"map_style\"\n class=\"a-pry-select\"\n ></pry-select>\n </div>\n\n <pry-checkbox (ngModelChange)=\"changeFit($event)\" [ngModel]=\"optionsCopy.fit ?? false\">\n {{ '@pry.widget.map.fit' | i18n }}\n </pry-checkbox>\n\n <pry-checkbox (ngModelChange)=\"changeAttributions($event)\" [ngModel]=\"optionsCopy.attributions ?? false\">\n {{ '@pry.widget.map.attributions' | i18n }}\n </pry-checkbox>\n\n <fieldset class=\"m-form-radio-group-wrapper\">\n <legend class=\"a-label\">{{ '@pry.widget.map.tooltip.title' | i18n }}</legend>\n <div class=\"m-form-radio-group\">\n <div class=\"m-form-radio-group__item\">\n <input\n class=\"a-form-field\"\n type=\"radio\"\n id=\"click\"\n name=\"tooltip\"\n [ngModel]=\"optionsCopy.tooltipMode\"\n (ngModelChange)=\"changeTooltipMode('click')\"\n value=\"click\"\n [disabled]=\"((geoServerLayerDescriptions$ | async)?.length ?? 0) > 0\"\n />\n <label for=\"click\" class=\"a-label\">\n {{ '@pry.widget.map.tooltip.click' | i18n }}\n </label>\n </div>\n <div class=\"m-form-radio-group__item\">\n <input\n class=\"a-form-field\"\n type=\"radio\"\n id=\"hover\"\n name=\"tooltip\"\n [ngModel]=\"optionsCopy.tooltipMode\"\n (ngModelChange)=\"changeTooltipMode('hover')\"\n value=\"hover\"\n [disabled]=\"((geoServerLayerDescriptions$ | async)?.length ?? 0) > 0\"\n />\n <label for=\"hover\" class=\"a-label\">\n {{ '@pry.widget.map.tooltip.hover' | i18n }}\n </label>\n </div>\n </div>\n </fieldset>\n\n <div class=\"o-settings__popup__content__actions -has-separator\">\n <button type=\"button\" (click)=\"addLayer()\" class=\"a-btn a-btn--icon-text -link-like\">\n <pry-icon iconSvg=\"library_add\"></pry-icon>\n {{ '@pry.widget.map.addLayer' | i18n }}\n </button>\n </div>\n\n <div *ngFor=\"let layer of optionsCopy?.layers; let i = index\" class=\"o-settings__popup__content__fields\">\n <div class=\"o-settings__popup__content__fields__head\">\n <h3 class=\"a-h3 settings-layer-title__title\">{{ '@pry.widget.map.layer' | i18n : { index: i + 1 } }}</h3>\n <div class=\"m-btn-group\">\n <button type=\"button\" class=\"a-btn a-btn--icon-only\" (click)=\"invertLayers(i, i - 1)\" *ngIf=\"i > 0\">\n <pry-icon iconSvg=\"fleche_haut\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.action.moveUp' | i18n }}</span>\n </button>\n <button\n type=\"button\"\n class=\"a-btn a-btn--icon-only\"\n (click)=\"invertLayers(i, i + 1)\"\n *ngIf=\"i < (optionsCopy?.layers?.length ?? 0) - 1\"\n >\n <pry-icon iconSvg=\"fleche_bas\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.action.moveDown' | i18n }}</span>\n </button>\n </div>\n </div>\n\n <div class=\"o-settings__popup__content__fields__content\">\n <pry-range\n [ngModel]=\"(layer?.opacity ?? 100) + ''\"\n (ngModelChange)=\"changeOpacity(layer, $event)\"\n labelTranslate=\"@pry.widget.map.opacity\"\n min=\"0\"\n max=\"100\"\n ></pry-range>\n\n <fieldset>\n <legend class=\"u-visually-hidden\">{{ '@pry.widget.map.layerOptions' | i18n : { index: i + 1 } }}</legend>\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"map_layerTitle\">{{ '@pry.widget.map.layerTitle' | i18n }}</label>\n <input\n id=\"map_layerTitle\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeTitle($event, layer)\"\n [value]=\"layer.title ?? ''\"\n />\n </div>\n\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"map_layerType\">{{ '@pry.widget.map.layerType.title' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeLayerType($event, i)\"\n [bindData]=\"true\"\n [itemsAsOption]=\"true\"\n [items]=\"layerTypes\"\n [labelTranslate]=\"true\"\n [ngModel]=\"layer.type\"\n [disabled]=\"layer.type === 'geoserver'\"\n baseTranslate=\"@pry.widget.map.layerType.\"\n class=\"a-pry-select\"\n id=\"map_layerType\"\n ></pry-select>\n </div>\n\n <div\n *ngIf=\"\n layer.type !== 'relation' &&\n layer.type !== 'wms' &&\n layer.type !== 'wmts' &&\n layer.type !== 'geoserver' &&\n layer.type !== 'featurelayer' &&\n layer.type !== 'vectortile' &&\n layer.type !== 'rastertile'\n \"\n class=\"m-form-label-field\"\n >\n <label class=\"a-label\" for=\"map_classes\">{{ '@pry.widget.map.classes' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeClasses($event, layer)\"\n [itemsAsOption]=\"true\"\n [items]=\"classes$ | async\"\n [multiple]=\"true\"\n [ngModel]=\"layer.classes\"\n bindLabel=\"name\"\n bindValue=\"id\"\n class=\"a-pry-select\"\n id=\"map_classes\"\n ></pry-select>\n </div>\n </fieldset>\n </div>\n\n <fieldset\n *ngIf=\"\n layer.type !== 'relation' &&\n layer.type !== 'wms' &&\n layer.type !== 'wmts' &&\n layer.type !== 'geoserver' &&\n layer.type !== 'featurelayer' &&\n layer.type !== 'vectortile' &&\n layer.type !== 'rastertile'\n \"\n >\n <legend class=\"u-visually-hidden\">{{ '@pry.widget.map.locationAttr' | i18n }}</legend>\n <ng-container\n *ngIf=\"\n layer\n | geometryFieldsFor : { resultSet: resultSet$, classes: layer.classes, type: layer.type }\n | async as fields\n \"\n >\n <div\n *ngIf=\"\n ['heatmap', 'bubble', 'marker', 'point', 'line', 'polygon', 'multi-line', 'multi-polygon'].indexOf(\n layer.type\n ) >= 0\n \"\n >\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"map_locationAttribute_both\">{{\n '@pry.widget.map.locationAttribute.both' | i18n\n }}</label>\n <pry-select\n (ngModelChange)=\"changeLocationAttributes($event, layer)\"\n [itemsAsOption]=\"true\"\n [items]=\"fields\"\n [ngModel]=\"layer.attribute\"\n bindLabel=\"name\"\n bindValue=\"name\"\n id=\"map_locationAttribute_both\"\n class=\"a-pry-select\"\n ></pry-select>\n </div>\n </div>\n\n <div *ngIf=\"['heatmap', 'bubble'].indexOf(layer.type) >= 0\">\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"map_intensityAttribute\">{{\n '@pry.widget.map.intensityAttribute' | i18n\n }}</label>\n <pry-select\n (ngModelChange)=\"changeIntensityAttributes($event, layer)\"\n [itemsAsOption]=\"true\"\n [items]=\"fields\"\n [ngModel]=\"layerHasIntensity(layer).intensityAttribute\"\n bindLabel=\"name\"\n bindValue=\"name\"\n id=\"map_intensityAttribute\"\n class=\"a-pry-select\"\n ></pry-select>\n </div>\n </div>\n </ng-container>\n </fieldset>\n\n <fieldset\n *ngIf=\"\n layer.type === 'wms' ||\n layer.type === 'geoserver' ||\n layer.type === 'wmts' ||\n layer.type === 'featurelayer' ||\n layer.type === 'vectortile' ||\n layer.type === 'rastertile'\n \"\n >\n <legend class=\"u-visually-hidden\">{{ '@pry.widget.map.tile' | i18n }}</legend>\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"map_wms_url\">{{ '@pry.widget.map.wms.url' | i18n }}</label>\n <input\n id=\"map_wms_url\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeUrl($event, layer)\"\n [disabled]=\"layer.type === 'geoserver'\"\n [value]=\"layer.url\"\n />\n </div>\n\n <div\n class=\"m-form-label-field\"\n *ngIf=\"layer.type === 'wms' || layer.type === 'geoserver' || layer.type === 'wmts'\"\n >\n <label class=\"a-label\" for=\"map_wms_paramLayer\">{{ '@pry.widget.map.wms.paramLayer' | i18n }}</label>\n <input\n id=\"map_wms_paramLayer\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeParamLayer($event, layer)\"\n [disabled]=\"layer.type === 'geoserver'\"\n [value]=\"layer.paramLayer\"\n />\n </div>\n\n <div class=\"m-form-label-field\" *ngIf=\"layer.type === 'wmts'\">\n <label class=\"a-label\" for=\"map_wms_matrixSet\">{{ '@pry.widget.map.wms.matrixSet' | i18n }}</label>\n <input\n id=\"map_wms_matrixSet\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeMatrixSet($event, layer)\"\n [value]=\"layer.matrixSet\"\n />\n </div>\n\n <div class=\"m-form-label-field\" *ngIf=\"layer.type === 'wmts'\">\n <label class=\"a-label\" for=\"map_wms_style\">{{ '@pry.widget.map.wms.style' | i18n }}</label>\n <input\n id=\"map_wms_style\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeParamStyle($event, layer)\"\n [value]=\"layer.style\"\n />\n </div>\n\n <div class=\"m-form-label-field\" *ngIf=\"layer.type === 'wms'\">\n <pry-checkbox (ngModelChange)=\"changeParamTiled($event, layer)\" [ngModel]=\"layer?.paramTiled ?? false\">\n {{ '@pry.widget.map.wms.paramTiled' | i18n }}\n </pry-checkbox>\n </div>\n </fieldset>\n\n <fieldset *ngIf=\"layer.type === 'marker'\">\n <legend class=\"u-visually-hidden\">{{ '@pry.widget.map.clustering' | i18n }}</legend>\n <div class=\"m-form-label-field\">\n <pry-checkbox (ngModelChange)=\"changeClustered(layer, $event)\" [ngModel]=\"layer.clustered\">\n {{ '@pry.widget.map.clustered' | i18n }}\n </pry-checkbox>\n </div>\n <div *ngIf=\"layer.clustered\">\n <pry-range\n [ngModel]=\"layer.clustered\"\n (ngModelChange)=\"changeClusterDistance(layer, $event)\"\n labelTranslate=\"@pry.widget.map.clusterDistance\"\n min=\"1\"\n max=\"500\"\n ></pry-range>\n </div>\n </fieldset>\n\n <div class=\"m-form-label-field\" *ngIf=\"optionsCopy.attributions\">\n <label class=\"a-label\" for=\"attribution\">{{ '@pry.widget.map.attribution' | i18n }}</label>\n <input\n id=\"attribution\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeAttribution($event, layer)\"\n [value]=\"layer.attribution ? layer.attribution : ''\"\n />\n </div>\n\n <button\n type=\"button\"\n (click)=\"deleteLayer(i)\"\n class=\"a-btn a-btn--icon-text -link-like\"\n *ngIf=\"layer.type !== 'geoserver'\"\n data-func=\"delete\"\n >\n <pry-icon iconSvg=\"delete\" [width]=\"19\" [height]=\"19\"></pry-icon>\n <span>{{ '@pry.widget.map.deleteLayer' | i18n }}</span>\n </button>\n </div>\n </pry-settings>\n </pry-widget-header>\n\n <div class=\"m-btn-group -selection-choice\" [style.transform]=\"bottomLeft$ | async\">\n <ng-container *ngFor=\"let action of basicActions$ | async\">\n <button\n type=\"button\"\n class=\"a-btn a-btn--icon-only\"\n (click)=\"selectionInteraction.changeSelection(action)\"\n [class.-selected]=\"selectionInteraction.selectionType === action\"\n [pryTooltip]=\"infoTooltipAction\"\n pryTooltipPosition=\"bottom\"\n aria-describedby=\"infoTooltipAction\"\n [pryTooltipContext]=\"{ action: action }\"\n >\n <pry-icon [iconSvg]=\"action\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.widget.map.' + action | i18n }}</span>\n </button>\n </ng-container>\n\n <button\n type=\"button\"\n class=\"a-btn a-btn--icon-only\"\n id=\"export_card\"\n aria-expanded=\"false\"\n aria-controls=\"export_type\"\n aria-haspopup=\"menu\"\n [pryTooltip]=\"infoTooltipDown\"\n pryTooltipPosition=\"bottom\"\n aria-describedby=\"infoTooltipDown_widgetMap\"\n *ngIf=\"(actions$ | async)?.includes('export')\"\n >\n <pry-icon iconSvg=\"file_download\" (click)=\"displayExportType($event)\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.widget.map.export' | i18n }}</span>\n </button>\n\n <button\n type=\"button\"\n class=\"a-btn a-btn--icon-only\"\n (click)=\"uploader.click()\"\n [pryTooltip]=\"infoTooltipLoad\"\n aria-describedby=\"infoTooltipLoad_widgetMap\"\n pryTooltipPosition=\"bottom\"\n *ngIf=\"(actions$ | async)?.includes('upload')\"\n >\n <pry-icon iconSvg=\"file_upload\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.widget.map.import' | i18n }}</span>\n </button>\n <input hidden type=\"file\" #uploader (change)=\"import($event)\" />\n </div>\n\n <div\n class=\"ol-control m-layer-legend\"\n *ngIf=\"((legendLayers$ | async)?.length ?? 0) > 0\"\n [style.top.px]=\"legendTop$ | async\"\n >\n <button class=\"m-layer-legend__toggle\" (click)=\"toggleLegendWindow()\">\n <pry-icon iconSvg=\"legend\" [width]=\"22\" [height]=\"22\"></pry-icon>\n </button>\n <ng-container *ngFor=\"let geoLayer of legendLayers$ | async; let index = index\">\n <div class=\"m-layer-legend__title\" [class.-hidden]=\"!legendTabOpen\">\n {{ geoLayer.title }}\n <ng-container *ngIf=\"isLayerRendered(geoLayer)\">\n <button class=\"m-layer-legend__toggle\" (click)=\"toggleLegend(index)\">\n <pry-icon\n [iconSvg]=\"legendTab === index ? 'chevron_top' : 'chevron_bottom'\"\n [width]=\"22\"\n [height]=\"22\"\n ></pry-icon>\n </button>\n </ng-container>\n <ng-container *ngIf=\"!isLayerRendered(geoLayer)\">\n <pry-icon [iconSvg]=\"'close'\" [width]=\"22\" [height]=\"22\"></pry-icon>\n </ng-container>\n </div>\n <div\n class=\"m-layer-legend__image\"\n [class.-hidden]=\"!legendTabOpen || legendTab !== index || !isLayerRendered(geoLayer)\"\n [style.max-height.px]=\"legendHeight$ | async\"\n >\n <ng-container *ngIf=\"!imageNotProvided[index] && (geoLayer | legendUrl)\">\n <img\n [src]=\"geoLayer | legendUrl\"\n [alt]=\"'@pry.widget.map.legend' | i18n : { layer: geoLayer.title }\"\n (error)=\"imageNotProvided[index] = true\"\n />\n </ng-container>\n <ng-container *ngIf=\"imageNotProvided[index]\">\n <p class=\"m-layer-legend__error\">{{ '@pry.widget.map.legendNotProvided' | i18n }}</p>\n </ng-container>\n </div>\n </ng-container>\n </div>\n\n <div [style.height.px]=\"height$ | async\" class=\"o-map-wrapper\">\n <div class=\"o-map\">\n <div #map id=\"map\"></div>\n </div>\n </div>\n\n <ng-template #infoTooltipAction let-action=\"action\">\n <div class=\"m-tooltip\" role=\"tooltip\" id=\"infoTooltipAction\" aria-hidden=\"true\">\n <span class=\"m-tooltip__text\">{{ '@pry.widget.map.' + action | i18n }}</span>\n </div>\n </ng-template>\n\n <ng-template #infoTooltipDown>\n <div class=\"m-tooltip\" role=\"tooltip\" id=\"infoTooltipDown_widgetMap\" aria-hidden=\"true\">\n <span class=\"m-tooltip__text\">{{ '@pry.widget.map.export' | i18n }}</span>\n </div>\n </ng-template>\n\n <ng-template #infoTooltipLoad>\n <div class=\"m-tooltip\" role=\"tooltip\" id=\"infoTooltipLoad_widgetMap\" aria-hidden=\"true\">\n <span class=\"m-tooltip__text\">{{ '@pry.widget.map.import' | i18n }}</span>\n </div>\n </ng-template>\n\n <div #popup class=\"m-tooltip m-tooltip--popup\" [hidden]=\"true\" role=\"tooltip\">\n <div #popupContent></div>\n </div>\n <div\n #address\n class=\"m-tooltip m-tooltip--address tooltip-address\"\n [style.display]=\"'none'\"\n (click)=\"hideAddress()\"\n ></div>\n <ng-template\n #exportTypeTemplate\n class=\"m-context-menu-wrapper\"\n id=\"export_type\"\n aria-hidden=\"true\"\n aria-label=\"TODO-access\"\n aria-labelledby=\"export_card\"\n >\n <div class=\"m-context-menu\">\n <ul class=\"m-context-menu__list\">\n <li class=\"m-context-menu__list__item\">\n <button type=\"button\" class=\"a-btn -link-like\" (click)=\"export('png')\">\n <span class=\"u-visually-hidden\">{{ '@pry.action.exportAsFormat' | i18n }} </span> PNG\n </button>\n </li>\n <li class=\"m-context-menu__list__item\">\n <button type=\"button\" class=\"a-btn -link-like\" (click)=\"export('kml')\">\n <span class=\"u-visually-hidden\">{{ '@pry.action.exportAsFormat' | i18n }} </span> KML\n </button>\n </li>\n <li class=\"m-context-menu__list__item\">\n <button type=\"button\" class=\"a-btn -link-like\" (click)=\"export('geoJSON')\">\n <span class=\"u-visually-hidden\">{{ '@pry.action.exportAsFormat' | i18n }} </span> GeoJSON\n </button>\n </li>\n </ul>\n </div>\n </ng-template>\n</div>\n", dependencies: [{ kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.SettingsComponent, selector: "pry-settings", inputs: ["widgetIndex", "isDisable", "headerPresent", "open$", "header"], outputs: ["saveTriggered"] }, { kind: "component", type: i2.PryWidgetHeaderComponent, selector: "pry-widget-header", inputs: ["manifest", "additionalOptions", "headerOptions", "displayCount", "datasourceIds", "widgetIndex"], outputs: ["manifestModified"] }, { kind: "component", type: i2.PrySelectComponent, selector: "pry-select", inputs: ["labelTranslate", "baseTranslate", "translationFn", "translationFnArgs", "clearable", "multiple", "multipleClearRight", "placeholder", "isForm", "required", "name", "readonly", "items", "itemsAsOption", "bindData", "bindValue", "bindLabel", "bindIcon", "iconSize", "templateLabel", "templateOption", "autocomplete"] }, { kind: "component", type: i2.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: i7.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle"] }, { kind: "directive", type: i2.PryTooltipDirective, selector: "[pryTooltip]", inputs: ["pryTooltip", "styleReversed", "pryTooltipContext", "pryTooltipPosition", "pryTooltipShowDelay"] }, { kind: "component", type: i2.PryRangeComponent, selector: "pry-range", inputs: ["min", "max", "step", "disabled", "labelTranslate"] }, { kind: "component", type: PryWidgetMapCssComponent, selector: "pry-widget-map-css" }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.I18nPipe, name: "i18n" }, { kind: "pipe", type: GeometryFieldsForPipe, name: "geometryFieldsFor" }, { kind: "pipe", type: WidgetMapLegendUrlPipe, name: "legendUrl" }] }); }
1819
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.6", type: WidgetMapComponent, selector: "pry-widget-map", viewQueries: [{ propertyName: "mapRef", first: true, predicate: ["map"], descendants: true }, { propertyName: "popup", first: true, predicate: ["popup"], descendants: true }, { propertyName: "popupContent", first: true, predicate: ["popupContent"], descendants: true, read: ViewContainerRef }, { propertyName: "exportTypeTemplate", first: true, predicate: ["exportTypeTemplate"], descendants: true, read: TemplateRef }, { propertyName: "address", first: true, predicate: ["address"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<pry-widget-map-css></pry-widget-map-css>\n<div class=\"o-widget o-widget--map\">\n <pry-widget-header\n [datasourceIds]=\"(datasourceIds$ | async) ?? []\"\n *ngIf=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [manifest]=\"manifest\"\n (manifestModified)=\"manifestModified.emit($event)\"\n [headerOptions]=\"(displayHeader$ | async) ?? {}\"\n #header\n >\n <pry-settings\n (saveTriggered)=\"emitManifest()\"\n [headerPresent]=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [header]=\"header\"\n [open$]=\"open$\"\n class=\"o-settings\"\n >\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"map_style\">{{ '@pry.widget.map.style' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeStyle($event)\"\n [itemsAsOption]=\"true\"\n [items]=\"styles$ | async\"\n [ngModel]=\"optionsCopy.style\"\n bindLabel=\"label\"\n bindValue=\"identifier\"\n id=\"map_style\"\n class=\"a-pry-select\"\n ></pry-select>\n </div>\n\n <pry-checkbox (ngModelChange)=\"changeFit($event)\" [ngModel]=\"optionsCopy.fit ?? false\">\n {{ '@pry.widget.map.fit' | i18n }}\n </pry-checkbox>\n\n <pry-checkbox (ngModelChange)=\"changeAttributions($event)\" [ngModel]=\"optionsCopy.attributions ?? false\">\n {{ '@pry.widget.map.attributions' | i18n }}\n </pry-checkbox>\n\n <div class=\"o-settings__popup__content__actions -has-separator\">\n <button type=\"button\" (click)=\"addLayer()\" class=\"a-btn a-btn--icon-text -link-like\">\n <pry-icon iconSvg=\"library_add\"></pry-icon>\n {{ '@pry.widget.map.addLayer' | i18n }}\n </button>\n </div>\n\n <div *ngFor=\"let layer of optionsCopy?.layers; let i = index\" class=\"o-settings__popup__content__fields\">\n <div class=\"o-settings__popup__content__fields__head\">\n <h3 class=\"a-h3 settings-layer-title__title\">{{ '@pry.widget.map.layer' | i18n : { index: i + 1 } }}</h3>\n <div class=\"m-btn-group\">\n <button type=\"button\" class=\"a-btn a-btn--icon-only\" (click)=\"invertLayers(i, i - 1)\" *ngIf=\"i > 0\">\n <pry-icon iconSvg=\"fleche_haut\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.action.moveUp' | i18n }}</span>\n </button>\n <button\n type=\"button\"\n class=\"a-btn a-btn--icon-only\"\n (click)=\"invertLayers(i, i + 1)\"\n *ngIf=\"i < (optionsCopy?.layers?.length ?? 0) - 1\"\n >\n <pry-icon iconSvg=\"fleche_bas\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.action.moveDown' | i18n }}</span>\n </button>\n </div>\n </div>\n\n <div class=\"o-settings__popup__content__fields__content\">\n <pry-range\n [ngModel]=\"(layer?.opacity ?? 100) + ''\"\n (ngModelChange)=\"changeOpacity(layer, $event)\"\n labelTranslate=\"@pry.widget.map.opacity\"\n min=\"0\"\n max=\"100\"\n ></pry-range>\n\n <fieldset>\n <legend class=\"u-visually-hidden\">{{ '@pry.widget.map.layerOptions' | i18n : { index: i + 1 } }}</legend>\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"map_layerTitle\">{{ '@pry.widget.map.layerTitle' | i18n }}</label>\n <input\n id=\"map_layerTitle\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeTitle($event, layer)\"\n [value]=\"layer.title ?? ''\"\n />\n </div>\n\n <div class=\"m-form-label-field\" *ngIf=\"layer.type !== 'geoserver'\">\n <label class=\"a-label\" for=\"map_layerType\">{{ '@pry.widget.map.layerType.title' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeLayerType($event, i)\"\n [bindData]=\"true\"\n [itemsAsOption]=\"true\"\n [items]=\"layerTypes\"\n [labelTranslate]=\"true\"\n [ngModel]=\"layer.type\"\n baseTranslate=\"@pry.widget.map.layerType.\"\n class=\"a-pry-select\"\n id=\"map_layerType\"\n ></pry-select>\n </div>\n\n <div\n *ngIf=\"\n layer.type !== 'relation' &&\n layer.type !== 'wms' &&\n layer.type !== 'wmts' &&\n layer.type !== 'geoserver' &&\n layer.type !== 'featurelayer' &&\n layer.type !== 'vectortile' &&\n layer.type !== 'rastertile'\n \"\n class=\"m-form-label-field\"\n >\n <label class=\"a-label\" for=\"map_classes\">{{ '@pry.widget.map.classes' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeClasses($event, layer)\"\n [itemsAsOption]=\"true\"\n [items]=\"classes$ | async\"\n [multiple]=\"true\"\n [ngModel]=\"layer.classes\"\n bindLabel=\"name\"\n bindValue=\"id\"\n class=\"a-pry-select\"\n id=\"map_classes\"\n ></pry-select>\n </div>\n </fieldset>\n </div>\n\n <fieldset\n *ngIf=\"\n layer.type !== 'relation' &&\n layer.type !== 'wms' &&\n layer.type !== 'wmts' &&\n layer.type !== 'geoserver' &&\n layer.type !== 'featurelayer' &&\n layer.type !== 'vectortile' &&\n layer.type !== 'rastertile'\n \"\n >\n <legend class=\"u-visually-hidden\">{{ '@pry.widget.map.locationAttr' | i18n }}</legend>\n <ng-container\n *ngIf=\"\n layer\n | geometryFieldsFor : { resultSet: resultSet$, classes: layer.classes, type: layer.type }\n | async as fields\n \"\n >\n <div\n *ngIf=\"\n ['heatmap', 'bubble', 'marker', 'point', 'line', 'polygon', 'multi-line', 'multi-polygon'].indexOf(\n layer.type\n ) >= 0\n \"\n >\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"map_locationAttribute_both\">{{\n '@pry.widget.map.locationAttribute.both' | i18n\n }}</label>\n <pry-select\n (ngModelChange)=\"changeLocationAttributes($event, layer)\"\n [itemsAsOption]=\"true\"\n [items]=\"fields\"\n [ngModel]=\"layer.attribute\"\n bindLabel=\"name\"\n bindValue=\"name\"\n id=\"map_locationAttribute_both\"\n class=\"a-pry-select\"\n ></pry-select>\n </div>\n </div>\n\n <div *ngIf=\"['heatmap', 'bubble'].indexOf(layer.type) >= 0\">\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"map_intensityAttribute\">{{\n '@pry.widget.map.intensityAttribute' | i18n\n }}</label>\n <pry-select\n (ngModelChange)=\"changeIntensityAttributes($event, layer)\"\n [itemsAsOption]=\"true\"\n [items]=\"fields\"\n [ngModel]=\"layerHasIntensity(layer).intensityAttribute\"\n bindLabel=\"name\"\n bindValue=\"name\"\n id=\"map_intensityAttribute\"\n class=\"a-pry-select\"\n ></pry-select>\n </div>\n </div>\n </ng-container>\n </fieldset>\n\n <fieldset\n *ngIf=\"\n layer.type === 'wms' ||\n layer.type === 'wmts' ||\n layer.type === 'featurelayer' ||\n layer.type === 'vectortile' ||\n layer.type === 'rastertile'\n \"\n >\n <legend class=\"u-visually-hidden\">{{ '@pry.widget.map.tile' | i18n }}</legend>\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"map_wms_url\">{{ '@pry.widget.map.wms.url' | i18n }}</label>\n <input\n id=\"map_wms_url\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeUrl($event, layer)\"\n [value]=\"layer.url\"\n />\n </div>\n\n <div class=\"m-form-label-field\" *ngIf=\"layer.type === 'wms' || layer.type === 'wmts'\">\n <label class=\"a-label\" for=\"map_wms_paramLayer\">{{ '@pry.widget.map.wms.paramLayer' | i18n }}</label>\n <input\n id=\"map_wms_paramLayer\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeParamLayer($event, layer)\"\n [value]=\"layer.paramLayer\"\n />\n </div>\n\n <div class=\"m-form-label-field\" *ngIf=\"layer.type === 'wmts'\">\n <label class=\"a-label\" for=\"map_wms_matrixSet\">{{ '@pry.widget.map.wms.matrixSet' | i18n }}</label>\n <input\n id=\"map_wms_matrixSet\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeMatrixSet($event, layer)\"\n [value]=\"layer.matrixSet\"\n />\n </div>\n\n <div class=\"m-form-label-field\" *ngIf=\"layer.type === 'wmts'\">\n <label class=\"a-label\" for=\"map_wms_style\">{{ '@pry.widget.map.wms.style' | i18n }}</label>\n <input\n id=\"map_wms_style\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeParamStyle($event, layer)\"\n [value]=\"layer.style\"\n />\n </div>\n\n <div class=\"m-form-label-field\" *ngIf=\"layer.type === 'wms'\">\n <pry-checkbox (ngModelChange)=\"changeParamTiled($event, layer)\" [ngModel]=\"layer?.paramTiled ?? false\">\n {{ '@pry.widget.map.wms.paramTiled' | i18n }}\n </pry-checkbox>\n </div>\n </fieldset>\n\n <fieldset *ngIf=\"layer.type === 'marker'\">\n <legend class=\"u-visually-hidden\">{{ '@pry.widget.map.clustering' | i18n }}</legend>\n <div class=\"m-form-label-field\">\n <pry-checkbox (ngModelChange)=\"changeClustered(layer, $event)\" [ngModel]=\"layer.clustered\">\n {{ '@pry.widget.map.clustered' | i18n }}\n </pry-checkbox>\n </div>\n <div *ngIf=\"layer.clustered\">\n <pry-range\n [ngModel]=\"layer.clustered\"\n (ngModelChange)=\"changeClusterDistance(layer, $event)\"\n labelTranslate=\"@pry.widget.map.clusterDistance\"\n min=\"1\"\n max=\"500\"\n ></pry-range>\n </div>\n </fieldset>\n\n <div class=\"m-form-label-field\" *ngIf=\"optionsCopy.attributions\">\n <label class=\"a-label\" for=\"attribution\">{{ '@pry.widget.map.attribution' | i18n }}</label>\n <input\n id=\"attribution\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeAttribution($event, layer)\"\n [value]=\"layer.attribution ? layer.attribution : ''\"\n />\n </div>\n\n <button\n type=\"button\"\n (click)=\"deleteLayer(i)\"\n class=\"a-btn a-btn--icon-text -link-like\"\n *ngIf=\"layer.type !== 'geoserver'\"\n data-func=\"delete\"\n >\n <pry-icon iconSvg=\"delete\" [width]=\"19\" [height]=\"19\"></pry-icon>\n <span>{{ '@pry.widget.map.deleteLayer' | i18n }}</span>\n </button>\n </div>\n </pry-settings>\n </pry-widget-header>\n\n <div class=\"m-btn-group -selection-choice\" [style.transform]=\"bottomLeft$ | async\">\n <ng-container *ngFor=\"let action of basicActions$ | async\">\n <button\n type=\"button\"\n class=\"a-btn a-btn--icon-only\"\n (click)=\"interactionManager.selectionInteraction.changeSelection(action)\"\n [class.-selected]=\"interactionManager.selectionInteraction.selectionType === action\"\n [pryTooltip]=\"infoTooltipAction\"\n pryTooltipPosition=\"bottom\"\n aria-describedby=\"infoTooltipAction\"\n [pryTooltipContext]=\"{ action: action }\"\n >\n <pry-icon [iconSvg]=\"action\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.widget.map.' + action | i18n }}</span>\n </button>\n </ng-container>\n\n <button\n type=\"button\"\n class=\"a-btn a-btn--icon-only\"\n id=\"export_card\"\n aria-expanded=\"false\"\n aria-controls=\"export_type\"\n aria-haspopup=\"menu\"\n [pryTooltip]=\"infoTooltipDown\"\n pryTooltipPosition=\"bottom\"\n aria-describedby=\"infoTooltipDown_widgetMap\"\n *ngIf=\"(actions$ | async)?.includes('export')\"\n >\n <pry-icon iconSvg=\"file_download\" (click)=\"displayExportType($event)\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.widget.map.export' | i18n }}</span>\n </button>\n\n <button\n type=\"button\"\n class=\"a-btn a-btn--icon-only\"\n (click)=\"uploader.click()\"\n [pryTooltip]=\"infoTooltipLoad\"\n aria-describedby=\"infoTooltipLoad_widgetMap\"\n pryTooltipPosition=\"bottom\"\n *ngIf=\"(actions$ | async)?.includes('upload')\"\n >\n <pry-icon iconSvg=\"file_upload\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.widget.map.import' | i18n }}</span>\n </button>\n <input hidden type=\"file\" #uploader (change)=\"import($event)\" />\n </div>\n\n <div\n class=\"ol-control m-layer-legend\"\n *ngIf=\"((legendLayers$ | async)?.length ?? 0) > 0\"\n [style.top.px]=\"legendTop$ | async\"\n >\n <button class=\"m-layer-legend__toggle\" (click)=\"toggleLegendWindow()\">\n <pry-icon iconSvg=\"legend\" [width]=\"22\" [height]=\"22\"></pry-icon>\n </button>\n <ng-container *ngFor=\"let geoLayer of legendLayers$ | async; let index = index\">\n <div class=\"m-layer-legend__title\" [class.-hidden]=\"!legendTabOpen\">\n {{ geoLayer.title }}\n <ng-container *ngIf=\"isLayerRendered(geoLayer)\">\n <button class=\"m-layer-legend__toggle\" (click)=\"toggleLegend(index)\">\n <pry-icon\n [iconSvg]=\"legendTab === index ? 'chevron_top' : 'chevron_bottom'\"\n [width]=\"22\"\n [height]=\"22\"\n ></pry-icon>\n </button>\n </ng-container>\n <ng-container *ngIf=\"!isLayerRendered(geoLayer)\">\n <pry-icon [iconSvg]=\"'close'\" [width]=\"22\" [height]=\"22\"></pry-icon>\n </ng-container>\n </div>\n <div\n class=\"m-layer-legend__image\"\n [class.-hidden]=\"!legendTabOpen || legendTab !== index || !isLayerRendered(geoLayer)\"\n [style.max-height.px]=\"legendHeight$ | async\"\n >\n <ng-container *ngIf=\"!imageNotProvided[index] && (geoLayer | legendUrl)\">\n <img\n [src]=\"geoLayer | legendUrl\"\n [alt]=\"'@pry.widget.map.legend' | i18n : { layer: geoLayer.title }\"\n (error)=\"imageNotProvided[index] = true\"\n />\n </ng-container>\n <ng-container *ngIf=\"imageNotProvided[index]\">\n <p class=\"m-layer-legend__error\">{{ '@pry.widget.map.legendNotProvided' | i18n }}</p>\n </ng-container>\n </div>\n </ng-container>\n </div>\n\n <div [style.height.px]=\"height$ | async\" class=\"o-map-wrapper\">\n <div class=\"o-map\">\n <div #map id=\"map\"></div>\n </div>\n </div>\n\n <ng-template #infoTooltipAction let-action=\"action\">\n <div class=\"m-tooltip\" role=\"tooltip\" id=\"infoTooltipAction\" aria-hidden=\"true\">\n <span class=\"m-tooltip__text\">{{ '@pry.widget.map.' + action | i18n }}</span>\n </div>\n </ng-template>\n\n <ng-template #infoTooltipDown>\n <div class=\"m-tooltip\" role=\"tooltip\" id=\"infoTooltipDown_widgetMap\" aria-hidden=\"true\">\n <span class=\"m-tooltip__text\">{{ '@pry.widget.map.export' | i18n }}</span>\n </div>\n </ng-template>\n\n <ng-template #infoTooltipLoad>\n <div class=\"m-tooltip\" role=\"tooltip\" id=\"infoTooltipLoad_widgetMap\" aria-hidden=\"true\">\n <span class=\"m-tooltip__text\">{{ '@pry.widget.map.import' | i18n }}</span>\n </div>\n </ng-template>\n\n <div #popup class=\"m-tooltip m-tooltip--popup\" [hidden]=\"true\" role=\"tooltip\">\n <div #popupContent></div>\n </div>\n <div\n #address\n class=\"m-tooltip m-tooltip--address tooltip-address\"\n [style.display]=\"'none'\"\n (click)=\"hideAddress()\"\n ></div>\n <ng-template\n #exportTypeTemplate\n class=\"m-context-menu-wrapper\"\n id=\"export_type\"\n aria-hidden=\"true\"\n aria-label=\"TODO-access\"\n aria-labelledby=\"export_card\"\n >\n <div class=\"m-context-menu\">\n <ul class=\"m-context-menu__list\">\n <li class=\"m-context-menu__list__item\">\n <button type=\"button\" class=\"a-btn -link-like\" (click)=\"export('png')\">\n <span class=\"u-visually-hidden\">{{ '@pry.action.exportAsFormat' | i18n }} </span> PNG\n </button>\n </li>\n <li class=\"m-context-menu__list__item\">\n <button type=\"button\" class=\"a-btn -link-like\" (click)=\"export('kml')\">\n <span class=\"u-visually-hidden\">{{ '@pry.action.exportAsFormat' | i18n }} </span> KML\n </button>\n </li>\n <li class=\"m-context-menu__list__item\">\n <button type=\"button\" class=\"a-btn -link-like\" (click)=\"export('geoJSON')\">\n <span class=\"u-visually-hidden\">{{ '@pry.action.exportAsFormat' | i18n }} </span> GeoJSON\n </button>\n </li>\n </ul>\n </div>\n </ng-template>\n</div>\n", dependencies: [{ kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2.SettingsComponent, selector: "pry-settings", inputs: ["widgetIndex", "isDisable", "headerPresent", "open$", "header"], outputs: ["saveTriggered"] }, { kind: "component", type: i2.PryWidgetHeaderComponent, selector: "pry-widget-header", inputs: ["manifest", "additionalOptions", "headerOptions", "displayCount", "datasourceIds", "widgetIndex"], outputs: ["manifestModified"] }, { kind: "component", type: i2.PrySelectComponent, selector: "pry-select", inputs: ["labelTranslate", "baseTranslate", "translationFn", "translationFnArgs", "clearable", "multiple", "multipleClearRight", "placeholder", "isForm", "required", "name", "readonly", "items", "itemsAsOption", "bindData", "bindValue", "bindLabel", "bindIcon", "iconSize", "templateLabel", "templateOption", "autocomplete"] }, { kind: "component", type: i2.PryIconComponent, selector: "pry-icon", inputs: ["color", "iconSvg", "animation", "iconImage", "alt", "width", "height", "classes"] }, { kind: "component", type: i7.PryCheckboxComponent, selector: "pry-checkbox", inputs: ["circle"] }, { kind: "directive", type: i2.PryTooltipDirective, selector: "[pryTooltip]", inputs: ["pryTooltip", "styleReversed", "pryTooltipContext", "pryTooltipPosition", "pryTooltipShowDelay"] }, { kind: "component", type: i2.PryRangeComponent, selector: "pry-range", inputs: ["min", "max", "step", "disabled", "labelTranslate"] }, { kind: "component", type: PryWidgetMapCssComponent, selector: "pry-widget-map-css" }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.I18nPipe, name: "i18n" }, { kind: "pipe", type: GeometryFieldsForPipe, name: "geometryFieldsFor" }, { kind: "pipe", type: WidgetMapLegendUrlPipe, name: "legendUrl" }] }); }
1820
1820
  }
1821
1821
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImport: i0, type: WidgetMapComponent, decorators: [{
1822
1822
  type: Component,
1823
- args: [{ selector: 'pry-widget-map', template: "<pry-widget-map-css></pry-widget-map-css>\n<div class=\"o-widget o-widget--map\">\n <pry-widget-header\n [datasourceIds]=\"(datasourceIds$ | async) ?? []\"\n *ngIf=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [manifest]=\"manifest\"\n (manifestModified)=\"manifestModified.emit($event)\"\n [headerOptions]=\"(displayHeader$ | async) ?? {}\"\n #header\n >\n <pry-settings\n (saveTriggered)=\"emitManifest()\"\n [headerPresent]=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [header]=\"header\"\n [open$]=\"open$\"\n class=\"o-settings\"\n >\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"map_style\">{{ '@pry.widget.map.style' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeStyle($event)\"\n [itemsAsOption]=\"true\"\n [items]=\"styles$ | async\"\n [ngModel]=\"optionsCopy.style\"\n bindLabel=\"label\"\n bindValue=\"identifier\"\n id=\"map_style\"\n class=\"a-pry-select\"\n ></pry-select>\n </div>\n\n <pry-checkbox (ngModelChange)=\"changeFit($event)\" [ngModel]=\"optionsCopy.fit ?? false\">\n {{ '@pry.widget.map.fit' | i18n }}\n </pry-checkbox>\n\n <pry-checkbox (ngModelChange)=\"changeAttributions($event)\" [ngModel]=\"optionsCopy.attributions ?? false\">\n {{ '@pry.widget.map.attributions' | i18n }}\n </pry-checkbox>\n\n <fieldset class=\"m-form-radio-group-wrapper\">\n <legend class=\"a-label\">{{ '@pry.widget.map.tooltip.title' | i18n }}</legend>\n <div class=\"m-form-radio-group\">\n <div class=\"m-form-radio-group__item\">\n <input\n class=\"a-form-field\"\n type=\"radio\"\n id=\"click\"\n name=\"tooltip\"\n [ngModel]=\"optionsCopy.tooltipMode\"\n (ngModelChange)=\"changeTooltipMode('click')\"\n value=\"click\"\n [disabled]=\"((geoServerLayerDescriptions$ | async)?.length ?? 0) > 0\"\n />\n <label for=\"click\" class=\"a-label\">\n {{ '@pry.widget.map.tooltip.click' | i18n }}\n </label>\n </div>\n <div class=\"m-form-radio-group__item\">\n <input\n class=\"a-form-field\"\n type=\"radio\"\n id=\"hover\"\n name=\"tooltip\"\n [ngModel]=\"optionsCopy.tooltipMode\"\n (ngModelChange)=\"changeTooltipMode('hover')\"\n value=\"hover\"\n [disabled]=\"((geoServerLayerDescriptions$ | async)?.length ?? 0) > 0\"\n />\n <label for=\"hover\" class=\"a-label\">\n {{ '@pry.widget.map.tooltip.hover' | i18n }}\n </label>\n </div>\n </div>\n </fieldset>\n\n <div class=\"o-settings__popup__content__actions -has-separator\">\n <button type=\"button\" (click)=\"addLayer()\" class=\"a-btn a-btn--icon-text -link-like\">\n <pry-icon iconSvg=\"library_add\"></pry-icon>\n {{ '@pry.widget.map.addLayer' | i18n }}\n </button>\n </div>\n\n <div *ngFor=\"let layer of optionsCopy?.layers; let i = index\" class=\"o-settings__popup__content__fields\">\n <div class=\"o-settings__popup__content__fields__head\">\n <h3 class=\"a-h3 settings-layer-title__title\">{{ '@pry.widget.map.layer' | i18n : { index: i + 1 } }}</h3>\n <div class=\"m-btn-group\">\n <button type=\"button\" class=\"a-btn a-btn--icon-only\" (click)=\"invertLayers(i, i - 1)\" *ngIf=\"i > 0\">\n <pry-icon iconSvg=\"fleche_haut\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.action.moveUp' | i18n }}</span>\n </button>\n <button\n type=\"button\"\n class=\"a-btn a-btn--icon-only\"\n (click)=\"invertLayers(i, i + 1)\"\n *ngIf=\"i < (optionsCopy?.layers?.length ?? 0) - 1\"\n >\n <pry-icon iconSvg=\"fleche_bas\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.action.moveDown' | i18n }}</span>\n </button>\n </div>\n </div>\n\n <div class=\"o-settings__popup__content__fields__content\">\n <pry-range\n [ngModel]=\"(layer?.opacity ?? 100) + ''\"\n (ngModelChange)=\"changeOpacity(layer, $event)\"\n labelTranslate=\"@pry.widget.map.opacity\"\n min=\"0\"\n max=\"100\"\n ></pry-range>\n\n <fieldset>\n <legend class=\"u-visually-hidden\">{{ '@pry.widget.map.layerOptions' | i18n : { index: i + 1 } }}</legend>\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"map_layerTitle\">{{ '@pry.widget.map.layerTitle' | i18n }}</label>\n <input\n id=\"map_layerTitle\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeTitle($event, layer)\"\n [value]=\"layer.title ?? ''\"\n />\n </div>\n\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"map_layerType\">{{ '@pry.widget.map.layerType.title' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeLayerType($event, i)\"\n [bindData]=\"true\"\n [itemsAsOption]=\"true\"\n [items]=\"layerTypes\"\n [labelTranslate]=\"true\"\n [ngModel]=\"layer.type\"\n [disabled]=\"layer.type === 'geoserver'\"\n baseTranslate=\"@pry.widget.map.layerType.\"\n class=\"a-pry-select\"\n id=\"map_layerType\"\n ></pry-select>\n </div>\n\n <div\n *ngIf=\"\n layer.type !== 'relation' &&\n layer.type !== 'wms' &&\n layer.type !== 'wmts' &&\n layer.type !== 'geoserver' &&\n layer.type !== 'featurelayer' &&\n layer.type !== 'vectortile' &&\n layer.type !== 'rastertile'\n \"\n class=\"m-form-label-field\"\n >\n <label class=\"a-label\" for=\"map_classes\">{{ '@pry.widget.map.classes' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeClasses($event, layer)\"\n [itemsAsOption]=\"true\"\n [items]=\"classes$ | async\"\n [multiple]=\"true\"\n [ngModel]=\"layer.classes\"\n bindLabel=\"name\"\n bindValue=\"id\"\n class=\"a-pry-select\"\n id=\"map_classes\"\n ></pry-select>\n </div>\n </fieldset>\n </div>\n\n <fieldset\n *ngIf=\"\n layer.type !== 'relation' &&\n layer.type !== 'wms' &&\n layer.type !== 'wmts' &&\n layer.type !== 'geoserver' &&\n layer.type !== 'featurelayer' &&\n layer.type !== 'vectortile' &&\n layer.type !== 'rastertile'\n \"\n >\n <legend class=\"u-visually-hidden\">{{ '@pry.widget.map.locationAttr' | i18n }}</legend>\n <ng-container\n *ngIf=\"\n layer\n | geometryFieldsFor : { resultSet: resultSet$, classes: layer.classes, type: layer.type }\n | async as fields\n \"\n >\n <div\n *ngIf=\"\n ['heatmap', 'bubble', 'marker', 'point', 'line', 'polygon', 'multi-line', 'multi-polygon'].indexOf(\n layer.type\n ) >= 0\n \"\n >\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"map_locationAttribute_both\">{{\n '@pry.widget.map.locationAttribute.both' | i18n\n }}</label>\n <pry-select\n (ngModelChange)=\"changeLocationAttributes($event, layer)\"\n [itemsAsOption]=\"true\"\n [items]=\"fields\"\n [ngModel]=\"layer.attribute\"\n bindLabel=\"name\"\n bindValue=\"name\"\n id=\"map_locationAttribute_both\"\n class=\"a-pry-select\"\n ></pry-select>\n </div>\n </div>\n\n <div *ngIf=\"['heatmap', 'bubble'].indexOf(layer.type) >= 0\">\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"map_intensityAttribute\">{{\n '@pry.widget.map.intensityAttribute' | i18n\n }}</label>\n <pry-select\n (ngModelChange)=\"changeIntensityAttributes($event, layer)\"\n [itemsAsOption]=\"true\"\n [items]=\"fields\"\n [ngModel]=\"layerHasIntensity(layer).intensityAttribute\"\n bindLabel=\"name\"\n bindValue=\"name\"\n id=\"map_intensityAttribute\"\n class=\"a-pry-select\"\n ></pry-select>\n </div>\n </div>\n </ng-container>\n </fieldset>\n\n <fieldset\n *ngIf=\"\n layer.type === 'wms' ||\n layer.type === 'geoserver' ||\n layer.type === 'wmts' ||\n layer.type === 'featurelayer' ||\n layer.type === 'vectortile' ||\n layer.type === 'rastertile'\n \"\n >\n <legend class=\"u-visually-hidden\">{{ '@pry.widget.map.tile' | i18n }}</legend>\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"map_wms_url\">{{ '@pry.widget.map.wms.url' | i18n }}</label>\n <input\n id=\"map_wms_url\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeUrl($event, layer)\"\n [disabled]=\"layer.type === 'geoserver'\"\n [value]=\"layer.url\"\n />\n </div>\n\n <div\n class=\"m-form-label-field\"\n *ngIf=\"layer.type === 'wms' || layer.type === 'geoserver' || layer.type === 'wmts'\"\n >\n <label class=\"a-label\" for=\"map_wms_paramLayer\">{{ '@pry.widget.map.wms.paramLayer' | i18n }}</label>\n <input\n id=\"map_wms_paramLayer\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeParamLayer($event, layer)\"\n [disabled]=\"layer.type === 'geoserver'\"\n [value]=\"layer.paramLayer\"\n />\n </div>\n\n <div class=\"m-form-label-field\" *ngIf=\"layer.type === 'wmts'\">\n <label class=\"a-label\" for=\"map_wms_matrixSet\">{{ '@pry.widget.map.wms.matrixSet' | i18n }}</label>\n <input\n id=\"map_wms_matrixSet\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeMatrixSet($event, layer)\"\n [value]=\"layer.matrixSet\"\n />\n </div>\n\n <div class=\"m-form-label-field\" *ngIf=\"layer.type === 'wmts'\">\n <label class=\"a-label\" for=\"map_wms_style\">{{ '@pry.widget.map.wms.style' | i18n }}</label>\n <input\n id=\"map_wms_style\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeParamStyle($event, layer)\"\n [value]=\"layer.style\"\n />\n </div>\n\n <div class=\"m-form-label-field\" *ngIf=\"layer.type === 'wms'\">\n <pry-checkbox (ngModelChange)=\"changeParamTiled($event, layer)\" [ngModel]=\"layer?.paramTiled ?? false\">\n {{ '@pry.widget.map.wms.paramTiled' | i18n }}\n </pry-checkbox>\n </div>\n </fieldset>\n\n <fieldset *ngIf=\"layer.type === 'marker'\">\n <legend class=\"u-visually-hidden\">{{ '@pry.widget.map.clustering' | i18n }}</legend>\n <div class=\"m-form-label-field\">\n <pry-checkbox (ngModelChange)=\"changeClustered(layer, $event)\" [ngModel]=\"layer.clustered\">\n {{ '@pry.widget.map.clustered' | i18n }}\n </pry-checkbox>\n </div>\n <div *ngIf=\"layer.clustered\">\n <pry-range\n [ngModel]=\"layer.clustered\"\n (ngModelChange)=\"changeClusterDistance(layer, $event)\"\n labelTranslate=\"@pry.widget.map.clusterDistance\"\n min=\"1\"\n max=\"500\"\n ></pry-range>\n </div>\n </fieldset>\n\n <div class=\"m-form-label-field\" *ngIf=\"optionsCopy.attributions\">\n <label class=\"a-label\" for=\"attribution\">{{ '@pry.widget.map.attribution' | i18n }}</label>\n <input\n id=\"attribution\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeAttribution($event, layer)\"\n [value]=\"layer.attribution ? layer.attribution : ''\"\n />\n </div>\n\n <button\n type=\"button\"\n (click)=\"deleteLayer(i)\"\n class=\"a-btn a-btn--icon-text -link-like\"\n *ngIf=\"layer.type !== 'geoserver'\"\n data-func=\"delete\"\n >\n <pry-icon iconSvg=\"delete\" [width]=\"19\" [height]=\"19\"></pry-icon>\n <span>{{ '@pry.widget.map.deleteLayer' | i18n }}</span>\n </button>\n </div>\n </pry-settings>\n </pry-widget-header>\n\n <div class=\"m-btn-group -selection-choice\" [style.transform]=\"bottomLeft$ | async\">\n <ng-container *ngFor=\"let action of basicActions$ | async\">\n <button\n type=\"button\"\n class=\"a-btn a-btn--icon-only\"\n (click)=\"selectionInteraction.changeSelection(action)\"\n [class.-selected]=\"selectionInteraction.selectionType === action\"\n [pryTooltip]=\"infoTooltipAction\"\n pryTooltipPosition=\"bottom\"\n aria-describedby=\"infoTooltipAction\"\n [pryTooltipContext]=\"{ action: action }\"\n >\n <pry-icon [iconSvg]=\"action\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.widget.map.' + action | i18n }}</span>\n </button>\n </ng-container>\n\n <button\n type=\"button\"\n class=\"a-btn a-btn--icon-only\"\n id=\"export_card\"\n aria-expanded=\"false\"\n aria-controls=\"export_type\"\n aria-haspopup=\"menu\"\n [pryTooltip]=\"infoTooltipDown\"\n pryTooltipPosition=\"bottom\"\n aria-describedby=\"infoTooltipDown_widgetMap\"\n *ngIf=\"(actions$ | async)?.includes('export')\"\n >\n <pry-icon iconSvg=\"file_download\" (click)=\"displayExportType($event)\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.widget.map.export' | i18n }}</span>\n </button>\n\n <button\n type=\"button\"\n class=\"a-btn a-btn--icon-only\"\n (click)=\"uploader.click()\"\n [pryTooltip]=\"infoTooltipLoad\"\n aria-describedby=\"infoTooltipLoad_widgetMap\"\n pryTooltipPosition=\"bottom\"\n *ngIf=\"(actions$ | async)?.includes('upload')\"\n >\n <pry-icon iconSvg=\"file_upload\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.widget.map.import' | i18n }}</span>\n </button>\n <input hidden type=\"file\" #uploader (change)=\"import($event)\" />\n </div>\n\n <div\n class=\"ol-control m-layer-legend\"\n *ngIf=\"((legendLayers$ | async)?.length ?? 0) > 0\"\n [style.top.px]=\"legendTop$ | async\"\n >\n <button class=\"m-layer-legend__toggle\" (click)=\"toggleLegendWindow()\">\n <pry-icon iconSvg=\"legend\" [width]=\"22\" [height]=\"22\"></pry-icon>\n </button>\n <ng-container *ngFor=\"let geoLayer of legendLayers$ | async; let index = index\">\n <div class=\"m-layer-legend__title\" [class.-hidden]=\"!legendTabOpen\">\n {{ geoLayer.title }}\n <ng-container *ngIf=\"isLayerRendered(geoLayer)\">\n <button class=\"m-layer-legend__toggle\" (click)=\"toggleLegend(index)\">\n <pry-icon\n [iconSvg]=\"legendTab === index ? 'chevron_top' : 'chevron_bottom'\"\n [width]=\"22\"\n [height]=\"22\"\n ></pry-icon>\n </button>\n </ng-container>\n <ng-container *ngIf=\"!isLayerRendered(geoLayer)\">\n <pry-icon [iconSvg]=\"'close'\" [width]=\"22\" [height]=\"22\"></pry-icon>\n </ng-container>\n </div>\n <div\n class=\"m-layer-legend__image\"\n [class.-hidden]=\"!legendTabOpen || legendTab !== index || !isLayerRendered(geoLayer)\"\n [style.max-height.px]=\"legendHeight$ | async\"\n >\n <ng-container *ngIf=\"!imageNotProvided[index] && (geoLayer | legendUrl)\">\n <img\n [src]=\"geoLayer | legendUrl\"\n [alt]=\"'@pry.widget.map.legend' | i18n : { layer: geoLayer.title }\"\n (error)=\"imageNotProvided[index] = true\"\n />\n </ng-container>\n <ng-container *ngIf=\"imageNotProvided[index]\">\n <p class=\"m-layer-legend__error\">{{ '@pry.widget.map.legendNotProvided' | i18n }}</p>\n </ng-container>\n </div>\n </ng-container>\n </div>\n\n <div [style.height.px]=\"height$ | async\" class=\"o-map-wrapper\">\n <div class=\"o-map\">\n <div #map id=\"map\"></div>\n </div>\n </div>\n\n <ng-template #infoTooltipAction let-action=\"action\">\n <div class=\"m-tooltip\" role=\"tooltip\" id=\"infoTooltipAction\" aria-hidden=\"true\">\n <span class=\"m-tooltip__text\">{{ '@pry.widget.map.' + action | i18n }}</span>\n </div>\n </ng-template>\n\n <ng-template #infoTooltipDown>\n <div class=\"m-tooltip\" role=\"tooltip\" id=\"infoTooltipDown_widgetMap\" aria-hidden=\"true\">\n <span class=\"m-tooltip__text\">{{ '@pry.widget.map.export' | i18n }}</span>\n </div>\n </ng-template>\n\n <ng-template #infoTooltipLoad>\n <div class=\"m-tooltip\" role=\"tooltip\" id=\"infoTooltipLoad_widgetMap\" aria-hidden=\"true\">\n <span class=\"m-tooltip__text\">{{ '@pry.widget.map.import' | i18n }}</span>\n </div>\n </ng-template>\n\n <div #popup class=\"m-tooltip m-tooltip--popup\" [hidden]=\"true\" role=\"tooltip\">\n <div #popupContent></div>\n </div>\n <div\n #address\n class=\"m-tooltip m-tooltip--address tooltip-address\"\n [style.display]=\"'none'\"\n (click)=\"hideAddress()\"\n ></div>\n <ng-template\n #exportTypeTemplate\n class=\"m-context-menu-wrapper\"\n id=\"export_type\"\n aria-hidden=\"true\"\n aria-label=\"TODO-access\"\n aria-labelledby=\"export_card\"\n >\n <div class=\"m-context-menu\">\n <ul class=\"m-context-menu__list\">\n <li class=\"m-context-menu__list__item\">\n <button type=\"button\" class=\"a-btn -link-like\" (click)=\"export('png')\">\n <span class=\"u-visually-hidden\">{{ '@pry.action.exportAsFormat' | i18n }} </span> PNG\n </button>\n </li>\n <li class=\"m-context-menu__list__item\">\n <button type=\"button\" class=\"a-btn -link-like\" (click)=\"export('kml')\">\n <span class=\"u-visually-hidden\">{{ '@pry.action.exportAsFormat' | i18n }} </span> KML\n </button>\n </li>\n <li class=\"m-context-menu__list__item\">\n <button type=\"button\" class=\"a-btn -link-like\" (click)=\"export('geoJSON')\">\n <span class=\"u-visually-hidden\">{{ '@pry.action.exportAsFormat' | i18n }} </span> GeoJSON\n </button>\n </li>\n </ul>\n </div>\n </ng-template>\n</div>\n" }]
1823
+ args: [{ selector: 'pry-widget-map', template: "<pry-widget-map-css></pry-widget-map-css>\n<div class=\"o-widget o-widget--map\">\n <pry-widget-header\n [datasourceIds]=\"(datasourceIds$ | async) ?? []\"\n *ngIf=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [manifest]=\"manifest\"\n (manifestModified)=\"manifestModified.emit($event)\"\n [headerOptions]=\"(displayHeader$ | async) ?? {}\"\n #header\n >\n <pry-settings\n (saveTriggered)=\"emitManifest()\"\n [headerPresent]=\"displayHeader$ | async\"\n [widgetIndex]=\"widgetIndex\"\n [header]=\"header\"\n [open$]=\"open$\"\n class=\"o-settings\"\n >\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"map_style\">{{ '@pry.widget.map.style' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeStyle($event)\"\n [itemsAsOption]=\"true\"\n [items]=\"styles$ | async\"\n [ngModel]=\"optionsCopy.style\"\n bindLabel=\"label\"\n bindValue=\"identifier\"\n id=\"map_style\"\n class=\"a-pry-select\"\n ></pry-select>\n </div>\n\n <pry-checkbox (ngModelChange)=\"changeFit($event)\" [ngModel]=\"optionsCopy.fit ?? false\">\n {{ '@pry.widget.map.fit' | i18n }}\n </pry-checkbox>\n\n <pry-checkbox (ngModelChange)=\"changeAttributions($event)\" [ngModel]=\"optionsCopy.attributions ?? false\">\n {{ '@pry.widget.map.attributions' | i18n }}\n </pry-checkbox>\n\n <div class=\"o-settings__popup__content__actions -has-separator\">\n <button type=\"button\" (click)=\"addLayer()\" class=\"a-btn a-btn--icon-text -link-like\">\n <pry-icon iconSvg=\"library_add\"></pry-icon>\n {{ '@pry.widget.map.addLayer' | i18n }}\n </button>\n </div>\n\n <div *ngFor=\"let layer of optionsCopy?.layers; let i = index\" class=\"o-settings__popup__content__fields\">\n <div class=\"o-settings__popup__content__fields__head\">\n <h3 class=\"a-h3 settings-layer-title__title\">{{ '@pry.widget.map.layer' | i18n : { index: i + 1 } }}</h3>\n <div class=\"m-btn-group\">\n <button type=\"button\" class=\"a-btn a-btn--icon-only\" (click)=\"invertLayers(i, i - 1)\" *ngIf=\"i > 0\">\n <pry-icon iconSvg=\"fleche_haut\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.action.moveUp' | i18n }}</span>\n </button>\n <button\n type=\"button\"\n class=\"a-btn a-btn--icon-only\"\n (click)=\"invertLayers(i, i + 1)\"\n *ngIf=\"i < (optionsCopy?.layers?.length ?? 0) - 1\"\n >\n <pry-icon iconSvg=\"fleche_bas\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.action.moveDown' | i18n }}</span>\n </button>\n </div>\n </div>\n\n <div class=\"o-settings__popup__content__fields__content\">\n <pry-range\n [ngModel]=\"(layer?.opacity ?? 100) + ''\"\n (ngModelChange)=\"changeOpacity(layer, $event)\"\n labelTranslate=\"@pry.widget.map.opacity\"\n min=\"0\"\n max=\"100\"\n ></pry-range>\n\n <fieldset>\n <legend class=\"u-visually-hidden\">{{ '@pry.widget.map.layerOptions' | i18n : { index: i + 1 } }}</legend>\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"map_layerTitle\">{{ '@pry.widget.map.layerTitle' | i18n }}</label>\n <input\n id=\"map_layerTitle\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeTitle($event, layer)\"\n [value]=\"layer.title ?? ''\"\n />\n </div>\n\n <div class=\"m-form-label-field\" *ngIf=\"layer.type !== 'geoserver'\">\n <label class=\"a-label\" for=\"map_layerType\">{{ '@pry.widget.map.layerType.title' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeLayerType($event, i)\"\n [bindData]=\"true\"\n [itemsAsOption]=\"true\"\n [items]=\"layerTypes\"\n [labelTranslate]=\"true\"\n [ngModel]=\"layer.type\"\n baseTranslate=\"@pry.widget.map.layerType.\"\n class=\"a-pry-select\"\n id=\"map_layerType\"\n ></pry-select>\n </div>\n\n <div\n *ngIf=\"\n layer.type !== 'relation' &&\n layer.type !== 'wms' &&\n layer.type !== 'wmts' &&\n layer.type !== 'geoserver' &&\n layer.type !== 'featurelayer' &&\n layer.type !== 'vectortile' &&\n layer.type !== 'rastertile'\n \"\n class=\"m-form-label-field\"\n >\n <label class=\"a-label\" for=\"map_classes\">{{ '@pry.widget.map.classes' | i18n }}</label>\n <pry-select\n (ngModelChange)=\"changeClasses($event, layer)\"\n [itemsAsOption]=\"true\"\n [items]=\"classes$ | async\"\n [multiple]=\"true\"\n [ngModel]=\"layer.classes\"\n bindLabel=\"name\"\n bindValue=\"id\"\n class=\"a-pry-select\"\n id=\"map_classes\"\n ></pry-select>\n </div>\n </fieldset>\n </div>\n\n <fieldset\n *ngIf=\"\n layer.type !== 'relation' &&\n layer.type !== 'wms' &&\n layer.type !== 'wmts' &&\n layer.type !== 'geoserver' &&\n layer.type !== 'featurelayer' &&\n layer.type !== 'vectortile' &&\n layer.type !== 'rastertile'\n \"\n >\n <legend class=\"u-visually-hidden\">{{ '@pry.widget.map.locationAttr' | i18n }}</legend>\n <ng-container\n *ngIf=\"\n layer\n | geometryFieldsFor : { resultSet: resultSet$, classes: layer.classes, type: layer.type }\n | async as fields\n \"\n >\n <div\n *ngIf=\"\n ['heatmap', 'bubble', 'marker', 'point', 'line', 'polygon', 'multi-line', 'multi-polygon'].indexOf(\n layer.type\n ) >= 0\n \"\n >\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"map_locationAttribute_both\">{{\n '@pry.widget.map.locationAttribute.both' | i18n\n }}</label>\n <pry-select\n (ngModelChange)=\"changeLocationAttributes($event, layer)\"\n [itemsAsOption]=\"true\"\n [items]=\"fields\"\n [ngModel]=\"layer.attribute\"\n bindLabel=\"name\"\n bindValue=\"name\"\n id=\"map_locationAttribute_both\"\n class=\"a-pry-select\"\n ></pry-select>\n </div>\n </div>\n\n <div *ngIf=\"['heatmap', 'bubble'].indexOf(layer.type) >= 0\">\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"map_intensityAttribute\">{{\n '@pry.widget.map.intensityAttribute' | i18n\n }}</label>\n <pry-select\n (ngModelChange)=\"changeIntensityAttributes($event, layer)\"\n [itemsAsOption]=\"true\"\n [items]=\"fields\"\n [ngModel]=\"layerHasIntensity(layer).intensityAttribute\"\n bindLabel=\"name\"\n bindValue=\"name\"\n id=\"map_intensityAttribute\"\n class=\"a-pry-select\"\n ></pry-select>\n </div>\n </div>\n </ng-container>\n </fieldset>\n\n <fieldset\n *ngIf=\"\n layer.type === 'wms' ||\n layer.type === 'wmts' ||\n layer.type === 'featurelayer' ||\n layer.type === 'vectortile' ||\n layer.type === 'rastertile'\n \"\n >\n <legend class=\"u-visually-hidden\">{{ '@pry.widget.map.tile' | i18n }}</legend>\n <div class=\"m-form-label-field\">\n <label class=\"a-label\" for=\"map_wms_url\">{{ '@pry.widget.map.wms.url' | i18n }}</label>\n <input\n id=\"map_wms_url\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeUrl($event, layer)\"\n [value]=\"layer.url\"\n />\n </div>\n\n <div class=\"m-form-label-field\" *ngIf=\"layer.type === 'wms' || layer.type === 'wmts'\">\n <label class=\"a-label\" for=\"map_wms_paramLayer\">{{ '@pry.widget.map.wms.paramLayer' | i18n }}</label>\n <input\n id=\"map_wms_paramLayer\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeParamLayer($event, layer)\"\n [value]=\"layer.paramLayer\"\n />\n </div>\n\n <div class=\"m-form-label-field\" *ngIf=\"layer.type === 'wmts'\">\n <label class=\"a-label\" for=\"map_wms_matrixSet\">{{ '@pry.widget.map.wms.matrixSet' | i18n }}</label>\n <input\n id=\"map_wms_matrixSet\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeMatrixSet($event, layer)\"\n [value]=\"layer.matrixSet\"\n />\n </div>\n\n <div class=\"m-form-label-field\" *ngIf=\"layer.type === 'wmts'\">\n <label class=\"a-label\" for=\"map_wms_style\">{{ '@pry.widget.map.wms.style' | i18n }}</label>\n <input\n id=\"map_wms_style\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeParamStyle($event, layer)\"\n [value]=\"layer.style\"\n />\n </div>\n\n <div class=\"m-form-label-field\" *ngIf=\"layer.type === 'wms'\">\n <pry-checkbox (ngModelChange)=\"changeParamTiled($event, layer)\" [ngModel]=\"layer?.paramTiled ?? false\">\n {{ '@pry.widget.map.wms.paramTiled' | i18n }}\n </pry-checkbox>\n </div>\n </fieldset>\n\n <fieldset *ngIf=\"layer.type === 'marker'\">\n <legend class=\"u-visually-hidden\">{{ '@pry.widget.map.clustering' | i18n }}</legend>\n <div class=\"m-form-label-field\">\n <pry-checkbox (ngModelChange)=\"changeClustered(layer, $event)\" [ngModel]=\"layer.clustered\">\n {{ '@pry.widget.map.clustered' | i18n }}\n </pry-checkbox>\n </div>\n <div *ngIf=\"layer.clustered\">\n <pry-range\n [ngModel]=\"layer.clustered\"\n (ngModelChange)=\"changeClusterDistance(layer, $event)\"\n labelTranslate=\"@pry.widget.map.clusterDistance\"\n min=\"1\"\n max=\"500\"\n ></pry-range>\n </div>\n </fieldset>\n\n <div class=\"m-form-label-field\" *ngIf=\"optionsCopy.attributions\">\n <label class=\"a-label\" for=\"attribution\">{{ '@pry.widget.map.attribution' | i18n }}</label>\n <input\n id=\"attribution\"\n class=\"a-form-field\"\n type=\"text\"\n (input)=\"changeAttribution($event, layer)\"\n [value]=\"layer.attribution ? layer.attribution : ''\"\n />\n </div>\n\n <button\n type=\"button\"\n (click)=\"deleteLayer(i)\"\n class=\"a-btn a-btn--icon-text -link-like\"\n *ngIf=\"layer.type !== 'geoserver'\"\n data-func=\"delete\"\n >\n <pry-icon iconSvg=\"delete\" [width]=\"19\" [height]=\"19\"></pry-icon>\n <span>{{ '@pry.widget.map.deleteLayer' | i18n }}</span>\n </button>\n </div>\n </pry-settings>\n </pry-widget-header>\n\n <div class=\"m-btn-group -selection-choice\" [style.transform]=\"bottomLeft$ | async\">\n <ng-container *ngFor=\"let action of basicActions$ | async\">\n <button\n type=\"button\"\n class=\"a-btn a-btn--icon-only\"\n (click)=\"interactionManager.selectionInteraction.changeSelection(action)\"\n [class.-selected]=\"interactionManager.selectionInteraction.selectionType === action\"\n [pryTooltip]=\"infoTooltipAction\"\n pryTooltipPosition=\"bottom\"\n aria-describedby=\"infoTooltipAction\"\n [pryTooltipContext]=\"{ action: action }\"\n >\n <pry-icon [iconSvg]=\"action\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.widget.map.' + action | i18n }}</span>\n </button>\n </ng-container>\n\n <button\n type=\"button\"\n class=\"a-btn a-btn--icon-only\"\n id=\"export_card\"\n aria-expanded=\"false\"\n aria-controls=\"export_type\"\n aria-haspopup=\"menu\"\n [pryTooltip]=\"infoTooltipDown\"\n pryTooltipPosition=\"bottom\"\n aria-describedby=\"infoTooltipDown_widgetMap\"\n *ngIf=\"(actions$ | async)?.includes('export')\"\n >\n <pry-icon iconSvg=\"file_download\" (click)=\"displayExportType($event)\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.widget.map.export' | i18n }}</span>\n </button>\n\n <button\n type=\"button\"\n class=\"a-btn a-btn--icon-only\"\n (click)=\"uploader.click()\"\n [pryTooltip]=\"infoTooltipLoad\"\n aria-describedby=\"infoTooltipLoad_widgetMap\"\n pryTooltipPosition=\"bottom\"\n *ngIf=\"(actions$ | async)?.includes('upload')\"\n >\n <pry-icon iconSvg=\"file_upload\"></pry-icon>\n <span class=\"u-visually-hidden\">{{ '@pry.widget.map.import' | i18n }}</span>\n </button>\n <input hidden type=\"file\" #uploader (change)=\"import($event)\" />\n </div>\n\n <div\n class=\"ol-control m-layer-legend\"\n *ngIf=\"((legendLayers$ | async)?.length ?? 0) > 0\"\n [style.top.px]=\"legendTop$ | async\"\n >\n <button class=\"m-layer-legend__toggle\" (click)=\"toggleLegendWindow()\">\n <pry-icon iconSvg=\"legend\" [width]=\"22\" [height]=\"22\"></pry-icon>\n </button>\n <ng-container *ngFor=\"let geoLayer of legendLayers$ | async; let index = index\">\n <div class=\"m-layer-legend__title\" [class.-hidden]=\"!legendTabOpen\">\n {{ geoLayer.title }}\n <ng-container *ngIf=\"isLayerRendered(geoLayer)\">\n <button class=\"m-layer-legend__toggle\" (click)=\"toggleLegend(index)\">\n <pry-icon\n [iconSvg]=\"legendTab === index ? 'chevron_top' : 'chevron_bottom'\"\n [width]=\"22\"\n [height]=\"22\"\n ></pry-icon>\n </button>\n </ng-container>\n <ng-container *ngIf=\"!isLayerRendered(geoLayer)\">\n <pry-icon [iconSvg]=\"'close'\" [width]=\"22\" [height]=\"22\"></pry-icon>\n </ng-container>\n </div>\n <div\n class=\"m-layer-legend__image\"\n [class.-hidden]=\"!legendTabOpen || legendTab !== index || !isLayerRendered(geoLayer)\"\n [style.max-height.px]=\"legendHeight$ | async\"\n >\n <ng-container *ngIf=\"!imageNotProvided[index] && (geoLayer | legendUrl)\">\n <img\n [src]=\"geoLayer | legendUrl\"\n [alt]=\"'@pry.widget.map.legend' | i18n : { layer: geoLayer.title }\"\n (error)=\"imageNotProvided[index] = true\"\n />\n </ng-container>\n <ng-container *ngIf=\"imageNotProvided[index]\">\n <p class=\"m-layer-legend__error\">{{ '@pry.widget.map.legendNotProvided' | i18n }}</p>\n </ng-container>\n </div>\n </ng-container>\n </div>\n\n <div [style.height.px]=\"height$ | async\" class=\"o-map-wrapper\">\n <div class=\"o-map\">\n <div #map id=\"map\"></div>\n </div>\n </div>\n\n <ng-template #infoTooltipAction let-action=\"action\">\n <div class=\"m-tooltip\" role=\"tooltip\" id=\"infoTooltipAction\" aria-hidden=\"true\">\n <span class=\"m-tooltip__text\">{{ '@pry.widget.map.' + action | i18n }}</span>\n </div>\n </ng-template>\n\n <ng-template #infoTooltipDown>\n <div class=\"m-tooltip\" role=\"tooltip\" id=\"infoTooltipDown_widgetMap\" aria-hidden=\"true\">\n <span class=\"m-tooltip__text\">{{ '@pry.widget.map.export' | i18n }}</span>\n </div>\n </ng-template>\n\n <ng-template #infoTooltipLoad>\n <div class=\"m-tooltip\" role=\"tooltip\" id=\"infoTooltipLoad_widgetMap\" aria-hidden=\"true\">\n <span class=\"m-tooltip__text\">{{ '@pry.widget.map.import' | i18n }}</span>\n </div>\n </ng-template>\n\n <div #popup class=\"m-tooltip m-tooltip--popup\" [hidden]=\"true\" role=\"tooltip\">\n <div #popupContent></div>\n </div>\n <div\n #address\n class=\"m-tooltip m-tooltip--address tooltip-address\"\n [style.display]=\"'none'\"\n (click)=\"hideAddress()\"\n ></div>\n <ng-template\n #exportTypeTemplate\n class=\"m-context-menu-wrapper\"\n id=\"export_type\"\n aria-hidden=\"true\"\n aria-label=\"TODO-access\"\n aria-labelledby=\"export_card\"\n >\n <div class=\"m-context-menu\">\n <ul class=\"m-context-menu__list\">\n <li class=\"m-context-menu__list__item\">\n <button type=\"button\" class=\"a-btn -link-like\" (click)=\"export('png')\">\n <span class=\"u-visually-hidden\">{{ '@pry.action.exportAsFormat' | i18n }} </span> PNG\n </button>\n </li>\n <li class=\"m-context-menu__list__item\">\n <button type=\"button\" class=\"a-btn -link-like\" (click)=\"export('kml')\">\n <span class=\"u-visually-hidden\">{{ '@pry.action.exportAsFormat' | i18n }} </span> KML\n </button>\n </li>\n <li class=\"m-context-menu__list__item\">\n <button type=\"button\" class=\"a-btn -link-like\" (click)=\"export('geoJSON')\">\n <span class=\"u-visually-hidden\">{{ '@pry.action.exportAsFormat' | i18n }} </span> GeoJSON\n </button>\n </li>\n </ul>\n </div>\n </ng-template>\n</div>\n" }]
1824
1824
  }], ctorParameters: function () { return [{ type: i1.Store }, { type: i2.PrySnackbarService }, { type: i2.PryI18nService }, { type: i2.TooltipFactoryService }, { type: i2.GeocodingService }, { type: i3.Overlay }, { type: i0.ViewContainerRef }, { type: i2.SymbolService }, { type: i0.Injector }, { type: WidgetMapLayerService }, { type: i0.ElementRef }]; }, propDecorators: { mapRef: [{
1825
1825
  type: ViewChild,
1826
1826
  args: ['map']
@@ -1865,7 +1865,7 @@ const enTranslations = {
1865
1865
  rastertile: 'Raster tile',
1866
1866
  point: 'Points',
1867
1867
  line: 'Lines',
1868
- geoserver: 'Geoserver',
1868
+ geoserver: 'Geoserver ({{key}})',
1869
1869
  'multi-line': 'Multi-lines',
1870
1870
  'multi-polygon': 'Multi-polygons'
1871
1871
  },
@@ -1946,7 +1946,7 @@ const frTranslations = {
1946
1946
  rastertile: 'Raster tile',
1947
1947
  point: 'Points',
1948
1948
  line: 'Lignes',
1949
- geoserver: 'Geoserver',
1949
+ geoserver: 'Geoserver ({{key}})',
1950
1950
  'multi-line': 'Multi-lignes',
1951
1951
  'multi-polygon': 'Multi-polygone'
1952
1952
  },
@@ -2062,5 +2062,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.6", ngImpor
2062
2062
  * Generated bundle index. Do not edit.
2063
2063
  */
2064
2064
 
2065
- export { DEFAULT_HEATMAP_RADIUS, DEFAULT_MAP_CENTER, DEFAULT_RADIUS_INTENSITY_FACTOR, DEFAULT_ZOOM_MAX, DEFAULT_ZOOM_MIN, DEFAULT_ZOOM_START, EMPTY_MAP_STYLE, GeometryFieldsForPipe, WidgetMapComponent, WidgetMapLayerService, WidgetMapLegendUrlPipe, WidgetMapModule, exportMapAsGeoJSON, exportMapAsImage, exportMapAsKML, geometryForLayer, getCircleFeatureFromItem, getFeatureFromItem, getLinkFeature, getMapAsPng, populateIntensityAttribute, populateLocationAttribute };
2065
+ export { DEFAULT_HEATMAP_RADIUS, DEFAULT_MAP_CENTER, DEFAULT_RADIUS_INTENSITY_FACTOR, DEFAULT_ZOOM_MAX, DEFAULT_ZOOM_MIN, DEFAULT_ZOOM_START, EMPTY_MAP_STYLE, GeometryFieldsForPipe, InteractionManager, SelectionInteraction, WidgetMapComponent, WidgetMapLayerService, WidgetMapLegendUrlPipe, WidgetMapModule, exportMapAsGeoJSON, exportMapAsImage, exportMapAsKML, geometryForLayer, getCircleFeatureFromItem, getFeatureFromItem, getLinkFeature, getMapAsPng, populateIntensityAttribute, populateLocationAttribute };
2066
2066
  //# sourceMappingURL=provoly-dashboard-widgets-widget-map.mjs.map