@geotrekce/geotrek-rando-widget 0.0.2 → 0.0.3
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.
- package/dist/cjs/geotrek-rando-widget.cjs.js +1 -1
- package/dist/cjs/{grw-app_7.cjs.entry.js → grw-app_10.cjs.entry.js} +275 -47
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/grw-app/grw-app.css +1 -0
- package/dist/collection/components/grw-app/grw-app.js +82 -6
- package/dist/collection/components/grw-information-desk-detail/grw-information-desk-detail.css +30 -0
- package/dist/collection/components/grw-information-desk-detail/grw-information-desk-detail.js +53 -0
- package/dist/collection/components/grw-map/grw-map.css +81 -0
- package/dist/collection/components/grw-map/grw-map.js +255 -31
- package/dist/collection/components/grw-poi-detail/grw-poi-detail.css +30 -0
- package/dist/collection/components/grw-poi-detail/grw-poi-detail.js +41 -0
- package/dist/collection/components/grw-sensitive-area-detail/grw-sensitive-area-detail.css +16 -0
- package/dist/collection/components/grw-sensitive-area-detail/grw-sensitive-area-detail.js +38 -0
- package/dist/collection/components/grw-trek-card/grw-trek-card.css +3 -0
- package/dist/collection/components/grw-trek-card/grw-trek-card.js +4 -4
- package/dist/collection/components/grw-trek-detail/grw-trek-detail.css +35 -0
- package/dist/collection/components/grw-trek-detail/grw-trek-detail.js +40 -6
- package/dist/collection/components/grw-treks-list/grw-treks-list.css +1 -0
- package/dist/collection/components/grw-treks-list/grw-treks-list.js +2 -2
- package/dist/collection/store/grw-trek-provider.js +11 -5
- package/dist/collection/store/grw-treks-provider.js +3 -3
- package/dist/collection/store/store.js +3 -0
- package/dist/collection/stories/App.js +14 -6
- package/dist/collection/stories/App.stories.js +10 -6
- package/dist/collection/stories/TrekCard.js +2 -1
- package/dist/collection/stories/TrekCard.stories.js +4 -3
- package/dist/collection/stories/TrekDetail.js +3 -1
- package/dist/collection/stories/TrekDetail.stories.js +5 -3
- package/dist/collection/stories/TrekMap.js +6 -4
- package/dist/collection/stories/TrekMap.stories.js +7 -5
- package/dist/collection/stories/TreksList.js +2 -1
- package/dist/collection/stories/TreksList.stories.js +4 -3
- package/dist/collection/stories/TreksMap.stories.js +3 -3
- package/dist/collection/utils/utils.js +2 -2
- package/dist/components/grw-app.js +31 -5
- package/dist/components/grw-information-desk-detail.d.ts +11 -0
- package/dist/components/grw-information-desk-detail.js +6 -0
- package/dist/components/grw-information-desk-detail2.js +34 -0
- package/dist/components/grw-map2.js +203 -28
- package/dist/components/grw-poi-detail.d.ts +11 -0
- package/dist/components/grw-poi-detail.js +6 -0
- package/dist/components/grw-poi-detail2.js +32 -0
- package/dist/components/grw-sensitive-area-detail.d.ts +11 -0
- package/dist/components/grw-sensitive-area-detail.js +6 -0
- package/dist/components/grw-sensitive-area-detail2.js +32 -0
- package/dist/components/grw-trek-card2.js +3 -3
- package/dist/components/grw-trek-detail2.js +25 -5
- package/dist/components/grw-trek-provider2.js +11 -5
- package/dist/components/grw-treks-list2.js +2 -2
- package/dist/components/grw-treks-provider2.js +3 -3
- package/dist/components/length.js +2 -2
- package/dist/components/store.js +3 -0
- package/dist/esm/geotrek-rando-widget.js +1 -1
- package/dist/esm/{grw-app_7.entry.js → grw-app_10.entry.js} +273 -48
- package/dist/esm/loader.js +1 -1
- package/dist/geotrek-rando-widget/geotrek-rando-widget.css +1 -1
- package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js +1 -1
- package/dist/geotrek-rando-widget/p-73bc92fe.entry.js +1 -0
- package/dist/types/components/grw-app/grw-app.d.ts +4 -0
- package/dist/types/components/grw-information-desk-detail/grw-information-desk-detail.d.ts +5 -0
- package/dist/types/components/grw-map/grw-map.d.ts +13 -4
- package/dist/types/components/grw-poi-detail/grw-poi-detail.d.ts +5 -0
- package/dist/types/components/grw-sensitive-area-detail/grw-sensitive-area-detail.d.ts +5 -0
- package/dist/types/components/grw-trek-detail/grw-trek-detail.d.ts +1 -0
- package/dist/types/components.d.ts +65 -1
- package/dist/types/store/store.d.ts +7 -1
- package/dist/types/types/types.d.ts +46 -3
- package/package.json +5 -7
- package/readme.md +20 -1
- package/dist/geotrek-rando-widget/p-b7c66d2d.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Host, h, Element, Prop, State } 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';
|
|
@@ -7,17 +7,20 @@ export class GrwMap {
|
|
|
7
7
|
this.mapIsReady = false;
|
|
8
8
|
this.center = '1, 1';
|
|
9
9
|
this.zoom = 10;
|
|
10
|
+
this.colorPrimary = '#6b0030';
|
|
11
|
+
this.colorPrimaryTint = '#974c6e';
|
|
10
12
|
this.colorTrekLine = '#6b0030';
|
|
11
13
|
this.colorDepartureIcon = '#006b3b';
|
|
12
14
|
this.colorArrivalIcon = '#85003b';
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
15
|
+
this.colorSensitiveArea = ' #4974a5';
|
|
16
|
+
this.colorPoiIcon = '#974c6e';
|
|
15
17
|
}
|
|
16
18
|
componentDidLoad() {
|
|
17
19
|
this.map = L.map(this.element, {
|
|
18
20
|
center: this.center.split(',').map(Number),
|
|
19
21
|
zoom: this.zoom,
|
|
20
22
|
});
|
|
23
|
+
L.control.scale().addTo(this.map);
|
|
21
24
|
L.tileLayer(this.urlLayer, {
|
|
22
25
|
maxZoom: 19,
|
|
23
26
|
attribution: this.attribution,
|
|
@@ -49,33 +52,56 @@ export class GrwMap {
|
|
|
49
52
|
}
|
|
50
53
|
addTreks() {
|
|
51
54
|
var _a;
|
|
52
|
-
const
|
|
55
|
+
const trekscurrentDepartureCoordinates = [];
|
|
53
56
|
const treksFeatureCollection = {
|
|
54
57
|
type: 'FeatureCollection',
|
|
55
58
|
features: [],
|
|
56
59
|
};
|
|
57
60
|
for (const trek of state.treks) {
|
|
58
|
-
|
|
61
|
+
trekscurrentDepartureCoordinates.push(trek.departure_geom);
|
|
59
62
|
treksFeatureCollection.features.push({
|
|
60
63
|
type: 'Feature',
|
|
61
|
-
properties: { practice: (_a = state.practices.find(practice => practice.id === trek.practice)) === null || _a === void 0 ? void 0 : _a.pictogram },
|
|
62
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].url,
|
|
70
|
+
},
|
|
63
71
|
});
|
|
64
72
|
}
|
|
65
|
-
if (
|
|
66
|
-
const bounds = L.latLngBounds(
|
|
73
|
+
if (trekscurrentDepartureCoordinates.length > 0) {
|
|
74
|
+
const bounds = L.latLngBounds(trekscurrentDepartureCoordinates.map(coordinate => [coordinate[1], coordinate[0]]));
|
|
67
75
|
this.currentBounds = bounds;
|
|
68
76
|
this.map.fitBounds(this.currentBounds);
|
|
69
77
|
}
|
|
70
78
|
this.treksLayer = L.geoJSON(treksFeatureCollection, {
|
|
71
79
|
pointToLayer: (geoJsonPoint, latlng) => L.marker(latlng, {
|
|
72
80
|
icon: L.divIcon({
|
|
81
|
+
html: geoJsonPoint.properties.practice && `<img src=${geoJsonPoint.properties.practice} />`,
|
|
73
82
|
className: 'trek-marker',
|
|
74
83
|
iconSize: 48,
|
|
75
|
-
html: geoJsonPoint.properties.practice ? `<img src=${geoJsonPoint.properties.practice} />` : '',
|
|
76
84
|
}),
|
|
77
85
|
autoPanOnFocus: false,
|
|
78
86
|
}),
|
|
87
|
+
onEachFeature: (geoJsonPoint, layer) => {
|
|
88
|
+
layer.once('click', () => {
|
|
89
|
+
const trekDeparturePopup = L.DomUtil.create('div');
|
|
90
|
+
trekDeparturePopup.className = 'trek-departure-popup';
|
|
91
|
+
trekDeparturePopup.onclick = () => this.trekCardPress.emit(geoJsonPoint.properties.id);
|
|
92
|
+
const trekName = L.DomUtil.create('div');
|
|
93
|
+
trekName.innerHTML = geoJsonPoint.properties.name;
|
|
94
|
+
trekName.className = 'trek-name';
|
|
95
|
+
if (geoJsonPoint.properties.imgSrc) {
|
|
96
|
+
trekName.className += ' trek-name-margin-top';
|
|
97
|
+
const trekImg = L.DomUtil.create('img');
|
|
98
|
+
trekImg.src = geoJsonPoint.properties.imgSrc;
|
|
99
|
+
trekDeparturePopup.appendChild(trekImg);
|
|
100
|
+
}
|
|
101
|
+
trekDeparturePopup.appendChild(trekName);
|
|
102
|
+
layer.bindPopup(trekDeparturePopup, { interactive: true, autoPan: false, closeButton: false }).openPopup();
|
|
103
|
+
});
|
|
104
|
+
},
|
|
79
105
|
}).addTo(this.map);
|
|
80
106
|
!this.mapIsReady && (this.mapIsReady = !this.mapIsReady);
|
|
81
107
|
}
|
|
@@ -86,39 +112,40 @@ export class GrwMap {
|
|
|
86
112
|
}
|
|
87
113
|
}
|
|
88
114
|
addTrek() {
|
|
89
|
-
const
|
|
115
|
+
const currentTrekFeature = {
|
|
90
116
|
type: 'Feature',
|
|
91
117
|
geometry: state.currentTrek.geometry,
|
|
92
118
|
properties: {},
|
|
93
119
|
};
|
|
94
|
-
this.
|
|
120
|
+
this.currentTrekLayer = L.geoJSON(currentTrekFeature, {
|
|
95
121
|
style: () => ({
|
|
96
122
|
color: this.colorTrekLine,
|
|
97
123
|
}),
|
|
124
|
+
interactive: false,
|
|
98
125
|
}).addTo(this.map);
|
|
99
126
|
const bounds = L.latLngBounds(state.currentTrek.geometry.coordinates.map(coordinate => [coordinate[1], coordinate[0]]));
|
|
100
127
|
this.currentBounds = bounds;
|
|
101
128
|
this.map.fitBounds(this.currentBounds);
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
-
const
|
|
129
|
+
const currentDepartureCoordinates = [state.currentTrek.geometry.coordinates.at(0)[0], state.currentTrek.geometry.coordinates.at(0)[1]];
|
|
130
|
+
const currentArrivalCoordinates = [state.currentTrek.geometry.coordinates.at(-1)[0], state.currentTrek.geometry.coordinates.at(-1)[1]];
|
|
131
|
+
const currentDepartureArrivalFeatureCollection = {
|
|
105
132
|
type: 'FeatureCollection',
|
|
106
133
|
features: [
|
|
107
134
|
{
|
|
108
135
|
type: 'Feature',
|
|
109
136
|
properties: { type: 'departure' },
|
|
110
|
-
geometry: { type: 'Point', coordinates:
|
|
137
|
+
geometry: { type: 'Point', coordinates: currentDepartureCoordinates },
|
|
111
138
|
},
|
|
112
139
|
],
|
|
113
140
|
};
|
|
114
|
-
if (
|
|
115
|
-
|
|
141
|
+
if (currentDepartureCoordinates[0] !== currentArrivalCoordinates[0] || currentDepartureCoordinates[1] !== currentArrivalCoordinates[1]) {
|
|
142
|
+
currentDepartureArrivalFeatureCollection.features.push({
|
|
116
143
|
type: 'Feature',
|
|
117
144
|
properties: { type: 'arrival' },
|
|
118
|
-
geometry: { type: 'Point', coordinates:
|
|
145
|
+
geometry: { type: 'Point', coordinates: currentArrivalCoordinates },
|
|
119
146
|
});
|
|
120
147
|
}
|
|
121
|
-
this.
|
|
148
|
+
this.currentDepartureArrivalLayer = L.geoJSON(currentDepartureArrivalFeatureCollection, {
|
|
122
149
|
pointToLayer: (geoJsonPoint, latlng) => L.marker(latlng, {
|
|
123
150
|
icon: L.divIcon({
|
|
124
151
|
html: departureArrivalImage,
|
|
@@ -127,18 +154,162 @@ export class GrwMap {
|
|
|
127
154
|
iconAnchor: [0, 48],
|
|
128
155
|
}),
|
|
129
156
|
autoPanOnFocus: false,
|
|
157
|
+
interactive: false,
|
|
130
158
|
}),
|
|
131
159
|
}).addTo(this.map);
|
|
160
|
+
if (state.currentTrek.parking_location) {
|
|
161
|
+
const currentParking = {
|
|
162
|
+
type: 'Feature',
|
|
163
|
+
properties: {},
|
|
164
|
+
geometry: { type: 'Point', coordinates: state.currentTrek.parking_location },
|
|
165
|
+
};
|
|
166
|
+
this.currentParkingLayer = L.geoJSON(currentParking, {
|
|
167
|
+
pointToLayer: (_geoJsonPoint, latlng) => L.marker(latlng, {
|
|
168
|
+
icon: L.divIcon({
|
|
169
|
+
html: '<div>P</div>',
|
|
170
|
+
className: 'parking-icon',
|
|
171
|
+
iconSize: 48,
|
|
172
|
+
iconAnchor: [0, 48],
|
|
173
|
+
}),
|
|
174
|
+
autoPanOnFocus: false,
|
|
175
|
+
interactive: false,
|
|
176
|
+
}),
|
|
177
|
+
}).addTo(this.map);
|
|
178
|
+
}
|
|
179
|
+
if (state.currentSensitiveAreas && state.currentSensitiveAreas.length > 0) {
|
|
180
|
+
const currentSensitiveAreasFeatureCollection = {
|
|
181
|
+
type: 'FeatureCollection',
|
|
182
|
+
features: [],
|
|
183
|
+
};
|
|
184
|
+
for (const sensitiveArea of state.currentSensitiveAreas) {
|
|
185
|
+
currentSensitiveAreasFeatureCollection.features.push({
|
|
186
|
+
type: 'Feature',
|
|
187
|
+
properties: {},
|
|
188
|
+
geometry: sensitiveArea.geometry,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
this.currentSensitiveAreasLayer = L.geoJSON(currentSensitiveAreasFeatureCollection, { style: () => ({ color: this.colorSensitiveArea }) }).addTo(this.map);
|
|
192
|
+
L.Control.SensitiveAreasCheckboxContainer = L.Control.extend({
|
|
193
|
+
onAdd: () => {
|
|
194
|
+
const sensitiveAreasCheckboxContainer = L.DomUtil.create('div');
|
|
195
|
+
sensitiveAreasCheckboxContainer.className = 'sensitiveAreasCheckboxContainer';
|
|
196
|
+
const sensitiveAreasCheckbox = L.DomUtil.create('input');
|
|
197
|
+
sensitiveAreasCheckbox.setAttribute('id', 'sensitiveAreasCheckbox');
|
|
198
|
+
sensitiveAreasCheckbox.setAttribute('type', 'checkbox');
|
|
199
|
+
sensitiveAreasCheckbox.setAttribute('checked', 'true');
|
|
200
|
+
sensitiveAreasCheckbox.onclick = value => value.composedPath()[0].checked ? this.map.addLayer(this.currentSensitiveAreasLayer) : this.map.removeLayer(this.currentSensitiveAreasLayer);
|
|
201
|
+
const sensitiveAreasLabel = L.DomUtil.create('label');
|
|
202
|
+
sensitiveAreasLabel.setAttribute('for', 'sensitiveAreasCheckbox');
|
|
203
|
+
sensitiveAreasLabel.innerHTML =
|
|
204
|
+
currentSensitiveAreasFeatureCollection.features.length > 1 || currentSensitiveAreasFeatureCollection.features[0].geometry.type === 'MultiPolygon'
|
|
205
|
+
? 'Afficher les zones sensibles'
|
|
206
|
+
: 'Afficher la zone sensible';
|
|
207
|
+
sensitiveAreasCheckboxContainer.appendChild(sensitiveAreasCheckbox);
|
|
208
|
+
sensitiveAreasCheckboxContainer.appendChild(sensitiveAreasLabel);
|
|
209
|
+
return sensitiveAreasCheckboxContainer;
|
|
210
|
+
},
|
|
211
|
+
});
|
|
212
|
+
L.control.sensitiveAreasCheckboxContainer = () => {
|
|
213
|
+
return new L.Control.SensitiveAreasCheckboxContainer();
|
|
214
|
+
};
|
|
215
|
+
this.sensitiveAreasControl = L.control.sensitiveAreasCheckboxContainer({ position: 'topright' }).addTo(this.map);
|
|
216
|
+
}
|
|
217
|
+
if (state.currentPois && state.currentPois.length > 0) {
|
|
218
|
+
const currentPoisFeatureCollection = {
|
|
219
|
+
type: 'FeatureCollection',
|
|
220
|
+
features: [],
|
|
221
|
+
};
|
|
222
|
+
for (const currentPoi of state.currentPois) {
|
|
223
|
+
currentPoisFeatureCollection.features.push({
|
|
224
|
+
type: 'Feature',
|
|
225
|
+
properties: { name: currentPoi.name, type_pictogram: currentPoi.type_pictogram },
|
|
226
|
+
geometry: currentPoi.geometry,
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
this.currentPoisLayer = L.geoJSON(currentPoisFeatureCollection, {
|
|
230
|
+
pointToLayer: (geoJsonPoint, latlng) => L.marker(latlng, {
|
|
231
|
+
icon: L.divIcon({
|
|
232
|
+
html: geoJsonPoint.properties.type_pictogram && `<img src=${geoJsonPoint.properties.type_pictogram} />`,
|
|
233
|
+
className: 'poi-icon',
|
|
234
|
+
iconSize: 48,
|
|
235
|
+
}),
|
|
236
|
+
autoPanOnFocus: false,
|
|
237
|
+
}),
|
|
238
|
+
onEachFeature: (geoJsonPoint, layer) => {
|
|
239
|
+
layer.once('mouseover', () => {
|
|
240
|
+
const poiTooltip = L.DomUtil.create('div');
|
|
241
|
+
poiTooltip.className = 'poi-tooltip';
|
|
242
|
+
const poiName = L.DomUtil.create('div');
|
|
243
|
+
poiName.innerHTML = geoJsonPoint.properties.name;
|
|
244
|
+
poiName.className = 'poi-name';
|
|
245
|
+
poiTooltip.appendChild(poiName);
|
|
246
|
+
layer.bindTooltip(poiTooltip).openTooltip();
|
|
247
|
+
});
|
|
248
|
+
},
|
|
249
|
+
}).addTo(this.map);
|
|
250
|
+
}
|
|
251
|
+
if (state.currentInformationDesks && state.currentInformationDesks.length > 0) {
|
|
252
|
+
const currentInformationDesksFeatureCollection = {
|
|
253
|
+
type: 'FeatureCollection',
|
|
254
|
+
features: [],
|
|
255
|
+
};
|
|
256
|
+
for (const currentInformationDesk of state.currentInformationDesks) {
|
|
257
|
+
currentInformationDesksFeatureCollection.features.push({
|
|
258
|
+
type: 'Feature',
|
|
259
|
+
properties: { name: currentInformationDesk.name, type_pictogram: currentInformationDesk.type.pictogram },
|
|
260
|
+
geometry: { type: 'Point', coordinates: [Number(currentInformationDesk.longitude), Number(currentInformationDesk.latitude)] },
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
this.currentInformationDesksLayer = L.geoJSON(currentInformationDesksFeatureCollection, {
|
|
264
|
+
pointToLayer: (geoJsonPoint, latlng) => L.marker(latlng, {
|
|
265
|
+
icon: L.divIcon({
|
|
266
|
+
html: geoJsonPoint.properties.type_pictogram && `<img src=${geoJsonPoint.properties.type_pictogram} />`,
|
|
267
|
+
className: 'information-desks-icon',
|
|
268
|
+
iconSize: 48,
|
|
269
|
+
}),
|
|
270
|
+
autoPanOnFocus: false,
|
|
271
|
+
}),
|
|
272
|
+
onEachFeature: (geoJsonPoint, layer) => {
|
|
273
|
+
layer.once('mouseover', () => {
|
|
274
|
+
const informationDesksTooltip = L.DomUtil.create('div');
|
|
275
|
+
informationDesksTooltip.className = 'information-desks-tooltip';
|
|
276
|
+
const informationDesksName = L.DomUtil.create('div');
|
|
277
|
+
informationDesksName.innerHTML = geoJsonPoint.properties.name;
|
|
278
|
+
informationDesksName.className = 'information-desks-name';
|
|
279
|
+
informationDesksTooltip.appendChild(informationDesksName);
|
|
280
|
+
layer.bindTooltip(informationDesksTooltip).openTooltip();
|
|
281
|
+
});
|
|
282
|
+
},
|
|
283
|
+
}).addTo(this.map);
|
|
284
|
+
}
|
|
132
285
|
!this.mapIsReady && (this.mapIsReady = !this.mapIsReady);
|
|
133
286
|
}
|
|
134
287
|
removeTrek() {
|
|
135
|
-
if (this.
|
|
136
|
-
this.map.removeLayer(this.
|
|
137
|
-
this.
|
|
288
|
+
if (this.currentTrekLayer) {
|
|
289
|
+
this.map.removeLayer(this.currentTrekLayer);
|
|
290
|
+
this.currentTrekLayer = null;
|
|
291
|
+
}
|
|
292
|
+
if (this.currentDepartureArrivalLayer) {
|
|
293
|
+
this.map.removeLayer(this.currentDepartureArrivalLayer);
|
|
294
|
+
this.currentDepartureArrivalLayer = null;
|
|
295
|
+
}
|
|
296
|
+
if (this.currentParkingLayer) {
|
|
297
|
+
this.map.removeLayer(this.currentParkingLayer);
|
|
298
|
+
this.currentParkingLayer = null;
|
|
138
299
|
}
|
|
139
|
-
if (this.
|
|
140
|
-
this.map.removeLayer(this.
|
|
141
|
-
this.
|
|
300
|
+
if (this.currentSensitiveAreasLayer) {
|
|
301
|
+
this.map.removeLayer(this.currentSensitiveAreasLayer);
|
|
302
|
+
this.currentSensitiveAreasLayer = null;
|
|
303
|
+
this.map.removeControl(this.sensitiveAreasControl);
|
|
304
|
+
this.sensitiveAreasControl = null;
|
|
305
|
+
}
|
|
306
|
+
if (this.currentPoisLayer) {
|
|
307
|
+
this.map.removeLayer(this.currentPoisLayer);
|
|
308
|
+
this.currentPoisLayer = null;
|
|
309
|
+
}
|
|
310
|
+
if (this.currentInformationDesksLayer) {
|
|
311
|
+
this.map.removeLayer(this.currentInformationDesksLayer);
|
|
312
|
+
this.currentInformationDesksLayer = null;
|
|
142
313
|
}
|
|
143
314
|
}
|
|
144
315
|
render() {
|
|
@@ -147,6 +318,7 @@ export class GrwMap {
|
|
|
147
318
|
'--color-primary-tint': this.colorPrimaryTint,
|
|
148
319
|
'--color-departure-icon': this.colorDepartureIcon,
|
|
149
320
|
'--color-arrival-icon': this.colorArrivalIcon,
|
|
321
|
+
'--color-poi-icon': this.colorPoiIcon,
|
|
150
322
|
} }, !this.mapIsReady && (h("div", { class: "map-loader-container" },
|
|
151
323
|
h("span", { class: "loader" })))));
|
|
152
324
|
}
|
|
@@ -228,6 +400,42 @@ export class GrwMap {
|
|
|
228
400
|
"reflect": false,
|
|
229
401
|
"defaultValue": "10"
|
|
230
402
|
},
|
|
403
|
+
"colorPrimary": {
|
|
404
|
+
"type": "string",
|
|
405
|
+
"mutable": false,
|
|
406
|
+
"complexType": {
|
|
407
|
+
"original": "string",
|
|
408
|
+
"resolved": "string",
|
|
409
|
+
"references": {}
|
|
410
|
+
},
|
|
411
|
+
"required": false,
|
|
412
|
+
"optional": false,
|
|
413
|
+
"docs": {
|
|
414
|
+
"tags": [],
|
|
415
|
+
"text": ""
|
|
416
|
+
},
|
|
417
|
+
"attribute": "color-primary",
|
|
418
|
+
"reflect": false,
|
|
419
|
+
"defaultValue": "'#6b0030'"
|
|
420
|
+
},
|
|
421
|
+
"colorPrimaryTint": {
|
|
422
|
+
"type": "string",
|
|
423
|
+
"mutable": false,
|
|
424
|
+
"complexType": {
|
|
425
|
+
"original": "string",
|
|
426
|
+
"resolved": "string",
|
|
427
|
+
"references": {}
|
|
428
|
+
},
|
|
429
|
+
"required": false,
|
|
430
|
+
"optional": false,
|
|
431
|
+
"docs": {
|
|
432
|
+
"tags": [],
|
|
433
|
+
"text": ""
|
|
434
|
+
},
|
|
435
|
+
"attribute": "color-primary-tint",
|
|
436
|
+
"reflect": false,
|
|
437
|
+
"defaultValue": "'#974c6e'"
|
|
438
|
+
},
|
|
231
439
|
"colorTrekLine": {
|
|
232
440
|
"type": "string",
|
|
233
441
|
"mutable": false,
|
|
@@ -282,7 +490,7 @@ export class GrwMap {
|
|
|
282
490
|
"reflect": false,
|
|
283
491
|
"defaultValue": "'#85003b'"
|
|
284
492
|
},
|
|
285
|
-
"
|
|
493
|
+
"colorSensitiveArea": {
|
|
286
494
|
"type": "string",
|
|
287
495
|
"mutable": false,
|
|
288
496
|
"complexType": {
|
|
@@ -296,11 +504,11 @@ export class GrwMap {
|
|
|
296
504
|
"tags": [],
|
|
297
505
|
"text": ""
|
|
298
506
|
},
|
|
299
|
-
"attribute": "color-
|
|
507
|
+
"attribute": "color-sensitive-area",
|
|
300
508
|
"reflect": false,
|
|
301
|
-
"defaultValue": "'#
|
|
509
|
+
"defaultValue": "'\t#4974a5'"
|
|
302
510
|
},
|
|
303
|
-
"
|
|
511
|
+
"colorPoiIcon": {
|
|
304
512
|
"type": "string",
|
|
305
513
|
"mutable": false,
|
|
306
514
|
"complexType": {
|
|
@@ -314,13 +522,29 @@ export class GrwMap {
|
|
|
314
522
|
"tags": [],
|
|
315
523
|
"text": ""
|
|
316
524
|
},
|
|
317
|
-
"attribute": "color-
|
|
525
|
+
"attribute": "color-poi-icon",
|
|
318
526
|
"reflect": false,
|
|
319
|
-
"defaultValue": "'#
|
|
527
|
+
"defaultValue": "'#974c6e'"
|
|
320
528
|
}
|
|
321
529
|
}; }
|
|
322
530
|
static get states() { return {
|
|
323
531
|
"mapIsReady": {}
|
|
324
532
|
}; }
|
|
533
|
+
static get events() { return [{
|
|
534
|
+
"method": "trekCardPress",
|
|
535
|
+
"name": "trekCardPress",
|
|
536
|
+
"bubbles": true,
|
|
537
|
+
"cancelable": true,
|
|
538
|
+
"composed": true,
|
|
539
|
+
"docs": {
|
|
540
|
+
"tags": [],
|
|
541
|
+
"text": ""
|
|
542
|
+
},
|
|
543
|
+
"complexType": {
|
|
544
|
+
"original": "number",
|
|
545
|
+
"resolved": "number",
|
|
546
|
+
"references": {}
|
|
547
|
+
}
|
|
548
|
+
}]; }
|
|
325
549
|
static get elementRef() { return "element"; }
|
|
326
550
|
}
|
|
@@ -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
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
.trek-card-container {
|
|
2
|
+
font-family: "Roboto";
|
|
2
3
|
width: 350px;
|
|
3
4
|
height: auto;
|
|
4
5
|
border-radius: 8px;
|
|
@@ -6,8 +7,10 @@
|
|
|
6
7
|
cursor: pointer;
|
|
7
8
|
}
|
|
8
9
|
.trek-card-container .image {
|
|
10
|
+
border-radius: 8px 8px 0px 0px;
|
|
9
11
|
width: 100%;
|
|
10
12
|
height: auto;
|
|
13
|
+
box-shadow: 4px 8px 24px rgba(0, 0, 0, 0.25);
|
|
11
14
|
}
|
|
12
15
|
.trek-card-container .sub-container {
|
|
13
16
|
padding: 12px;
|
|
@@ -7,7 +7,7 @@ import lengthImage from '../../assets/length.svg';
|
|
|
7
7
|
export class GrwTrekCard {
|
|
8
8
|
constructor() {
|
|
9
9
|
this.colorPrimary = '#6b0030';
|
|
10
|
-
this.colorPrimaryTint = '#
|
|
10
|
+
this.colorPrimaryTint = '#974c6e';
|
|
11
11
|
}
|
|
12
12
|
componentWillLoad() {
|
|
13
13
|
this.currentTrek = this.trek ? this.trek : state.currentTrek;
|
|
@@ -28,7 +28,7 @@ export class GrwTrekCard {
|
|
|
28
28
|
render() {
|
|
29
29
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
30
30
|
return (h(Host, { onClick: () => this.trekCardPress.emit(this.currentTrek.id), style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, this.currentTrek && (h("div", { class: "trek-card-container" },
|
|
31
|
-
this.currentTrek.attachments && this.currentTrek.attachments[0] && this.currentTrek.attachments[0].
|
|
31
|
+
this.currentTrek.attachments && this.currentTrek.attachments[0] && this.currentTrek.attachments[0].thumbnail && (h("img", { class: "image", src: `${this.currentTrek.attachments[0].thumbnail}`, loading: "lazy" })),
|
|
32
32
|
h("div", { class: "sub-container" },
|
|
33
33
|
h("div", { class: "name" }, (_a = this.currentTrek) === null || _a === void 0 ? void 0 : _a.name),
|
|
34
34
|
h("div", { class: "description", innerHTML: (_b = this.currentTrek) === null || _b === void 0 ? void 0 : _b.description_teaser }),
|
|
@@ -68,7 +68,7 @@ export class GrwTrekCard {
|
|
|
68
68
|
"mutable": false,
|
|
69
69
|
"complexType": {
|
|
70
70
|
"original": "Trek",
|
|
71
|
-
"resolved": "{ id: number; name: string; attachments: Attachments; description?: string; description_teaser: string; difficulty: number; route: number; practice: number; duration: number; length_2d: number; ascent: number; geometry?: LineString; departure_geom?: Position; }",
|
|
71
|
+
"resolved": "{ id: number; name: string; attachments: Attachments; description?: string; description_teaser: string; difficulty: number; route: number; practice: number; duration: number; length_2d: number; ascent: number; geometry?: LineString; departure_geom?: Position; gpx?: string; kml?: string; pdf?: string; parking_location?: Position; }",
|
|
72
72
|
"references": {
|
|
73
73
|
"Trek": {
|
|
74
74
|
"location": "import",
|
|
@@ -117,7 +117,7 @@ export class GrwTrekCard {
|
|
|
117
117
|
},
|
|
118
118
|
"attribute": "color-primary-tint",
|
|
119
119
|
"reflect": false,
|
|
120
|
-
"defaultValue": "'#
|
|
120
|
+
"defaultValue": "'#974c6e'"
|
|
121
121
|
}
|
|
122
122
|
}; }
|
|
123
123
|
static get states() { return {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
.trek-detail-container {
|
|
2
|
+
font-family: "Roboto";
|
|
2
3
|
display: flex;
|
|
3
4
|
flex-direction: column;
|
|
4
5
|
height: 100%;
|
|
@@ -11,6 +12,7 @@
|
|
|
11
12
|
padding: 24px;
|
|
12
13
|
}
|
|
13
14
|
.trek-detail-container .image {
|
|
15
|
+
border-radius: 8px;
|
|
14
16
|
align-self: center;
|
|
15
17
|
width: 100%;
|
|
16
18
|
max-width: 700px;
|
|
@@ -53,6 +55,39 @@
|
|
|
53
55
|
.trek-detail-container .sub-container .icons-labels-container .row .practice img {
|
|
54
56
|
background-color: var(--color-primary);
|
|
55
57
|
}
|
|
58
|
+
.trek-detail-container .downloads-container {
|
|
59
|
+
padding: 0px 24px 24px 24px;
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
align-items: center;
|
|
64
|
+
}
|
|
65
|
+
.trek-detail-container .downloads-container .download-title {
|
|
66
|
+
color: var(--color-primary);
|
|
67
|
+
font-size: 18px;
|
|
68
|
+
margin-bottom: 18px;
|
|
69
|
+
}
|
|
70
|
+
.trek-detail-container .downloads-container .links-container a {
|
|
71
|
+
background-color: var(--color-primary);
|
|
72
|
+
padding: 8px;
|
|
73
|
+
color: #ffffff;
|
|
74
|
+
text-decoration: none;
|
|
75
|
+
border-radius: 8px;
|
|
76
|
+
}
|
|
77
|
+
.trek-detail-container .downloads-container .links-container a:nth-child(2) {
|
|
78
|
+
margin: 0px 12px;
|
|
79
|
+
}
|
|
80
|
+
.trek-detail-container .downloads-container .links-container a:hover {
|
|
81
|
+
background-color: var(--color-primary-shade);
|
|
82
|
+
}
|
|
56
83
|
.trek-detail-container .description {
|
|
57
84
|
padding: 0px 24px 24px 24px;
|
|
85
|
+
}
|
|
86
|
+
.trek-detail-container .pois-title,
|
|
87
|
+
.trek-detail-container .sensitive-areas-title,
|
|
88
|
+
.trek-detail-container .information-desks-title {
|
|
89
|
+
color: var(--color-primary);
|
|
90
|
+
font-size: 36px;
|
|
91
|
+
font-weight: bold;
|
|
92
|
+
padding: 16px;
|
|
58
93
|
}
|