@geops/rvf-mobility-web-component 0.1.45 → 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.
Files changed (195) hide show
  1. package/.prettierrc.js +3 -1
  2. package/CHANGELOG.md +7 -0
  3. package/README.md +1 -1
  4. package/doc/package.json +4 -3
  5. package/doc/postcss.config.mjs +1 -1
  6. package/doc/src/app/components/GeopsMobilityDoc.tsx +13 -224
  7. package/doc/src/app/components/GeopsMobilitySearchDoc.tsx +11 -107
  8. package/doc/src/app/components/WebComponentDoc.tsx +45 -56
  9. package/doc/src/app/geops-mobility/page.tsx +7 -2
  10. package/doc/src/app/geops-mobility-search/page.tsx +6 -2
  11. package/doc/src/app/globals.css +47 -27
  12. package/doc/src/app/layout.tsx +4 -2
  13. package/docutils.js +33 -17
  14. package/eslint.config.mjs +28 -34
  15. package/iframe.html +5624 -201
  16. package/index.html +108 -88
  17. package/index.js +2229 -1976
  18. package/input.css +21 -3
  19. package/package.json +37 -40
  20. package/scripts/build.mjs +2 -2
  21. package/scripts/dev.mjs +3 -3
  22. package/search.html +70 -23
  23. package/src/BaseLayer/BaseLayer.tsx +2 -1
  24. package/src/Copyright/Copyright.tsx +4 -2
  25. package/src/DebugDeparture/DebugDeparture.tsx +16 -12
  26. package/src/DebugStop/DebugStop.tsx +2 -2
  27. package/src/Departure/Departure.tsx +2 -3
  28. package/src/EmbedNavigation/DragPanWarning.ts +125 -0
  29. package/src/EmbedNavigation/EmbedNavigation.tsx +52 -0
  30. package/src/EmbedNavigation/index.js +1 -0
  31. package/src/EmbedNavigation/index.tsx +1 -0
  32. package/src/GeolocationButton/GeolocationButton.tsx +11 -35
  33. package/src/GeolocationButton/index.tsx +1 -1
  34. package/src/Map/Map.tsx +5 -3
  35. package/src/MapDispatchEvents/MapDispatchEvents.tsx +78 -0
  36. package/src/MapDispatchEvents/index.tsx +1 -0
  37. package/src/MobilityMap/MobilityMap.tsx +117 -162
  38. package/src/MobilityMap/MobilityMapAttributes.test.ts +21 -0
  39. package/src/MobilityMap/MobilityMapAttributes.ts +243 -0
  40. package/src/MobilityMap/index.tsx +1 -0
  41. package/src/MobilitySearch/MobilitySearch.tsx +35 -0
  42. package/src/MobilitySearch/MobilitySearchAttributes.test.ts +21 -0
  43. package/src/MobilitySearch/MobilitySearchAttributes.ts +68 -0
  44. package/src/MobilitySearch/index.ts +2 -0
  45. package/src/NotificationLayer/NotificationLayer.tsx +27 -4
  46. package/src/Overlay/Overlay.tsx +24 -11
  47. package/src/Permalink/Permalink.tsx +77 -0
  48. package/src/Permalink/index.tsx +1 -0
  49. package/src/RealtimeLayer/RealtimeLayer.tsx +72 -33
  50. package/src/RouteDestination/RouteDestination.tsx +3 -3
  51. package/src/RouteIcon/RouteIcon.tsx +33 -25
  52. package/src/RouteIcon/index.tsx +1 -1
  53. package/src/RouteIdentifier/RouteIdentifer.tsx +6 -5
  54. package/src/RouteInfos/RouteInfos.tsx +7 -3
  55. package/src/RouteSchedule/RouteSchedule.tsx +3 -3
  56. package/src/RouteScheduleFooter/RouteScheduleFooter.tsx +1 -1
  57. package/src/RouteScheduleHeader/RouteScheduleHeader.tsx +7 -29
  58. package/src/RouteStop/RouteStop.tsx +8 -11
  59. package/src/RouteStopDelay/RouteStopDelay.tsx +2 -1
  60. package/src/RouteStopName/RouteStopName.tsx +2 -2
  61. package/src/RouteStopPlatform/RouteStopPlatform.tsx +2 -2
  62. package/src/RouteStopProgress/RouteStopProgress.tsx +2 -1
  63. package/src/RouteStopServices/RouteStopServices.tsx +2 -2
  64. package/src/RouteStopStation/RouteStopStation.tsx +8 -2
  65. package/src/RouteStopTime/RouteStopTime.tsx +2 -1
  66. package/src/RvfButton/RvfButton.tsx +14 -5
  67. package/src/RvfCheckbox/RvfCheckbox.tsx +8 -8
  68. package/src/RvfEmbedNavigation/DragPanWarning.ts +5 -5
  69. package/src/RvfEmbedNavigation/RvfEmbedNavigation.tsx +1 -0
  70. package/src/RvfExportMenu/RvfExportMenu.tsx +14 -12
  71. package/src/RvfExportMenuButton/RvfExportMenuButton.tsx +6 -7
  72. package/src/RvfFeatureDetails/RvfFeatureDetails.tsx +5 -5
  73. package/src/RvfFeatureDetails/RvfLineNetworkDetails/RvfLineNetworkDetails.tsx +164 -138
  74. package/src/RvfFeatureDetails/RvfNotificationDetails/RvfNotificationDetails.tsx +151 -109
  75. package/src/RvfFeatureDetails/RvfSellingPointDetails/RvfSellingPointDetails.tsx +2 -2
  76. package/src/RvfFeatureDetails/RvfSharedMobilityDetail/FloatingVehiclesDetails/FloatingVehiclesDetails.tsx +3 -3
  77. package/src/RvfFeatureDetails/RvfSharedMobilityDetail/RvfSharedMobilityDetails.tsx +8 -6
  78. package/src/RvfFeatureDetails/RvfSharedMobilityDetail/StationDetails/StationDetails.tsx +5 -4
  79. package/src/RvfFeatureDetailsTitle/RvfFeatureDetailsTitle.tsx +81 -0
  80. package/src/RvfFeatureDetailsTitle/index.tsx +1 -0
  81. package/src/RvfFloatingMenu/RvfFloatingMenu.tsx +4 -4
  82. package/src/RvfGeolocationButton/GeolocationButton.tsx +98 -0
  83. package/src/RvfGeolocationButton/index.tsx +1 -0
  84. package/src/RvfIconButton/RvfIconButton.tsx +20 -9
  85. package/src/RvfInputCopy/RvfInputCopy.tsx +8 -8
  86. package/src/RvfLayerTree/RvfLayerTree.tsx +5 -2
  87. package/src/RvfLayerTree/TreeItem/TreeItem.tsx +13 -16
  88. package/src/RvfLayerTree/layersTreeReducer.ts +23 -18
  89. package/src/RvfLayerTreeButton/RvfLayerTreeButton.tsx +6 -6
  90. package/src/RvfLineNetworkPlanLayer/RvfLineNetworkPlanLayer.tsx +2 -1
  91. package/src/RvfLink/RvfLink.tsx +4 -3
  92. package/src/RvfMobilityMap/RvfMobilityMap.tsx +314 -322
  93. package/src/RvfModal/RvfModal.tsx +4 -3
  94. package/src/RvfOverlayContent/RvfOverlayContent.tsx +126 -0
  95. package/src/RvfOverlayContent/index.ts +0 -0
  96. package/src/RvfOverlayHeader/RvfOverlayHeader.tsx +13 -10
  97. package/src/RvfPermalink/RvfPermalink.tsx +2 -2
  98. package/src/RvfPoisLayer/RvfPoisLayer.tsx +2 -1
  99. package/src/RvfRadioButton/RvfRadioButton.tsx +1 -1
  100. package/src/RvfRouteIcon/RvfRouteIcon.tsx +10 -0
  101. package/src/RvfRouteIcon/index.tsx +1 -0
  102. package/src/RvfSearch/RvfSearch.tsx +4 -1
  103. package/src/RvfSearchButton/RvfSearchButton.tsx +27 -0
  104. package/src/RvfSearchButton/index.tsx +1 -0
  105. package/src/RvfSelect/RvfSelect.tsx +7 -5
  106. package/src/RvfSelectedFeatureHighlightLayer/RvfSelectedFeatureHighlightLayer.tsx +1 -2
  107. package/src/RvfSellingPointsLayer/RvfSellingPointsLayer.tsx +2 -1
  108. package/src/RvfShare/RvfPermalinkButton/RvfPermalinkButton.tsx +13 -12
  109. package/src/RvfShare/RvfShare.tsx +11 -10
  110. package/src/RvfShareMenuButton/RvfShareMenuButton.tsx +5 -5
  111. package/src/RvfSharedMobilityLayerGroup/RvfSharedMobilityLayerGroup.tsx +25 -22
  112. package/src/RvfSingleClickListener/RvfSingleClickListener.tsx +46 -31
  113. package/src/RvfTarifZonenLayer/RvfTarifZonenLayer.tsx +2 -1
  114. package/src/RvfTopics/RvfTopics.tsx +6 -5
  115. package/src/RvfZoomButtons/RvfZoomButtons.tsx +3 -3
  116. package/src/ScaleLine/ScaleLine.tsx +5 -4
  117. package/src/ScrollableHandler/ScrollableHandler.tsx +2 -1
  118. package/src/ScrollableHandler/index.tsx +1 -1
  119. package/src/SingleClickListener/SingleClickListener.tsx +47 -4
  120. package/src/Station/Station.tsx +5 -5
  121. package/src/StationName/StationName.tsx +3 -3
  122. package/src/StationServices/StationServices.tsx +3 -3
  123. package/src/StationsLayer/StationsLayer.tsx +5 -4
  124. package/src/StopsSearch/StopsSearch.tsx +115 -84
  125. package/src/WindowMessageListener/WindowMessageListener.tsx +67 -0
  126. package/src/WindowMessageListener/index.tsx +1 -0
  127. package/src/icons/Airport/Airport.tsx +4 -4
  128. package/src/icons/ArrowDown/ArrowDown.tsx +1 -1
  129. package/src/icons/ArrowUp/ArrowUp.tsx +1 -1
  130. package/src/icons/ArrowUpRight/ArrowUpRight.tsx +1 -1
  131. package/src/icons/BarAndRestaurants/BarAndRestaurants.tsx +2 -2
  132. package/src/icons/Bathroom/Bathroom.tsx +1 -1
  133. package/src/icons/Copy/Copy.tsx +1 -1
  134. package/src/icons/Doc/Doc.tsx +1 -1
  135. package/src/icons/Email/Email.tsx +1 -1
  136. package/src/icons/FilePdf/FilePdf.tsx +1 -1
  137. package/src/icons/Geolocation/Geolocation.tsx +3 -5
  138. package/src/icons/Image/Image.tsx +1 -1
  139. package/src/icons/Menu/Menu.tsx +1 -1
  140. package/src/icons/Minus/Minus.tsx +1 -1
  141. package/src/icons/NoRealtime/NoRealtime.tsx +1 -1
  142. package/src/icons/Plus/Plus.tsx +1 -1
  143. package/src/icons/Police/Police.tsx +3 -3
  144. package/src/icons/Share/Share.tsx +1 -1
  145. package/src/icons/Stack/Stack.tsx +1 -1
  146. package/src/icons/Tracking/Tracking.tsx +29 -0
  147. package/src/icons/Tracking/airport-14-svgrepo-com.svg +41 -0
  148. package/src/icons/Tracking/index.tsx +1 -0
  149. package/src/icons/WaitingAreas/WaitingAreas.tsx +1 -1
  150. package/src/icons/WheelChair/WheelChair.tsx +1 -1
  151. package/src/index.tsx +8 -46
  152. package/src/indexDoc.ts +13 -0
  153. package/src/ui/Button/Button.tsx +57 -0
  154. package/src/ui/Button/index.tsx +1 -0
  155. package/src/ui/IconButton/IconButton.tsx +44 -0
  156. package/src/ui/IconButton/index.tsx +1 -0
  157. package/src/utils/MobilityEvent.ts +4 -3
  158. package/src/utils/applyInitialLayerVisibility.ts +3 -3
  159. package/src/utils/centerOnStation.ts +3 -2
  160. package/src/utils/centerOnVehicle.ts +5 -4
  161. package/src/utils/constants.ts +17 -3
  162. package/src/utils/exportPdf.ts +26 -20
  163. package/src/utils/fullTrajectoryStyle.ts +2 -2
  164. package/src/utils/getAllLayers.ts +4 -3
  165. package/src/utils/getDelayColor.test.ts +1 -0
  166. package/src/utils/getDelayColorForVehicle.test.ts +2 -0
  167. package/src/utils/getDelayString.test.ts +3 -0
  168. package/src/utils/getDelayTextForVehicle.test.ts +4 -0
  169. package/src/utils/getFullTrajectoryAndFit.ts +4 -3
  170. package/src/utils/getHoursAndMinutes.test.ts +1 -0
  171. package/src/utils/getLayersAsFlatArray.ts +2 -2
  172. package/src/utils/getLinkByDevice.ts +1 -1
  173. package/src/utils/getMainColorForVehicle.ts +3 -3
  174. package/src/utils/getPermalinkParameters.ts +2 -2
  175. package/src/utils/getStopStatus.test.ts +2 -1
  176. package/src/utils/getStopStatus.ts +1 -1
  177. package/src/utils/getTextForVehicle.ts +1 -1
  178. package/src/utils/hooks/useDeparture.tsx +6 -5
  179. package/src/utils/hooks/useI18n.tsx +6 -4
  180. package/src/utils/hooks/useInitialLayersVisiblity.tsx +2 -1
  181. package/src/utils/hooks/useLayerConfig.tsx +39 -0
  182. package/src/utils/hooks/useMapContext.tsx +30 -18
  183. package/src/utils/hooks/useRouteStop.tsx +3 -2
  184. package/src/utils/hooks/useRvfContext.tsx +11 -3
  185. package/src/utils/hooks/useStation.tsx +2 -1
  186. package/src/utils/hooks/useUpdatePermalink.tsx +25 -24
  187. package/src/utils/hooks/useZoom.tsx +4 -4
  188. package/src/utils/realtimeRVFStyle.ts +5 -4
  189. package/src/utils/sharingGraphqlUtils.ts +3 -2
  190. package/src/utils/sharingStylesUtils.ts +7 -7
  191. package/src/utils/sharingWFSUtils.ts +9 -15
  192. package/tailwind.config.mjs +1 -0
  193. package/tsconfig.json +1 -1
  194. package/doc/tailwind.config.ts +0 -20
  195. 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
- useCallback,
19
- useEffect,
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 { MobilityMapProps } from "../MobilityMap/MobilityMap";
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 RvfFeatureDetails from "../RvfFeatureDetails";
38
- import RvfFloatingMenu from "../RvfFloatingMenu";
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&notificationat=2024-01-25T22%3A59%3A00Z
41
21
  import RvfLineNetworkPlanLayer from "../RvfLineNetworkPlanLayer";
42
- import Modal from "../RvfModal";
43
- import RvfOverlayHeader from "../RvfOverlayHeader";
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
- // @ts-expect-error bad type definition
59
- import tailwind from "../style.css";
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",
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 [previewNotification, setPreviewNotification] =
214
- useState<MocoNotification[]>();
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" || !!previewNotification;
231
- }, [notification, previewNotification]);
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 && MapContextProps
267
- apikey,
268
- baselayer,
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
- mapsurl,
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
- setPreviewNotification,
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
- apikey,
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
- mapsurl,
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
- previewNotification,
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
- previewNotification,
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
- setIsLayerTreeOpen(!isLayerTreeOpen);
444
- }, [isLayerTreeOpen]);
334
+ // const onLayerTreeMenuClick = useCallback(() => {
335
+ // setIsLayerTreeOpen(!isLayerTreeOpen);
336
+ // }, [isLayerTreeOpen]);
445
337
 
446
- const onExportMenuClose = useCallback(() => {
447
- setIsExportMenuOpen(false);
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
- const notificationsLayerProps: MocoLayerOptions = useMemo(() => {
482
- return {
483
- // beforeId: notificationbeforelayerid,
484
- apiKey: apikey,
485
- date: notificationat ? new Date(notificationat) : undefined,
486
- isQueryable: true,
487
- notifications: previewNotification,
488
- tenant: "rvf",
489
- title: RVF_LAYERS_TITLES.meldungen,
490
- url: notificationurl,
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 (hasToolbar && isLayerTreeOpen) {
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, hasToolbar]);
405
+ }, [isLayerTreeOpen]);
504
406
 
505
407
  useEffect(() => {
506
- if (hasToolbar && isExportMenuOpen) {
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, hasToolbar]);
417
+ }, [isExportMenuOpen]);
515
418
 
516
419
  useEffect(() => {
517
- if (hasToolbar && selectedFeature) {
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, hasToolbar]);
428
+ }, [selectedFeature]);
525
429
 
526
430
  useEffect(() => {
527
- if (hasToolbar && stationId) {
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, hasToolbar]);
439
+ }, [stationId]);
535
440
 
536
441
  useEffect(() => {
537
- if (hasToolbar && trainId) {
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, hasToolbar]);
545
-
546
- useEffect(() => {
547
- if (hasToolbar && isShareMenuOpen) {
548
- setIsLayerTreeOpen(false);
549
- setIsExportMenuOpen(false);
550
- setStationId(null);
551
- setTrainId(null);
552
- setSelectedFeature(null);
553
- }
554
- }, [isShareMenuOpen, hasToolbar]);
555
-
556
- useEffect(() => {
557
- window.addEventListener("message", (event) => {
558
- console.log("Received message from parent:", event.data);
559
- if (event.data.notification) {
560
- setPreviewNotification([event.data.notification]);
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 @container/main"
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 {...notificationsLayerProps} />
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 top-2 z-10 flex flex-col gap-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
- {!hasToolbar && hasLayerTree && (
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={"z-50 bg-white"}
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
- {hasRealtime && trainId && (
652
- <>
653
- <RvfOverlayHeader
654
- onClose={() => {
655
- setTrainId(null);
656
- }}
657
- title={RVF_LAYERS_TITLES.echtzeit}
658
- ></RvfOverlayHeader>
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-r @lg/main:border-t-0 @lg/main:p-0 "
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
- {!hasToolbar && hasPrint && isExportMenuOpen && (
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-y-auto overflow-x-hidden px-4 py-6" />
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
- export default memo(RvfMobilityMap);
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);