@geops/rvf-mobility-web-component 0.1.55 → 0.1.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/docutils.js +21 -6
- package/global.d.ts +1 -0
- package/iframe.html +15 -0
- package/index.html +2 -1
- package/index.js +295 -335
- package/package.json +16 -17
- package/src/{RvfExportMenu/RvfExportMenu.tsx → ExportMenu/ExportMenu.tsx} +12 -12
- package/src/ExportMenu/index.tsx +1 -0
- package/src/{RvfExportMenuButton/RvfExportMenuButton.tsx → ExportMenuButton/ExportMenuButton.tsx} +5 -5
- package/src/ExportMenuButton/index.tsx +1 -0
- package/src/FeatureDetails/FeatureDetails.tsx +57 -0
- package/src/FeatureDetails/index.ts +1 -0
- package/src/FeaturesInfosListener/FeaturesInfosListener.tsx +73 -0
- package/src/FeaturesInfosListener/index.tsx +1 -0
- package/src/GeolocationButton/GeolocationButton.tsx +0 -1
- package/src/LayerTree/LayerTree.tsx +58 -0
- package/src/LayerTree/TreeItem/TreeItem.tsx +151 -0
- package/src/LayerTree/TreeItem/index.tsx +1 -0
- package/src/LayerTree/index.tsx +1 -0
- package/src/LayerTree/layersTreeContext.ts +4 -0
- package/src/LayerTree/layersTreeReducer.ts +158 -0
- package/src/{RvfLayerTreeButton/RvfLayerTreeButton.tsx → LayerTreeButton/LayerTreeButton.tsx} +5 -5
- package/src/LayerTreeButton/index.tsx +1 -0
- package/src/{RvfTopics/RvfTopics.tsx → LayerTreeMenu/LayerTreeMenu.tsx} +17 -13
- package/src/LayerTreeMenu/index.tsx +1 -0
- package/src/LayoutState/LayoutState.tsx +277 -0
- package/src/LayoutState/index.tsx +1 -0
- package/src/LinesNetworkPlanDetails/LinesNetworkPlanDetails.tsx +292 -0
- package/src/LinesNetworkPlanDetails/index.tsx +1 -0
- package/src/{RvfLineNetworkPlanLayer/RvfLineNetworkPlanLayer.tsx → LinesNetworkPlanLayer/LinesNetworkPlanLayer.tsx} +7 -9
- package/src/LinesNetworkPlanLayer/index.tsx +1 -0
- package/src/MobilityMap/MobilityMap.tsx +274 -60
- package/src/MobilityMap/MobilityMapAttributes.ts +46 -50
- package/src/NotificationDetails/NotificationDetails.tsx +468 -0
- package/src/NotificationDetails/index.ts +1 -0
- package/src/{NotificationLayer/NotificationLayer.tsx → NotificationsLayer/NotificationsLayer.tsx} +9 -4
- package/src/NotificationsLayer/index.tsx +1 -0
- package/src/Overlay/Overlay.tsx +1 -6
- package/src/OverlayContent/OverlayContent.tsx +87 -0
- package/src/OverlayContent/index.ts +1 -0
- package/src/OverlayDetails/OverlayDetails.tsx +47 -0
- package/src/OverlayDetails/index.ts +1 -0
- package/src/OverlayDetailsFooter/OverlayDetailsFooter.tsx +51 -0
- package/src/OverlayDetailsFooter/index.tsx +1 -0
- package/src/OverlayDetailsHeader/OverlayDetailsHeader.tsx +35 -0
- package/src/OverlayDetailsHeader/index.ts +1 -0
- package/src/OverlayFooter/OverlayFooter.tsx +41 -0
- package/src/OverlayFooter/index.tsx +1 -0
- package/src/OverlayHeader/OverlayHeader.tsx +44 -0
- package/src/OverlayHeader/index.tsx +1 -0
- package/src/PermalinkInput/PermalinkInput.tsx +28 -0
- package/src/PermalinkInput/index.tsx +1 -0
- package/src/RouteSchedule/RouteSchedule.tsx +22 -18
- package/src/RvfFeatureDetails/RvfFeatureDetails.tsx +22 -50
- package/src/RvfFeatureDetails/RvfLineNetworkDetails/RvfLineNetworkDetails.tsx +108 -104
- package/src/RvfFeatureDetails/RvfNotificationDetails/RvfNotificationDetails.tsx +189 -154
- package/src/RvfFeatureDetails/RvfSharedMobilityDetail/RvfSharedMobilityDetails.tsx +12 -14
- package/src/RvfFeatureDetailsTitle/RvfFeatureDetailsTitle.tsx +5 -5
- package/src/RvfMainLinkButton/RvfMainLinkButton.tsx +65 -0
- package/src/RvfMainLinkButton/index.tsx +1 -0
- package/src/RvfMobilityMap/RvfMobilityMap.tsx +183 -395
- package/src/RvfOverlayContent/RvfOverlayContent.tsx +2 -2
- package/src/RvfPoisLayer/RvfPoisLayer.tsx +2 -2
- package/src/RvfSearch/RvfSearch.tsx +1 -1
- package/src/RvfSellingPointsLayer/RvfSellingPointsLayer.tsx +2 -2
- package/src/RvfSharedMobilityLayerGroup/RvfSharedMobilityLayerGroup.tsx +23 -23
- package/src/RvfTarifZonenLayer/RvfTarifZonenLayer.tsx +2 -2
- package/src/Search/Search.tsx +11 -2
- package/src/{RvfSearchButton/RvfSearchButton.tsx → SearchButton/SearchButton.tsx} +5 -5
- package/src/SearchButton/index.tsx +1 -0
- package/src/ShadowOverflow/ShadowOverflow.tsx +20 -0
- package/src/ShadowOverflow/index.tsx +1 -0
- package/src/{RvfShare/RvfPermalinkButton/RvfPermalinkButton.tsx → ShareMenu/PermalinkButton/PermalinkButton.tsx} +4 -4
- package/src/ShareMenu/PermalinkButton/index.tsx +1 -0
- package/src/{RvfShare/RvfShare.tsx → ShareMenu/ShareMenu.tsx} +9 -11
- package/src/ShareMenu/index.tsx +1 -0
- package/src/{RvfShareMenuButton/RvfShareMenuButton.tsx → ShareMenuButton/ShareMenuButton.tsx} +6 -6
- package/src/ShareMenuButton/index.tsx +1 -0
- package/src/SingleClickListener/SingleClickListener.tsx +55 -113
- package/src/SingleClickListener/index.tsx +1 -1
- package/src/Station/Station.tsx +10 -3
- package/src/StationsLayer/StationsLayer.tsx +0 -1
- package/src/StopsSearch/StopsSearch.tsx +3 -4
- package/src/StopsSearch/index.tsx +2 -1
- package/src/WindowMessageListener/WindowMessageListener.tsx +7 -1
- package/src/{RvfZoomButtons/RvfZoomButtons.tsx → ZoomButtons/ZoomButtons.tsx} +9 -12
- package/src/ZoomButtons/index.tsx +1 -0
- package/src/icons/Geolocation/airport-14-svgrepo-com.svg +41 -0
- package/src/ui/Button/Button.tsx +9 -2
- package/src/ui/Checkbox/Checkbox.tsx +32 -0
- package/src/ui/Checkbox/index.tsx +1 -0
- package/src/ui/IconButton/IconButton.tsx +24 -4
- package/src/ui/Input/Input.tsx +17 -0
- package/src/ui/Input/index.tsx +1 -0
- package/src/ui/InputCopy/InputCopy.tsx +86 -0
- package/src/ui/InputCopy/index.tsx +1 -0
- package/src/ui/Select/Select.tsx +24 -0
- package/src/ui/Select/index.tsx +1 -0
- package/src/utils/constants.ts +43 -42
- package/src/utils/exportPdf.ts +3 -5
- package/src/utils/hooks/useInitialLayersVisiblity.tsx +1 -1
- package/src/utils/hooks/useLayerConfig.tsx +2 -2
- package/src/utils/hooks/useLayersConfig.tsx +3 -3
- package/src/utils/hooks/useMapContext.tsx +67 -8
- package/src/utils/hooks/useRvfContext.tsx +0 -44
- package/src/NotificationLayer/index.tsx +0 -1
- package/src/RvfEmbedNavigation/DragPanWarning.ts +0 -124
- package/src/RvfEmbedNavigation/RvfEmbedNavigation.tsx +0 -51
- package/src/RvfEmbedNavigation/index.js +0 -1
- package/src/RvfExportMenu/index.tsx +0 -1
- package/src/RvfExportMenuButton/index.tsx +0 -1
- package/src/RvfFloatingMenu/RvfFloatingMenu.tsx +0 -44
- package/src/RvfFloatingMenu/index.tsx +0 -1
- package/src/RvfLayerTreeButton/index.tsx +0 -1
- package/src/RvfLineNetworkPlanLayer/index.tsx +0 -1
- package/src/RvfPermalink/RvfPermalink.tsx +0 -18
- package/src/RvfPermalink/index.tsx +0 -1
- package/src/RvfSearchButton/index.tsx +0 -1
- package/src/RvfShare/RvfPermalinkButton/index.tsx +0 -1
- package/src/RvfShare/index.tsx +0 -1
- package/src/RvfShareMenuButton/index.tsx +0 -1
- package/src/RvfTopics/index.tsx +0 -1
- package/src/RvfZoomButtons/index.tsx +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useState } from "preact/hooks";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { LAYERS_NAMES, LAYERS_TITLES } from "../constants";
|
|
4
4
|
|
|
5
5
|
import useMapContext from "./useMapContext";
|
|
6
6
|
|
|
@@ -23,9 +23,9 @@ function useLayersConfig() {
|
|
|
23
23
|
const config = JSON.parse(layersconfig || "{}");
|
|
24
24
|
|
|
25
25
|
// Set the default title if not present in layersconfig
|
|
26
|
-
Object.values(
|
|
26
|
+
Object.values(LAYERS_NAMES).forEach((name) => {
|
|
27
27
|
config[name] = {
|
|
28
|
-
title:
|
|
28
|
+
title: LAYERS_TITLES[name],
|
|
29
29
|
...(config[name] || {}),
|
|
30
30
|
};
|
|
31
31
|
});
|
|
@@ -5,9 +5,11 @@ import { useContext } from "preact/hooks";
|
|
|
5
5
|
import type {
|
|
6
6
|
MaplibreLayer,
|
|
7
7
|
MaplibreStyleLayer,
|
|
8
|
+
MocoLayer,
|
|
8
9
|
RealtimeLayer,
|
|
9
10
|
} from "mobility-toolbox-js/ol";
|
|
10
11
|
import type {
|
|
12
|
+
LayerGetFeatureInfoResponse,
|
|
11
13
|
RealtimeStation,
|
|
12
14
|
RealtimeStationId,
|
|
13
15
|
RealtimeStopSequence,
|
|
@@ -20,23 +22,66 @@ import type { MobilityMapProps } from "../../MobilityMap/MobilityMap";
|
|
|
20
22
|
|
|
21
23
|
export type MapContextType = {
|
|
22
24
|
baseLayer: MaplibreLayer;
|
|
25
|
+
featuresInfos: LayerGetFeatureInfoResponse[];
|
|
26
|
+
featuresInfosHovered: LayerGetFeatureInfoResponse[];
|
|
27
|
+
hasDetails: boolean;
|
|
28
|
+
hasGeolocation: boolean;
|
|
29
|
+
hasLayerTree: boolean;
|
|
30
|
+
hasLnp: boolean;
|
|
31
|
+
hasNotification: boolean;
|
|
32
|
+
hasPermalink: boolean;
|
|
33
|
+
hasPrint: boolean;
|
|
34
|
+
hasRealtime: boolean;
|
|
35
|
+
hasSearch: boolean;
|
|
36
|
+
hasShare: boolean;
|
|
37
|
+
hasStations: boolean;
|
|
38
|
+
hasToolbar: boolean;
|
|
23
39
|
isEmbed: boolean;
|
|
40
|
+
isExportMenuOpen: boolean;
|
|
24
41
|
isFollowing: boolean;
|
|
42
|
+
isLayerTreeOpen: boolean;
|
|
43
|
+
isOverlayOpen: boolean;
|
|
44
|
+
isSearchOpen: boolean;
|
|
45
|
+
isShareMenuOpen: boolean;
|
|
25
46
|
isTracking: boolean;
|
|
26
|
-
|
|
47
|
+
linesNetworkPlanLayer: MaplibreStyleLayer;
|
|
27
48
|
map: Map;
|
|
49
|
+
notificationsLayer?: MocoLayer;
|
|
28
50
|
permalinkUrlSearchParams: URLSearchParams;
|
|
29
51
|
previewNotifications?: SituationType[];
|
|
30
|
-
queryablelayers: string;
|
|
31
52
|
realtimeLayer: RealtimeLayer;
|
|
32
53
|
selectedFeature: Feature;
|
|
33
54
|
selectedFeatures: Feature[];
|
|
34
55
|
setBaseLayer: (baseLayer: MaplibreLayer) => void;
|
|
56
|
+
setFeaturesInfos: (featuresInfos: LayerGetFeatureInfoResponse[]) => void;
|
|
57
|
+
setFeaturesInfosHovered: (
|
|
58
|
+
featuresInfos: LayerGetFeatureInfoResponse[],
|
|
59
|
+
) => void;
|
|
60
|
+
setHasDetails: (hasDetails: boolean) => void;
|
|
61
|
+
setHasGeolocation: (hasGeolocation: boolean) => void;
|
|
62
|
+
setHasLayerTree: (hasLayerTree: boolean) => void;
|
|
63
|
+
setHasLnp: (hasLnp: boolean) => void;
|
|
64
|
+
setHasNotification: (hasNotification: boolean) => void;
|
|
65
|
+
setHasPermalink: (hasPermalink: boolean) => void;
|
|
66
|
+
setHasPrint: (hasPrint: boolean) => void;
|
|
67
|
+
setHasRealtime: (hasRealtime: boolean) => void;
|
|
68
|
+
setHasSearch: (hasSearch: boolean) => void;
|
|
69
|
+
setHasShare: (hasShare: boolean) => void;
|
|
70
|
+
setHasStations: (hasStations: boolean) => void;
|
|
71
|
+
setHasToolbar: (hasToolbar: boolean) => void;
|
|
72
|
+
setIsEmbed: (isEmbed: boolean) => void;
|
|
73
|
+
setIsExportMenuOpen: (isExportMenuOpen: boolean) => void;
|
|
35
74
|
setIsFollowing: (isFollowing: boolean) => void;
|
|
75
|
+
setIsLayerTreeOpen: (isLayerTreeOpen: boolean) => void;
|
|
76
|
+
setIsOverlayOpen: (isOverlayOpen: boolean) => void;
|
|
77
|
+
setIsSearchOpen: (isSearchOpen: boolean) => void;
|
|
78
|
+
setIsShareMenuOpen: (isShareMenuOpen: boolean) => void;
|
|
36
79
|
setIsTracking: (isTracking: boolean) => void;
|
|
80
|
+
setLinesNetworkPlanLayer: (layer?: MaplibreStyleLayer) => void;
|
|
37
81
|
setMap: (map?: Map) => void;
|
|
82
|
+
setNotificationsLayer: (notificationsLayer?: MocoLayer) => void;
|
|
38
83
|
setPermalinkUrlSearchParams: (
|
|
39
|
-
|
|
84
|
+
setPermalinkUrlSearchParams: URLSearchParams,
|
|
40
85
|
) => void;
|
|
41
86
|
setPreviewNotifications: (setPreviewNotifications?: SituationType[]) => void;
|
|
42
87
|
setRealtimeLayer: (realtimeLayer?: RealtimeLayer) => void;
|
|
@@ -55,19 +100,33 @@ export type MapContextType = {
|
|
|
55
100
|
} & MobilityMapProps;
|
|
56
101
|
|
|
57
102
|
export const MapContext = createContext<MapContextType>({
|
|
103
|
+
hasDetails: false,
|
|
104
|
+
hasGeolocation: false,
|
|
105
|
+
hasLayerTree: false,
|
|
106
|
+
hasLnp: false,
|
|
107
|
+
hasNotification: false,
|
|
108
|
+
hasPermalink: false,
|
|
109
|
+
hasPrint: false,
|
|
110
|
+
hasRealtime: false,
|
|
111
|
+
hasSearch: false,
|
|
112
|
+
hasShare: false,
|
|
113
|
+
hasStations: false,
|
|
114
|
+
hasToolbar: true,
|
|
58
115
|
isEmbed: false,
|
|
116
|
+
isExportMenuOpen: false,
|
|
59
117
|
isFollowing: false,
|
|
118
|
+
isLayerTreeOpen: false,
|
|
119
|
+
isOverlayOpen: false,
|
|
120
|
+
isSearchOpen: false,
|
|
121
|
+
isShareMenuOpen: false,
|
|
60
122
|
isTracking: false,
|
|
61
|
-
layers: null,
|
|
62
|
-
map: null,
|
|
63
|
-
previewNotifications: null,
|
|
64
|
-
queryablelayers: null,
|
|
65
|
-
realtimeLayer: null,
|
|
66
123
|
selectedFeatures: [],
|
|
67
124
|
setBaseLayer: (baseLayer?: MaplibreLayer) => {},
|
|
68
125
|
setIsFollowing: (isFollowing: boolean) => {},
|
|
69
126
|
setIsTracking: (isTracking: boolean) => {},
|
|
127
|
+
setLinesNetworkPlanLayer: (linesNetworkPlanLayer: MaplibreStyleLayer) => {},
|
|
70
128
|
setMap: (map?: Map) => {},
|
|
129
|
+
setNotificationsLayer: (notificationsLayer?: MocoLayer) => {},
|
|
71
130
|
setPermalinkUrlSearchParams: (
|
|
72
131
|
permalinkUrlSearchParams: URLSearchParams,
|
|
73
132
|
) => {},
|
|
@@ -3,27 +3,12 @@ import { createContext } from "preact";
|
|
|
3
3
|
import { useContext } from "preact/hooks";
|
|
4
4
|
|
|
5
5
|
import type { MaplibreStyleLayer } from "mobility-toolbox-js/ol";
|
|
6
|
-
import type { Feature } from "ol";
|
|
7
6
|
import type { Group } from "ol/layer";
|
|
8
7
|
|
|
9
8
|
export interface RvfContextType {
|
|
10
|
-
isExportMenuOpen: boolean;
|
|
11
|
-
isLayerTreeOpen: boolean;
|
|
12
|
-
isSearchOpen: boolean;
|
|
13
|
-
isShareMenuOpen: boolean;
|
|
14
|
-
lineNetworkPlanLayer: MaplibreStyleLayer;
|
|
15
9
|
poisLayer: MaplibreStyleLayer;
|
|
16
|
-
selectedFeature: Feature;
|
|
17
|
-
selectedFeatures: Feature[];
|
|
18
10
|
sellingPointsLayer: MaplibreStyleLayer;
|
|
19
|
-
setIsExportMenuOpen: (isOpen: boolean) => void;
|
|
20
|
-
setIsLayerTreeOpen: (isOpen: boolean) => void;
|
|
21
|
-
setIsSearchOpen: (isOpen: boolean) => void;
|
|
22
|
-
setIsShareMenuOpen: (isOpen: boolean) => void;
|
|
23
|
-
setLineNetworkPlanLayer: (layer: MaplibreStyleLayer) => void;
|
|
24
11
|
setPoisLayer: (layer: MaplibreStyleLayer) => void;
|
|
25
|
-
setSelectedFeature: (feature: Feature) => void;
|
|
26
|
-
setSelectedFeatures: (features: Feature[]) => void;
|
|
27
12
|
setSellingPointsLayer: (layer: MaplibreStyleLayer) => void;
|
|
28
13
|
setSharedMobilityLayerGroup: (group: Group) => void;
|
|
29
14
|
setTarifZonenLayer: (layer: MaplibreStyleLayer) => void;
|
|
@@ -32,40 +17,11 @@ export interface RvfContextType {
|
|
|
32
17
|
}
|
|
33
18
|
|
|
34
19
|
export const RvfContext = createContext<RvfContextType>({
|
|
35
|
-
isExportMenuOpen: false,
|
|
36
|
-
isLayerTreeOpen: false,
|
|
37
|
-
isSearchOpen: false,
|
|
38
|
-
isShareMenuOpen: false,
|
|
39
|
-
lineNetworkPlanLayer: null,
|
|
40
20
|
poisLayer: null,
|
|
41
|
-
selectedFeature: null,
|
|
42
|
-
selectedFeatures: [],
|
|
43
21
|
sellingPointsLayer: null,
|
|
44
|
-
setIsExportMenuOpen: () => {
|
|
45
|
-
console.warn("setIsExportMenuOpen is not implemented");
|
|
46
|
-
},
|
|
47
|
-
setIsLayerTreeOpen: () => {
|
|
48
|
-
console.warn("setIsLayerTreeOpen is not implemented");
|
|
49
|
-
},
|
|
50
|
-
setIsSearchOpen: () => {
|
|
51
|
-
console.warn("setIsSearchOpen is not implemented");
|
|
52
|
-
},
|
|
53
|
-
setIsShareMenuOpen: () => {
|
|
54
|
-
console.warn("setIsShareMenuOpen is not implemented");
|
|
55
|
-
},
|
|
56
|
-
setLineNetworkPlanLayer: () => {
|
|
57
|
-
console.warn("setLineNetworkPlanLayer is not implemented");
|
|
58
|
-
},
|
|
59
22
|
setPoisLayer: () => {
|
|
60
23
|
console.warn("setPoisLayer is not implemented");
|
|
61
24
|
},
|
|
62
|
-
setSelectedFeature: () => {
|
|
63
|
-
console.warn("setSelectedFeature is not implemented");
|
|
64
|
-
},
|
|
65
|
-
setSelectedFeatures: () => {
|
|
66
|
-
console.warn("setSelectedFeatures is not implemented");
|
|
67
|
-
},
|
|
68
|
-
|
|
69
25
|
setSellingPointsLayer: () => {
|
|
70
26
|
console.warn("setSellingPointsLayer is not implemented");
|
|
71
27
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./NotificationLayer";
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { Control } from "ol/control";
|
|
2
|
-
import { DragPan } from "ol/interaction";
|
|
3
|
-
import { unByKey } from "ol/Observable";
|
|
4
|
-
|
|
5
|
-
import type { Map, MapBrowserEvent } from "ol";
|
|
6
|
-
import type { Options } from "ol/control/Control";
|
|
7
|
-
import type { EventsKey } from "ol/events";
|
|
8
|
-
|
|
9
|
-
type DragPanWarningOptions = {
|
|
10
|
-
className?: string;
|
|
11
|
-
} & Options;
|
|
12
|
-
|
|
13
|
-
class DragPanWarning extends Control {
|
|
14
|
-
dragPan?: DragPan;
|
|
15
|
-
|
|
16
|
-
icon: HTMLDivElement;
|
|
17
|
-
|
|
18
|
-
onPointerDragRef?: EventsKey;
|
|
19
|
-
|
|
20
|
-
text: HTMLParagraphElement;
|
|
21
|
-
|
|
22
|
-
constructor(options: DragPanWarningOptions = {}) {
|
|
23
|
-
const element = document.createElement("div");
|
|
24
|
-
element.className =
|
|
25
|
-
options.className !== undefined
|
|
26
|
-
? options.className
|
|
27
|
-
: "ol-drag-pan-warning";
|
|
28
|
-
element.style.display = "none";
|
|
29
|
-
element.style.pointerEvents = "auto";
|
|
30
|
-
|
|
31
|
-
super({
|
|
32
|
-
element,
|
|
33
|
-
render: options.render,
|
|
34
|
-
target: options.target,
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
this.icon = document.createElement("div");
|
|
38
|
-
this.icon.className = `${element.className}-icon`;
|
|
39
|
-
|
|
40
|
-
// sbb icons: sbb/two-finger-tap-large.svg';
|
|
41
|
-
this.icon.innerHTML = `
|
|
42
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48">
|
|
43
|
-
<path fill="none" stroke="currentColor" stroke-width="2" d="M22.999,25 L22.997,13.002 C22.997,11.896 23.893,11 24.999,11 C26.105,11 27.001,11.896 27.001,13.002 L26.999,26.002 M31,25.003 C31,23.897 31.896,23.001 33.002,23.001 C34.11,23.001 35.006,23.897 35.006,25.003 C35.006,25.003 35,26.125 35,32.001 C35,37.875 33.2,41.001 33.2,41.001 L19,41.001 C19,41.001 12.21,29.483 11.586,28.419 C10.962,27.355 10.804,26.369 11.586,25.587 C12.37,24.805 13.636,24.805 14.418,25.587 L18.998,30.169 L19,30.169 L19,25.001 L18.996,15.003 C18.996,13.897 19.894,13.001 21,13.001 C22.106,13.001 23.002,13.897 23.002,15.003 L23,26.015 M26.9942,22.997 C26.9942,21.891 27.8902,20.995 28.9962,20.995 C30.1042,20.995 31.0002,21.891 31.0002,22.997 L31.0002,26.001 M30,16.3046 C30.632,15.3606 31,14.2246 31,13.0006 C31,9.6846 28.314,7.0006 25,7.0006 C23.208,7.0006 21.616,7.8026 20.518,9.0486 C17.432,9.2986 15,11.8506 15,15.0006 C15,16.2166 15.368,17.3426 15.988,18.2866"/>
|
|
44
|
-
</svg>
|
|
45
|
-
`;
|
|
46
|
-
this.element.appendChild(this.icon);
|
|
47
|
-
|
|
48
|
-
this.text = document.createElement("p");
|
|
49
|
-
this.text.className = `${element.className}-text`;
|
|
50
|
-
this.text.innerHTML = "Benutzen Sie 2 Finger um die Karte zu bedienen.";
|
|
51
|
-
this.element.appendChild(this.text);
|
|
52
|
-
|
|
53
|
-
this.dragPan = undefined;
|
|
54
|
-
this.onPointerDragRef = undefined;
|
|
55
|
-
this.onPointerDrag = this.onPointerDrag.bind(this);
|
|
56
|
-
this.onTouchEnd = this.onTouchEnd.bind(this);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
onPointerDrag(event: MapBrowserEvent<PointerEvent>) {
|
|
60
|
-
// Show the warning on next pointerdrag events.
|
|
61
|
-
if (event.activePointers?.length !== 1) {
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
this.element.style.display = "flex";
|
|
65
|
-
document.addEventListener("touchend", this.onTouchEnd, { once: true });
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
onTouchEnd() {
|
|
70
|
-
unByKey(this.onPointerDragRef);
|
|
71
|
-
this.element.style.display = "none";
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
setMap(map: Map) {
|
|
75
|
-
super.setMap(map);
|
|
76
|
-
document.removeEventListener("touchend", this.onTouchEnd);
|
|
77
|
-
unByKey(this.onPointerDragRef);
|
|
78
|
-
|
|
79
|
-
if (map) {
|
|
80
|
-
const viewport = map.getViewport();
|
|
81
|
-
|
|
82
|
-
// We allow default scroll behavior for touch events.
|
|
83
|
-
viewport.style.touchAction = "pan-x pan-y";
|
|
84
|
-
|
|
85
|
-
// Deactivate drag pan only on touch events.
|
|
86
|
-
this.dragPan = map
|
|
87
|
-
.getInteractions()
|
|
88
|
-
.getArray()
|
|
89
|
-
.find((interaction) => {
|
|
90
|
-
return interaction instanceof DragPan;
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
if (!this.dragPan) {
|
|
94
|
-
console.error(
|
|
95
|
-
"Impossible to find the DragPan interaction, DragPanWarning will not work as expected.",
|
|
96
|
-
);
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
this.listenerKeys.push(
|
|
101
|
-
// @ts-expect-error - we need to listen to pointerdown events
|
|
102
|
-
map.on("pointerdown", (evt: MapBrowserEvent<PointerEvent>) => {
|
|
103
|
-
document.removeEventListener("touchend", this.onTouchEnd);
|
|
104
|
-
|
|
105
|
-
if (
|
|
106
|
-
evt.originalEvent.pointerType !== "touch" ||
|
|
107
|
-
// @ts-expect-error - condition_ is a private method
|
|
108
|
-
!this.dragPan?.condition_(evt)
|
|
109
|
-
) {
|
|
110
|
-
this.element.style.display = "none";
|
|
111
|
-
return true;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
this.onPointerDragRef = map.on("pointerdrag", this.onPointerDrag);
|
|
115
|
-
|
|
116
|
-
return true;
|
|
117
|
-
}),
|
|
118
|
-
);
|
|
119
|
-
this.element.addEventListener("click", this.onTouchEnd);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export default DragPanWarning;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { MouseWheelZoom } from "ol/interaction";
|
|
2
|
-
import { useEffect, useState } from "preact/hooks";
|
|
3
|
-
|
|
4
|
-
import useMapContext from "../utils/hooks/useMapContext";
|
|
5
|
-
|
|
6
|
-
import DragPanWarning from "./DragPanWarning";
|
|
7
|
-
|
|
8
|
-
function RvfEmbedNavigation() {
|
|
9
|
-
const { map } = useMapContext();
|
|
10
|
-
const [target, setTarget] = useState(null);
|
|
11
|
-
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
let dragPanWarningControl = null;
|
|
14
|
-
|
|
15
|
-
if (!map || !target) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
// Deactivates mouse wheel zoom
|
|
19
|
-
map.getInteractions().forEach((interaction) => {
|
|
20
|
-
if (interaction instanceof MouseWheelZoom) {
|
|
21
|
-
interaction.setActive(false);
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
dragPanWarningControl = new DragPanWarning({ target: target });
|
|
26
|
-
map.addControl(dragPanWarningControl);
|
|
27
|
-
|
|
28
|
-
return () => {
|
|
29
|
-
if (dragPanWarningControl) {
|
|
30
|
-
map.removeControl(dragPanWarningControl);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// Deactivates mouse wheel zoom
|
|
34
|
-
map.getInteractions().forEach((interaction) => {
|
|
35
|
-
if (interaction instanceof MouseWheelZoom) {
|
|
36
|
-
interaction.setActive(true);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
}, [map, target]);
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<div
|
|
44
|
-
ref={(node) => {
|
|
45
|
-
return setTarget(node);
|
|
46
|
-
}}
|
|
47
|
-
></div>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export default RvfEmbedNavigation;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./RvfEmbedNavigation";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./RvfExportMenu";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./RvfExportMenuButton";
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import ArrowDown from "../icons/ArrowDown";
|
|
2
|
-
import ArrowUp from "../icons/ArrowUp";
|
|
3
|
-
import useMapContext from "../utils/hooks/useMapContext";
|
|
4
|
-
|
|
5
|
-
import type { JSX, PreactDOMAttributes } from "preact";
|
|
6
|
-
|
|
7
|
-
export type RvfFloatingMenuProps = {
|
|
8
|
-
isOpen: boolean;
|
|
9
|
-
onClick: () => void;
|
|
10
|
-
} & JSX.HTMLAttributes<HTMLDivElement> &
|
|
11
|
-
PreactDOMAttributes;
|
|
12
|
-
|
|
13
|
-
function RvfFloatingMenu({
|
|
14
|
-
children,
|
|
15
|
-
isOpen,
|
|
16
|
-
onClick,
|
|
17
|
-
title,
|
|
18
|
-
}: RvfFloatingMenuProps) {
|
|
19
|
-
const { map } = useMapContext();
|
|
20
|
-
|
|
21
|
-
if (!map) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<div className="pointer-events-none absolute top-2 bottom-8 left-2 z-10 flex flex-col overflow-hidden rounded-lg">
|
|
27
|
-
<div className="border-grey pointer-events-auto max-h-full w-48 rounded-lg border bg-white shadow-lg @lg/main:w-52">
|
|
28
|
-
<button
|
|
29
|
-
className="flex w-full items-center justify-between px-2 py-1.5 font-bold"
|
|
30
|
-
onClick={onClick}
|
|
31
|
-
>
|
|
32
|
-
{title} {isOpen ? <ArrowDown /> : <ArrowUp />}
|
|
33
|
-
</button>
|
|
34
|
-
{!isOpen && (
|
|
35
|
-
<div className="flex h-[calc(100%-39px)] w-full flex-1 flex-col overflow-y-auto">
|
|
36
|
-
{children}
|
|
37
|
-
</div>
|
|
38
|
-
)}
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export default RvfFloatingMenu;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./RvfFloatingMenu";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./RvfLayerTreeButton";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./RvfLineNetworkPlanLayer";
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import RvfInputCopy from "../RvfInputCopy";
|
|
2
|
-
|
|
3
|
-
import type { JSX, PreactDOMAttributes } from "preact";
|
|
4
|
-
|
|
5
|
-
function RvfPermalink({
|
|
6
|
-
...props
|
|
7
|
-
}: JSX.HTMLAttributes<HTMLDivElement> & PreactDOMAttributes) {
|
|
8
|
-
return (
|
|
9
|
-
<div {...props}>
|
|
10
|
-
<RvfInputCopy value={window?.location.href} />
|
|
11
|
-
<p className="py-2">
|
|
12
|
-
Sie können auch den Link aus der Adresszeile des Browsers kopieren.
|
|
13
|
-
</p>
|
|
14
|
-
</div>
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export default RvfPermalink;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./RvfPermalink";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./RvfSearchButton";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./RvfPermalinkButton";
|
package/src/RvfShare/index.tsx
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./RvfShare";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./RvfShareMenuButton";
|
package/src/RvfTopics/index.tsx
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./RvfTopics";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./RvfZoomButtons";
|