@geotrekce/geotrek-rando-widget 0.0.1 → 0.0.4

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 (87) hide show
  1. package/dist/cjs/geotrek-rando-widget.cjs.js +2 -2
  2. package/dist/cjs/{grw-app_7.cjs.entry.js → grw-app_11.cjs.entry.js} +513 -89
  3. package/dist/cjs/{index-31255e29.js → index-c2c4531d.js} +82 -1
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/collection/assets/departure-arrival.svg +1 -1
  6. package/dist/collection/collection-manifest.json +4 -0
  7. package/dist/collection/components/grw-app/grw-app.css +127 -39
  8. package/dist/collection/components/grw-app/grw-app.js +375 -18
  9. package/dist/collection/components/grw-filter/grw-filter.css +29 -0
  10. package/dist/collection/components/grw-filter/grw-filter.js +132 -0
  11. package/dist/collection/components/grw-information-desk-detail/grw-information-desk-detail.css +30 -0
  12. package/dist/collection/components/grw-information-desk-detail/grw-information-desk-detail.js +53 -0
  13. package/dist/collection/components/grw-map/grw-map.css +117 -0
  14. package/dist/collection/components/grw-map/grw-map.js +409 -40
  15. package/dist/collection/components/grw-poi-detail/grw-poi-detail.css +30 -0
  16. package/dist/collection/components/grw-poi-detail/grw-poi-detail.js +41 -0
  17. package/dist/collection/components/grw-sensitive-area-detail/grw-sensitive-area-detail.css +16 -0
  18. package/dist/collection/components/grw-sensitive-area-detail/grw-sensitive-area-detail.js +38 -0
  19. package/dist/collection/components/grw-trek-card/grw-trek-card.css +67 -30
  20. package/dist/collection/components/grw-trek-card/grw-trek-card.js +112 -33
  21. package/dist/collection/components/grw-trek-detail/grw-trek-detail.css +36 -1
  22. package/dist/collection/components/grw-trek-detail/grw-trek-detail.js +122 -33
  23. package/dist/collection/components/grw-treks-list/grw-treks-list.css +17 -12
  24. package/dist/collection/components/grw-treks-list/grw-treks-list.js +70 -6
  25. package/dist/collection/store/grw-trek-provider.js +50 -8
  26. package/dist/collection/store/grw-treks-provider.js +166 -11
  27. package/dist/collection/store/store.js +6 -0
  28. package/dist/collection/stories/App.js +39 -3
  29. package/dist/collection/stories/App.stories.js +30 -5
  30. package/dist/collection/stories/TrekCard.js +9 -3
  31. package/dist/collection/stories/TrekCard.stories.js +5 -2
  32. package/dist/collection/stories/TrekDetail.js +10 -3
  33. package/dist/collection/stories/TrekDetail.stories.js +6 -2
  34. package/dist/collection/stories/TrekMap.js +15 -6
  35. package/dist/collection/stories/TrekMap.stories.js +21 -6
  36. package/dist/collection/stories/TreksList.js +17 -3
  37. package/dist/collection/stories/TreksList.stories.js +13 -2
  38. package/dist/collection/stories/TreksMap.js +12 -3
  39. package/dist/collection/stories/TreksMap.stories.js +18 -3
  40. package/dist/collection/utils/utils.js +2 -2
  41. package/dist/components/grw-app.js +79 -9
  42. package/dist/components/grw-filter.d.ts +11 -0
  43. package/dist/components/grw-filter.js +6 -0
  44. package/dist/components/grw-filter2.js +95 -0
  45. package/dist/components/grw-information-desk-detail.d.ts +11 -0
  46. package/dist/components/grw-information-desk-detail.js +6 -0
  47. package/dist/components/grw-information-desk-detail2.js +34 -0
  48. package/dist/components/grw-map2.js +260 -43
  49. package/dist/components/grw-poi-detail.d.ts +11 -0
  50. package/dist/components/grw-poi-detail.js +6 -0
  51. package/dist/components/grw-poi-detail2.js +32 -0
  52. package/dist/components/grw-sensitive-area-detail.d.ts +11 -0
  53. package/dist/components/grw-sensitive-area-detail.js +6 -0
  54. package/dist/components/grw-sensitive-area-detail2.js +32 -0
  55. package/dist/components/grw-trek-card2.js +33 -10
  56. package/dist/components/grw-trek-detail2.js +47 -9
  57. package/dist/components/grw-trek-provider2.js +32 -9
  58. package/dist/components/grw-treks-list2.js +15 -6
  59. package/dist/components/grw-treks-provider2.js +37 -13
  60. package/dist/components/length.js +2 -2
  61. package/dist/components/store.js +6 -0
  62. package/dist/esm/geotrek-rando-widget.js +2 -2
  63. package/dist/esm/{grw-app_7.entry.js → grw-app_11.entry.js} +510 -90
  64. package/dist/esm/{index-b36f38f5.js → index-fe16e7b6.js} +82 -1
  65. package/dist/esm/loader.js +2 -2
  66. package/dist/geotrek-rando-widget/geotrek-rando-widget.css +1 -1
  67. package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js +1 -1
  68. package/dist/geotrek-rando-widget/p-8c206aec.js +2 -0
  69. package/dist/geotrek-rando-widget/p-ed8706fb.entry.js +1 -0
  70. package/dist/types/components/grw-app/grw-app.d.ts +27 -2
  71. package/dist/types/components/grw-filter/grw-filter.d.ts +9 -0
  72. package/dist/types/components/grw-information-desk-detail/grw-information-desk-detail.d.ts +5 -0
  73. package/dist/types/components/grw-map/grw-map.d.ts +19 -2
  74. package/dist/types/components/grw-poi-detail/grw-poi-detail.d.ts +5 -0
  75. package/dist/types/components/grw-sensitive-area-detail/grw-sensitive-area-detail.d.ts +5 -0
  76. package/dist/types/components/grw-trek-card/grw-trek-card.d.ts +6 -2
  77. package/dist/types/components/grw-trek-detail/grw-trek-detail.d.ts +3 -0
  78. package/dist/types/components/grw-treks-list/grw-treks-list.d.ts +3 -0
  79. package/dist/types/components.d.ts +158 -1
  80. package/dist/types/store/grw-trek-provider.d.ts +1 -0
  81. package/dist/types/store/grw-treks-provider.d.ts +8 -0
  82. package/dist/types/store/store.d.ts +13 -1
  83. package/dist/types/types/types.d.ts +69 -3
  84. package/package.json +5 -7
  85. package/readme.md +19 -1
  86. package/dist/geotrek-rando-widget/p-f721481d.js +0 -2
  87. package/dist/geotrek-rando-widget/p-fe788eaa.entry.js +0 -1
@@ -1,28 +1,44 @@
1
- import { Component, Host, h, Element, Prop } from '@stencil/core';
1
+ import { Component, Host, h, Element, Prop, State, Event } from '@stencil/core';
2
2
  import L from 'leaflet';
3
3
  import state, { onChange } from 'store/store';
4
4
  import departureArrivalImage from '../../assets/departure-arrival.svg';
5
5
  export class GrwMap {
6
6
  constructor() {
7
+ this.mapIsReady = false;
8
+ this.center = '1, 1';
9
+ this.zoom = 10;
10
+ this.colorPrimary = '#6b0030';
11
+ this.colorPrimaryTint = '#974c6e';
7
12
  this.colorTrekLine = '#6b0030';
8
13
  this.colorDepartureIcon = '#006b3b';
9
14
  this.colorArrivalIcon = '#85003b';
15
+ this.colorSensitiveArea = ' #4974a5';
16
+ this.colorPoiIcon = '#974c6e';
10
17
  }
11
18
  componentDidLoad() {
12
19
  this.map = L.map(this.element, {
13
- center: [1, 1],
14
- zoom: 10,
20
+ center: this.center.split(',').map(Number),
21
+ zoom: this.zoom,
15
22
  });
16
- L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
23
+ L.control.scale().addTo(this.map);
24
+ L.tileLayer(this.urlLayer, {
17
25
  maxZoom: 19,
18
- attribution: '© OpenStreetMap',
26
+ attribution: this.attribution,
19
27
  }).addTo(this.map);
20
28
  if (state.currentTrek) {
21
29
  this.addTrek();
22
30
  }
23
- else {
31
+ else if (state.currentTrek) {
24
32
  this.addTreks();
25
33
  }
34
+ onChange('currentTreks', () => {
35
+ if (state.currentTrek) {
36
+ this.addTrek();
37
+ }
38
+ else if (state.currentTreks) {
39
+ this.addTreks();
40
+ }
41
+ });
26
42
  onChange('currentTrek', () => {
27
43
  if (state.currentTrek) {
28
44
  this.removeTreks();
@@ -35,71 +51,107 @@ export class GrwMap {
35
51
  });
36
52
  }
37
53
  addTreks() {
38
- const treksDepartureCoordinates = [];
54
+ var _a;
55
+ const trekscurrentDepartureCoordinates = [];
39
56
  const treksFeatureCollection = {
40
57
  type: 'FeatureCollection',
41
58
  features: [],
42
59
  };
43
- for (const trek of state.treks) {
44
- treksDepartureCoordinates.push(trek.departure_geom);
60
+ for (const trek of state.currentTreks) {
61
+ trekscurrentDepartureCoordinates.push(trek.departure_geom);
45
62
  treksFeatureCollection.features.push({
46
63
  type: 'Feature',
47
- properties: {},
48
64
  geometry: { type: 'Point', coordinates: trek.departure_geom },
65
+ properties: {
66
+ id: trek.id,
67
+ name: trek.name,
68
+ practice: (_a = state.practices.find(practice => practice.id === trek.practice)) === null || _a === void 0 ? void 0 : _a.pictogram,
69
+ imgSrc: trek.attachments && trek.attachments.length > 0 && trek.attachments[0].thumbnail,
70
+ },
49
71
  });
50
72
  }
51
- if (treksDepartureCoordinates.length > 0) {
52
- const bounds = L.latLngBounds(treksDepartureCoordinates.map(coordinate => [coordinate[1], coordinate[0]]));
53
- this.map.fitBounds(bounds);
73
+ if (trekscurrentDepartureCoordinates.length > 0) {
74
+ const bounds = L.latLngBounds(trekscurrentDepartureCoordinates.map(coordinate => [coordinate[1], coordinate[0]]));
75
+ this.currentBounds = bounds;
76
+ this.map.fitBounds(this.currentBounds);
54
77
  }
55
- this.treksLayer = L.geoJSON(treksFeatureCollection, {
56
- pointToLayer: (_geoJsonPoint, latlng) => L.marker(latlng, {
57
- icon: L.divIcon({
58
- className: 'trek-marker',
59
- iconSize: 48,
60
- iconAnchor: [0, 48],
78
+ if (!this.treksLayer) {
79
+ this.treksLayer = L.geoJSON(treksFeatureCollection, {
80
+ pointToLayer: (geoJsonPoint, latlng) => L.marker(latlng, {
81
+ icon: L.divIcon({
82
+ html: geoJsonPoint.properties.practice && `<img src=${geoJsonPoint.properties.practice} />`,
83
+ className: 'trek-marker',
84
+ iconSize: 48,
85
+ }),
86
+ autoPanOnFocus: false,
61
87
  }),
62
- autoPanOnFocus: false,
63
- }),
64
- }).addTo(this.map);
88
+ onEachFeature: (geoJsonPoint, layer) => {
89
+ layer.once('click', () => {
90
+ const trekDeparturePopup = L.DomUtil.create('div');
91
+ trekDeparturePopup.className = 'trek-departure-popup';
92
+ trekDeparturePopup.onclick = () => this.trekCardPress.emit(geoJsonPoint.properties.id);
93
+ const trekName = L.DomUtil.create('div');
94
+ trekName.innerHTML = geoJsonPoint.properties.name;
95
+ trekName.className = 'trek-name';
96
+ if (geoJsonPoint.properties.imgSrc) {
97
+ trekName.className += ' trek-name-margin-top';
98
+ const trekImg = L.DomUtil.create('img');
99
+ trekImg.src = geoJsonPoint.properties.imgSrc;
100
+ trekDeparturePopup.appendChild(trekImg);
101
+ }
102
+ trekDeparturePopup.appendChild(trekName);
103
+ layer.bindPopup(trekDeparturePopup, { interactive: true, autoPan: false, closeButton: false }).openPopup();
104
+ });
105
+ },
106
+ }).addTo(this.map);
107
+ }
108
+ else {
109
+ this.treksLayer.clearLayers();
110
+ this.treksLayer.addData(treksFeatureCollection);
111
+ }
112
+ !this.mapIsReady && (this.mapIsReady = !this.mapIsReady);
65
113
  }
66
114
  removeTreks() {
67
- this.map.removeLayer(this.treksLayer);
68
- this.treksLayer = null;
115
+ if (this.treksLayer) {
116
+ this.map.removeLayer(this.treksLayer);
117
+ this.treksLayer = null;
118
+ }
69
119
  }
70
120
  addTrek() {
71
- const trekFeature = {
121
+ const currentTrekFeature = {
72
122
  type: 'Feature',
73
123
  geometry: state.currentTrek.geometry,
74
124
  properties: {},
75
125
  };
76
- this.trekLayer = L.geoJSON(trekFeature, {
126
+ this.currentTrekLayer = L.geoJSON(currentTrekFeature, {
77
127
  style: () => ({
78
128
  color: this.colorTrekLine,
79
129
  }),
130
+ interactive: false,
80
131
  }).addTo(this.map);
81
132
  const bounds = L.latLngBounds(state.currentTrek.geometry.coordinates.map(coordinate => [coordinate[1], coordinate[0]]));
82
- this.map.fitBounds(bounds);
83
- const departureCoordinates = [state.currentTrek.geometry.coordinates.at(0)[0], state.currentTrek.geometry.coordinates.at(0)[1]];
84
- const arrivalCoordinates = [state.currentTrek.geometry.coordinates.at(-1)[0], state.currentTrek.geometry.coordinates.at(-1)[1]];
85
- const departureArrivalFeatureCollection = {
133
+ this.currentBounds = bounds;
134
+ this.map.fitBounds(this.currentBounds);
135
+ const currentDepartureCoordinates = [state.currentTrek.geometry.coordinates.at(0)[0], state.currentTrek.geometry.coordinates.at(0)[1]];
136
+ const currentArrivalCoordinates = [state.currentTrek.geometry.coordinates.at(-1)[0], state.currentTrek.geometry.coordinates.at(-1)[1]];
137
+ const currentDepartureArrivalFeatureCollection = {
86
138
  type: 'FeatureCollection',
87
139
  features: [
88
140
  {
89
141
  type: 'Feature',
90
142
  properties: { type: 'departure' },
91
- geometry: { type: 'Point', coordinates: departureCoordinates },
143
+ geometry: { type: 'Point', coordinates: currentDepartureCoordinates },
92
144
  },
93
145
  ],
94
146
  };
95
- if (departureCoordinates[0] !== arrivalCoordinates[0] || departureCoordinates[1] !== arrivalCoordinates[1]) {
96
- departureArrivalFeatureCollection.features.push({
147
+ if (currentDepartureCoordinates[0] !== currentArrivalCoordinates[0] || currentDepartureCoordinates[1] !== currentArrivalCoordinates[1]) {
148
+ currentDepartureArrivalFeatureCollection.features.push({
97
149
  type: 'Feature',
98
150
  properties: { type: 'arrival' },
99
- geometry: { type: 'Point', coordinates: arrivalCoordinates },
151
+ geometry: { type: 'Point', coordinates: currentArrivalCoordinates },
100
152
  });
101
153
  }
102
- this.departureArrivalLayer = L.geoJSON(departureArrivalFeatureCollection, {
154
+ this.currentDepartureArrivalLayer = L.geoJSON(currentDepartureArrivalFeatureCollection, {
103
155
  pointToLayer: (geoJsonPoint, latlng) => L.marker(latlng, {
104
156
  icon: L.divIcon({
105
157
  html: departureArrivalImage,
@@ -108,17 +160,173 @@ export class GrwMap {
108
160
  iconAnchor: [0, 48],
109
161
  }),
110
162
  autoPanOnFocus: false,
163
+ interactive: false,
111
164
  }),
112
165
  }).addTo(this.map);
166
+ if (state.currentTrek.parking_location) {
167
+ const currentParking = {
168
+ type: 'Feature',
169
+ properties: {},
170
+ geometry: { type: 'Point', coordinates: state.currentTrek.parking_location },
171
+ };
172
+ this.currentParkingLayer = L.geoJSON(currentParking, {
173
+ pointToLayer: (_geoJsonPoint, latlng) => L.marker(latlng, {
174
+ icon: L.divIcon({
175
+ html: '<div>P</div>',
176
+ className: 'parking-icon',
177
+ iconSize: 48,
178
+ iconAnchor: [0, 48],
179
+ }),
180
+ autoPanOnFocus: false,
181
+ interactive: false,
182
+ }),
183
+ }).addTo(this.map);
184
+ }
185
+ if (state.currentSensitiveAreas && state.currentSensitiveAreas.length > 0) {
186
+ const currentSensitiveAreasFeatureCollection = {
187
+ type: 'FeatureCollection',
188
+ features: [],
189
+ };
190
+ for (const sensitiveArea of state.currentSensitiveAreas) {
191
+ currentSensitiveAreasFeatureCollection.features.push({
192
+ type: 'Feature',
193
+ properties: {},
194
+ geometry: sensitiveArea.geometry,
195
+ });
196
+ }
197
+ this.currentSensitiveAreasLayer = L.geoJSON(currentSensitiveAreasFeatureCollection, { style: () => ({ color: this.colorSensitiveArea }) }).addTo(this.map);
198
+ L.Control.SensitiveAreasCheckboxContainer = L.Control.extend({
199
+ onAdd: () => {
200
+ const sensitiveAreasCheckboxContainer = L.DomUtil.create('div');
201
+ sensitiveAreasCheckboxContainer.className = 'sensitiveAreasCheckboxContainer';
202
+ const sensitiveAreasCheckbox = L.DomUtil.create('input');
203
+ sensitiveAreasCheckbox.setAttribute('id', 'sensitiveAreasCheckbox');
204
+ sensitiveAreasCheckbox.setAttribute('type', 'checkbox');
205
+ sensitiveAreasCheckbox.setAttribute('checked', 'true');
206
+ sensitiveAreasCheckbox.onclick = value => value.composedPath()[0].checked ? this.map.addLayer(this.currentSensitiveAreasLayer) : this.map.removeLayer(this.currentSensitiveAreasLayer);
207
+ const sensitiveAreasLabel = L.DomUtil.create('label');
208
+ sensitiveAreasLabel.setAttribute('for', 'sensitiveAreasCheckbox');
209
+ sensitiveAreasLabel.innerHTML =
210
+ currentSensitiveAreasFeatureCollection.features.length > 1 || currentSensitiveAreasFeatureCollection.features[0].geometry.type === 'MultiPolygon'
211
+ ? 'Afficher les zones sensibles'
212
+ : 'Afficher la zone sensible';
213
+ sensitiveAreasCheckboxContainer.appendChild(sensitiveAreasCheckbox);
214
+ sensitiveAreasCheckboxContainer.appendChild(sensitiveAreasLabel);
215
+ return sensitiveAreasCheckboxContainer;
216
+ },
217
+ });
218
+ L.control.sensitiveAreasCheckboxContainer = () => {
219
+ return new L.Control.SensitiveAreasCheckboxContainer();
220
+ };
221
+ this.sensitiveAreasControl = L.control.sensitiveAreasCheckboxContainer({ position: 'topright' }).addTo(this.map);
222
+ }
223
+ if (state.currentPois && state.currentPois.length > 0) {
224
+ const currentPoisFeatureCollection = {
225
+ type: 'FeatureCollection',
226
+ features: [],
227
+ };
228
+ for (const currentPoi of state.currentPois) {
229
+ currentPoisFeatureCollection.features.push({
230
+ type: 'Feature',
231
+ properties: { name: currentPoi.name, type_pictogram: currentPoi.type_pictogram },
232
+ geometry: currentPoi.geometry,
233
+ });
234
+ }
235
+ this.currentPoisLayer = L.geoJSON(currentPoisFeatureCollection, {
236
+ pointToLayer: (geoJsonPoint, latlng) => L.marker(latlng, {
237
+ icon: L.divIcon({
238
+ html: geoJsonPoint.properties.type_pictogram && `<img src=${geoJsonPoint.properties.type_pictogram} />`,
239
+ className: 'poi-icon',
240
+ iconSize: 48,
241
+ }),
242
+ autoPanOnFocus: false,
243
+ }),
244
+ onEachFeature: (geoJsonPoint, layer) => {
245
+ layer.once('mouseover', () => {
246
+ const poiTooltip = L.DomUtil.create('div');
247
+ poiTooltip.className = 'poi-tooltip';
248
+ const poiName = L.DomUtil.create('div');
249
+ poiName.innerHTML = geoJsonPoint.properties.name;
250
+ poiName.className = 'poi-name';
251
+ poiTooltip.appendChild(poiName);
252
+ layer.bindTooltip(poiTooltip).openTooltip();
253
+ });
254
+ },
255
+ }).addTo(this.map);
256
+ }
257
+ if (state.currentInformationDesks && state.currentInformationDesks.length > 0) {
258
+ const currentInformationDesksFeatureCollection = {
259
+ type: 'FeatureCollection',
260
+ features: [],
261
+ };
262
+ for (const currentInformationDesk of state.currentInformationDesks) {
263
+ currentInformationDesksFeatureCollection.features.push({
264
+ type: 'Feature',
265
+ properties: { name: currentInformationDesk.name, type_pictogram: currentInformationDesk.type.pictogram },
266
+ geometry: { type: 'Point', coordinates: [Number(currentInformationDesk.longitude), Number(currentInformationDesk.latitude)] },
267
+ });
268
+ }
269
+ this.currentInformationDesksLayer = L.geoJSON(currentInformationDesksFeatureCollection, {
270
+ pointToLayer: (geoJsonPoint, latlng) => L.marker(latlng, {
271
+ icon: L.divIcon({
272
+ html: geoJsonPoint.properties.type_pictogram && `<img src=${geoJsonPoint.properties.type_pictogram} />`,
273
+ className: 'information-desks-icon',
274
+ iconSize: 48,
275
+ }),
276
+ autoPanOnFocus: false,
277
+ }),
278
+ onEachFeature: (geoJsonPoint, layer) => {
279
+ layer.once('mouseover', () => {
280
+ const informationDesksTooltip = L.DomUtil.create('div');
281
+ informationDesksTooltip.className = 'information-desks-tooltip';
282
+ const informationDesksName = L.DomUtil.create('div');
283
+ informationDesksName.innerHTML = geoJsonPoint.properties.name;
284
+ informationDesksName.className = 'information-desks-name';
285
+ informationDesksTooltip.appendChild(informationDesksName);
286
+ layer.bindTooltip(informationDesksTooltip).openTooltip();
287
+ });
288
+ },
289
+ }).addTo(this.map);
290
+ }
291
+ !this.mapIsReady && (this.mapIsReady = !this.mapIsReady);
113
292
  }
114
293
  removeTrek() {
115
- this.map.removeLayer(this.trekLayer);
116
- this.map.removeLayer(this.departureArrivalLayer);
117
- this.trekLayer = null;
118
- this.departureArrivalLayer = null;
294
+ if (this.currentTrekLayer) {
295
+ this.map.removeLayer(this.currentTrekLayer);
296
+ this.currentTrekLayer = null;
297
+ }
298
+ if (this.currentDepartureArrivalLayer) {
299
+ this.map.removeLayer(this.currentDepartureArrivalLayer);
300
+ this.currentDepartureArrivalLayer = null;
301
+ }
302
+ if (this.currentParkingLayer) {
303
+ this.map.removeLayer(this.currentParkingLayer);
304
+ this.currentParkingLayer = null;
305
+ }
306
+ if (this.currentSensitiveAreasLayer) {
307
+ this.map.removeLayer(this.currentSensitiveAreasLayer);
308
+ this.currentSensitiveAreasLayer = null;
309
+ this.map.removeControl(this.sensitiveAreasControl);
310
+ this.sensitiveAreasControl = null;
311
+ }
312
+ if (this.currentPoisLayer) {
313
+ this.map.removeLayer(this.currentPoisLayer);
314
+ this.currentPoisLayer = null;
315
+ }
316
+ if (this.currentInformationDesksLayer) {
317
+ this.map.removeLayer(this.currentInformationDesksLayer);
318
+ this.currentInformationDesksLayer = null;
319
+ }
119
320
  }
120
321
  render() {
121
- return h(Host, { style: { '--color-departure-icon': this.colorDepartureIcon, '--color-arrival-icon': this.colorArrivalIcon } });
322
+ return (h(Host, { style: {
323
+ '--color-primary': this.colorPrimary,
324
+ '--color-primary-tint': this.colorPrimaryTint,
325
+ '--color-departure-icon': this.colorDepartureIcon,
326
+ '--color-arrival-icon': this.colorArrivalIcon,
327
+ '--color-poi-icon': this.colorPoiIcon,
328
+ } }, !this.mapIsReady && (h("div", { class: "map-loader-container" },
329
+ h("span", { class: "loader" })))));
122
330
  }
123
331
  static get is() { return "grw-map"; }
124
332
  static get originalStyleUrls() { return {
@@ -128,6 +336,112 @@ export class GrwMap {
128
336
  "$": ["grw-map.css"]
129
337
  }; }
130
338
  static get properties() { return {
339
+ "urlLayer": {
340
+ "type": "string",
341
+ "mutable": false,
342
+ "complexType": {
343
+ "original": "string",
344
+ "resolved": "string",
345
+ "references": {}
346
+ },
347
+ "required": false,
348
+ "optional": false,
349
+ "docs": {
350
+ "tags": [],
351
+ "text": ""
352
+ },
353
+ "attribute": "url-layer",
354
+ "reflect": false
355
+ },
356
+ "attribution": {
357
+ "type": "string",
358
+ "mutable": false,
359
+ "complexType": {
360
+ "original": "string",
361
+ "resolved": "string",
362
+ "references": {}
363
+ },
364
+ "required": false,
365
+ "optional": false,
366
+ "docs": {
367
+ "tags": [],
368
+ "text": ""
369
+ },
370
+ "attribute": "attribution",
371
+ "reflect": false
372
+ },
373
+ "center": {
374
+ "type": "string",
375
+ "mutable": false,
376
+ "complexType": {
377
+ "original": "string",
378
+ "resolved": "string",
379
+ "references": {}
380
+ },
381
+ "required": false,
382
+ "optional": false,
383
+ "docs": {
384
+ "tags": [],
385
+ "text": ""
386
+ },
387
+ "attribute": "center",
388
+ "reflect": false,
389
+ "defaultValue": "'1, 1'"
390
+ },
391
+ "zoom": {
392
+ "type": "number",
393
+ "mutable": false,
394
+ "complexType": {
395
+ "original": "number",
396
+ "resolved": "number",
397
+ "references": {}
398
+ },
399
+ "required": false,
400
+ "optional": false,
401
+ "docs": {
402
+ "tags": [],
403
+ "text": ""
404
+ },
405
+ "attribute": "zoom",
406
+ "reflect": false,
407
+ "defaultValue": "10"
408
+ },
409
+ "colorPrimary": {
410
+ "type": "string",
411
+ "mutable": false,
412
+ "complexType": {
413
+ "original": "string",
414
+ "resolved": "string",
415
+ "references": {}
416
+ },
417
+ "required": false,
418
+ "optional": false,
419
+ "docs": {
420
+ "tags": [],
421
+ "text": ""
422
+ },
423
+ "attribute": "color-primary",
424
+ "reflect": false,
425
+ "defaultValue": "'#6b0030'"
426
+ },
427
+ "colorPrimaryTint": {
428
+ "type": "string",
429
+ "mutable": false,
430
+ "complexType": {
431
+ "original": "string",
432
+ "resolved": "string",
433
+ "references": {}
434
+ },
435
+ "required": false,
436
+ "optional": false,
437
+ "docs": {
438
+ "tags": [],
439
+ "text": ""
440
+ },
441
+ "attribute": "color-primary-tint",
442
+ "reflect": false,
443
+ "defaultValue": "'#974c6e'"
444
+ },
131
445
  "colorTrekLine": {
132
446
  "type": "string",
133
447
  "mutable": false,
@@ -181,7 +495,62 @@ export class GrwMap {
181
495
  "attribute": "color-arrival-icon",
182
496
  "reflect": false,
183
497
  "defaultValue": "'#85003b'"
498
+ },
499
+ "colorSensitiveArea": {
500
+ "type": "string",
501
+ "mutable": false,
502
+ "complexType": {
503
+ "original": "string",
504
+ "resolved": "string",
505
+ "references": {}
506
+ },
507
+ "required": false,
508
+ "optional": false,
509
+ "docs": {
510
+ "tags": [],
511
+ "text": ""
512
+ },
513
+ "attribute": "color-sensitive-area",
514
+ "reflect": false,
515
+ "defaultValue": "'\t#4974a5'"
516
+ },
517
+ "colorPoiIcon": {
518
+ "type": "string",
519
+ "mutable": false,
520
+ "complexType": {
521
+ "original": "string",
522
+ "resolved": "string",
523
+ "references": {}
524
+ },
525
+ "required": false,
526
+ "optional": false,
527
+ "docs": {
528
+ "tags": [],
529
+ "text": ""
530
+ },
531
+ "attribute": "color-poi-icon",
532
+ "reflect": false,
533
+ "defaultValue": "'#974c6e'"
184
534
  }
185
535
  }; }
536
+ static get states() { return {
537
+ "mapIsReady": {}
538
+ }; }
539
+ static get events() { return [{
540
+ "method": "trekCardPress",
541
+ "name": "trekCardPress",
542
+ "bubbles": true,
543
+ "cancelable": true,
544
+ "composed": true,
545
+ "docs": {
546
+ "tags": [],
547
+ "text": ""
548
+ },
549
+ "complexType": {
550
+ "original": "number",
551
+ "resolved": "number",
552
+ "references": {}
553
+ }
554
+ }]; }
186
555
  static get elementRef() { return "element"; }
187
556
  }
@@ -0,0 +1,30 @@
1
+ :host {
2
+ display: flex;
3
+ flex-direction: column;
4
+ padding: 0px 8px 8px 8px;
5
+ }
6
+
7
+ .poi-img {
8
+ width: 180px;
9
+ }
10
+ .poi-img img {
11
+ width: 180px;
12
+ border-radius: 8px;
13
+ }
14
+
15
+ .poi-right-container {
16
+ display: flex;
17
+ flex-direction: column;
18
+ padding: 8px;
19
+ }
20
+
21
+ .poi-name {
22
+ color: var(--color-primary);
23
+ font-size: 24px;
24
+ font-weight: bold;
25
+ padding: 0px 0px 8px 0px;
26
+ }
27
+
28
+ .poi-description {
29
+ font-size: 16px;
30
+ }
@@ -0,0 +1,41 @@
1
+ import { Component, Host, h, Prop } from '@stencil/core';
2
+ export class GrwPoiDetail {
3
+ render() {
4
+ return (h(Host, null,
5
+ this.poi.attachments && this.poi.attachments[0] && this.poi.attachments[0].thumbnail && (h("div", { class: "poi-img" },
6
+ h("img", { src: this.poi.attachments[0].thumbnail, loading: "lazy" }))),
7
+ h("div", { class: "poi-right-container" },
8
+ h("div", { class: "poi-name" }, this.poi.name),
9
+ h("div", { class: "poi-description", innerHTML: this.poi.description }))));
10
+ }
11
+ static get is() { return "grw-poi-detail"; }
12
+ static get encapsulation() { return "shadow"; }
13
+ static get originalStyleUrls() { return {
14
+ "$": ["grw-poi-detail.scss"]
15
+ }; }
16
+ static get styleUrls() { return {
17
+ "$": ["grw-poi-detail.css"]
18
+ }; }
19
+ static get properties() { return {
20
+ "poi": {
21
+ "type": "unknown",
22
+ "mutable": false,
23
+ "complexType": {
24
+ "original": "Poi",
25
+ "resolved": "{ id: number; name: string; description: string; attachments: Attachments; type: any; type_label: any; type_pictogram: any; url: string; published: boolean; geometry: Geometry; }",
26
+ "references": {
27
+ "Poi": {
28
+ "location": "import",
29
+ "path": "types/types"
30
+ }
31
+ }
32
+ },
33
+ "required": false,
34
+ "optional": false,
35
+ "docs": {
36
+ "tags": [],
37
+ "text": ""
38
+ }
39
+ }
40
+ }; }
41
+ }
@@ -0,0 +1,16 @@
1
+ :host {
2
+ display: flex;
3
+ flex-direction: column;
4
+ padding: 0px 8px 8px 8px;
5
+ }
6
+
7
+ .sensitive-area-name {
8
+ color: var(--color-primary);
9
+ font-size: 24px;
10
+ font-weight: bold;
11
+ padding: 0px 0px 8px 0px;
12
+ }
13
+
14
+ .sensitive-area-description {
15
+ font-size: 16px;
16
+ }
@@ -0,0 +1,38 @@
1
+ import { Component, Host, h, Prop } from '@stencil/core';
2
+ export class GrwSensitiveAreaDetail {
3
+ render() {
4
+ return (h(Host, null,
5
+ h("div", { class: "sensitive-area-name" }, this.sensitiveArea.name),
6
+ h("div", { class: "sensitive-area-description", innerHTML: this.sensitiveArea.description })));
7
+ }
8
+ static get is() { return "grw-sensitive-area-detail"; }
9
+ static get encapsulation() { return "shadow"; }
10
+ static get originalStyleUrls() { return {
11
+ "$": ["grw-sensitive-area-detail.scss"]
12
+ }; }
13
+ static get styleUrls() { return {
14
+ "$": ["grw-sensitive-area-detail.css"]
15
+ }; }
16
+ static get properties() { return {
17
+ "sensitiveArea": {
18
+ "type": "unknown",
19
+ "mutable": false,
20
+ "complexType": {
21
+ "original": "SensitiveArea",
22
+ "resolved": "{ id: number; geometry: Geometry; name: string; description: string; }",
23
+ "references": {
24
+ "SensitiveArea": {
25
+ "location": "import",
26
+ "path": "types/types"
27
+ }
28
+ }
29
+ },
30
+ "required": false,
31
+ "optional": false,
32
+ "docs": {
33
+ "tags": [],
34
+ "text": ""
35
+ }
36
+ }
37
+ }; }
38
+ }