@geops/rvf-mobility-web-component 0.1.46 → 0.1.47-beta.0
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/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 +5624 -201
- package/index.html +108 -88
- package/index.js +2229 -1976
- package/input.css +21 -3
- package/package.json +37 -40
- 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 +243 -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 +27 -4
- 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 +5 -5
- package/src/RvfFeatureDetails/RvfLineNetworkDetails/RvfLineNetworkDetails.tsx +164 -138
- package/src/RvfFeatureDetails/RvfNotificationDetails/RvfNotificationDetails.tsx +151 -109
- 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/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 +314 -322
- package/src/RvfModal/RvfModal.tsx +4 -3
- package/src/RvfOverlayContent/RvfOverlayContent.tsx +126 -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 +46 -31
- 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 +115 -84
- package/src/WindowMessageListener/WindowMessageListener.tsx +67 -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/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/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/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 +17 -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 +39 -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,27 @@ 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
|
+
layersconfig,
|
|
185
|
+
layertree,
|
|
186
|
+
mainlink,
|
|
187
|
+
notification,
|
|
188
|
+
permalink,
|
|
189
|
+
print,
|
|
190
|
+
realtime,
|
|
191
|
+
search,
|
|
192
|
+
share,
|
|
193
|
+
tenant,
|
|
194
|
+
toolbar,
|
|
195
|
+
} = props;
|
|
196
|
+
console.log("RvfMobilityMap props:", mainlink, layersconfig);
|
|
215
197
|
|
|
216
198
|
// Convert string boolean to boolean
|
|
217
199
|
const hasToolbar = useMemo(() => {
|
|
@@ -227,8 +209,8 @@ function RvfMobilityMap({
|
|
|
227
209
|
}, [realtime]);
|
|
228
210
|
|
|
229
211
|
const hasNotification = useMemo(() => {
|
|
230
|
-
return notification === "true" || !!
|
|
231
|
-
}, [notification,
|
|
212
|
+
return notification === "true" || !!previewNotifications;
|
|
213
|
+
}, [notification, previewNotifications]);
|
|
232
214
|
|
|
233
215
|
const hasGeolocation = useMemo(() => {
|
|
234
216
|
return geolocation === "true";
|
|
@@ -263,35 +245,21 @@ function RvfMobilityMap({
|
|
|
263
245
|
|
|
264
246
|
const mapContextValue = useMemo(() => {
|
|
265
247
|
return {
|
|
266
|
-
// MobilityMapProps
|
|
267
|
-
|
|
268
|
-
|
|
248
|
+
// MobilityMapProps
|
|
249
|
+
...props,
|
|
250
|
+
// MapContextProps
|
|
269
251
|
baseLayer,
|
|
270
|
-
center,
|
|
271
|
-
extent,
|
|
272
252
|
geolocation,
|
|
273
253
|
isFollowing,
|
|
274
254
|
isTracking,
|
|
275
|
-
layers,
|
|
276
255
|
map,
|
|
277
|
-
|
|
278
|
-
maxextent,
|
|
279
|
-
maxzoom,
|
|
280
|
-
minzoom,
|
|
281
|
-
mots,
|
|
282
|
-
notification,
|
|
283
|
-
notificationat,
|
|
284
|
-
notificationbeforelayerid,
|
|
285
|
-
notificationurl,
|
|
286
|
-
permalink,
|
|
287
|
-
previewNotification,
|
|
256
|
+
previewNotifications,
|
|
288
257
|
realtimeLayer,
|
|
289
|
-
realtimeurl,
|
|
290
258
|
setBaseLayer,
|
|
291
259
|
setIsFollowing,
|
|
292
260
|
setIsTracking,
|
|
293
261
|
setMap,
|
|
294
|
-
|
|
262
|
+
setPreviewNotifications,
|
|
295
263
|
setRealtimeLayer,
|
|
296
264
|
setStation,
|
|
297
265
|
setStationId,
|
|
@@ -302,117 +270,40 @@ function RvfMobilityMap({
|
|
|
302
270
|
stationId,
|
|
303
271
|
stationsLayer,
|
|
304
272
|
stopSequence,
|
|
305
|
-
stopsurl,
|
|
306
|
-
tenant,
|
|
307
273
|
trainId,
|
|
308
|
-
zoom,
|
|
309
274
|
};
|
|
310
275
|
}, [
|
|
311
|
-
|
|
312
|
-
baselayer,
|
|
276
|
+
props,
|
|
313
277
|
baseLayer,
|
|
314
|
-
center,
|
|
315
|
-
extent,
|
|
316
278
|
geolocation,
|
|
317
279
|
isFollowing,
|
|
318
280
|
isTracking,
|
|
319
|
-
layers,
|
|
320
281
|
map,
|
|
321
|
-
|
|
322
|
-
maxextent,
|
|
323
|
-
maxzoom,
|
|
324
|
-
minzoom,
|
|
325
|
-
mots,
|
|
326
|
-
notification,
|
|
327
|
-
notificationat,
|
|
328
|
-
notificationbeforelayerid,
|
|
329
|
-
notificationurl,
|
|
330
|
-
permalink,
|
|
331
|
-
previewNotification,
|
|
282
|
+
previewNotifications,
|
|
332
283
|
realtimeLayer,
|
|
333
|
-
realtimeurl,
|
|
334
284
|
station,
|
|
335
285
|
stationId,
|
|
336
286
|
stationsLayer,
|
|
337
287
|
stopSequence,
|
|
338
|
-
stopsurl,
|
|
339
|
-
tenant,
|
|
340
288
|
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
289
|
]);
|
|
401
290
|
|
|
402
291
|
const rvfContextValue = useMemo(() => {
|
|
403
292
|
return {
|
|
404
293
|
isExportMenuOpen,
|
|
405
294
|
isLayerTreeOpen,
|
|
295
|
+
isSearchOpen,
|
|
406
296
|
isShareMenuOpen,
|
|
407
297
|
layertree,
|
|
408
298
|
lineNetworkPlanLayer,
|
|
409
299
|
poisLayer,
|
|
410
|
-
|
|
300
|
+
previewNotifications,
|
|
411
301
|
selectedFeature,
|
|
412
302
|
selectedFeatures,
|
|
413
303
|
sellingPointsLayer,
|
|
414
304
|
setIsExportMenuOpen,
|
|
415
305
|
setIsLayerTreeOpen,
|
|
306
|
+
setIsSearchOpen,
|
|
416
307
|
setIsShareMenuOpen,
|
|
417
308
|
setLineNetworkPlanLayer,
|
|
418
309
|
setPoisLayer,
|
|
@@ -427,11 +318,12 @@ function RvfMobilityMap({
|
|
|
427
318
|
}, [
|
|
428
319
|
isExportMenuOpen,
|
|
429
320
|
isLayerTreeOpen,
|
|
321
|
+
isSearchOpen,
|
|
430
322
|
isShareMenuOpen,
|
|
431
323
|
layertree,
|
|
432
324
|
lineNetworkPlanLayer,
|
|
433
325
|
poisLayer,
|
|
434
|
-
|
|
326
|
+
previewNotifications,
|
|
435
327
|
selectedFeature,
|
|
436
328
|
selectedFeatures,
|
|
437
329
|
sellingPointsLayer,
|
|
@@ -439,13 +331,13 @@ function RvfMobilityMap({
|
|
|
439
331
|
tarifZonenLayer,
|
|
440
332
|
]);
|
|
441
333
|
|
|
442
|
-
const onLayerTreeMenuClick = useCallback(() => {
|
|
443
|
-
|
|
444
|
-
}, [isLayerTreeOpen]);
|
|
334
|
+
// const onLayerTreeMenuClick = useCallback(() => {
|
|
335
|
+
// setIsLayerTreeOpen(!isLayerTreeOpen);
|
|
336
|
+
// }, [isLayerTreeOpen]);
|
|
445
337
|
|
|
446
|
-
const onExportMenuClose = useCallback(() => {
|
|
447
|
-
|
|
448
|
-
}, []);
|
|
338
|
+
// const onExportMenuClose = useCallback(() => {
|
|
339
|
+
// setIsExportMenuOpen(false);
|
|
340
|
+
// }, []);
|
|
449
341
|
|
|
450
342
|
const copyrightOptions = useMemo(() => {
|
|
451
343
|
return {
|
|
@@ -478,89 +370,108 @@ function RvfMobilityMap({
|
|
|
478
370
|
};
|
|
479
371
|
}, []);
|
|
480
372
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
};
|
|
492
|
-
}, [apikey, notificationat, notificationurl, previewNotification]);
|
|
373
|
+
useEffect(() => {
|
|
374
|
+
if (isSearchOpen) {
|
|
375
|
+
setIsLayerTreeOpen(false);
|
|
376
|
+
setIsExportMenuOpen(false);
|
|
377
|
+
setIsShareMenuOpen(false);
|
|
378
|
+
setStationId(null);
|
|
379
|
+
setTrainId(null);
|
|
380
|
+
setSelectedFeature(null);
|
|
381
|
+
}
|
|
382
|
+
}, [isSearchOpen]);
|
|
493
383
|
|
|
494
384
|
useEffect(() => {
|
|
495
|
-
if (
|
|
385
|
+
if (isShareMenuOpen) {
|
|
386
|
+
setIsLayerTreeOpen(false);
|
|
387
|
+
setIsExportMenuOpen(false);
|
|
388
|
+
setIsSearchOpen(false);
|
|
389
|
+
setStationId(null);
|
|
390
|
+
setTrainId(null);
|
|
391
|
+
setSelectedFeature(null);
|
|
392
|
+
}
|
|
393
|
+
}, [isShareMenuOpen]);
|
|
394
|
+
|
|
395
|
+
useEffect(() => {
|
|
396
|
+
if (isLayerTreeOpen) {
|
|
496
397
|
setIsExportMenuOpen(false);
|
|
497
398
|
setIsLayerTreeOpen(isLayerTreeOpen);
|
|
399
|
+
setIsSearchOpen(false);
|
|
498
400
|
setSelectedFeature(null);
|
|
499
401
|
setTrainId(null);
|
|
500
402
|
setStationId(null);
|
|
501
403
|
setIsShareMenuOpen(false);
|
|
502
404
|
}
|
|
503
|
-
}, [isLayerTreeOpen
|
|
405
|
+
}, [isLayerTreeOpen]);
|
|
504
406
|
|
|
505
407
|
useEffect(() => {
|
|
506
|
-
if (
|
|
408
|
+
if (isExportMenuOpen) {
|
|
507
409
|
setIsLayerTreeOpen(false);
|
|
508
410
|
setIsExportMenuOpen(isExportMenuOpen);
|
|
411
|
+
setIsSearchOpen(false);
|
|
509
412
|
setSelectedFeature(null);
|
|
510
413
|
setTrainId(null);
|
|
511
414
|
setIsShareMenuOpen(false);
|
|
512
415
|
setStationId(null);
|
|
513
416
|
}
|
|
514
|
-
}, [isExportMenuOpen
|
|
417
|
+
}, [isExportMenuOpen]);
|
|
515
418
|
|
|
516
419
|
useEffect(() => {
|
|
517
|
-
if (
|
|
420
|
+
if (selectedFeature) {
|
|
518
421
|
setIsLayerTreeOpen(false);
|
|
422
|
+
setIsSearchOpen(false);
|
|
519
423
|
setIsExportMenuOpen(false);
|
|
520
424
|
setTrainId(null);
|
|
521
425
|
setIsShareMenuOpen(false);
|
|
522
426
|
setStationId(null);
|
|
523
427
|
}
|
|
524
|
-
}, [selectedFeature
|
|
428
|
+
}, [selectedFeature]);
|
|
525
429
|
|
|
526
430
|
useEffect(() => {
|
|
527
|
-
if (
|
|
431
|
+
if (stationId) {
|
|
528
432
|
setIsLayerTreeOpen(false);
|
|
529
433
|
setIsExportMenuOpen(false);
|
|
434
|
+
setIsSearchOpen(false);
|
|
530
435
|
setTrainId(null);
|
|
531
436
|
setIsShareMenuOpen(false);
|
|
532
437
|
setSelectedFeature(null);
|
|
533
438
|
}
|
|
534
|
-
}, [stationId
|
|
439
|
+
}, [stationId]);
|
|
535
440
|
|
|
536
441
|
useEffect(() => {
|
|
537
|
-
if (
|
|
442
|
+
if (trainId) {
|
|
538
443
|
setIsLayerTreeOpen(false);
|
|
539
444
|
setIsExportMenuOpen(false);
|
|
445
|
+
setIsSearchOpen(false);
|
|
540
446
|
setStationId(null);
|
|
541
447
|
setIsShareMenuOpen(false);
|
|
542
448
|
setSelectedFeature(null);
|
|
543
449
|
}
|
|
544
|
-
}, [trainId
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
450
|
+
}, [trainId]);
|
|
451
|
+
|
|
452
|
+
const isOverlayDisplayed = useMemo(() => {
|
|
453
|
+
return (
|
|
454
|
+
(hasDetails && !!selectedFeature) ||
|
|
455
|
+
(hasPrint && isExportMenuOpen) ||
|
|
456
|
+
(hasLayerTree && isLayerTreeOpen) ||
|
|
457
|
+
(hasShare && isShareMenuOpen) ||
|
|
458
|
+
(hasRealtime && !!trainId) ||
|
|
459
|
+
(tenant && !!stationId)
|
|
460
|
+
);
|
|
461
|
+
}, [
|
|
462
|
+
hasDetails,
|
|
463
|
+
selectedFeature,
|
|
464
|
+
hasPrint,
|
|
465
|
+
isExportMenuOpen,
|
|
466
|
+
hasLayerTree,
|
|
467
|
+
isLayerTreeOpen,
|
|
468
|
+
hasShare,
|
|
469
|
+
isShareMenuOpen,
|
|
470
|
+
hasRealtime,
|
|
471
|
+
trainId,
|
|
472
|
+
tenant,
|
|
473
|
+
stationId,
|
|
474
|
+
]);
|
|
564
475
|
|
|
565
476
|
return (
|
|
566
477
|
<I18nContext.Provider value={i18n}>
|
|
@@ -568,19 +479,24 @@ function RvfMobilityMap({
|
|
|
568
479
|
<style>{style}</style>
|
|
569
480
|
<MapContext.Provider value={mapContextValue}>
|
|
570
481
|
<RvfContext.Provider value={rvfContextValue}>
|
|
482
|
+
<MapDispatchEvents node={eventNodeRef.current} wcAttributes={props} />
|
|
483
|
+
<WindowMessageListener eventNode={eventNodeRef.current} />
|
|
571
484
|
<div
|
|
572
|
-
className="relative size-full overflow-hidden font-sans
|
|
485
|
+
className="@container/main relative size-full overflow-hidden font-sans"
|
|
573
486
|
ref={eventNodeRef}
|
|
574
487
|
style={styleProps}
|
|
575
488
|
>
|
|
576
489
|
<div className="relative flex size-full flex-col text-base @lg/main:flex-row-reverse">
|
|
577
|
-
<Map className="relative flex-1 overflow-visible
|
|
490
|
+
<Map className="relative flex-1 overflow-visible">
|
|
578
491
|
<BaseLayer {...baseLayerProps} />
|
|
579
|
-
<SingleClickListener />
|
|
492
|
+
<SingleClickListener eventNode={eventNodeRef.current} />
|
|
580
493
|
{isEmbed && <RvfEmbedNavigation />}
|
|
581
494
|
|
|
582
495
|
{hasNotification && (
|
|
583
|
-
<NotificationLayer
|
|
496
|
+
<NotificationLayer
|
|
497
|
+
isQueryable={true}
|
|
498
|
+
title={RVF_LAYERS_TITLES.meldungen}
|
|
499
|
+
/>
|
|
584
500
|
)}
|
|
585
501
|
|
|
586
502
|
<RvfSelectedFeatureHighlightLayer />
|
|
@@ -619,22 +535,10 @@ function RvfMobilityMap({
|
|
|
619
535
|
/>
|
|
620
536
|
</div>
|
|
621
537
|
|
|
622
|
-
<div className="absolute right-2
|
|
623
|
-
{hasGeolocation && <GeolocationButton />}
|
|
624
|
-
{!hasToolbar && hasPrint && <RvfExportMenuButton />}
|
|
625
|
-
</div>
|
|
626
|
-
|
|
627
|
-
{hasSearch && (
|
|
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">
|
|
538
|
+
<div className="absolute right-2 bottom-10 z-10 flex flex-col justify-between gap-2">
|
|
634
539
|
<RvfZoomButtons />
|
|
635
|
-
</div>
|
|
636
540
|
|
|
637
|
-
|
|
541
|
+
{/* {!hasToolbar && hasLayerTree && (
|
|
638
542
|
<RvfFloatingMenu
|
|
639
543
|
isOpen={isLayerTreeOpen}
|
|
640
544
|
onClick={onLayerTreeMenuClick}
|
|
@@ -642,86 +546,114 @@ function RvfMobilityMap({
|
|
|
642
546
|
>
|
|
643
547
|
<Topics className={"w-full px-2"} />
|
|
644
548
|
</RvfFloatingMenu>
|
|
645
|
-
)}
|
|
549
|
+
)} */}
|
|
550
|
+
</div>
|
|
646
551
|
</Map>
|
|
552
|
+
|
|
553
|
+
<div className="pointer-events-none absolute top-2 bottom-8 left-2 z-10 flex flex-col gap-2 *:pointer-events-auto">
|
|
554
|
+
<div className={"relative z-0"}>
|
|
555
|
+
<div
|
|
556
|
+
className={twMerge(
|
|
557
|
+
"absolute top-[54px] left-0 h-[40px] w-0 p-0 opacity-0 transition-all @sm/main:top-2 @sm/main:left-[calc(100%-43px)] @md/main:left-[calc(100%-47px)]",
|
|
558
|
+
isSearchOpen ? "w-64 opacity-100" : "",
|
|
559
|
+
)}
|
|
560
|
+
>
|
|
561
|
+
<Search
|
|
562
|
+
className={
|
|
563
|
+
"border-grey @container m-0 h-[40px] rounded-2xl border p-2 px-4 text-base @sm/main:h-[44px] @md/main:h-[48px]"
|
|
564
|
+
}
|
|
565
|
+
inputClassName="h-6 text-base"
|
|
566
|
+
resultClassName="text-base **:hover:cursor-pointer hover:text-red-500 p-2"
|
|
567
|
+
resultsContainerClassName="@container rounded-b-2xl max-h-[200px] overflow-y-auto border border-grey border-t-0 "
|
|
568
|
+
withResultsClassName="text-base rounded-b-none border-b-lightgrey"
|
|
569
|
+
/>
|
|
570
|
+
</div>
|
|
571
|
+
</div>
|
|
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 className="border-grey relative flex gap-[1px] overflow-hidden rounded-2xl border *:size-[38px] *:rounded-none *:border-white first:!rounded-l-2xl last:!rounded-r-2xl *:@sm/main:size-[42px] *:@md/main:!size-[46px]">
|
|
579
|
+
{hasGeolocation && (
|
|
580
|
+
<GeolocationButton title={"Geolokalisierung"} />
|
|
581
|
+
)}
|
|
582
|
+
{!hasToolbar && hasPrint && (
|
|
583
|
+
<RvfExportMenuButton title={"Drucken"} />
|
|
584
|
+
)}
|
|
585
|
+
{!hasToolbar && hasShare && (
|
|
586
|
+
<RvfShareMenuButton title={"Share"} />
|
|
587
|
+
)}
|
|
588
|
+
{!hasToolbar && hasLayerTree && (
|
|
589
|
+
<RvfLayerTreeButton title={"Layers"} />
|
|
590
|
+
)}
|
|
591
|
+
{!hasToolbar && hasSearch && (
|
|
592
|
+
<RvfSearchButton title={"Suche"} />
|
|
593
|
+
)}
|
|
594
|
+
</div>
|
|
595
|
+
</div>
|
|
596
|
+
|
|
597
|
+
<div
|
|
598
|
+
className={twMerge(
|
|
599
|
+
"flex w-0 flex-1 resize flex-col overflow-hidden rounded-2xl",
|
|
600
|
+
isOverlayDisplayed ? "@lg:w-60" : "p-0",
|
|
601
|
+
)}
|
|
602
|
+
style={{ containerType: "normal" }}
|
|
603
|
+
>
|
|
604
|
+
<Overlay
|
|
605
|
+
className={
|
|
606
|
+
"border-grey @container/overlay pointer-events-auto relative hidden flex-col overflow-hidden rounded-2xl border bg-white text-base shadow-lg @lg:flex"
|
|
607
|
+
}
|
|
608
|
+
ScrollableHandlerProps={scrollableHandlerProps}
|
|
609
|
+
>
|
|
610
|
+
<RvfOverlayContent
|
|
611
|
+
hasDetails={hasDetails}
|
|
612
|
+
hasLayerTree={hasLayerTree}
|
|
613
|
+
hasPrint={hasPrint}
|
|
614
|
+
hasRealtime={hasRealtime}
|
|
615
|
+
hasSearch={false}
|
|
616
|
+
hasShare={hasShare}
|
|
617
|
+
/>
|
|
618
|
+
</Overlay>
|
|
619
|
+
</div>
|
|
620
|
+
|
|
621
|
+
{mainlink && (
|
|
622
|
+
<IconButton
|
|
623
|
+
className={"pointer-events-auto"}
|
|
624
|
+
href={mainlink}
|
|
625
|
+
target="_blank"
|
|
626
|
+
theme="primary"
|
|
627
|
+
title="Hauptseite"
|
|
628
|
+
>
|
|
629
|
+
<LiaMapSolid />
|
|
630
|
+
</IconButton>
|
|
631
|
+
)}
|
|
632
|
+
</div>
|
|
633
|
+
|
|
634
|
+
{/* Mobile */}
|
|
647
635
|
<Overlay
|
|
648
|
-
className={
|
|
636
|
+
className={
|
|
637
|
+
isOverlayDisplayed
|
|
638
|
+
? "absolute bottom-0 z-20 max-h-[70%] min-h-[75px] w-full border-t bg-white @lg:hidden"
|
|
639
|
+
: "@lg:hidden"
|
|
640
|
+
}
|
|
649
641
|
ScrollableHandlerProps={scrollableHandlerProps}
|
|
650
642
|
>
|
|
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
|
-
)}
|
|
643
|
+
<RvfOverlayContent
|
|
644
|
+
hasDetails={hasDetails}
|
|
645
|
+
hasLayerTree={hasLayerTree}
|
|
646
|
+
hasPrint={hasPrint}
|
|
647
|
+
hasRealtime={hasRealtime}
|
|
648
|
+
hasSearch={false}
|
|
649
|
+
hasShare={hasShare}
|
|
650
|
+
/>
|
|
719
651
|
</Overlay>
|
|
720
652
|
|
|
721
653
|
{hasToolbar && (
|
|
722
654
|
<div
|
|
723
655
|
className={
|
|
724
|
-
"z-[100] flex justify-around overflow-x-hidden border-t bg-white p-1 @lg/main:block @lg/main:border-
|
|
656
|
+
"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
657
|
}
|
|
726
658
|
>
|
|
727
659
|
{hasLayerTree && (
|
|
@@ -747,7 +679,8 @@ function RvfMobilityMap({
|
|
|
747
679
|
</div>
|
|
748
680
|
)}
|
|
749
681
|
|
|
750
|
-
{
|
|
682
|
+
{/* Modal display */}
|
|
683
|
+
{/* {!hasToolbar && hasPrint && isExportMenuOpen && (
|
|
751
684
|
<Modal onClose={onExportMenuClose}>
|
|
752
685
|
<RvfOverlayHeader
|
|
753
686
|
onClose={() => {
|
|
@@ -755,9 +688,57 @@ function RvfMobilityMap({
|
|
|
755
688
|
}}
|
|
756
689
|
title="Drucken"
|
|
757
690
|
></RvfOverlayHeader>
|
|
758
|
-
<RvfExportMenu className="relative flex flex-col gap-4 overflow-
|
|
691
|
+
<RvfExportMenu className="relative flex flex-col gap-4 overflow-x-hidden overflow-y-auto px-4 py-4" />
|
|
692
|
+
</Modal>
|
|
693
|
+
)}
|
|
694
|
+
|
|
695
|
+
{!hasToolbar && hasShare && isShareMenuOpen && (
|
|
696
|
+
<Modal
|
|
697
|
+
onClose={() => {
|
|
698
|
+
setIsShareMenuOpen(false);
|
|
699
|
+
}}
|
|
700
|
+
>
|
|
701
|
+
<RvfOverlayHeader
|
|
702
|
+
onClose={() => {
|
|
703
|
+
setIsShareMenuOpen(false);
|
|
704
|
+
}}
|
|
705
|
+
title="Share"
|
|
706
|
+
></RvfOverlayHeader>
|
|
707
|
+
<RvfShare className="relative flex flex-col gap-4 overflow-x-hidden overflow-y-auto px-4 py-4" />
|
|
708
|
+
</Modal>
|
|
709
|
+
)}
|
|
710
|
+
|
|
711
|
+
{!hasToolbar && hasLayerTree && isLayerTreeOpen && (
|
|
712
|
+
<Modal
|
|
713
|
+
onClose={() => {
|
|
714
|
+
setIsLayerTreeOpen(false);
|
|
715
|
+
}}
|
|
716
|
+
>
|
|
717
|
+
<RvfOverlayHeader
|
|
718
|
+
onClose={() => {
|
|
719
|
+
setIsLayerTreeOpen(false);
|
|
720
|
+
}}
|
|
721
|
+
title="Layers"
|
|
722
|
+
></RvfOverlayHeader>
|
|
723
|
+
<Topics className="overflow-x-hidden overflow-y-auto px-4" />
|
|
759
724
|
</Modal>
|
|
760
725
|
)}
|
|
726
|
+
|
|
727
|
+
{!hasToolbar && hasSearch && isSearchOpen && (
|
|
728
|
+
<Modal
|
|
729
|
+
onClose={() => {
|
|
730
|
+
setIsSearchOpen(false);
|
|
731
|
+
}}
|
|
732
|
+
>
|
|
733
|
+
<RvfOverlayHeader
|
|
734
|
+
onClose={() => {
|
|
735
|
+
setIsSearchOpen(false);
|
|
736
|
+
}}
|
|
737
|
+
title="Search"
|
|
738
|
+
></RvfOverlayHeader>
|
|
739
|
+
<Search />
|
|
740
|
+
</Modal>
|
|
741
|
+
)} */}
|
|
761
742
|
</div>
|
|
762
743
|
</div>
|
|
763
744
|
</RvfContext.Provider>
|
|
@@ -766,4 +747,15 @@ function RvfMobilityMap({
|
|
|
766
747
|
);
|
|
767
748
|
}
|
|
768
749
|
|
|
769
|
-
|
|
750
|
+
// We creates a wrapper to inject the default props values from MobilityMapAttributes.
|
|
751
|
+
const defaultProps = {};
|
|
752
|
+
|
|
753
|
+
Object.entries(MobilityMapAttributes).forEach(([key]) => {
|
|
754
|
+
defaultProps[key] = MobilityMapAttributes[key].defaultValue || null;
|
|
755
|
+
});
|
|
756
|
+
|
|
757
|
+
function MobilityMapWithDefaultProps(props: MobilityMapProps) {
|
|
758
|
+
return <RvfMobilityMap {...defaultProps} {...props} />;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
export default memo(MobilityMapWithDefaultProps);
|