@rio-cloud/uikit-mcp 1.1.9 → 1.1.11
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/README.md +2 -1
- package/dist/doc-metadata.json +334 -94
- package/dist/docs/components/accentBar.md +110 -116
- package/dist/docs/components/activity.md +1 -1
- package/dist/docs/components/analyticsAnalysisOverlay.md +630 -0
- package/dist/docs/components/animatedNumber.md +2 -2
- package/dist/docs/components/animatedTextReveal.md +53 -55
- package/dist/docs/components/animations.md +21 -21
- package/dist/docs/components/appHeader.md +27 -38
- package/dist/docs/components/appLayout.md +23 -77
- package/dist/docs/components/appNavigationBar.md +1 -1
- package/dist/docs/components/areaCharts.md +57 -61
- package/dist/docs/components/aspectRatioPlaceholder.md +1 -1
- package/dist/docs/components/assetTree.md +429 -342
- package/dist/docs/components/autosuggests.md +1 -1
- package/dist/docs/components/avatar.md +1 -1
- package/dist/docs/components/banner.md +2 -2
- package/dist/docs/components/barCharts.md +530 -414
- package/dist/docs/components/barList.md +10 -10
- package/dist/docs/components/basicMap.md +104 -39
- package/dist/docs/components/bottomSheet.md +2 -2
- package/dist/docs/components/button.md +8 -2
- package/dist/docs/components/buttonToolbar.md +1 -1
- package/dist/docs/components/calendarStripe.md +59 -63
- package/dist/docs/components/card.md +1 -1
- package/dist/docs/components/carousel.md +1 -1
- package/dist/docs/components/chartColors.md +1 -1
- package/dist/docs/components/chartsGettingStarted.md +1 -1
- package/dist/docs/components/chat.md +2 -2
- package/dist/docs/components/checkbox.md +15 -10
- package/dist/docs/components/circularProgress.md +6 -6
- package/dist/docs/components/clearableInput.md +1 -1
- package/dist/docs/components/collapse.md +2 -2
- package/dist/docs/components/composedCharts.md +63 -51
- package/dist/docs/components/contentLoader.md +1 -1
- package/dist/docs/components/dataTabs.md +33 -33
- package/dist/docs/components/datepickers.md +693 -685
- package/dist/docs/components/dayPicker.md +5624 -0
- package/dist/docs/components/dayPickerCalendar.md +5289 -0
- package/dist/docs/components/dialogs.md +17 -19
- package/dist/docs/components/divider.md +1 -1
- package/dist/docs/components/dropdowns.md +3264 -3276
- package/dist/docs/components/editableContent.md +91 -91
- package/dist/docs/components/expander.md +4 -1
- package/dist/docs/components/fade.md +1 -1
- package/dist/docs/components/fadeExpander.md +1 -1
- package/dist/docs/components/fadeUp.md +32 -36
- package/dist/docs/components/feedback.md +1 -1
- package/dist/docs/components/filePickers.md +1 -1
- package/dist/docs/components/formLabel.md +29 -31
- package/dist/docs/components/groupedItemList.md +3 -7
- package/dist/docs/components/htmlTable.md +5074 -0
- package/dist/docs/components/iconList.md +4 -4
- package/dist/docs/components/imagePreloader.md +1 -1
- package/dist/docs/components/labeledElement.md +1 -1
- package/dist/docs/components/licensePlate.md +1 -1
- package/dist/docs/components/lineCharts.md +172 -170
- package/dist/docs/components/listMenu.md +15 -12
- package/dist/docs/components/loadMore.md +4 -2
- package/dist/docs/components/mainNavigation.md +1 -1
- package/dist/docs/components/mapCircle.md +10 -1
- package/dist/docs/components/mapCluster.md +25 -1
- package/dist/docs/components/mapContext.md +12 -4
- package/dist/docs/components/mapDraggableMarker.md +12 -1
- package/dist/docs/components/mapGettingStarted.md +39 -1
- package/dist/docs/components/mapInfoBubble.md +129 -2
- package/dist/docs/components/mapLayerGroup.md +10 -1
- package/dist/docs/components/mapMarker.md +10 -1
- package/dist/docs/components/mapPolygon.md +288 -85
- package/dist/docs/components/mapRoute.md +262 -172
- package/dist/docs/components/mapSettings.md +28 -1
- package/dist/docs/components/mapUtils.md +1 -1
- package/dist/docs/components/mapViewportHistory.md +287 -0
- package/dist/docs/components/multiselects.md +217 -18
- package/dist/docs/components/noData.md +1 -1
- package/dist/docs/components/notifications.md +2 -2
- package/dist/docs/components/numbercontrol.md +15 -15
- package/dist/docs/components/onboarding.md +1 -1
- package/dist/docs/components/page.md +1 -1
- package/dist/docs/components/pager.md +1 -1
- package/dist/docs/components/pieCharts.md +237 -211
- package/dist/docs/components/popover.md +1 -1
- package/dist/docs/components/position.md +1 -1
- package/dist/docs/components/radialBarCharts.md +446 -398
- package/dist/docs/components/radioCardGroup.md +1 -1
- package/dist/docs/components/radiobutton.md +98 -98
- package/dist/docs/components/releaseNotes.md +1 -1
- package/dist/docs/components/resizer.md +1 -1
- package/dist/docs/components/responsiveColumnStripe.md +1 -1
- package/dist/docs/components/responsiveVideo.md +1 -1
- package/dist/docs/components/rioglyph.md +1 -1
- package/dist/docs/components/rules.md +41 -47
- package/dist/docs/components/saveableInput.md +252 -252
- package/dist/docs/components/selects.md +332 -161
- package/dist/docs/components/sidebar.md +1 -1
- package/dist/docs/components/sliders.md +1 -1
- package/dist/docs/components/smoothScrollbars.md +19 -13
- package/dist/docs/components/spinners.md +1 -1
- package/dist/docs/components/states.md +15 -1
- package/dist/docs/components/statsWidgets.md +1 -1
- package/dist/docs/components/statusBar.md +3 -1
- package/dist/docs/components/stepButton.md +1 -1
- package/dist/docs/components/steppedProgressBars.md +9 -11
- package/dist/docs/components/subNavigation.md +1 -1
- package/dist/docs/components/supportMarker.md +1 -1
- package/dist/docs/components/svgImage.md +1 -1
- package/dist/docs/components/switch.md +5 -1
- package/dist/docs/components/table.md +21361 -0
- package/dist/docs/components/tableControls.md +982 -0
- package/dist/docs/components/tagManager.md +1 -1
- package/dist/docs/components/tags.md +1 -1
- package/dist/docs/components/teaser.md +1 -1
- package/dist/docs/components/textTruncateMiddle.md +1 -1
- package/dist/docs/components/timeline.md +1 -1
- package/dist/docs/components/timepicker.md +3 -1
- package/dist/docs/components/toggleButton.md +3 -1
- package/dist/docs/components/tooltip.md +8 -2
- package/dist/docs/components/tracker.md +1 -1
- package/dist/docs/components/virtualList.md +60 -60
- package/dist/docs/foundations.md +761 -3077
- package/dist/docs/start/changelog.md +73 -3
- package/dist/docs/start/goodtoknow.md +5 -1
- package/dist/docs/start/guidelines/color-combinations.md +5 -1
- package/dist/docs/start/guidelines/custom-css.md +26 -2
- package/dist/docs/start/guidelines/custom-rioglyph.md +20 -2
- package/dist/docs/start/guidelines/formatting.md +2254 -249
- package/dist/docs/start/guidelines/iframe.md +53 -19
- package/dist/docs/start/guidelines/obfuscate-data.md +24 -2
- package/dist/docs/start/guidelines/print-css.md +16 -2
- package/dist/docs/start/guidelines/spinner.md +1 -1
- package/dist/docs/start/guidelines/state-in-url.md +1138 -11
- package/dist/docs/start/guidelines/supported-browsers.md +9 -2
- package/dist/docs/start/guidelines/writing.md +228 -2
- package/dist/docs/start/howto.md +155 -13
- package/dist/docs/start/intro.md +40 -2
- package/dist/docs/start/responsiveness.md +27 -1
- package/dist/docs/templates/ai-assistant.md +311 -0
- package/dist/docs/templates/common-table.md +814 -0
- package/dist/docs/templates/detail-views.md +846 -0
- package/dist/docs/templates/expandable-details.md +214 -0
- package/dist/docs/templates/feature-cards.md +479 -0
- package/dist/docs/templates/form-summary.md +179 -0
- package/dist/docs/templates/form-toggle.md +329 -0
- package/dist/docs/templates/list-blocks.md +872 -0
- package/dist/docs/templates/loading-progress.md +100 -0
- package/dist/docs/templates/options-panel.md +132 -0
- package/dist/docs/templates/panel-variants.md +137 -0
- package/dist/docs/templates/progress-cards.md +541 -0
- package/dist/docs/templates/progress-success.md +125 -0
- package/dist/docs/templates/settings-form.md +401 -0
- package/dist/docs/templates/stats-blocks.md +1245 -0
- package/dist/docs/templates/table-panel.md +310 -0
- package/dist/docs/templates/usage-cards.md +199 -0
- package/dist/docs/utilities/classNames.md +89 -1
- package/dist/docs/utilities/deviceUtils.md +2 -2
- package/dist/docs/utilities/featureToggles.md +182 -2
- package/dist/docs/utilities/fuelTypeUtils.md +27 -29
- package/dist/docs/utilities/getTrackingAttributes.md +322 -0
- package/dist/docs/utilities/routeUtils.md +211 -3
- package/dist/docs/utilities/useAfterMount.md +1 -1
- package/dist/docs/utilities/useAutoAnimate.md +1 -1
- package/dist/docs/utilities/useAverage.md +1 -1
- package/dist/docs/utilities/useClickOutside.md +1 -1
- package/dist/docs/utilities/useClipboard.md +2 -2
- package/dist/docs/utilities/useCookies.md +1 -1
- package/dist/docs/utilities/useCount.md +1 -1
- package/dist/docs/utilities/useDarkMode.md +5 -4
- package/dist/docs/utilities/useDebugInfo.md +3 -3
- package/dist/docs/utilities/useDraggableElement.md +281 -0
- package/dist/docs/utilities/useEffectOnce.md +1 -1
- package/dist/docs/utilities/useElapsedTime.md +1 -1
- package/dist/docs/utilities/useElementSize.md +1 -1
- package/dist/docs/utilities/useEsc.md +1 -1
- package/dist/docs/utilities/useEvent.md +1 -1
- package/dist/docs/utilities/useFocusTrap.md +1 -1
- package/dist/docs/utilities/useFullscreen.md +1 -1
- package/dist/docs/utilities/useHover.md +1 -1
- package/dist/docs/utilities/useIncomingPostMessages.md +1 -1
- package/dist/docs/utilities/useInterval.md +1 -1
- package/dist/docs/utilities/useIsFocusWithin.md +1 -1
- package/dist/docs/utilities/useKey.md +8 -10
- package/dist/docs/utilities/useLocalStorage.md +1 -1
- package/dist/docs/utilities/useLocationSuggestions.md +1 -1
- package/dist/docs/utilities/useMax.md +1 -1
- package/dist/docs/utilities/useMin.md +1 -1
- package/dist/docs/utilities/useMutationObserver.md +1 -1
- package/dist/docs/utilities/useOnScreen.md +1 -1
- package/dist/docs/utilities/useOnlineStatus.md +1 -1
- package/dist/docs/utilities/usePostMessage.md +2 -2
- package/dist/docs/utilities/usePostMessageSender.md +1 -1
- package/dist/docs/utilities/usePrevious.md +110 -2
- package/dist/docs/utilities/useResizeObserver.md +35 -15
- package/dist/docs/utilities/useRioCookieConsent.md +1 -1
- package/dist/docs/utilities/useScrollPosition.md +3 -6
- package/dist/docs/utilities/useSearch.md +1 -3
- package/dist/docs/utilities/useSearchHighlight.md +1 -1
- package/dist/docs/utilities/useSorting.md +370 -239
- package/dist/docs/utilities/useStateWithValidation.md +1 -1
- package/dist/docs/utilities/useSum.md +1 -1
- package/dist/docs/utilities/useTableExport.md +364 -288
- package/dist/docs/utilities/useTableSelection.md +88 -92
- package/dist/docs/utilities/useTimeout.md +1 -1
- package/dist/docs/utilities/useToggle.md +1 -1
- package/dist/docs/utilities/useUrlState.md +1 -1
- package/dist/docs/utilities/useWindowResize.md +1 -1
- package/dist/index.mjs +173 -69
- package/dist/search-synonyms.json +214 -76
- package/dist/version.json +2 -2
- package/package.json +4 -5
- package/dist/docs/components/mapRouteGenerator.md +0 -6
- package/dist/docs/components/tables.md +0 -8
|
@@ -3,12 +3,23 @@
|
|
|
3
3
|
*Category:* Components
|
|
4
4
|
*Section:* Map
|
|
5
5
|
*Source:* https://uikit.developers.rio.cloud/#/components/mapSettings
|
|
6
|
-
*Captured:* 2026-
|
|
6
|
+
*Captured:* 2026-04-27T14:58:59.718Z
|
|
7
7
|
|
|
8
8
|
## Map settings
|
|
9
9
|
|
|
10
10
|
### Example: Example 1
|
|
11
11
|
|
|
12
|
+
Terms of use © 1987–2026 HERE
|
|
13
|
+
|
|
14
|
+
20 km
|
|
15
|
+
|
|
16
|
+
Choose view
|
|
17
|
+
Map view
|
|
18
|
+
Satellite
|
|
19
|
+
|
|
20
|
+
Traffic conditions
|
|
21
|
+
Show traffic incidents
|
|
22
|
+
|
|
12
23
|
Map Type Day Day
|
|
13
24
|
Fleet style
|
|
14
25
|
Satellite
|
|
@@ -71,6 +82,7 @@ import MapLayerTrafficItem from '@rio-cloud/rio-uikit/MapLayerTrafficItem';
|
|
|
71
82
|
import MapBoundingBoxButton from '@rio-cloud/rio-uikit/MapBoundingBoxButton';
|
|
72
83
|
import MapCenterMarkerButton from '@rio-cloud/rio-uikit/MapCenterMarkerButton';
|
|
73
84
|
import MapLockMarkerButton from '@rio-cloud/rio-uikit/MapLockMarkerButton';
|
|
85
|
+
import MapPreviousViewportButton from '@rio-cloud/rio-uikit/MapPreviousViewportButton';
|
|
74
86
|
import Select, { type SelectOption } from '@rio-cloud/rio-uikit/Select';
|
|
75
87
|
import Multiselect from '@rio-cloud/rio-uikit/Multiselect';
|
|
76
88
|
import Checkbox from '@rio-cloud/rio-uikit/Checkbox';
|
|
@@ -375,6 +387,10 @@ const FullSettingsExample = () => {
|
|
|
375
387
|
tooltip='Center current Marker'
|
|
376
388
|
/>,
|
|
377
389
|
<MapLockMarkerButton key='mapLockMarkerButton' />,
|
|
390
|
+
<MapPreviousViewportButton
|
|
391
|
+
key='mapPreviousViewportButton'
|
|
392
|
+
tooltip='Back to previous map position'
|
|
393
|
+
/>,
|
|
378
394
|
]}
|
|
379
395
|
/>
|
|
380
396
|
}
|
|
@@ -745,6 +761,17 @@ export default FullSettingsExample;
|
|
|
745
761
|
|
|
746
762
|
No settings
|
|
747
763
|
|
|
764
|
+
Terms of use © 1987–2026 HERE
|
|
765
|
+
|
|
766
|
+
10 km
|
|
767
|
+
|
|
768
|
+
Choose view
|
|
769
|
+
Map view
|
|
770
|
+
Satellite
|
|
771
|
+
|
|
772
|
+
Traffic conditions
|
|
773
|
+
Show traffic incidents
|
|
774
|
+
|
|
748
775
|
Without cluster settings
|
|
749
776
|
|
|
750
777
|
Terms of use © 1987–2026 HERE
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
# Map viewport history
|
|
2
|
+
|
|
3
|
+
*Category:* Components
|
|
4
|
+
*Section:* Map
|
|
5
|
+
*Source:* https://uikit.developers.rio.cloud/#/components/mapViewportHistory
|
|
6
|
+
*Captured:* 2026-04-27T14:58:53.332Z
|
|
7
|
+
|
|
8
|
+
Viewport history stores relevant map movements and exposes a settings button that jumps back to the previous center and zoom. The button is only rendered when a previous viewport exists.
|
|
9
|
+
|
|
10
|
+
## Map viewport history
|
|
11
|
+
|
|
12
|
+
Use the buttons below to trigger programmatic map changes, pause or resume the moving truck asset, or pan and zoom manually. When the asset lock is active, the map follows the truck and the history button is hidden because returning to a previous viewport would immediately conflict with the locked asset.
|
|
13
|
+
|
|
14
|
+
### Example: Current center:N49° 8.106′ E10° 34.920′Zoom: 7Animation: offAsset lock: off
|
|
15
|
+
|
|
16
|
+
Terms of use © 1987–2026 HERE
|
|
17
|
+
|
|
18
|
+
50 km
|
|
19
|
+
|
|
20
|
+
Choose view
|
|
21
|
+
Map view
|
|
22
|
+
Satellite
|
|
23
|
+
|
|
24
|
+
Traffic conditions
|
|
25
|
+
Show traffic incidents
|
|
26
|
+
|
|
27
|
+
Select depot Select customer Reset map Enable animation Enable asset movement Current center: N49° 8.106′ E10° 34.920′ Zoom: 7 Animation: off Asset lock: off
|
|
28
|
+
|
|
29
|
+
#### React (tsx)
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import { useEffect, useRef, useState } from 'react';
|
|
33
|
+
|
|
34
|
+
import Button from '@rio-cloud/rio-uikit/Button';
|
|
35
|
+
import EventUtils, { type EventListenerMap } from '@rio-cloud/rio-uikit/EventUtils';
|
|
36
|
+
import Map from '@rio-cloud/rio-uikit/Map';
|
|
37
|
+
import MapLockMarkerButton from '@rio-cloud/rio-uikit/MapLockMarkerButton';
|
|
38
|
+
import MapPreviousViewportButton from '@rio-cloud/rio-uikit/MapPreviousViewportButton';
|
|
39
|
+
import MapSettings from '@rio-cloud/rio-uikit/MapSettings';
|
|
40
|
+
import MapTypeSettings from '@rio-cloud/rio-uikit/MapTypeSettings';
|
|
41
|
+
import Marker from '@rio-cloud/rio-uikit/Marker';
|
|
42
|
+
import Position from '@rio-cloud/rio-uikit/Position';
|
|
43
|
+
import SingleMapMarker from '@rio-cloud/rio-uikit/SingleMapMarker';
|
|
44
|
+
import type { MapEvent, Position as MapPosition } from '@rio-cloud/rio-uikit/mapTypes';
|
|
45
|
+
|
|
46
|
+
import { UIKIT_DEMO_CREDENTIALS_ARE_NOT_ALLOWED_IN_PROD_ENVIRONMENT } from '../uikit_demo_credentials';
|
|
47
|
+
import ButtonToolbar from '@rio-cloud/rio-uikit/ButtonToolbar';
|
|
48
|
+
|
|
49
|
+
const INITIAL_ZOOM = 7;
|
|
50
|
+
|
|
51
|
+
const initialPosition: MapPosition = { lat: 49.1351, lng: 10.582 };
|
|
52
|
+
const depotPosition: MapPosition = { lat: 48.7758, lng: 9.1829 };
|
|
53
|
+
const customerPosition: MapPosition = { lat: 49.4521, lng: 11.0767 };
|
|
54
|
+
|
|
55
|
+
const assetRoute: MapPosition[] = [
|
|
56
|
+
{ lat: 48.1351, lng: 11.582 },
|
|
57
|
+
{ lat: 48.144, lng: 11.596 },
|
|
58
|
+
{ lat: 48.151, lng: 11.612 },
|
|
59
|
+
{ lat: 48.159, lng: 11.628 },
|
|
60
|
+
{ lat: 48.167, lng: 11.645 },
|
|
61
|
+
{ lat: 48.154, lng: 11.626 },
|
|
62
|
+
{ lat: 48.142, lng: 11.604 },
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
const isSameViewport = (
|
|
66
|
+
currentCenter: MapPosition,
|
|
67
|
+
currentZoom: number,
|
|
68
|
+
targetCenter: MapPosition,
|
|
69
|
+
targetZoom: number
|
|
70
|
+
) =>
|
|
71
|
+
Math.abs(currentCenter.lat - targetCenter.lat) < 0.0001 &&
|
|
72
|
+
Math.abs(currentCenter.lng - targetCenter.lng) < 0.0001 &&
|
|
73
|
+
Math.abs(currentZoom - targetZoom) < 0.1;
|
|
74
|
+
|
|
75
|
+
const MapViewportHistoryExample = () => {
|
|
76
|
+
const [center, setCenter] = useState(initialPosition);
|
|
77
|
+
const [zoom, setZoom] = useState(INITIAL_ZOOM);
|
|
78
|
+
const [zoomAnimation, setZoomAnimation] = useState(false);
|
|
79
|
+
const [assetPositionIndex, setAssetPositionIndex] = useState(0);
|
|
80
|
+
const [isAssetMovementEnabled, setIsAssetMovementEnabled] = useState(false);
|
|
81
|
+
const [isAssetLocked, setIsAssetLocked] = useState(false);
|
|
82
|
+
|
|
83
|
+
const pendingViewportRef = useRef<{ center: MapPosition; zoom: number }>();
|
|
84
|
+
|
|
85
|
+
const assetPosition = assetRoute[assetPositionIndex];
|
|
86
|
+
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (!isAssetMovementEnabled) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const intervalId = window.setInterval(() => {
|
|
93
|
+
setAssetPositionIndex(currentIndex => (currentIndex + 1) % assetRoute.length);
|
|
94
|
+
}, 5000);
|
|
95
|
+
|
|
96
|
+
return () => window.clearInterval(intervalId);
|
|
97
|
+
}, [isAssetMovementEnabled]);
|
|
98
|
+
|
|
99
|
+
const setMapView = (position: MapPosition, nextZoom: number) => {
|
|
100
|
+
pendingViewportRef.current = isSameViewport(center, zoom, position, nextZoom)
|
|
101
|
+
? undefined
|
|
102
|
+
: { center: position, zoom: nextZoom };
|
|
103
|
+
|
|
104
|
+
setCenter(position);
|
|
105
|
+
setZoom(nextZoom);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const setMapCenter = (position: MapPosition) => {
|
|
109
|
+
pendingViewportRef.current = isSameViewport(center, zoom, position, zoom)
|
|
110
|
+
? undefined
|
|
111
|
+
: { center: position, zoom };
|
|
112
|
+
|
|
113
|
+
setCenter(position);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
if (isAssetLocked) {
|
|
118
|
+
setMapCenter(assetPosition);
|
|
119
|
+
}
|
|
120
|
+
}, [assetPosition, isAssetLocked]);
|
|
121
|
+
|
|
122
|
+
const eventListenerMap: EventListenerMap = {
|
|
123
|
+
[EventUtils.MAP_VIEW_CHANGE_END]: (event: MapEvent) => {
|
|
124
|
+
const target = event.currentTarget as H.Map;
|
|
125
|
+
const updatedCenter = target.getCenter();
|
|
126
|
+
const updatedZoom = target.getZoom();
|
|
127
|
+
|
|
128
|
+
if (!updatedCenter) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const pendingViewport = pendingViewportRef.current;
|
|
133
|
+
if (pendingViewport) {
|
|
134
|
+
if (!isSameViewport(updatedCenter, updatedZoom, pendingViewport.center, pendingViewport.zoom)) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
pendingViewportRef.current = undefined;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
setCenter(updatedCenter);
|
|
142
|
+
setZoom(updatedZoom);
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
const mapSettingsButtons = [
|
|
147
|
+
<MapTypeSettings
|
|
148
|
+
key='mapTypeSettings'
|
|
149
|
+
tooltip='Change map type'
|
|
150
|
+
dropdownHeaderText='Map views'
|
|
151
|
+
defaultTypeLabel='Default view'
|
|
152
|
+
truckTypeLabel='Truck view'
|
|
153
|
+
terrainTypeLabel='Terrain view'
|
|
154
|
+
satelliteTypeLabel='Satellite view'
|
|
155
|
+
nightTypeLabel='Night view'
|
|
156
|
+
/>,
|
|
157
|
+
<MapLockMarkerButton
|
|
158
|
+
key='mapLockAssetButton'
|
|
159
|
+
tooltip={isAssetLocked ? 'Unlock asset' : 'Lock asset'}
|
|
160
|
+
isActive={isAssetLocked}
|
|
161
|
+
onToggle={() => setIsAssetLocked(!isAssetLocked)}
|
|
162
|
+
/>,
|
|
163
|
+
];
|
|
164
|
+
|
|
165
|
+
if (!isAssetLocked) {
|
|
166
|
+
mapSettingsButtons.push(
|
|
167
|
+
<MapPreviousViewportButton key='mapPreviousViewportButton' tooltip='Back to previous map position' />
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return (
|
|
172
|
+
<>
|
|
173
|
+
<Map
|
|
174
|
+
credentials={UIKIT_DEMO_CREDENTIALS_ARE_NOT_ALLOWED_IN_PROD_ENVIRONMENT}
|
|
175
|
+
center={center}
|
|
176
|
+
zoom={zoom}
|
|
177
|
+
height={400}
|
|
178
|
+
eventListenerMap={eventListenerMap}
|
|
179
|
+
zoomAnimation={zoomAnimation}
|
|
180
|
+
mapSettings={<MapSettings options={mapSettingsButtons} />}
|
|
181
|
+
>
|
|
182
|
+
<Marker
|
|
183
|
+
position={assetPosition}
|
|
184
|
+
icon={<SingleMapMarker iconNames={['truck']} markerColor='bg-map-marker-asset' name='Asset' />}
|
|
185
|
+
/>
|
|
186
|
+
<Marker
|
|
187
|
+
position={depotPosition}
|
|
188
|
+
icon={<SingleMapMarker iconNames={['warehouse']} markerColor='bg-map-marker-poi' name='Depot' />}
|
|
189
|
+
/>
|
|
190
|
+
<Marker
|
|
191
|
+
position={customerPosition}
|
|
192
|
+
icon={<SingleMapMarker iconNames={['factory']} markerColor='bg-map-marker-route' name='Customer' />}
|
|
193
|
+
/>
|
|
194
|
+
</Map>
|
|
195
|
+
|
|
196
|
+
<ButtonToolbar className='margin-top-15'>
|
|
197
|
+
<Button onClick={() => setMapView(depotPosition, 12)}>Select depot</Button>
|
|
198
|
+
<Button onClick={() => setMapView(customerPosition, 13)}>Select customer</Button>
|
|
199
|
+
<Button onClick={() => setMapView(initialPosition, INITIAL_ZOOM)}>Reset map</Button>
|
|
200
|
+
<Button onClick={() => setZoomAnimation(!zoomAnimation)}>
|
|
201
|
+
{zoomAnimation ? 'Disable animation' : 'Enable animation'}
|
|
202
|
+
</Button>
|
|
203
|
+
<Button onClick={() => setIsAssetMovementEnabled(!isAssetMovementEnabled)}>
|
|
204
|
+
{isAssetMovementEnabled ? 'Pause asset movement' : 'Enable asset movement'}
|
|
205
|
+
</Button>
|
|
206
|
+
<div className='text-size-12 text-color-dark display-flex align-items-center gap-10'>
|
|
207
|
+
<span>Current center:</span>
|
|
208
|
+
<Position latitude={center.lat} longitude={center.lng} />
|
|
209
|
+
<span>Zoom: {Math.round(zoom)}</span>
|
|
210
|
+
<span>Animation: {zoomAnimation ? 'on' : 'off'}</span>
|
|
211
|
+
<span>Asset lock: {isAssetLocked ? 'on' : 'off'}</span>
|
|
212
|
+
</div>
|
|
213
|
+
</ButtonToolbar>
|
|
214
|
+
</>
|
|
215
|
+
);
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
export default MapViewportHistoryExample;
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
#### Props: Map
|
|
222
|
+
|
|
223
|
+
### Map
|
|
224
|
+
|
|
225
|
+
| Name | Type | Default | Description |
|
|
226
|
+
| --- | --- | --- | --- |
|
|
227
|
+
| credentials | MapCredentials | — | HERE credentials used to initialize the map platform. |
|
|
228
|
+
| height | number | — | Height of the map container. |
|
|
229
|
+
| width | number | — | Width of the map container. |
|
|
230
|
+
| language | string | 'en' | Language used for HERE map labels and controls. |
|
|
231
|
+
| center | Position | — | Initial center position of the map. |
|
|
232
|
+
| zoom | number | — | Initial or controlled zoom level of the map. |
|
|
233
|
+
| boundingBox | BoundingBox | — | Bounding box that should be fitted by the map view. |
|
|
234
|
+
| disableMapEvents | boolean | — | Disables HERE map events entirely. |
|
|
235
|
+
| disableBehavior | boolean | false | Disables the default HERE map behavior such as pan and zoom interaction. |
|
|
236
|
+
| disableZoomMomentum | boolean | true | Disables HERE zoom momentum to reduce scroll inertia on zoom. |
|
|
237
|
+
| eventListenerMap | EventListenerMap | — | Event listeners attached to the HERE map instance. |
|
|
238
|
+
| hideMapSettings | boolean | — | Legacy prop for hiding map settings. |
|
|
239
|
+
| hideClusterSettings | boolean | false | Hides the cluster settings entry in the map settings UI. |
|
|
240
|
+
| hideMapLayerSettings | boolean | false | Hides the map layer settings entry in the map settings UI. |
|
|
241
|
+
| mapType | MapType | Map.TYPE_DEFAULT | Base map type to render. |
|
|
242
|
+
| mapLayer | MapLayer[] | [] | Active overlay layers such as traffic or incidents. |
|
|
243
|
+
| showCluster | boolean | true | Controls whether marker clustering is enabled. |
|
|
244
|
+
| showScaleBar | boolean | false | Shows the HERE scale bar. |
|
|
245
|
+
| onMapTypeChange | (type: MapType, previousType?: MapType) => void | — | Callback fired when the map type changes. |
|
|
246
|
+
| onMapLayerChange | (activeLayer: MapLayer[], previousLayer?: MapLayer[]) => void | — | Callback fired when the active map layers change. |
|
|
247
|
+
| onShowClusterChange | (show: boolean) => void | — | Callback fired when the cluster visibility changes. |
|
|
248
|
+
| onZoomIn | (zoom: number) => void | — | Callback fired when zooming in via the built-in zoom controls. |
|
|
249
|
+
| onZoomOut | (zoom: number) => void | — | Callback fired when zooming out via the built-in zoom controls. |
|
|
250
|
+
| onIncidentsChange | (incidentsResult: MapIncidents) => void | — | Callback used by incidents overlays to report fetched incidents. |
|
|
251
|
+
| mapSettingsTooltip | string \| React.ReactNode | — | Tooltip content for the map settings entry. |
|
|
252
|
+
| mapSettings | React.ReactNode | — | Custom settings UI rendered on top of the map. |
|
|
253
|
+
| zoomAnimation | boolean | false | Enables animation when zoom or center changes are applied programmatically. |
|
|
254
|
+
| maxViewportHistoryEntries | number | 5 | Maximum number of previous map viewports stored for viewport history. |
|
|
255
|
+
| enableWebGL | boolean | true | Enables the WebGL/HARP rendering engine where supported. |
|
|
256
|
+
| enableDevicePixelRatio | boolean | true | Uses window.devicePixelRatio for map rendering. |
|
|
257
|
+
| enableMarkerIconCache | boolean | true | Enables caching for generated marker icons. |
|
|
258
|
+
| enableFractionalZoom | boolean | false | Keeps HERE fractional zoom enabled for smoother trackpad and wheel zoom interaction. |
|
|
259
|
+
| disableMarkerPointerEventsWhileZooming | boolean | false | Temporarily disables marker pointer events during zoom interactions to reduce DOM hit-testing overhead. |
|
|
260
|
+
| pixelRatio | number | — | Fallback pixel ratio used when device pixel ratio support is disabled. |
|
|
261
|
+
| minZoom | number | — | Minimum allowed zoom level. |
|
|
262
|
+
| maxZoom | number | — | Maximum allowed zoom level. |
|
|
263
|
+
| children | React.ReactNode \| ((api: MapApi, incidents?: MapIncidents) => React.ReactNode) | — | Map content or a render function receiving the map API. |
|
|
264
|
+
|
|
265
|
+
#### Props: MapPreviousViewportButton
|
|
266
|
+
|
|
267
|
+
### MapPreviousViewportButton
|
|
268
|
+
|
|
269
|
+
| Name | Type | Default | Description |
|
|
270
|
+
| --- | --- | --- | --- |
|
|
271
|
+
| onGoBack | () => void | — | Callback fired after the map viewport history jumps back to the previous viewport. |
|
|
272
|
+
|
|
273
|
+
#### Props: MapSettingsTile
|
|
274
|
+
|
|
275
|
+
### MapSettingsTile
|
|
276
|
+
|
|
277
|
+
| Name | Type | Default | Description |
|
|
278
|
+
| --- | --- | --- | --- |
|
|
279
|
+
| onToggle | (newState: boolean) => void | — | Callback fired when the settings tile opens or closes. |
|
|
280
|
+
| tooltip | React.ReactNode | — | Tooltip shown while the settings tile is closed. |
|
|
281
|
+
| panel | React.ReactNode | — | Custom panel rendered below the settings tile when it is open. |
|
|
282
|
+
| items | JSX.Element[] \| undefined | — | Dropdown menu items rendered when the settings tile is open. |
|
|
283
|
+
| activeIcon | JSX.Element \| undefined | — | Icon shown when the tile is active. |
|
|
284
|
+
| inactiveIcon | JSX.Element \| undefined | — | Icon shown when the tile is inactive. |
|
|
285
|
+
| isActive | boolean | — | Controls whether the active or inactive icon is shown. |
|
|
286
|
+
| buttonClassName | string | — | Additional class name for the clickable settings button. |
|
|
287
|
+
| className | string | — | Additional class name for the settings tile wrapper. |
|