@geops/rvf-mobility-web-component 0.1.46 → 0.1.47
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/.prettierrc.js +3 -1
- package/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/doc/package.json +4 -3
- package/doc/postcss.config.mjs +1 -1
- package/doc/src/app/components/GeopsMobilityDoc.tsx +13 -224
- package/doc/src/app/components/GeopsMobilitySearchDoc.tsx +11 -107
- package/doc/src/app/components/WebComponentDoc.tsx +45 -56
- package/doc/src/app/geops-mobility/page.tsx +7 -2
- package/doc/src/app/geops-mobility-search/page.tsx +6 -2
- package/doc/src/app/globals.css +47 -27
- package/doc/src/app/layout.tsx +4 -2
- package/docutils.js +33 -17
- package/eslint.config.mjs +28 -34
- package/iframe.html +181 -207
- package/index.html +108 -88
- package/index.js +2345 -1976
- package/input.css +21 -3
- package/package.json +39 -41
- package/scripts/build.mjs +2 -2
- package/scripts/dev.mjs +3 -3
- package/search.html +70 -23
- package/src/BaseLayer/BaseLayer.tsx +2 -1
- package/src/Copyright/Copyright.tsx +4 -2
- package/src/DebugDeparture/DebugDeparture.tsx +16 -12
- package/src/DebugStop/DebugStop.tsx +2 -2
- package/src/Departure/Departure.tsx +2 -3
- package/src/EmbedNavigation/DragPanWarning.ts +125 -0
- package/src/EmbedNavigation/EmbedNavigation.tsx +52 -0
- package/src/EmbedNavigation/index.js +1 -0
- package/src/EmbedNavigation/index.tsx +1 -0
- package/src/GeolocationButton/GeolocationButton.tsx +11 -35
- package/src/GeolocationButton/index.tsx +1 -1
- package/src/Map/Map.tsx +5 -3
- package/src/MapDispatchEvents/MapDispatchEvents.tsx +78 -0
- package/src/MapDispatchEvents/index.tsx +1 -0
- package/src/MobilityMap/MobilityMap.tsx +117 -162
- package/src/MobilityMap/MobilityMapAttributes.test.ts +21 -0
- package/src/MobilityMap/MobilityMapAttributes.ts +252 -0
- package/src/MobilityMap/index.tsx +1 -0
- package/src/MobilitySearch/MobilitySearch.tsx +35 -0
- package/src/MobilitySearch/MobilitySearchAttributes.test.ts +21 -0
- package/src/MobilitySearch/MobilitySearchAttributes.ts +68 -0
- package/src/MobilitySearch/index.ts +2 -0
- package/src/NotificationLayer/NotificationLayer.tsx +36 -5
- package/src/Overlay/Overlay.tsx +24 -11
- package/src/Permalink/Permalink.tsx +77 -0
- package/src/Permalink/index.tsx +1 -0
- package/src/RealtimeLayer/RealtimeLayer.tsx +72 -33
- package/src/RouteDestination/RouteDestination.tsx +3 -3
- package/src/RouteIcon/RouteIcon.tsx +33 -25
- package/src/RouteIcon/index.tsx +1 -1
- package/src/RouteIdentifier/RouteIdentifer.tsx +6 -5
- package/src/RouteInfos/RouteInfos.tsx +7 -3
- package/src/RouteSchedule/RouteSchedule.tsx +3 -3
- package/src/RouteScheduleFooter/RouteScheduleFooter.tsx +1 -1
- package/src/RouteScheduleHeader/RouteScheduleHeader.tsx +7 -29
- package/src/RouteStop/RouteStop.tsx +8 -11
- package/src/RouteStopDelay/RouteStopDelay.tsx +2 -1
- package/src/RouteStopName/RouteStopName.tsx +2 -2
- package/src/RouteStopPlatform/RouteStopPlatform.tsx +2 -2
- package/src/RouteStopProgress/RouteStopProgress.tsx +2 -1
- package/src/RouteStopServices/RouteStopServices.tsx +2 -2
- package/src/RouteStopStation/RouteStopStation.tsx +8 -2
- package/src/RouteStopTime/RouteStopTime.tsx +2 -1
- package/src/RvfButton/RvfButton.tsx +14 -5
- package/src/RvfCheckbox/RvfCheckbox.tsx +8 -8
- package/src/RvfEmbedNavigation/DragPanWarning.ts +5 -5
- package/src/RvfEmbedNavigation/RvfEmbedNavigation.tsx +1 -0
- package/src/RvfExportMenu/RvfExportMenu.tsx +14 -12
- package/src/RvfExportMenuButton/RvfExportMenuButton.tsx +6 -7
- package/src/RvfFeatureDetails/RvfFeatureDetails.tsx +25 -21
- package/src/RvfFeatureDetails/RvfLineNetworkDetails/RvfLineNetworkDetails.tsx +131 -127
- package/src/RvfFeatureDetails/RvfNotificationDetails/RvfNotificationDetails.tsx +309 -111
- package/src/RvfFeatureDetails/RvfSellingPointDetails/RvfSellingPointDetails.tsx +2 -2
- package/src/RvfFeatureDetails/RvfSharedMobilityDetail/FloatingVehiclesDetails/FloatingVehiclesDetails.tsx +3 -3
- package/src/RvfFeatureDetails/RvfSharedMobilityDetail/RvfSharedMobilityDetails.tsx +8 -6
- package/src/RvfFeatureDetails/RvfSharedMobilityDetail/StationDetails/StationDetails.tsx +5 -4
- package/src/RvfFeatureDetailsFooter/RvfFeatureDetailsFooter.tsx +43 -0
- package/src/RvfFeatureDetailsFooter/index.tsx +1 -0
- package/src/RvfFeatureDetailsTitle/RvfFeatureDetailsTitle.tsx +81 -0
- package/src/RvfFeatureDetailsTitle/index.tsx +1 -0
- package/src/RvfFloatingMenu/RvfFloatingMenu.tsx +4 -4
- package/src/RvfGeolocationButton/GeolocationButton.tsx +98 -0
- package/src/RvfGeolocationButton/index.tsx +1 -0
- package/src/RvfIconButton/RvfIconButton.tsx +20 -9
- package/src/RvfInputCopy/RvfInputCopy.tsx +8 -8
- package/src/RvfLayerTree/RvfLayerTree.tsx +5 -2
- package/src/RvfLayerTree/TreeItem/TreeItem.tsx +13 -16
- package/src/RvfLayerTree/layersTreeReducer.ts +23 -18
- package/src/RvfLayerTreeButton/RvfLayerTreeButton.tsx +6 -6
- package/src/RvfLineNetworkPlanLayer/RvfLineNetworkPlanLayer.tsx +2 -1
- package/src/RvfLink/RvfLink.tsx +4 -3
- package/src/RvfMobilityMap/RvfMobilityMap.tsx +324 -320
- package/src/RvfModal/RvfModal.tsx +4 -3
- package/src/RvfOverlayContent/RvfOverlayContent.tsx +128 -0
- package/src/RvfOverlayContent/index.ts +0 -0
- package/src/RvfOverlayHeader/RvfOverlayHeader.tsx +13 -10
- package/src/RvfPermalink/RvfPermalink.tsx +2 -2
- package/src/RvfPoisLayer/RvfPoisLayer.tsx +2 -1
- package/src/RvfRadioButton/RvfRadioButton.tsx +1 -1
- package/src/RvfRouteIcon/RvfRouteIcon.tsx +10 -0
- package/src/RvfRouteIcon/index.tsx +1 -0
- package/src/RvfSearch/RvfSearch.tsx +4 -1
- package/src/RvfSearchButton/RvfSearchButton.tsx +27 -0
- package/src/RvfSearchButton/index.tsx +1 -0
- package/src/RvfSelect/RvfSelect.tsx +7 -5
- package/src/RvfSelectedFeatureHighlightLayer/RvfSelectedFeatureHighlightLayer.tsx +1 -2
- package/src/RvfSellingPointsLayer/RvfSellingPointsLayer.tsx +2 -1
- package/src/RvfShare/RvfPermalinkButton/RvfPermalinkButton.tsx +13 -12
- package/src/RvfShare/RvfShare.tsx +11 -10
- package/src/RvfShareMenuButton/RvfShareMenuButton.tsx +5 -5
- package/src/RvfSharedMobilityLayerGroup/RvfSharedMobilityLayerGroup.tsx +25 -22
- package/src/RvfSingleClickListener/RvfSingleClickListener.tsx +102 -67
- package/src/RvfTarifZonenLayer/RvfTarifZonenLayer.tsx +2 -1
- package/src/RvfTopics/RvfTopics.tsx +6 -5
- package/src/RvfZoomButtons/RvfZoomButtons.tsx +3 -3
- package/src/ScaleLine/ScaleLine.tsx +5 -4
- package/src/ScrollableHandler/ScrollableHandler.tsx +2 -1
- package/src/ScrollableHandler/index.tsx +1 -1
- package/src/SingleClickListener/SingleClickListener.tsx +47 -4
- package/src/Station/Station.tsx +5 -5
- package/src/StationName/StationName.tsx +3 -3
- package/src/StationServices/StationServices.tsx +3 -3
- package/src/StationsLayer/StationsLayer.tsx +5 -4
- package/src/StopsSearch/StopsSearch.tsx +143 -88
- package/src/WindowMessageListener/WindowMessageListener.tsx +68 -0
- package/src/WindowMessageListener/index.tsx +1 -0
- package/src/icons/Airport/Airport.tsx +4 -4
- package/src/icons/ArrowDown/ArrowDown.tsx +1 -1
- package/src/icons/ArrowRight/ArrowRight.tsx +19 -0
- package/src/icons/ArrowRight/arrow-right.svg +16 -0
- package/src/icons/ArrowRight/index.tsx +1 -0
- package/src/icons/ArrowUp/ArrowUp.tsx +1 -1
- package/src/icons/ArrowUpRight/ArrowUpRight.tsx +1 -1
- package/src/icons/BarAndRestaurants/BarAndRestaurants.tsx +2 -2
- package/src/icons/Bathroom/Bathroom.tsx +1 -1
- package/src/icons/Copy/Copy.tsx +1 -1
- package/src/icons/Doc/Doc.tsx +1 -1
- package/src/icons/Email/Email.tsx +1 -1
- package/src/icons/FilePdf/FilePdf.tsx +1 -1
- package/src/icons/Geolocation/Geolocation.tsx +3 -5
- package/src/icons/Image/Image.tsx +1 -1
- package/src/icons/Menu/Menu.tsx +1 -1
- package/src/icons/Minus/Minus.tsx +1 -1
- package/src/icons/NoRealtime/NoRealtime.tsx +1 -1
- package/src/icons/Plus/Plus.tsx +1 -1
- package/src/icons/Police/Police.tsx +3 -3
- package/src/icons/Search/Search.tsx +0 -1
- package/src/icons/Share/Share.tsx +1 -1
- package/src/icons/Stack/Stack.tsx +1 -1
- package/src/icons/Tracking/Tracking.tsx +29 -0
- package/src/icons/Tracking/airport-14-svgrepo-com.svg +41 -0
- package/src/icons/Tracking/index.tsx +1 -0
- package/src/icons/WaitingAreas/WaitingAreas.tsx +1 -1
- package/src/icons/Warning/Warning.tsx +56 -0
- package/src/icons/Warning/index.tsx +1 -0
- package/src/icons/Warning/info-achtung-kreisrot-rot.svg +28 -0
- package/src/icons/WheelChair/WheelChair.tsx +1 -1
- package/src/index.tsx +8 -46
- package/src/indexDoc.ts +13 -0
- package/src/ui/Button/Button.tsx +57 -0
- package/src/ui/Button/index.tsx +1 -0
- package/src/ui/IconButton/IconButton.tsx +44 -0
- package/src/ui/IconButton/index.tsx +1 -0
- package/src/utils/MobilityEvent.ts +4 -3
- package/src/utils/applyInitialLayerVisibility.ts +3 -3
- package/src/utils/centerOnStation.ts +3 -2
- package/src/utils/centerOnVehicle.ts +5 -4
- package/src/utils/constants.ts +27 -3
- package/src/utils/exportPdf.ts +26 -20
- package/src/utils/fullTrajectoryStyle.ts +2 -2
- package/src/utils/getAllLayers.ts +4 -3
- package/src/utils/getDelayColor.test.ts +1 -0
- package/src/utils/getDelayColorForVehicle.test.ts +2 -0
- package/src/utils/getDelayString.test.ts +3 -0
- package/src/utils/getDelayTextForVehicle.test.ts +4 -0
- package/src/utils/getFullTrajectoryAndFit.ts +4 -3
- package/src/utils/getHoursAndMinutes.test.ts +1 -0
- package/src/utils/getLayersAsFlatArray.ts +2 -2
- package/src/utils/getLinkByDevice.ts +1 -1
- package/src/utils/getMainColorForVehicle.ts +3 -3
- package/src/utils/getPermalinkParameters.ts +2 -2
- package/src/utils/getStopStatus.test.ts +2 -1
- package/src/utils/getStopStatus.ts +1 -1
- package/src/utils/getTextForVehicle.ts +1 -1
- package/src/utils/hooks/useDeparture.tsx +6 -5
- package/src/utils/hooks/useI18n.tsx +6 -4
- package/src/utils/hooks/useInitialLayersVisiblity.tsx +2 -1
- package/src/utils/hooks/useLayerConfig.tsx +40 -0
- package/src/utils/hooks/useMapContext.tsx +30 -18
- package/src/utils/hooks/useRouteStop.tsx +3 -2
- package/src/utils/hooks/useRvfContext.tsx +11 -3
- package/src/utils/hooks/useStation.tsx +2 -1
- package/src/utils/hooks/useUpdatePermalink.tsx +25 -24
- package/src/utils/hooks/useZoom.tsx +4 -4
- package/src/utils/realtimeRVFStyle.ts +5 -4
- package/src/utils/sharingGraphqlUtils.ts +3 -2
- package/src/utils/sharingStylesUtils.ts +7 -7
- package/src/utils/sharingWFSUtils.ts +9 -15
- package/tailwind.config.mjs +1 -0
- package/tsconfig.json +1 -1
- package/doc/tailwind.config.ts +0 -20
- package/src/utils/getFeatureInformationTitle.tsx +0 -54
|
@@ -1,66 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
MaplibreLayer,
|
|
3
|
-
MaplibreStyleLayer,
|
|
4
|
-
RealtimeLayer as MbtRealtimeLayer,
|
|
5
|
-
} from "mobility-toolbox-js/ol";
|
|
6
|
-
import { MocoLayerOptions } from "mobility-toolbox-js/ol/layers/MocoLayer";
|
|
7
|
-
import {
|
|
8
|
-
MocoNotification,
|
|
9
|
-
RealtimeStation,
|
|
10
|
-
RealtimeStationId,
|
|
11
|
-
RealtimeStopSequence,
|
|
12
|
-
RealtimeTrainId,
|
|
13
|
-
} from "mobility-toolbox-js/types";
|
|
14
|
-
import { Feature, Map as OlMap } from "ol";
|
|
15
|
-
import { Group } from "ol/layer";
|
|
16
1
|
import { memo } from "preact/compat";
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
useMemo,
|
|
21
|
-
useRef,
|
|
22
|
-
useState,
|
|
23
|
-
} from "preact/hooks";
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from "preact/hooks";
|
|
3
|
+
import { LiaMapSolid } from "react-icons/lia";
|
|
4
|
+
import { twMerge } from "tailwind-merge";
|
|
24
5
|
|
|
25
6
|
import BaseLayer from "../BaseLayer";
|
|
26
7
|
import Copyright from "../Copyright";
|
|
27
8
|
import GeolocationButton from "../GeolocationButton";
|
|
28
9
|
import Map from "../Map";
|
|
29
|
-
import
|
|
10
|
+
import MapDispatchEvents from "../MapDispatchEvents";
|
|
11
|
+
import MobilityMapAttributes from "../MobilityMap/MobilityMapAttributes";
|
|
30
12
|
import NotificationLayer from "../NotificationLayer";
|
|
31
13
|
import Overlay from "../Overlay";
|
|
32
14
|
import RealtimeLayer from "../RealtimeLayer";
|
|
33
|
-
import RouteSchedule from "../RouteSchedule";
|
|
34
15
|
import RvfEmbedNavigation from "../RvfEmbedNavigation/RvfEmbedNavigation";
|
|
35
|
-
import RvfExportMenu from "../RvfExportMenu";
|
|
36
16
|
import RvfExportMenuButton from "../RvfExportMenuButton";
|
|
37
|
-
import
|
|
38
|
-
import
|
|
17
|
+
// import RvfFloatingMenu from "../RvfFloatingMenu";
|
|
18
|
+
// import RvfLayerTree from "../RvfLayerTree";
|
|
39
19
|
import RvfLayerTreeButton from "../RvfLayerTreeButton";
|
|
40
20
|
// Notificationurl example: https://mobility-web-component-tmp.vercel.app/geops-mobility?notificationurl=https%3A%2F%2Fmoco.geops.io%2Fapi%2Fv1%2Fexport%2Fpublication%2F%3Fsso_config%3Drvf&geolocation=false&realtime=false&search=false¬ificationat=2024-01-25T22%3A59%3A00Z
|
|
41
21
|
import RvfLineNetworkPlanLayer from "../RvfLineNetworkPlanLayer";
|
|
42
|
-
import
|
|
43
|
-
import
|
|
22
|
+
import RvfOverlayContent from "../RvfOverlayContent/RvfOverlayContent";
|
|
23
|
+
// import Modal from "../RvfModal";
|
|
44
24
|
import RvfPoisLayer from "../RvfPoisLayer";
|
|
25
|
+
import RvfSearchButton from "../RvfSearchButton";
|
|
45
26
|
import RvfSelectedFeatureHighlightLayer from "../RvfSelectedFeatureHighlightLayer";
|
|
46
27
|
import RvfSellingPointsLayer from "../RvfSellingPointsLayer";
|
|
47
|
-
import RvfShare from "../RvfShare";
|
|
48
28
|
import RvfSharedMobilityLayerGroup from "../RvfSharedMobilityLayerGroup";
|
|
49
29
|
import RvfShareMenuButton from "../RvfShareMenuButton";
|
|
50
30
|
import RvfTarifZonenLayer from "../RvfTarifZonenLayer";
|
|
51
|
-
import Topics from "../RvfTopics";
|
|
52
31
|
import RvfZoomButtons from "../RvfZoomButtons";
|
|
53
32
|
import ScaleLine from "../ScaleLine";
|
|
54
33
|
import Search from "../Search";
|
|
55
34
|
import SingleClickListener from "../SingleClickListener";
|
|
56
|
-
import Station from "../Station";
|
|
57
35
|
import StationsLayer from "../StationsLayer";
|
|
58
|
-
|
|
59
|
-
import
|
|
60
|
-
import { RVF_EXTENT_3857, RVF_LAYERS_TITLES } from "../utils/constants";
|
|
36
|
+
import IconButton from "../ui/IconButton";
|
|
37
|
+
import { RVF_LAYERS_TITLES } from "../utils/constants";
|
|
61
38
|
import fullTrajectoryStyle from "../utils/fullTrajectoryStyle";
|
|
62
39
|
import getBgColor from "../utils/getBgColor";
|
|
63
|
-
import getFeatureInformationTitle from "../utils/getFeatureInformationTitle";
|
|
64
40
|
import { getRadius } from "../utils/getRadius";
|
|
65
41
|
import getTextColor from "../utils/getTextColor";
|
|
66
42
|
import { I18nContext } from "../utils/hooks/useI18n";
|
|
@@ -69,11 +45,31 @@ import { MapContext } from "../utils/hooks/useMapContext";
|
|
|
69
45
|
import { RvfContext } from "../utils/hooks/useRvfContext";
|
|
70
46
|
import useUpdatePermalink from "../utils/hooks/useUpdatePermalink";
|
|
71
47
|
import i18n from "../utils/i18n";
|
|
72
|
-
import MobilityEvent from "../utils/MobilityEvent";
|
|
73
48
|
import realtimeRVFStyle from "../utils/realtimeRVFStyle";
|
|
49
|
+
import WindowMessageListener from "../WindowMessageListener";
|
|
50
|
+
|
|
51
|
+
// @ts-expect-error bad type definition
|
|
52
|
+
import tailwind from "../style.css";
|
|
74
53
|
// @ts-expect-error bad type definition
|
|
75
54
|
import style from "./index.css";
|
|
76
55
|
|
|
56
|
+
import type {
|
|
57
|
+
MaplibreLayer,
|
|
58
|
+
MaplibreStyleLayer,
|
|
59
|
+
RealtimeLayer as MbtRealtimeLayer,
|
|
60
|
+
} from "mobility-toolbox-js/ol";
|
|
61
|
+
import type {
|
|
62
|
+
RealtimeStation,
|
|
63
|
+
RealtimeStationId,
|
|
64
|
+
RealtimeStopSequence,
|
|
65
|
+
RealtimeTrainId,
|
|
66
|
+
SituationType,
|
|
67
|
+
} from "mobility-toolbox-js/types";
|
|
68
|
+
import type { Feature, Map as OlMap } from "ol";
|
|
69
|
+
import type { Group } from "ol/layer";
|
|
70
|
+
|
|
71
|
+
import type { MobilityMapProps } from "../MobilityMap/MobilityMap";
|
|
72
|
+
|
|
77
73
|
const PRIORITY_FROM_TYPE = {
|
|
78
74
|
bus: 25,
|
|
79
75
|
coach: 15,
|
|
@@ -87,14 +83,14 @@ export type RvfMobilityMapProps = {
|
|
|
87
83
|
layers: string; // list of visible layers on load
|
|
88
84
|
layertree: string;
|
|
89
85
|
print: string;
|
|
86
|
+
queryablelayers: string;
|
|
90
87
|
share: string;
|
|
91
88
|
toolbar: string;
|
|
92
89
|
} & MobilityMapProps;
|
|
93
90
|
|
|
94
|
-
const bbox = RVF_EXTENT_3857.join(",");
|
|
95
|
-
|
|
96
91
|
const baseLayerProps = {
|
|
97
92
|
mapLibreOptions: {
|
|
93
|
+
// For printing purpose
|
|
98
94
|
maxCanvasSize: [20000, 20000] as [number, number], // remove 4096 limitations
|
|
99
95
|
preserveDrawingBuffer: true,
|
|
100
96
|
},
|
|
@@ -103,16 +99,14 @@ const baseLayerProps = {
|
|
|
103
99
|
const styleProps = {
|
|
104
100
|
//fontSize: 16
|
|
105
101
|
};
|
|
102
|
+
|
|
106
103
|
const scrollableHandlerProps = {
|
|
107
104
|
style: { width: "calc(100% - 60px)" },
|
|
108
105
|
};
|
|
109
|
-
const realtimeLayerProps = {
|
|
110
|
-
bboxParameters: {
|
|
111
|
-
line_tags: "RVF",
|
|
112
|
-
},
|
|
113
106
|
|
|
107
|
+
const realtimeLayerProps = {
|
|
114
108
|
fullTrajectoryStyle: fullTrajectoryStyle,
|
|
115
|
-
getMotsByZoom: (z) => {
|
|
109
|
+
getMotsByZoom: (z: number) => {
|
|
116
110
|
if (z < 9) {
|
|
117
111
|
return ["rail"];
|
|
118
112
|
}
|
|
@@ -152,39 +146,7 @@ const realtimeLayerProps = {
|
|
|
152
146
|
},
|
|
153
147
|
};
|
|
154
148
|
|
|
155
|
-
function RvfMobilityMap({
|
|
156
|
-
apikey = "5cc87b12d7c5370001c1d655820abcc37dfd4d968d7bab5b2a74a935",
|
|
157
|
-
// baselayer = "review-geops-tgma-085vyz.de.rvf",
|
|
158
|
-
baselayer = "de.rvf_moco",
|
|
159
|
-
center = null,
|
|
160
|
-
details = "true",
|
|
161
|
-
embed = "false",
|
|
162
|
-
extent = bbox,
|
|
163
|
-
geolocation = "true",
|
|
164
|
-
layers = null,
|
|
165
|
-
layertree = "true",
|
|
166
|
-
// mapsurl = "https://style-review.geops.io",
|
|
167
|
-
// mapsurl = "https://maps.style-dev.geops.io",
|
|
168
|
-
mapsurl = "https://maps.geops.io",
|
|
169
|
-
maxextent = bbox,
|
|
170
|
-
maxzoom = "20",
|
|
171
|
-
minzoom = null,
|
|
172
|
-
mots = null,
|
|
173
|
-
notification = "false",
|
|
174
|
-
notificationat = null, //"2025-09-10T00:00:00Z",
|
|
175
|
-
notificationbeforelayerid = null,
|
|
176
|
-
notificationurl = "https://moco.geops.io/api/v1/",
|
|
177
|
-
permalink = "false",
|
|
178
|
-
print = "true",
|
|
179
|
-
realtime = "true",
|
|
180
|
-
realtimeurl = "wss://api.geops.io/tracker-ws/v1/ws",
|
|
181
|
-
search = "false",
|
|
182
|
-
share = "true",
|
|
183
|
-
stopsurl = "https://api.geops.io/stops/v1/",
|
|
184
|
-
tenant = null,
|
|
185
|
-
toolbar = "true",
|
|
186
|
-
zoom = null,
|
|
187
|
-
}: RvfMobilityMapProps) {
|
|
149
|
+
function RvfMobilityMap(props: RvfMobilityMapProps) {
|
|
188
150
|
const eventNodeRef = useRef<HTMLDivElement>();
|
|
189
151
|
const [baseLayer, setBaseLayer] = useState<MaplibreLayer>();
|
|
190
152
|
const [isFollowing, setIsFollowing] = useState(false);
|
|
@@ -201,6 +163,7 @@ function RvfMobilityMap({
|
|
|
201
163
|
const [selectedFeature, setSelectedFeature] = useState<Feature>();
|
|
202
164
|
const [selectedFeatures, setSelectedFeatures] = useState<Feature[]>();
|
|
203
165
|
const [isLayerTreeOpen, setIsLayerTreeOpen] = useState<boolean>(false);
|
|
166
|
+
const [isSearchOpen, setIsSearchOpen] = useState<boolean>(false);
|
|
204
167
|
const [sellingPointsLayer, setSellingPointsLayer] =
|
|
205
168
|
useState<MaplibreStyleLayer>();
|
|
206
169
|
const [tarifZonenLayer, setTarifZonenLayer] = useState<MaplibreStyleLayer>();
|
|
@@ -210,8 +173,26 @@ function RvfMobilityMap({
|
|
|
210
173
|
const [sharedMobilityLayerGroup, setSharedMobilityLayerGroup] =
|
|
211
174
|
useState<Group>();
|
|
212
175
|
|
|
213
|
-
const [
|
|
214
|
-
useState<
|
|
176
|
+
const [previewNotifications, setPreviewNotifications] =
|
|
177
|
+
useState<SituationType[]>();
|
|
178
|
+
|
|
179
|
+
const {
|
|
180
|
+
details,
|
|
181
|
+
embed,
|
|
182
|
+
geolocation,
|
|
183
|
+
layers,
|
|
184
|
+
layertree,
|
|
185
|
+
mainlink,
|
|
186
|
+
mainlinktitle,
|
|
187
|
+
notification,
|
|
188
|
+
permalink,
|
|
189
|
+
print,
|
|
190
|
+
realtime,
|
|
191
|
+
search,
|
|
192
|
+
share,
|
|
193
|
+
tenant,
|
|
194
|
+
toolbar,
|
|
195
|
+
} = props;
|
|
215
196
|
|
|
216
197
|
// Convert string boolean to boolean
|
|
217
198
|
const hasToolbar = useMemo(() => {
|
|
@@ -227,8 +208,8 @@ function RvfMobilityMap({
|
|
|
227
208
|
}, [realtime]);
|
|
228
209
|
|
|
229
210
|
const hasNotification = useMemo(() => {
|
|
230
|
-
return notification === "true" || !!
|
|
231
|
-
}, [notification,
|
|
211
|
+
return notification === "true" || !!previewNotifications;
|
|
212
|
+
}, [notification, previewNotifications]);
|
|
232
213
|
|
|
233
214
|
const hasGeolocation = useMemo(() => {
|
|
234
215
|
return geolocation === "true";
|
|
@@ -263,35 +244,21 @@ function RvfMobilityMap({
|
|
|
263
244
|
|
|
264
245
|
const mapContextValue = useMemo(() => {
|
|
265
246
|
return {
|
|
266
|
-
// MobilityMapProps
|
|
267
|
-
|
|
268
|
-
|
|
247
|
+
// MobilityMapProps
|
|
248
|
+
...props,
|
|
249
|
+
// MapContextProps
|
|
269
250
|
baseLayer,
|
|
270
|
-
center,
|
|
271
|
-
extent,
|
|
272
251
|
geolocation,
|
|
273
252
|
isFollowing,
|
|
274
253
|
isTracking,
|
|
275
|
-
layers,
|
|
276
254
|
map,
|
|
277
|
-
|
|
278
|
-
maxextent,
|
|
279
|
-
maxzoom,
|
|
280
|
-
minzoom,
|
|
281
|
-
mots,
|
|
282
|
-
notification,
|
|
283
|
-
notificationat,
|
|
284
|
-
notificationbeforelayerid,
|
|
285
|
-
notificationurl,
|
|
286
|
-
permalink,
|
|
287
|
-
previewNotification,
|
|
255
|
+
previewNotifications,
|
|
288
256
|
realtimeLayer,
|
|
289
|
-
realtimeurl,
|
|
290
257
|
setBaseLayer,
|
|
291
258
|
setIsFollowing,
|
|
292
259
|
setIsTracking,
|
|
293
260
|
setMap,
|
|
294
|
-
|
|
261
|
+
setPreviewNotifications,
|
|
295
262
|
setRealtimeLayer,
|
|
296
263
|
setStation,
|
|
297
264
|
setStationId,
|
|
@@ -302,117 +269,40 @@ function RvfMobilityMap({
|
|
|
302
269
|
stationId,
|
|
303
270
|
stationsLayer,
|
|
304
271
|
stopSequence,
|
|
305
|
-
stopsurl,
|
|
306
|
-
tenant,
|
|
307
272
|
trainId,
|
|
308
|
-
zoom,
|
|
309
273
|
};
|
|
310
274
|
}, [
|
|
311
|
-
|
|
312
|
-
baselayer,
|
|
275
|
+
props,
|
|
313
276
|
baseLayer,
|
|
314
|
-
center,
|
|
315
|
-
extent,
|
|
316
277
|
geolocation,
|
|
317
278
|
isFollowing,
|
|
318
279
|
isTracking,
|
|
319
|
-
layers,
|
|
320
280
|
map,
|
|
321
|
-
|
|
322
|
-
maxextent,
|
|
323
|
-
maxzoom,
|
|
324
|
-
minzoom,
|
|
325
|
-
mots,
|
|
326
|
-
notification,
|
|
327
|
-
notificationat,
|
|
328
|
-
notificationbeforelayerid,
|
|
329
|
-
notificationurl,
|
|
330
|
-
permalink,
|
|
331
|
-
previewNotification,
|
|
281
|
+
previewNotifications,
|
|
332
282
|
realtimeLayer,
|
|
333
|
-
realtimeurl,
|
|
334
283
|
station,
|
|
335
284
|
stationId,
|
|
336
285
|
stationsLayer,
|
|
337
286
|
stopSequence,
|
|
338
|
-
stopsurl,
|
|
339
|
-
tenant,
|
|
340
287
|
trainId,
|
|
341
|
-
zoom,
|
|
342
|
-
]);
|
|
343
|
-
|
|
344
|
-
useEffect(() => {
|
|
345
|
-
eventNodeRef.current?.dispatchEvent(
|
|
346
|
-
new MobilityEvent<RvfMobilityMapProps>("mwc:attribute", {
|
|
347
|
-
baselayer,
|
|
348
|
-
center,
|
|
349
|
-
details,
|
|
350
|
-
embed,
|
|
351
|
-
extent,
|
|
352
|
-
geolocation,
|
|
353
|
-
layers,
|
|
354
|
-
layertree,
|
|
355
|
-
mapsurl,
|
|
356
|
-
maxextent,
|
|
357
|
-
maxzoom,
|
|
358
|
-
minzoom,
|
|
359
|
-
mots,
|
|
360
|
-
notification,
|
|
361
|
-
notificationat,
|
|
362
|
-
notificationbeforelayerid,
|
|
363
|
-
notificationurl,
|
|
364
|
-
print,
|
|
365
|
-
realtime,
|
|
366
|
-
realtimeurl,
|
|
367
|
-
search,
|
|
368
|
-
share,
|
|
369
|
-
tenant,
|
|
370
|
-
toolbar,
|
|
371
|
-
zoom,
|
|
372
|
-
}),
|
|
373
|
-
);
|
|
374
|
-
}, [
|
|
375
|
-
baselayer,
|
|
376
|
-
embed,
|
|
377
|
-
layers,
|
|
378
|
-
center,
|
|
379
|
-
geolocation,
|
|
380
|
-
layertree,
|
|
381
|
-
toolbar,
|
|
382
|
-
mapsurl,
|
|
383
|
-
maxzoom,
|
|
384
|
-
minzoom,
|
|
385
|
-
mots,
|
|
386
|
-
notification,
|
|
387
|
-
notificationat,
|
|
388
|
-
notificationurl,
|
|
389
|
-
notificationbeforelayerid,
|
|
390
|
-
realtime,
|
|
391
|
-
realtimeurl,
|
|
392
|
-
search,
|
|
393
|
-
tenant,
|
|
394
|
-
zoom,
|
|
395
|
-
extent,
|
|
396
|
-
maxextent,
|
|
397
|
-
print,
|
|
398
|
-
share,
|
|
399
|
-
details,
|
|
400
288
|
]);
|
|
401
289
|
|
|
402
290
|
const rvfContextValue = useMemo(() => {
|
|
403
291
|
return {
|
|
404
292
|
isExportMenuOpen,
|
|
405
293
|
isLayerTreeOpen,
|
|
294
|
+
isSearchOpen,
|
|
406
295
|
isShareMenuOpen,
|
|
407
296
|
layertree,
|
|
408
297
|
lineNetworkPlanLayer,
|
|
409
298
|
poisLayer,
|
|
410
|
-
|
|
299
|
+
previewNotifications,
|
|
411
300
|
selectedFeature,
|
|
412
301
|
selectedFeatures,
|
|
413
302
|
sellingPointsLayer,
|
|
414
303
|
setIsExportMenuOpen,
|
|
415
304
|
setIsLayerTreeOpen,
|
|
305
|
+
setIsSearchOpen,
|
|
416
306
|
setIsShareMenuOpen,
|
|
417
307
|
setLineNetworkPlanLayer,
|
|
418
308
|
setPoisLayer,
|
|
@@ -427,11 +317,12 @@ function RvfMobilityMap({
|
|
|
427
317
|
}, [
|
|
428
318
|
isExportMenuOpen,
|
|
429
319
|
isLayerTreeOpen,
|
|
320
|
+
isSearchOpen,
|
|
430
321
|
isShareMenuOpen,
|
|
431
322
|
layertree,
|
|
432
323
|
lineNetworkPlanLayer,
|
|
433
324
|
poisLayer,
|
|
434
|
-
|
|
325
|
+
previewNotifications,
|
|
435
326
|
selectedFeature,
|
|
436
327
|
selectedFeatures,
|
|
437
328
|
sellingPointsLayer,
|
|
@@ -439,13 +330,13 @@ function RvfMobilityMap({
|
|
|
439
330
|
tarifZonenLayer,
|
|
440
331
|
]);
|
|
441
332
|
|
|
442
|
-
const onLayerTreeMenuClick = useCallback(() => {
|
|
443
|
-
|
|
444
|
-
}, [isLayerTreeOpen]);
|
|
333
|
+
// const onLayerTreeMenuClick = useCallback(() => {
|
|
334
|
+
// setIsLayerTreeOpen(!isLayerTreeOpen);
|
|
335
|
+
// }, [isLayerTreeOpen]);
|
|
445
336
|
|
|
446
|
-
const onExportMenuClose = useCallback(() => {
|
|
447
|
-
|
|
448
|
-
}, []);
|
|
337
|
+
// const onExportMenuClose = useCallback(() => {
|
|
338
|
+
// setIsExportMenuOpen(false);
|
|
339
|
+
// }, []);
|
|
449
340
|
|
|
450
341
|
const copyrightOptions = useMemo(() => {
|
|
451
342
|
return {
|
|
@@ -478,89 +369,108 @@ function RvfMobilityMap({
|
|
|
478
369
|
};
|
|
479
370
|
}, []);
|
|
480
371
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
};
|
|
492
|
-
}, [apikey, notificationat, notificationurl, previewNotification]);
|
|
372
|
+
useEffect(() => {
|
|
373
|
+
if (isSearchOpen) {
|
|
374
|
+
setIsLayerTreeOpen(false);
|
|
375
|
+
setIsExportMenuOpen(false);
|
|
376
|
+
setIsShareMenuOpen(false);
|
|
377
|
+
setStationId(null);
|
|
378
|
+
setTrainId(null);
|
|
379
|
+
setSelectedFeature(null);
|
|
380
|
+
}
|
|
381
|
+
}, [isSearchOpen]);
|
|
493
382
|
|
|
494
383
|
useEffect(() => {
|
|
495
|
-
if (
|
|
384
|
+
if (isShareMenuOpen) {
|
|
385
|
+
setIsLayerTreeOpen(false);
|
|
386
|
+
setIsExportMenuOpen(false);
|
|
387
|
+
setIsSearchOpen(false);
|
|
388
|
+
setStationId(null);
|
|
389
|
+
setTrainId(null);
|
|
390
|
+
setSelectedFeature(null);
|
|
391
|
+
}
|
|
392
|
+
}, [isShareMenuOpen]);
|
|
393
|
+
|
|
394
|
+
useEffect(() => {
|
|
395
|
+
if (isLayerTreeOpen) {
|
|
496
396
|
setIsExportMenuOpen(false);
|
|
497
397
|
setIsLayerTreeOpen(isLayerTreeOpen);
|
|
398
|
+
setIsSearchOpen(false);
|
|
498
399
|
setSelectedFeature(null);
|
|
499
400
|
setTrainId(null);
|
|
500
401
|
setStationId(null);
|
|
501
402
|
setIsShareMenuOpen(false);
|
|
502
403
|
}
|
|
503
|
-
}, [isLayerTreeOpen
|
|
404
|
+
}, [isLayerTreeOpen]);
|
|
504
405
|
|
|
505
406
|
useEffect(() => {
|
|
506
|
-
if (
|
|
407
|
+
if (isExportMenuOpen) {
|
|
507
408
|
setIsLayerTreeOpen(false);
|
|
508
409
|
setIsExportMenuOpen(isExportMenuOpen);
|
|
410
|
+
setIsSearchOpen(false);
|
|
509
411
|
setSelectedFeature(null);
|
|
510
412
|
setTrainId(null);
|
|
511
413
|
setIsShareMenuOpen(false);
|
|
512
414
|
setStationId(null);
|
|
513
415
|
}
|
|
514
|
-
}, [isExportMenuOpen
|
|
416
|
+
}, [isExportMenuOpen]);
|
|
515
417
|
|
|
516
418
|
useEffect(() => {
|
|
517
|
-
if (
|
|
419
|
+
if (selectedFeature) {
|
|
518
420
|
setIsLayerTreeOpen(false);
|
|
421
|
+
setIsSearchOpen(false);
|
|
519
422
|
setIsExportMenuOpen(false);
|
|
520
423
|
setTrainId(null);
|
|
521
424
|
setIsShareMenuOpen(false);
|
|
522
425
|
setStationId(null);
|
|
523
426
|
}
|
|
524
|
-
}, [selectedFeature
|
|
427
|
+
}, [selectedFeature]);
|
|
525
428
|
|
|
526
429
|
useEffect(() => {
|
|
527
|
-
if (
|
|
430
|
+
if (stationId) {
|
|
528
431
|
setIsLayerTreeOpen(false);
|
|
529
432
|
setIsExportMenuOpen(false);
|
|
433
|
+
setIsSearchOpen(false);
|
|
530
434
|
setTrainId(null);
|
|
531
435
|
setIsShareMenuOpen(false);
|
|
532
436
|
setSelectedFeature(null);
|
|
533
437
|
}
|
|
534
|
-
}, [stationId
|
|
438
|
+
}, [stationId]);
|
|
535
439
|
|
|
536
440
|
useEffect(() => {
|
|
537
|
-
if (
|
|
441
|
+
if (trainId) {
|
|
538
442
|
setIsLayerTreeOpen(false);
|
|
539
443
|
setIsExportMenuOpen(false);
|
|
444
|
+
setIsSearchOpen(false);
|
|
540
445
|
setStationId(null);
|
|
541
446
|
setIsShareMenuOpen(false);
|
|
542
447
|
setSelectedFeature(null);
|
|
543
448
|
}
|
|
544
|
-
}, [trainId
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
449
|
+
}, [trainId]);
|
|
450
|
+
|
|
451
|
+
const isOverlayDisplayed = useMemo(() => {
|
|
452
|
+
return (
|
|
453
|
+
(hasDetails && !!selectedFeature) ||
|
|
454
|
+
(hasPrint && isExportMenuOpen) ||
|
|
455
|
+
(hasLayerTree && isLayerTreeOpen) ||
|
|
456
|
+
(hasShare && isShareMenuOpen) ||
|
|
457
|
+
(hasRealtime && !!trainId) ||
|
|
458
|
+
(tenant && !!stationId)
|
|
459
|
+
);
|
|
460
|
+
}, [
|
|
461
|
+
hasDetails,
|
|
462
|
+
selectedFeature,
|
|
463
|
+
hasPrint,
|
|
464
|
+
isExportMenuOpen,
|
|
465
|
+
hasLayerTree,
|
|
466
|
+
isLayerTreeOpen,
|
|
467
|
+
hasShare,
|
|
468
|
+
isShareMenuOpen,
|
|
469
|
+
hasRealtime,
|
|
470
|
+
trainId,
|
|
471
|
+
tenant,
|
|
472
|
+
stationId,
|
|
473
|
+
]);
|
|
564
474
|
|
|
565
475
|
return (
|
|
566
476
|
<I18nContext.Provider value={i18n}>
|
|
@@ -568,19 +478,24 @@ function RvfMobilityMap({
|
|
|
568
478
|
<style>{style}</style>
|
|
569
479
|
<MapContext.Provider value={mapContextValue}>
|
|
570
480
|
<RvfContext.Provider value={rvfContextValue}>
|
|
481
|
+
<MapDispatchEvents node={eventNodeRef.current} wcAttributes={props} />
|
|
482
|
+
<WindowMessageListener eventNode={eventNodeRef.current} />
|
|
571
483
|
<div
|
|
572
|
-
className="relative size-full overflow-hidden font-sans
|
|
484
|
+
className="@container/main relative size-full overflow-hidden font-sans"
|
|
573
485
|
ref={eventNodeRef}
|
|
574
486
|
style={styleProps}
|
|
575
487
|
>
|
|
576
488
|
<div className="relative flex size-full flex-col text-base @lg/main:flex-row-reverse">
|
|
577
|
-
<Map className="relative flex-1 overflow-visible
|
|
489
|
+
<Map className="relative flex-1 overflow-visible">
|
|
578
490
|
<BaseLayer {...baseLayerProps} />
|
|
579
|
-
<SingleClickListener />
|
|
491
|
+
<SingleClickListener eventNode={eventNodeRef.current} />
|
|
580
492
|
{isEmbed && <RvfEmbedNavigation />}
|
|
581
493
|
|
|
582
494
|
{hasNotification && (
|
|
583
|
-
<NotificationLayer
|
|
495
|
+
<NotificationLayer
|
|
496
|
+
isQueryable={true}
|
|
497
|
+
title={RVF_LAYERS_TITLES.meldungen}
|
|
498
|
+
/>
|
|
584
499
|
)}
|
|
585
500
|
|
|
586
501
|
<RvfSelectedFeatureHighlightLayer />
|
|
@@ -611,6 +526,19 @@ function RvfMobilityMap({
|
|
|
611
526
|
title={RVF_LAYERS_TITLES.sharedMobility}
|
|
612
527
|
/>
|
|
613
528
|
|
|
529
|
+
{mainlink && (
|
|
530
|
+
<IconButton
|
|
531
|
+
className={
|
|
532
|
+
"absolute inset-x-2 bottom-8 z-10 rounded-xl border-3 border-white"
|
|
533
|
+
}
|
|
534
|
+
href={mainlink}
|
|
535
|
+
target="_blank"
|
|
536
|
+
theme="primary"
|
|
537
|
+
title={mainlinktitle}
|
|
538
|
+
>
|
|
539
|
+
<LiaMapSolid />
|
|
540
|
+
</IconButton>
|
|
541
|
+
)}
|
|
614
542
|
<div className="pointer-events-none absolute inset-x-2 bottom-2 z-10 flex items-end justify-between gap-2 text-[10px]">
|
|
615
543
|
<ScaleLine className="bg-slate-50/70" />
|
|
616
544
|
<Copyright
|
|
@@ -619,22 +547,16 @@ function RvfMobilityMap({
|
|
|
619
547
|
/>
|
|
620
548
|
</div>
|
|
621
549
|
|
|
622
|
-
<div className="absolute
|
|
623
|
-
{hasGeolocation &&
|
|
624
|
-
|
|
550
|
+
<div className="absolute top-2 right-2 z-10 flex">
|
|
551
|
+
{hasGeolocation && (
|
|
552
|
+
<GeolocationButton title={"Geolokalisierung"} />
|
|
553
|
+
)}
|
|
625
554
|
</div>
|
|
626
555
|
|
|
627
|
-
|
|
628
|
-
<div className="absolute left-2 right-12 top-2 z-10 flex max-h-[90%] min-w-64 max-w-96 flex-col">
|
|
629
|
-
<Search />
|
|
630
|
-
</div>
|
|
631
|
-
)}
|
|
632
|
-
|
|
633
|
-
<div className="absolute bottom-10 right-2 z-10 flex flex-col justify-between gap-2">
|
|
556
|
+
<div className="absolute right-2 bottom-10 z-10 flex flex-col justify-between gap-2">
|
|
634
557
|
<RvfZoomButtons />
|
|
635
|
-
</div>
|
|
636
558
|
|
|
637
|
-
|
|
559
|
+
{/* {!hasToolbar && hasLayerTree && (
|
|
638
560
|
<RvfFloatingMenu
|
|
639
561
|
isOpen={isLayerTreeOpen}
|
|
640
562
|
onClick={onLayerTreeMenuClick}
|
|
@@ -642,86 +564,108 @@ function RvfMobilityMap({
|
|
|
642
564
|
>
|
|
643
565
|
<Topics className={"w-full px-2"} />
|
|
644
566
|
</RvfFloatingMenu>
|
|
645
|
-
)}
|
|
567
|
+
)} */}
|
|
568
|
+
</div>
|
|
646
569
|
</Map>
|
|
570
|
+
|
|
571
|
+
<div className="pointer-events-none absolute top-2 bottom-2 left-2 z-10 flex flex-col gap-2 *:pointer-events-auto">
|
|
572
|
+
<div
|
|
573
|
+
className={
|
|
574
|
+
"relative z-10 w-fit rounded-2xl bg-black/10 p-0 backdrop-blur-sm"
|
|
575
|
+
}
|
|
576
|
+
// className="w-fit rounded-2xl bg-black/10 p-1 backdrop-blur-sm">
|
|
577
|
+
>
|
|
578
|
+
<div
|
|
579
|
+
className={twMerge(
|
|
580
|
+
"absolute top-12 left-0 h-[40px] w-0 p-0 opacity-0 transition-all @sm:top-0 @sm:left-[calc(100%-43px)] @md:left-[calc(100%-47px)]",
|
|
581
|
+
isSearchOpen ? "w-64 opacity-100" : "",
|
|
582
|
+
)}
|
|
583
|
+
>
|
|
584
|
+
<Search
|
|
585
|
+
className={
|
|
586
|
+
"border-grey @container m-0 h-[40px] rounded-2xl border p-2 px-4 text-base @sm/main:h-[44px] @sm/main:rounded-l-none @sm/main:rounded-r-2xl @md/main:h-[48px]"
|
|
587
|
+
}
|
|
588
|
+
inputClassName="h-6 text-base"
|
|
589
|
+
inputContainerClassName="border-none"
|
|
590
|
+
resultClassName="text-base **:hover:cursor-pointer hover:text-red-500 p-2"
|
|
591
|
+
resultsContainerClassName="@container rounded-b-2xl max-h-[200px] overflow-y-auto border border-grey border-t-0 "
|
|
592
|
+
withResultsClassName="text-base !rounded-b-none"
|
|
593
|
+
/>
|
|
594
|
+
</div>
|
|
595
|
+
<div
|
|
596
|
+
className={twMerge(
|
|
597
|
+
"border-grey relative flex gap-[1px] overflow-hidden rounded-2xl border",
|
|
598
|
+
"*:size-[38px] *:rounded-none *:border-none *:@sm/main:size-[42px] *:@md/main:!size-[46px]",
|
|
599
|
+
"*:first:!rounded-l-2xl",
|
|
600
|
+
"*:last:!rounded-r-2xl",
|
|
601
|
+
isSearchOpen
|
|
602
|
+
? "@sm:rounded-r-none @sm:border-r-0 @sm:*:last:!rounded-r-none @sm:*:last:border-r-0"
|
|
603
|
+
: "",
|
|
604
|
+
)}
|
|
605
|
+
>
|
|
606
|
+
{!hasToolbar && hasPrint && (
|
|
607
|
+
<RvfExportMenuButton title={"Drucken"} />
|
|
608
|
+
)}
|
|
609
|
+
{!hasToolbar && hasShare && (
|
|
610
|
+
<RvfShareMenuButton title={"Share"} />
|
|
611
|
+
)}
|
|
612
|
+
{!hasToolbar && hasLayerTree && (
|
|
613
|
+
<RvfLayerTreeButton title={"Layers"} />
|
|
614
|
+
)}
|
|
615
|
+
{!hasToolbar && hasSearch && (
|
|
616
|
+
<RvfSearchButton title={"Suche"} />
|
|
617
|
+
)}
|
|
618
|
+
</div>
|
|
619
|
+
</div>
|
|
620
|
+
|
|
621
|
+
<div
|
|
622
|
+
className={twMerge(
|
|
623
|
+
"flex w-0 flex-1 flex-col overflow-hidden rounded-2xl",
|
|
624
|
+
isOverlayDisplayed ? "@lg:min-w-60" : "p-0",
|
|
625
|
+
)}
|
|
626
|
+
style={{ containerType: "normal" }}
|
|
627
|
+
>
|
|
628
|
+
<Overlay
|
|
629
|
+
className={
|
|
630
|
+
"border-grey @container/overlay pointer-events-auto relative hidden flex-col overflow-hidden rounded-2xl border bg-white text-base shadow-lg @lg:flex"
|
|
631
|
+
}
|
|
632
|
+
ScrollableHandlerProps={scrollableHandlerProps}
|
|
633
|
+
>
|
|
634
|
+
<RvfOverlayContent
|
|
635
|
+
hasDetails={hasDetails}
|
|
636
|
+
hasLayerTree={hasLayerTree}
|
|
637
|
+
hasPrint={hasPrint}
|
|
638
|
+
hasRealtime={hasRealtime}
|
|
639
|
+
hasSearch={false}
|
|
640
|
+
hasShare={hasShare}
|
|
641
|
+
/>
|
|
642
|
+
</Overlay>
|
|
643
|
+
</div>
|
|
644
|
+
</div>
|
|
645
|
+
|
|
646
|
+
{/* Mobile */}
|
|
647
647
|
<Overlay
|
|
648
|
-
className={
|
|
648
|
+
className={
|
|
649
|
+
isOverlayDisplayed
|
|
650
|
+
? "absolute bottom-0 z-20 flex max-h-[70%] min-h-[75px] w-full flex-col border-t bg-white @lg:hidden"
|
|
651
|
+
: "@lg:hidden"
|
|
652
|
+
}
|
|
649
653
|
ScrollableHandlerProps={scrollableHandlerProps}
|
|
650
654
|
>
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
<RouteSchedule className="relative overflow-y-auto overflow-x-hidden" />
|
|
660
|
-
</>
|
|
661
|
-
)}
|
|
662
|
-
{tenant && stationId && (
|
|
663
|
-
<>
|
|
664
|
-
<RvfOverlayHeader
|
|
665
|
-
onClose={() => {
|
|
666
|
-
setStationId(null);
|
|
667
|
-
}}
|
|
668
|
-
title="Station"
|
|
669
|
-
></RvfOverlayHeader>
|
|
670
|
-
<Station className="relative flex flex-col overflow-y-auto overflow-x-hidden p-2" />
|
|
671
|
-
</>
|
|
672
|
-
)}
|
|
673
|
-
{hasDetails &&
|
|
674
|
-
selectedFeature &&
|
|
675
|
-
!selectedFeature.get("severity") && (
|
|
676
|
-
<>
|
|
677
|
-
<RvfOverlayHeader
|
|
678
|
-
onClose={() => {
|
|
679
|
-
setSelectedFeature(null);
|
|
680
|
-
}}
|
|
681
|
-
title={getFeatureInformationTitle(selectedFeature)}
|
|
682
|
-
></RvfOverlayHeader>
|
|
683
|
-
<RvfFeatureDetails className="relative flex h-full flex-col gap-4 overflow-y-auto overflow-x-hidden p-4" />
|
|
684
|
-
</>
|
|
685
|
-
)}
|
|
686
|
-
{hasToolbar && hasPrint && isExportMenuOpen && (
|
|
687
|
-
<>
|
|
688
|
-
<RvfOverlayHeader
|
|
689
|
-
onClose={() => {
|
|
690
|
-
setIsExportMenuOpen(false);
|
|
691
|
-
}}
|
|
692
|
-
title="Drucken"
|
|
693
|
-
></RvfOverlayHeader>
|
|
694
|
-
<RvfExportMenu className="relative flex flex-col gap-8 overflow-y-auto overflow-x-hidden px-4 py-6" />
|
|
695
|
-
</>
|
|
696
|
-
)}
|
|
697
|
-
{hasToolbar && hasLayerTree && isLayerTreeOpen && (
|
|
698
|
-
<>
|
|
699
|
-
<RvfOverlayHeader
|
|
700
|
-
onClose={() => {
|
|
701
|
-
setIsLayerTreeOpen(false);
|
|
702
|
-
}}
|
|
703
|
-
title="Layers"
|
|
704
|
-
></RvfOverlayHeader>
|
|
705
|
-
<Topics className=" relative flex h-full flex-col overflow-y-auto overflow-x-hidden p-2" />
|
|
706
|
-
</>
|
|
707
|
-
)}
|
|
708
|
-
{hasToolbar && hasShare && isShareMenuOpen && (
|
|
709
|
-
<>
|
|
710
|
-
<RvfOverlayHeader
|
|
711
|
-
onClose={() => {
|
|
712
|
-
setIsShareMenuOpen(false);
|
|
713
|
-
}}
|
|
714
|
-
title="Share"
|
|
715
|
-
></RvfOverlayHeader>
|
|
716
|
-
<RvfShare className="relative flex h-full flex-col gap-8 overflow-y-auto overflow-x-hidden px-4 py-6" />
|
|
717
|
-
</>
|
|
718
|
-
)}
|
|
655
|
+
<RvfOverlayContent
|
|
656
|
+
hasDetails={hasDetails}
|
|
657
|
+
hasLayerTree={hasLayerTree}
|
|
658
|
+
hasPrint={hasPrint}
|
|
659
|
+
hasRealtime={hasRealtime}
|
|
660
|
+
hasSearch={false}
|
|
661
|
+
hasShare={hasShare}
|
|
662
|
+
/>
|
|
719
663
|
</Overlay>
|
|
720
664
|
|
|
721
665
|
{hasToolbar && (
|
|
722
666
|
<div
|
|
723
667
|
className={
|
|
724
|
-
"z-[100] flex justify-around overflow-x-hidden border-t bg-white p-1 @lg/main:block @lg/main:border-
|
|
668
|
+
"z-[100] flex justify-around overflow-x-hidden border-t bg-white p-1 *:border-none @lg/main:block @lg/main:border-t-0 @lg/main:border-r @lg/main:p-0"
|
|
725
669
|
}
|
|
726
670
|
>
|
|
727
671
|
{hasLayerTree && (
|
|
@@ -747,7 +691,8 @@ function RvfMobilityMap({
|
|
|
747
691
|
</div>
|
|
748
692
|
)}
|
|
749
693
|
|
|
750
|
-
{
|
|
694
|
+
{/* Modal display */}
|
|
695
|
+
{/* {!hasToolbar && hasPrint && isExportMenuOpen && (
|
|
751
696
|
<Modal onClose={onExportMenuClose}>
|
|
752
697
|
<RvfOverlayHeader
|
|
753
698
|
onClose={() => {
|
|
@@ -755,9 +700,57 @@ function RvfMobilityMap({
|
|
|
755
700
|
}}
|
|
756
701
|
title="Drucken"
|
|
757
702
|
></RvfOverlayHeader>
|
|
758
|
-
<RvfExportMenu className="relative flex flex-col gap-4 overflow-
|
|
703
|
+
<RvfExportMenu className="relative flex flex-col gap-4 overflow-x-hidden overflow-y-auto px-4 py-4" />
|
|
759
704
|
</Modal>
|
|
760
705
|
)}
|
|
706
|
+
|
|
707
|
+
{!hasToolbar && hasShare && isShareMenuOpen && (
|
|
708
|
+
<Modal
|
|
709
|
+
onClose={() => {
|
|
710
|
+
setIsShareMenuOpen(false);
|
|
711
|
+
}}
|
|
712
|
+
>
|
|
713
|
+
<RvfOverlayHeader
|
|
714
|
+
onClose={() => {
|
|
715
|
+
setIsShareMenuOpen(false);
|
|
716
|
+
}}
|
|
717
|
+
title="Share"
|
|
718
|
+
></RvfOverlayHeader>
|
|
719
|
+
<RvfShare className="relative flex flex-col gap-4 overflow-x-hidden overflow-y-auto px-4 py-4" />
|
|
720
|
+
</Modal>
|
|
721
|
+
)}
|
|
722
|
+
|
|
723
|
+
{!hasToolbar && hasLayerTree && isLayerTreeOpen && (
|
|
724
|
+
<Modal
|
|
725
|
+
onClose={() => {
|
|
726
|
+
setIsLayerTreeOpen(false);
|
|
727
|
+
}}
|
|
728
|
+
>
|
|
729
|
+
<RvfOverlayHeader
|
|
730
|
+
onClose={() => {
|
|
731
|
+
setIsLayerTreeOpen(false);
|
|
732
|
+
}}
|
|
733
|
+
title="Layers"
|
|
734
|
+
></RvfOverlayHeader>
|
|
735
|
+
<Topics className="overflow-x-hidden overflow-y-auto px-4" />
|
|
736
|
+
</Modal>
|
|
737
|
+
)}
|
|
738
|
+
|
|
739
|
+
{!hasToolbar && hasSearch && isSearchOpen && (
|
|
740
|
+
<Modal
|
|
741
|
+
onClose={() => {
|
|
742
|
+
setIsSearchOpen(false);
|
|
743
|
+
}}
|
|
744
|
+
>
|
|
745
|
+
<RvfOverlayHeader
|
|
746
|
+
onClose={() => {
|
|
747
|
+
setIsSearchOpen(false);
|
|
748
|
+
}}
|
|
749
|
+
title="Search"
|
|
750
|
+
></RvfOverlayHeader>
|
|
751
|
+
<Search />
|
|
752
|
+
</Modal>
|
|
753
|
+
)} */}
|
|
761
754
|
</div>
|
|
762
755
|
</div>
|
|
763
756
|
</RvfContext.Provider>
|
|
@@ -766,4 +759,15 @@ function RvfMobilityMap({
|
|
|
766
759
|
);
|
|
767
760
|
}
|
|
768
761
|
|
|
769
|
-
|
|
762
|
+
// We creates a wrapper to inject the default props values from MobilityMapAttributes.
|
|
763
|
+
const defaultProps = {};
|
|
764
|
+
|
|
765
|
+
Object.entries(MobilityMapAttributes).forEach(([key]) => {
|
|
766
|
+
defaultProps[key] = MobilityMapAttributes[key].defaultValue || null;
|
|
767
|
+
});
|
|
768
|
+
|
|
769
|
+
function MobilityMapWithDefaultProps(props: MobilityMapProps) {
|
|
770
|
+
return <RvfMobilityMap {...defaultProps} {...props} />;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
export default memo(MobilityMapWithDefaultProps);
|