@geops/rvf-mobility-web-component 0.1.59 → 0.1.60
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/CHANGELOG.md +44 -0
- package/README.md +16 -123
- package/docutils.js +1 -1
- package/index.js +152 -149
- package/package.json +1 -1
- package/src/ExportMenu/ExportMenu.tsx +7 -5
- package/src/ExportMenuButton/ExportMenuButton.tsx +8 -1
- package/src/GeolocationButton/GeolocationButton.tsx +9 -3
- package/src/LayerTree/TreeItem/TreeItem.tsx +3 -1
- package/src/LayerTreeButton/LayerTreeButton.tsx +10 -4
- package/src/LayerTreeMenu/LayerTreeMenu.tsx +15 -5
- package/src/LinesNetworkPlanLayer/LinesNetworkPlanLayer.tsx +5 -2
- package/src/MapDispatchEvents/MapDispatchEvents.tsx +7 -0
- package/src/MapLayout/MapLayout.tsx +176 -0
- package/src/MapLayout/index.tsx +1 -0
- package/src/MobilityMap/MobilityMap.tsx +25 -139
- package/src/MobilityMap/MobilityMapAttributes.ts +15 -3
- package/src/NotificationDetails/NotificationDetails.tsx +23 -8
- package/src/OverlayContent/OverlayContent.tsx +5 -3
- package/src/OverlayDetails/OverlayDetails.tsx +29 -11
- package/src/OverlayDetailsHeader/OverlayDetailsHeader.tsx +11 -14
- package/src/Permalink/Permalink.tsx +5 -5
- package/src/PermalinkInput/PermalinkInput.tsx +6 -4
- package/src/RealtimeLayer/RealtimeLayer.tsx +10 -9
- package/src/RouteScheduleFooter/RouteScheduleFooter.tsx +1 -1
- package/src/RvfFeatureDetails/RvfNotificationDetails/RvfNotificationDetails.tsx +23 -8
- package/src/RvfMobilityMap/RvfMobilityMap.tsx +45 -41
- package/src/RvfSellingPointsLayer/RvfSellingPointsLayer.tsx +6 -6
- package/src/RvfSharedMobilityLayerGroup/RvfSharedMobilityLayerGroup.tsx +76 -58
- package/src/Search/Search.tsx +1 -1
- package/src/SearchButton/SearchButton.tsx +10 -4
- package/src/ShareMenu/ShareMenu.tsx +4 -2
- package/src/ShareMenuButton/ShareMenuButton.tsx +10 -3
- package/src/StationsLayer/StationsLayer.tsx +4 -1
- package/src/ZoomButtons/ZoomButtons.tsx +12 -2
- package/src/index.tsx +13 -5
- package/src/utils/constants.ts +20 -40
- package/src/utils/getPermalinkParameters.ts +12 -4
- package/src/utils/hooks/useInitialPermalink.tsx +76 -0
- package/src/utils/hooks/useLayerConfig.tsx +1 -3
- package/src/utils/hooks/useLayersConfig.tsx +2 -2
- package/src/utils/i18n.ts +0 -10
- package/src/utils/translations.ts +165 -0
- package/src/RvfFeatureDetailsFooter/RvfFeatureDetailsFooter.tsx +0 -43
- package/src/RvfFeatureDetailsFooter/index.tsx +0 -1
- package/src/RvfFeatureDetailsTitle/RvfFeatureDetailsTitle.tsx +0 -81
- package/src/RvfFeatureDetailsTitle/index.tsx +0 -1
- package/src/RvfLayerTree/RvfLayerTree.tsx +0 -40
- package/src/RvfLayerTree/TreeItem/TreeItem.tsx +0 -145
- package/src/RvfLayerTree/TreeItem/index.tsx +0 -1
- package/src/RvfLayerTree/index.tsx +0 -1
- package/src/RvfLayerTree/layersTreeContext.ts +0 -4
- package/src/RvfLayerTree/layersTreeReducer.ts +0 -158
- package/src/RvfOverlayContent/RvfOverlayContent.tsx +0 -128
- package/src/RvfOverlayContent/index.ts +0 -0
- package/src/utils/hooks/useUpdatePermalink.tsx +0 -76
|
@@ -5,12 +5,14 @@ import { useCallback, useEffect, useState } from "preact/hooks";
|
|
|
5
5
|
import Minus from "../icons/Minus";
|
|
6
6
|
import Plus from "../icons/Plus";
|
|
7
7
|
import IconButton from "../ui/IconButton";
|
|
8
|
+
import useI18n from "../utils/hooks/useI18n";
|
|
8
9
|
import useMapContext from "../utils/hooks/useMapContext";
|
|
9
10
|
|
|
10
11
|
function ZoomButtons() {
|
|
11
12
|
const { map } = useMapContext();
|
|
12
13
|
const [isZoomInDisabled, setIsZoomInDisabled] = useState(false);
|
|
13
14
|
const [isZoomOutDisabled, setIsZoomOutDisabled] = useState(false);
|
|
15
|
+
const { t } = useI18n();
|
|
14
16
|
|
|
15
17
|
const handleZoomIn = useCallback(() => {
|
|
16
18
|
if (!map?.getView()) {
|
|
@@ -56,11 +58,19 @@ function ZoomButtons() {
|
|
|
56
58
|
|
|
57
59
|
return (
|
|
58
60
|
<>
|
|
59
|
-
<IconButton
|
|
61
|
+
<IconButton
|
|
62
|
+
disabled={isZoomInDisabled}
|
|
63
|
+
onClick={handleZoomIn}
|
|
64
|
+
title={t("zoomin")}
|
|
65
|
+
>
|
|
60
66
|
<Plus />
|
|
61
67
|
</IconButton>
|
|
62
68
|
|
|
63
|
-
<IconButton
|
|
69
|
+
<IconButton
|
|
70
|
+
disabled={isZoomOutDisabled}
|
|
71
|
+
onClick={handleZoomOut}
|
|
72
|
+
title={t("zoomout")}
|
|
73
|
+
>
|
|
64
74
|
<Minus />
|
|
65
75
|
</IconButton>
|
|
66
76
|
</>
|
package/src/index.tsx
CHANGED
|
@@ -4,15 +4,23 @@ import MobilityMap from "./MobilityMap";
|
|
|
4
4
|
import MobilityMapAttributes from "./MobilityMap/MobilityMapAttributes";
|
|
5
5
|
import MobilitySearch, { MobilitySearchAttributes } from "./MobilitySearch";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import type { MobilityMapAttributeName } from "./MobilityMap/MobilityMapAttributes";
|
|
8
|
+
import type { MobilitySearchAttributeName } from "./MobilitySearch/MobilitySearchAttributes";
|
|
9
|
+
|
|
10
|
+
register(
|
|
11
|
+
MobilityMap,
|
|
12
|
+
"geops-mobility",
|
|
13
|
+
Object.keys(MobilityMapAttributes) as MobilityMapAttributeName[],
|
|
14
|
+
{
|
|
15
|
+
mode: "open",
|
|
16
|
+
shadow: true,
|
|
17
|
+
},
|
|
18
|
+
);
|
|
11
19
|
|
|
12
20
|
register(
|
|
13
21
|
MobilitySearch,
|
|
14
22
|
"geops-mobility-search",
|
|
15
|
-
Object.keys(MobilitySearchAttributes),
|
|
23
|
+
Object.keys(MobilitySearchAttributes) as MobilitySearchAttributeName[],
|
|
16
24
|
{
|
|
17
25
|
mode: "open",
|
|
18
26
|
shadow: true,
|
package/src/utils/constants.ts
CHANGED
|
@@ -32,29 +32,6 @@ window.fromLonLat = fromLonLat;
|
|
|
32
32
|
window.toLonLat = toLonLat;
|
|
33
33
|
export const LAYER_PROP_IS_EXPORTING = "isExporting";
|
|
34
34
|
|
|
35
|
-
export const LAYERS_TITLES = {
|
|
36
|
-
auto: "Auto",
|
|
37
|
-
autoandere: "Auto, andere Anbieter",
|
|
38
|
-
cargobike: "Cargobike",
|
|
39
|
-
cargobikeandere: "Lastenrad, andere Anbieter",
|
|
40
|
-
cargobikefrelo: "Lastenfrelo",
|
|
41
|
-
"e-roller": "E-Roller",
|
|
42
|
-
eroller: "E-Roller",
|
|
43
|
-
fahrrad: "Fahrrad",
|
|
44
|
-
fahrradandere: "Fahrrad, andere Anbieter",
|
|
45
|
-
grueneflotte: "Grüne Flotte",
|
|
46
|
-
linesnetworkplan: "Liniennetz",
|
|
47
|
-
mitfahrpunkte: "Mitfahrpunkte",
|
|
48
|
-
naturenergie: "Naturenergie-Sharing",
|
|
49
|
-
notifications: "Meldungen",
|
|
50
|
-
pois: "POIs",
|
|
51
|
-
realtime: "Echtzeit",
|
|
52
|
-
sharedMobility: "Shared Mobility",
|
|
53
|
-
stations: "Haltestellen",
|
|
54
|
-
tarifzonen: "Tarifzonen",
|
|
55
|
-
verkaufsstellen: "Verkaufsstellen",
|
|
56
|
-
};
|
|
57
|
-
|
|
58
35
|
export const LAYERS_NAMES = {
|
|
59
36
|
bikeFrelo: "fahrradfrelo",
|
|
60
37
|
bikeOthers: "fahrradandere",
|
|
@@ -69,11 +46,14 @@ export const LAYERS_NAMES = {
|
|
|
69
46
|
notifications: LAYER_NAME_NOTIFICATIONS,
|
|
70
47
|
pois: "pois",
|
|
71
48
|
realtime: LAYER_NAME_REALTIME,
|
|
49
|
+
sharedMobility: "sharedmobility",
|
|
72
50
|
stations: LAYER_NAME_STATIONS,
|
|
73
51
|
tarifzonen: "tarifzonen",
|
|
74
52
|
verkaufsstellen: "verkaufsstellen",
|
|
75
53
|
};
|
|
76
54
|
|
|
55
|
+
export const DEFAULT_VISIBLE_LAYERS = Object.values(LAYERS_NAMES);
|
|
56
|
+
|
|
77
57
|
export const DEFAULT_QUERYABLE_LAYERS = Object.values(LAYERS_NAMES).filter(
|
|
78
58
|
(name) => {
|
|
79
59
|
return ![
|
|
@@ -128,23 +108,23 @@ export const API_REQUEST_FEATURE_TYPE = {
|
|
|
128
108
|
},
|
|
129
109
|
};
|
|
130
110
|
|
|
131
|
-
export const TITLE_BY_FEED_ID = {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
export const TITLE_BY_CATEGORY = {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
};
|
|
111
|
+
// export const TITLE_BY_FEED_ID = {
|
|
112
|
+
// callabike_ice: LAYERS_TITLES.fahrrad,
|
|
113
|
+
// flinkster_carsharing: LAYERS_TITLES.auto,
|
|
114
|
+
// "gruene-flotte_freiburg": LAYERS_TITLES.auto,
|
|
115
|
+
// lastenvelo_fr: LAYERS_TITLES.cargobike,
|
|
116
|
+
// naturenergie_sharing: LAYERS_TITLES.auto,
|
|
117
|
+
// nextbike_df: LAYERS_TITLES.fahrrad,
|
|
118
|
+
// yoio_freiburg: LAYERS_TITLES.eroller,
|
|
119
|
+
// zeus_freiburg: LAYERS_TITLES.eroller,
|
|
120
|
+
// };
|
|
121
|
+
|
|
122
|
+
// export const TITLE_BY_CATEGORY = {
|
|
123
|
+
// "Bike Sharing": LAYERS_TITLES.fahrrad,
|
|
124
|
+
// "Cargo Bike Sharing": LAYERS_TITLES.cargobike,
|
|
125
|
+
// "Car Sharing": LAYERS_TITLES.auto,
|
|
126
|
+
// "E-Scooter": LAYERS_TITLES.eroller,
|
|
127
|
+
// };
|
|
148
128
|
|
|
149
129
|
export const PROVIDER_BY_FEED_ID = {
|
|
150
130
|
callabike_ice: "Call a Bike",
|
|
@@ -8,7 +8,7 @@ const getPermalinkParameters = (
|
|
|
8
8
|
urlParams: URLSearchParams = new URLSearchParams(),
|
|
9
9
|
): URLSearchParams => {
|
|
10
10
|
const z = map.getView().getZoom();
|
|
11
|
-
const [x, y] = map.getView().getCenter();
|
|
11
|
+
const [x, y] = map.getView().getCenter() || [];
|
|
12
12
|
const layers = getLayersAsFlatArray(map.getLayers().getArray())
|
|
13
13
|
.filter((layer) => {
|
|
14
14
|
return layer.get("name") && layer.getVisible();
|
|
@@ -18,9 +18,17 @@ const getPermalinkParameters = (
|
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
urlParams.set("layers", layers.join(","));
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
if (x >= 0) {
|
|
22
|
+
urlParams.set("x", x.toFixed(2));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (y >= 0) {
|
|
26
|
+
urlParams.set("y", y.toFixed(2));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (z >= 0) {
|
|
30
|
+
urlParams.set("z", z.toFixed(1));
|
|
31
|
+
}
|
|
24
32
|
return urlParams;
|
|
25
33
|
};
|
|
26
34
|
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { useMemo } from "preact/hooks";
|
|
2
|
+
|
|
3
|
+
import type { MobilityMapProps } from "../../MobilityMap/MobilityMap";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Return x,y and z values from the url. This hook should not managed more usecases than that.
|
|
7
|
+
* The application should be responsible to read url parameters then provides these parameters as attributes to the web-component.
|
|
8
|
+
*/
|
|
9
|
+
const useInitialPermalink = (
|
|
10
|
+
permalinktemplate: string,
|
|
11
|
+
): null | Partial<MobilityMapProps> => {
|
|
12
|
+
const props = useMemo(() => {
|
|
13
|
+
if (!permalinktemplate) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
try {
|
|
17
|
+
let x: null | string,
|
|
18
|
+
y: null | string,
|
|
19
|
+
z: null | string = null;
|
|
20
|
+
|
|
21
|
+
if (permalinktemplate?.startsWith("?")) {
|
|
22
|
+
const urlSearchParams = new URLSearchParams(permalinktemplate);
|
|
23
|
+
const names = [...urlSearchParams.keys()];
|
|
24
|
+
const nameX = names.find((name) => {
|
|
25
|
+
return urlSearchParams.get(name).includes("{{x}}");
|
|
26
|
+
});
|
|
27
|
+
const nameY = names.find((name) => {
|
|
28
|
+
return urlSearchParams.get(name).includes("{{y}}");
|
|
29
|
+
});
|
|
30
|
+
const nameZ = names.find((name) => {
|
|
31
|
+
return urlSearchParams.get(name).includes("{{z}}");
|
|
32
|
+
});
|
|
33
|
+
const currSearchParams = new URLSearchParams(window.location.search);
|
|
34
|
+
x = currSearchParams.get(nameX);
|
|
35
|
+
y = currSearchParams.get(nameY);
|
|
36
|
+
z = currSearchParams.get(nameZ);
|
|
37
|
+
} else if (permalinktemplate?.startsWith("#")) {
|
|
38
|
+
const values = permalinktemplate.substring(1).split("/");
|
|
39
|
+
const currHash = window.location.hash;
|
|
40
|
+
const currIndexes = currHash.substring(1).split("/");
|
|
41
|
+
const indexX = values.findIndex((name) => {
|
|
42
|
+
return name.includes("{{x}}");
|
|
43
|
+
});
|
|
44
|
+
const indexY = values.findIndex((name) => {
|
|
45
|
+
return name.includes("{{y}}");
|
|
46
|
+
});
|
|
47
|
+
const indexZ = values.findIndex((name) => {
|
|
48
|
+
return name.includes("{{z}}");
|
|
49
|
+
});
|
|
50
|
+
x = indexX > -1 ? currIndexes[indexX] : null;
|
|
51
|
+
y = indexY > -1 ? currIndexes[indexY] : null;
|
|
52
|
+
z = indexZ > -1 ? currIndexes[indexZ] : null;
|
|
53
|
+
}
|
|
54
|
+
const propsFromPermalink: Partial<MobilityMapProps> = {};
|
|
55
|
+
if (x && y) {
|
|
56
|
+
propsFromPermalink.center = `${x},${y}`;
|
|
57
|
+
}
|
|
58
|
+
if (z) {
|
|
59
|
+
propsFromPermalink.zoom = z;
|
|
60
|
+
}
|
|
61
|
+
return propsFromPermalink;
|
|
62
|
+
} catch (error) {
|
|
63
|
+
// eslint-disable-next-line no-console
|
|
64
|
+
console.warn(
|
|
65
|
+
"Impossible to read x,y,z from the url with permalinktemplate",
|
|
66
|
+
permalinktemplate,
|
|
67
|
+
error,
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
}, [permalinktemplate]);
|
|
72
|
+
|
|
73
|
+
return props;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export default useInitialPermalink;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { LAYERS_TITLES } from "../constants";
|
|
2
|
-
|
|
3
1
|
import useLayersConfig from "./useLayersConfig";
|
|
4
2
|
|
|
5
3
|
import type { LayerConfig } from "./useLayersConfig";
|
|
@@ -10,7 +8,7 @@ function useLayerConfig(layerName: string) {
|
|
|
10
8
|
// Set defaultstyle if not present in layersconfig
|
|
11
9
|
const layerConfig = layersConfig[layerName] || ({} as LayerConfig);
|
|
12
10
|
if (!layerConfig.title) {
|
|
13
|
-
layerConfig.title =
|
|
11
|
+
layerConfig.title = layerName;
|
|
14
12
|
}
|
|
15
13
|
|
|
16
14
|
return layerConfig;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useState } from "preact/hooks";
|
|
2
2
|
|
|
3
|
-
import { LAYERS_NAMES
|
|
3
|
+
import { LAYERS_NAMES } from "../constants";
|
|
4
4
|
|
|
5
5
|
import useMapContext from "./useMapContext";
|
|
6
6
|
|
|
@@ -25,7 +25,7 @@ function useLayersConfig() {
|
|
|
25
25
|
// Set the default title if not present in layersconfig
|
|
26
26
|
Object.values(LAYERS_NAMES).forEach((name) => {
|
|
27
27
|
config[name] = {
|
|
28
|
-
title:
|
|
28
|
+
title: name,
|
|
29
29
|
...(config[name] || {}),
|
|
30
30
|
};
|
|
31
31
|
});
|
package/src/utils/i18n.ts
CHANGED
|
@@ -4,14 +4,4 @@ import translations from "./translations";
|
|
|
4
4
|
|
|
5
5
|
const i18n = rosetta(translations);
|
|
6
6
|
|
|
7
|
-
// Set current language to preferred browser language with fallback to english
|
|
8
|
-
i18n.locale(
|
|
9
|
-
"de",
|
|
10
|
-
// navigator.languages // @ts-expect-error bad type definition
|
|
11
|
-
// .find((l) => {
|
|
12
|
-
// return i18n.table(l.split("-")[0]) !== undefined;
|
|
13
|
-
// })
|
|
14
|
-
// ?.split("-")[0] || "de",
|
|
15
|
-
);
|
|
16
|
-
|
|
17
7
|
export default i18n;
|
|
@@ -1,47 +1,212 @@
|
|
|
1
|
+
import { LAYERS_NAMES } from "./constants";
|
|
2
|
+
|
|
1
3
|
const translations = {
|
|
2
4
|
de: {
|
|
5
|
+
affected_lines: "Betroffene Linien",
|
|
6
|
+
affected_stops: "Betroffene Haltestellen",
|
|
7
|
+
all_line_stops: "Alle Haltestellen auf dieser Strecke",
|
|
3
8
|
consequence: "konsequenz",
|
|
9
|
+
daily_from_to: "Täglich von {{from}} bis {{to}}",
|
|
10
|
+
download: "Herunterladen",
|
|
4
11
|
duration_text: "Dauer",
|
|
12
|
+
error: "Fehler",
|
|
13
|
+
export_all_region: "Ganze Region exportieren",
|
|
14
|
+
export_format_title: "Format",
|
|
15
|
+
exporting: "Exportieren ...",
|
|
16
|
+
from_to: "von {{from}} bis {{to}}",
|
|
17
|
+
geolocation_button_title_off: "Geolokalisierung deaktivieren",
|
|
18
|
+
geolocation_button_title_on: "Geolokalisierung aktivieren",
|
|
19
|
+
[LAYERS_NAMES.bikeFrelo]: "Frelo",
|
|
20
|
+
[LAYERS_NAMES.bikeOthers]: "Fahrrad, andere Anbieter",
|
|
21
|
+
[LAYERS_NAMES.cargobikeFrelo]: "Lastenfrelo",
|
|
22
|
+
[LAYERS_NAMES.cargobikeOthers]: "Cargobike, andere Anbieter",
|
|
23
|
+
[LAYERS_NAMES.carGrf]: "Grüne Flotte",
|
|
24
|
+
[LAYERS_NAMES.carNatur]: "Naturenergie-Sharing",
|
|
25
|
+
[LAYERS_NAMES.carOthers]: "Auto, andere Anbieter",
|
|
26
|
+
[LAYERS_NAMES.eroller]: "E-Roller",
|
|
27
|
+
[LAYERS_NAMES.linesnetworkplan]: "Liniennetzpläne",
|
|
28
|
+
[LAYERS_NAMES.mitfahrpunkte]: "Mitfahrpunkte",
|
|
29
|
+
[LAYERS_NAMES.notifications]: "Meldungen",
|
|
30
|
+
[LAYERS_NAMES.pois]: "POIs",
|
|
31
|
+
[LAYERS_NAMES.realtime]: "Echtzeit",
|
|
32
|
+
[LAYERS_NAMES.sharedMobility]: "Shared Mobility",
|
|
33
|
+
[LAYERS_NAMES.stations]: "Stationen",
|
|
34
|
+
[LAYERS_NAMES.tarifzonen]: "Tarifzonen",
|
|
35
|
+
[LAYERS_NAMES.verkaufsstellen]: "Verkaufsstellen",
|
|
36
|
+
|
|
37
|
+
layertree_menu_title: "Ebenen",
|
|
38
|
+
linesnetworkplan: "plan retea linii",
|
|
39
|
+
no_details_available: "Keine Details verfügbar",
|
|
5
40
|
no_stops_found: "Keine Haltestellen gefunden",
|
|
41
|
+
notifications: "notificari",
|
|
42
|
+
permalink_input_hint:
|
|
43
|
+
"Sie können auch den Link aus der Adresszeile des Browsers kopieren.",
|
|
6
44
|
platform_ferry: "St.",
|
|
7
45
|
platform_other: "Kan.",
|
|
8
46
|
platform_rail: "Gl.",
|
|
47
|
+
print_menu_title: "Drucken",
|
|
9
48
|
reason: "Grund",
|
|
10
49
|
recommendation: "Empfehlung",
|
|
50
|
+
search_menu_title: "Suchen",
|
|
51
|
+
share_email_send: "E-Mail senden",
|
|
52
|
+
share_image_save: "Bild speichern",
|
|
53
|
+
share_menu_title: "Teilen",
|
|
11
54
|
stops_search_placeholder: "Haltestellen suchen",
|
|
55
|
+
zoomin: "Hineinzoomen",
|
|
56
|
+
zoomout: "Herauszoomen",
|
|
12
57
|
},
|
|
13
58
|
en: {
|
|
59
|
+
affected_lines: "Affected lines",
|
|
60
|
+
affected_stops: "Affected stops",
|
|
61
|
+
all_line_stops: "All stops on this line",
|
|
14
62
|
consequence: "Consequence",
|
|
63
|
+
daily_from_to: "Daily from {{from}} to {{to}}",
|
|
64
|
+
download: "Download",
|
|
15
65
|
duration_text: "Duration",
|
|
66
|
+
error: "Error",
|
|
67
|
+
export_all_region: "Export entire region",
|
|
68
|
+
export_format_title: "Format",
|
|
69
|
+
exporting: "Exporting ...",
|
|
70
|
+
from_to: "from {{from}} to {{to}}",
|
|
71
|
+
geolocation_button_title_off: "Disable geolocation",
|
|
72
|
+
geolocation_button_title_on: "Enable geolocation",
|
|
73
|
+
[LAYERS_NAMES.bikeFrelo]: "Frelo",
|
|
74
|
+
[LAYERS_NAMES.bikeOthers]: "Bicycle, other providers",
|
|
75
|
+
[LAYERS_NAMES.cargobikeFrelo]: "Cargo bike Frelo",
|
|
76
|
+
[LAYERS_NAMES.cargobikeOthers]: "Cargo bike, other providers",
|
|
77
|
+
[LAYERS_NAMES.carGrf]: "Grüne Flotte",
|
|
78
|
+
[LAYERS_NAMES.carNatur]: "Naturenergie-Sharing",
|
|
79
|
+
[LAYERS_NAMES.carOthers]: "Auto, andere Anbieter",
|
|
80
|
+
[LAYERS_NAMES.eroller]: "E-Roller",
|
|
81
|
+
[LAYERS_NAMES.linesnetworkplan]: "Lines Network Plan",
|
|
82
|
+
[LAYERS_NAMES.mitfahrpunkte]: "Carpooling Points",
|
|
83
|
+
[LAYERS_NAMES.notifications]: "Notifications",
|
|
84
|
+
[LAYERS_NAMES.pois]: "POIs",
|
|
85
|
+
[LAYERS_NAMES.realtime]: "Realtime",
|
|
86
|
+
[LAYERS_NAMES.sharedMobility]: "Shared Mobility",
|
|
87
|
+
[LAYERS_NAMES.stations]: "Stations",
|
|
88
|
+
[LAYERS_NAMES.tarifzonen]: "Tariff Zones",
|
|
89
|
+
[LAYERS_NAMES.verkaufsstellen]: "Sales Outlets",
|
|
90
|
+
layertree_menu_title: "Layers",
|
|
91
|
+
no_details_available: "No details available",
|
|
16
92
|
no_stops_found: "No stops found",
|
|
93
|
+
permalink_input_hint:
|
|
94
|
+
"You can also copy the link from the browser address bar.",
|
|
17
95
|
platform_ferry: "Pier", // pier
|
|
18
96
|
platform_other: "Std.", // stand
|
|
19
97
|
platform_rail: "Pl.",
|
|
98
|
+
print_menu_title: "Print",
|
|
20
99
|
reason: "Reason",
|
|
21
100
|
recommendation: "Recommendation",
|
|
101
|
+
search_menu_title: "Search",
|
|
102
|
+
share_email_send: "Send email",
|
|
103
|
+
share_image_save: "Save image",
|
|
104
|
+
share_menu_title: "Share",
|
|
22
105
|
stops_search_placeholder: "Search for stop",
|
|
106
|
+
zoomin: "Zoom in",
|
|
107
|
+
zoomout: "Zoom out",
|
|
23
108
|
},
|
|
24
109
|
fr: {
|
|
110
|
+
affected_lines: "Lignes affectées",
|
|
111
|
+
affected_stops: "Arrêts affectés",
|
|
112
|
+
all_line_stops: "Tous les arrêts sur cette ligne",
|
|
25
113
|
consequence: "Conséquence",
|
|
114
|
+
daily_from_to: "Tous les jours de {{from}} à {{to}}",
|
|
115
|
+
download: "Télécharger",
|
|
26
116
|
duration_text: "Durée",
|
|
117
|
+
error: "Erreur",
|
|
118
|
+
export_all_region: "Exporter toute la région",
|
|
119
|
+
export_format_title: "Format",
|
|
120
|
+
exporting: "Exportation ...",
|
|
121
|
+
from_to: "de {{from}} à {{to}}",
|
|
122
|
+
geolocation_button_title_off: "Désactiver la géolocalisation",
|
|
123
|
+
geolocation_button_title_on: "Activer la géolocalisation",
|
|
124
|
+
[LAYERS_NAMES.bikeFrelo]: "Frelo",
|
|
125
|
+
[LAYERS_NAMES.bikeOthers]: "Vélo, autres fournisseurs",
|
|
126
|
+
[LAYERS_NAMES.cargobikeFrelo]: "Cargobike Frelo",
|
|
127
|
+
[LAYERS_NAMES.cargobikeOthers]: "Cargobike, autres fournisseurs",
|
|
128
|
+
[LAYERS_NAMES.carGrf]: "Grüne Flotte",
|
|
129
|
+
[LAYERS_NAMES.carNatur]: "Naturenergie-Sharing",
|
|
130
|
+
[LAYERS_NAMES.carOthers]: "Voiture, autres fournisseurs",
|
|
131
|
+
[LAYERS_NAMES.eroller]: "E-Scooter",
|
|
132
|
+
[LAYERS_NAMES.linesnetworkplan]: "Plans du réseau",
|
|
133
|
+
[LAYERS_NAMES.mitfahrpunkte]: "Points de covoiturage",
|
|
134
|
+
[LAYERS_NAMES.notifications]: "Notifications",
|
|
135
|
+
[LAYERS_NAMES.pois]: "POIs",
|
|
136
|
+
[LAYERS_NAMES.realtime]: "Temps réel",
|
|
137
|
+
[LAYERS_NAMES.sharedMobility]: "Mobilité partagée",
|
|
138
|
+
[LAYERS_NAMES.stations]: "Stations",
|
|
139
|
+
[LAYERS_NAMES.tarifzonen]: "Zones tarifaires",
|
|
140
|
+
[LAYERS_NAMES.verkaufsstellen]: "Points de vente",
|
|
141
|
+
layertree_menu_title: "Couches",
|
|
142
|
+
no_details_available: "Aucun détail disponible",
|
|
27
143
|
no_stops_found: "Aucun arrêt trouvé",
|
|
144
|
+
permalink_input_hint:
|
|
145
|
+
"Vous pouvez aussi copier le lien depuis la barre d'adresse du navigateur.",
|
|
28
146
|
platform_ferry: "Quai",
|
|
29
147
|
platform_other: "Quai",
|
|
30
148
|
platform_rail: "Voie",
|
|
149
|
+
print_menu_title: "Imprimer",
|
|
31
150
|
reason: "Raison",
|
|
32
151
|
recommendation: "Recommandation",
|
|
152
|
+
search_menu_title: "Rechercher",
|
|
153
|
+
share_email_send: "Envoyer un email",
|
|
154
|
+
share_image_save: "Enregistrer l'image",
|
|
155
|
+
share_menu_title: "Partager",
|
|
33
156
|
stops_search_placeholder: "Chercher un arrêt",
|
|
157
|
+
zoomin: "Zoomer",
|
|
158
|
+
zoomout: "Dézoomer",
|
|
34
159
|
},
|
|
35
160
|
it: {
|
|
161
|
+
affected_lines: "Linee interessate",
|
|
162
|
+
affected_stops: "Fermate interessate",
|
|
163
|
+
all_line_stops: "Tutte le fermate su questa linea",
|
|
36
164
|
consequence: "Conseguenza",
|
|
165
|
+
daily_from_to: "Tutti i giorni da {{from}} a {{to}}",
|
|
166
|
+
download: "Scarica",
|
|
37
167
|
duration_text: "Durata",
|
|
168
|
+
error: "Errore",
|
|
169
|
+
export_all_region: "Esporta l'intera regione",
|
|
170
|
+
export_format_title: "Formato",
|
|
171
|
+
exporting: "Esportazione ...",
|
|
172
|
+
from_to: "da {{from}} a {{to}}",
|
|
173
|
+
geolocation_button_title_off: "Disattiva geolocalizzazione",
|
|
174
|
+
geolocation_button_title_on: "Attiva geolocalizzazione",
|
|
175
|
+
[LAYERS_NAMES.bikeFrelo]: "Frelo",
|
|
176
|
+
[LAYERS_NAMES.bikeOthers]: "Bicicletta, altri fornitori",
|
|
177
|
+
[LAYERS_NAMES.cargobikeFrelo]: "Cargobike Frelo",
|
|
178
|
+
[LAYERS_NAMES.cargobikeOthers]: "Cargobike, altri fornitori",
|
|
179
|
+
[LAYERS_NAMES.carGrf]: "Grüne Flotte",
|
|
180
|
+
[LAYERS_NAMES.carNatur]: "Naturenergie-Sharing",
|
|
181
|
+
[LAYERS_NAMES.carOthers]: "Auto, altri fornitori",
|
|
182
|
+
[LAYERS_NAMES.eroller]: "E-Scooter",
|
|
183
|
+
[LAYERS_NAMES.linesnetworkplan]: "Piani della rete",
|
|
184
|
+
[LAYERS_NAMES.mitfahrpunkte]: "Punti di carpooling",
|
|
185
|
+
[LAYERS_NAMES.notifications]: "Notifiche",
|
|
186
|
+
[LAYERS_NAMES.pois]: "POI",
|
|
187
|
+
[LAYERS_NAMES.realtime]: "In tempo reale",
|
|
188
|
+
[LAYERS_NAMES.sharedMobility]: "Mobilità condivisa",
|
|
189
|
+
[LAYERS_NAMES.stations]: "Stazioni",
|
|
190
|
+
[LAYERS_NAMES.tarifzonen]: "Zone tariffarie",
|
|
191
|
+
[LAYERS_NAMES.verkaufsstellen]: "Punti vendita",
|
|
192
|
+
layertree_menu_title: "Livelli",
|
|
193
|
+
no_details_available: "Nessun dettaglio disponibile",
|
|
38
194
|
no_stops_found: "Nessuna fermata trovata",
|
|
195
|
+
permalink_input_hint:
|
|
196
|
+
"Puoi anche copiare il link dalla barra degli indirizzi del browser.",
|
|
39
197
|
platform_ferry: "Imb.", // imbarcadero
|
|
40
198
|
platform_other: "Cor.", // corsia
|
|
41
199
|
platform_rail: "Bin.",
|
|
200
|
+
print_menu_title: "Stampa",
|
|
42
201
|
reason: "Motivo",
|
|
43
202
|
recommendation: "Raccomandazione",
|
|
203
|
+
search_menu_title: "Cerca",
|
|
204
|
+
share_email_send: "Invia email",
|
|
205
|
+
share_image_save: "Salva immagine",
|
|
206
|
+
share_menu_title: "Condividi",
|
|
44
207
|
stops_search_placeholder: "Ricerca delle fermate",
|
|
208
|
+
zoomin: "Zoom avanti",
|
|
209
|
+
zoomout: "Zoom indietro",
|
|
45
210
|
},
|
|
46
211
|
};
|
|
47
212
|
export default translations;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { memo } from "preact/compat";
|
|
2
|
-
|
|
3
|
-
import ArrowRight from "../icons/ArrowRight";
|
|
4
|
-
import Button from "../ui/Button";
|
|
5
|
-
import useLayerConfig from "../utils/hooks/useLayerConfig";
|
|
6
|
-
import useRvfContext from "../utils/hooks/useRvfContext";
|
|
7
|
-
|
|
8
|
-
import type { HTMLAttributes, PreactDOMAttributes } from "preact";
|
|
9
|
-
|
|
10
|
-
export type RvfFeatureDetailsFooterProps = {
|
|
11
|
-
onClose?: () => void;
|
|
12
|
-
title?: React.ReactNode;
|
|
13
|
-
} & HTMLAttributes<HTMLDivElement> &
|
|
14
|
-
PreactDOMAttributes;
|
|
15
|
-
|
|
16
|
-
function RvfFeatureDetailsFooter({ ...props }: RvfFeatureDetailsFooterProps) {
|
|
17
|
-
const { selectedFeature } = useRvfContext();
|
|
18
|
-
const layerConfig = useLayerConfig(selectedFeature?.get("layerName"));
|
|
19
|
-
if (!layerConfig?.link || layerConfig?.link?.show === false) {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
let id = selectedFeature?.get("id");
|
|
23
|
-
const situation = selectedFeature?.get("situation");
|
|
24
|
-
if (situation) {
|
|
25
|
-
const situationParsed = JSON.parse(situation);
|
|
26
|
-
id = situationParsed?.id || id;
|
|
27
|
-
}
|
|
28
|
-
return (
|
|
29
|
-
<div {...props}>
|
|
30
|
-
<Button
|
|
31
|
-
className={"text-base"}
|
|
32
|
-
href={layerConfig.link.href.replace("{{id}}", id)}
|
|
33
|
-
target="_blank"
|
|
34
|
-
theme="primary"
|
|
35
|
-
>
|
|
36
|
-
<span>{layerConfig.link.text || "Mehr erfahren"}</span>
|
|
37
|
-
<ArrowRight />
|
|
38
|
-
</Button>
|
|
39
|
-
</div>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export default memo(RvfFeatureDetailsFooter);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./RvfFeatureDetailsFooter";
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { icons } from "../utils/addSourceAndLayers";
|
|
2
|
-
import {
|
|
3
|
-
LAYERS_NAMES,
|
|
4
|
-
LAYERS_TITLES,
|
|
5
|
-
TITLE_BY_CATEGORY,
|
|
6
|
-
TITLE_BY_FEED_ID,
|
|
7
|
-
} from "../utils/constants";
|
|
8
|
-
import useLayerConfig from "../utils/hooks/useLayerConfig";
|
|
9
|
-
|
|
10
|
-
import type { Feature } from "ol";
|
|
11
|
-
|
|
12
|
-
const defaultTitle = "Informations";
|
|
13
|
-
|
|
14
|
-
function RvfFeatureDetailsTitle({ feature }: { feature: Feature }) {
|
|
15
|
-
const features = feature.get("features");
|
|
16
|
-
const selectedFeature = features?.[0] || feature;
|
|
17
|
-
const {
|
|
18
|
-
category,
|
|
19
|
-
condition_group: conditionGroup,
|
|
20
|
-
disruption_type: disruptionType,
|
|
21
|
-
feed_id: feedId,
|
|
22
|
-
line_id: lineId,
|
|
23
|
-
tickets,
|
|
24
|
-
} = selectedFeature.getProperties();
|
|
25
|
-
const layerConfigLinienNetz = useLayerConfig(LAYERS_NAMES.linesnetworkplan);
|
|
26
|
-
const layerConfigMeldungen = useLayerConfig(LAYERS_NAMES.notifications);
|
|
27
|
-
|
|
28
|
-
// moco export v1
|
|
29
|
-
if (disruptionType) {
|
|
30
|
-
return (
|
|
31
|
-
<div className={"flex items-center gap-2 text-sm"}>
|
|
32
|
-
<div className="min-w-8 shrink-0 grow-0">
|
|
33
|
-
<img
|
|
34
|
-
alt={disruptionType}
|
|
35
|
-
className={"w-8"}
|
|
36
|
-
src={icons[disruptionType] || icons.warning}
|
|
37
|
-
></img>
|
|
38
|
-
</div>
|
|
39
|
-
<div className={"flex flex-col gap-2 text-base font-bold"}>
|
|
40
|
-
{layerConfigMeldungen.title}
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// moco export v2
|
|
47
|
-
if (conditionGroup) {
|
|
48
|
-
return (
|
|
49
|
-
<div className={"flex items-center gap-2 text-sm"}>
|
|
50
|
-
{icons[conditionGroup] && (
|
|
51
|
-
<div className="min-w-8 shrink-0 grow-0">
|
|
52
|
-
<img
|
|
53
|
-
alt={conditionGroup}
|
|
54
|
-
className={"w-8"}
|
|
55
|
-
src={icons[conditionGroup] || icons.warning}
|
|
56
|
-
></img>
|
|
57
|
-
</div>
|
|
58
|
-
)}
|
|
59
|
-
<div className={"flex flex-col gap-2 text-base font-bold"}>
|
|
60
|
-
{layerConfigMeldungen.title}
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
if (category) {
|
|
66
|
-
return TITLE_BY_CATEGORY[category] || defaultTitle;
|
|
67
|
-
}
|
|
68
|
-
if (feedId) {
|
|
69
|
-
return TITLE_BY_FEED_ID[feedId] || defaultTitle;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (lineId) {
|
|
73
|
-
return layerConfigLinienNetz.title;
|
|
74
|
-
}
|
|
75
|
-
if (tickets) {
|
|
76
|
-
return LAYERS_TITLES.verkaufsstellen;
|
|
77
|
-
}
|
|
78
|
-
return defaultTitle;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export default RvfFeatureDetailsTitle;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./RvfFeatureDetailsTitle";
|