@rio-cloud/uikit-mcp 1.1.3 → 1.1.5

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 (191) hide show
  1. package/README.md +1 -0
  2. package/dist/doc-metadata.json +97 -97
  3. package/dist/docs/components/accentBar.md +5 -5
  4. package/dist/docs/components/activity.md +7 -7
  5. package/dist/docs/components/animatedNumber.md +10 -10
  6. package/dist/docs/components/animatedTextReveal.md +42 -43
  7. package/dist/docs/components/animations.md +42 -34
  8. package/dist/docs/components/appHeader.md +20 -35
  9. package/dist/docs/components/appLayout.md +198 -221
  10. package/dist/docs/components/appNavigationBar.md +21 -21
  11. package/dist/docs/components/areaCharts.md +38 -38
  12. package/dist/docs/components/aspectRatioPlaceholder.md +4 -5
  13. package/dist/docs/components/assetTree.md +887 -614
  14. package/dist/docs/components/autosuggests.md +4 -4
  15. package/dist/docs/components/avatar.md +7 -7
  16. package/dist/docs/components/banner.md +2 -2
  17. package/dist/docs/components/barCharts.md +173 -173
  18. package/dist/docs/components/barList.md +19 -41
  19. package/dist/docs/components/basicMap.md +1 -1
  20. package/dist/docs/components/bottomSheet.md +74 -74
  21. package/dist/docs/components/button.md +161 -71
  22. package/dist/docs/components/buttonToolbar.md +3 -3
  23. package/dist/docs/components/calendarStripe.md +71 -123
  24. package/dist/docs/components/card.md +4 -4
  25. package/dist/docs/components/carousel.md +1 -1
  26. package/dist/docs/components/chartColors.md +1 -1
  27. package/dist/docs/components/chartsGettingStarted.md +1 -1
  28. package/dist/docs/components/chat.md +2 -2
  29. package/dist/docs/components/checkbox.md +56 -131
  30. package/dist/docs/components/clearableInput.md +23 -127
  31. package/dist/docs/components/collapse.md +14 -16
  32. package/dist/docs/components/composedCharts.md +31 -31
  33. package/dist/docs/components/contentLoader.md +125 -122
  34. package/dist/docs/components/dataTabs.md +103 -93
  35. package/dist/docs/components/datepickers.md +734 -764
  36. package/dist/docs/components/dialogs.md +299 -186
  37. package/dist/docs/components/divider.md +4 -4
  38. package/dist/docs/components/dropdowns.md +4555 -4498
  39. package/dist/docs/components/editableContent.md +97 -97
  40. package/dist/docs/components/expander.md +56 -56
  41. package/dist/docs/components/fade.md +41 -41
  42. package/dist/docs/components/fadeExpander.md +4 -4
  43. package/dist/docs/components/fadeUp.md +8 -10
  44. package/dist/docs/components/feedback.md +22 -21
  45. package/dist/docs/components/filePickers.md +25 -25
  46. package/dist/docs/components/formLabel.md +5 -7
  47. package/dist/docs/components/groupedItemList.md +37 -37
  48. package/dist/docs/components/iconList.md +4 -4
  49. package/dist/docs/components/imagePreloader.md +6 -6
  50. package/dist/docs/components/labeledElement.md +4 -3
  51. package/dist/docs/components/licensePlate.md +2 -2
  52. package/dist/docs/components/lineCharts.md +58 -58
  53. package/dist/docs/components/listMenu.md +63 -41
  54. package/dist/docs/components/loadMore.md +17 -17
  55. package/dist/docs/components/mainNavigation.md +1 -1
  56. package/dist/docs/components/mapCircle.md +1 -1
  57. package/dist/docs/components/mapCluster.md +1 -1
  58. package/dist/docs/components/mapContext.md +1 -1
  59. package/dist/docs/components/mapDraggableMarker.md +1 -1
  60. package/dist/docs/components/mapGettingStarted.md +1 -1
  61. package/dist/docs/components/mapInfoBubble.md +1 -1
  62. package/dist/docs/components/mapLayerGroup.md +1 -1
  63. package/dist/docs/components/mapMarker.md +339 -345
  64. package/dist/docs/components/mapPolygon.md +16 -20
  65. package/dist/docs/components/mapRoute.md +14 -20
  66. package/dist/docs/components/mapRouteGenerator.md +1 -1
  67. package/dist/docs/components/mapSettings.md +263 -274
  68. package/dist/docs/components/mapUtils.md +3 -5
  69. package/dist/docs/components/multiselects.md +1 -1
  70. package/dist/docs/components/noData.md +11 -11
  71. package/dist/docs/components/notifications.md +1 -1
  72. package/dist/docs/components/numbercontrol.md +39 -37
  73. package/dist/docs/components/onboarding.md +18 -38
  74. package/dist/docs/components/page.md +16 -16
  75. package/dist/docs/components/pager.md +8 -8
  76. package/dist/docs/components/pieCharts.md +124 -124
  77. package/dist/docs/components/popover.md +37 -53
  78. package/dist/docs/components/position.md +4 -4
  79. package/dist/docs/components/radialBarCharts.md +506 -506
  80. package/dist/docs/components/radiobutton.md +209 -191
  81. package/dist/docs/components/releaseNotes.md +9 -3
  82. package/dist/docs/components/resizer.md +7 -8
  83. package/dist/docs/components/responsiveColumnStripe.md +11 -11
  84. package/dist/docs/components/responsiveVideo.md +5 -5
  85. package/dist/docs/components/rioglyph.md +11 -11
  86. package/dist/docs/components/rules.md +118 -92
  87. package/dist/docs/components/saveableInput.md +366 -356
  88. package/dist/docs/components/selects.md +9996 -15
  89. package/dist/docs/components/sidebar.md +22 -23
  90. package/dist/docs/components/sliders.md +26 -26
  91. package/dist/docs/components/smoothScrollbars.md +61 -25
  92. package/dist/docs/components/spinners.md +32 -30
  93. package/dist/docs/components/states.md +236 -245
  94. package/dist/docs/components/statsWidgets.md +37 -28
  95. package/dist/docs/components/statusBar.md +22 -22
  96. package/dist/docs/components/stepButton.md +2 -2
  97. package/dist/docs/components/steppedProgressBars.md +45 -45
  98. package/dist/docs/components/subNavigation.md +3 -3
  99. package/dist/docs/components/supportMarker.md +1 -1
  100. package/dist/docs/components/svgImage.md +2 -38
  101. package/dist/docs/components/switch.md +11 -11
  102. package/dist/docs/components/tables.md +1 -1
  103. package/dist/docs/components/tagManager.md +40 -40
  104. package/dist/docs/components/tags.md +21 -20
  105. package/dist/docs/components/teaser.md +22 -23
  106. package/dist/docs/components/timeline.md +1 -1
  107. package/dist/docs/components/timepicker.md +17 -13
  108. package/dist/docs/components/toggleButton.md +65 -29
  109. package/dist/docs/components/tooltip.md +27 -50
  110. package/dist/docs/components/virtualList.md +75 -75
  111. package/dist/docs/foundations.md +167 -167
  112. package/dist/docs/start/changelog.md +23 -1
  113. package/dist/docs/start/goodtoknow.md +1 -1
  114. package/dist/docs/start/guidelines/color-combinations.md +1 -1
  115. package/dist/docs/start/guidelines/custom-css.md +1 -1
  116. package/dist/docs/start/guidelines/custom-rioglyph.md +1 -1
  117. package/dist/docs/start/guidelines/formatting.md +1 -1
  118. package/dist/docs/start/guidelines/iframe.md +80 -27
  119. package/dist/docs/start/guidelines/obfuscate-data.md +1 -1
  120. package/dist/docs/start/guidelines/print-css.md +1 -1
  121. package/dist/docs/start/guidelines/spinner.md +81 -81
  122. package/dist/docs/start/guidelines/supported-browsers.md +1 -1
  123. package/dist/docs/start/guidelines/writing.md +1 -1
  124. package/dist/docs/start/howto.md +9 -9
  125. package/dist/docs/start/intro.md +1 -1
  126. package/dist/docs/start/responsiveness.md +1 -1
  127. package/dist/docs/templates/common-table.md +11 -11
  128. package/dist/docs/templates/detail-views.md +2 -2
  129. package/dist/docs/templates/expandable-details.md +1 -1
  130. package/dist/docs/templates/feature-cards.md +55 -55
  131. package/dist/docs/templates/form-summary.md +22 -22
  132. package/dist/docs/templates/form-toggle.md +1 -1
  133. package/dist/docs/templates/list-blocks.md +197 -197
  134. package/dist/docs/templates/loading-progress.md +1 -1
  135. package/dist/docs/templates/options-panel.md +1 -1
  136. package/dist/docs/templates/panel-variants.md +1 -1
  137. package/dist/docs/templates/progress-cards.md +1 -1
  138. package/dist/docs/templates/progress-success.md +1 -1
  139. package/dist/docs/templates/settings-form.md +23 -23
  140. package/dist/docs/templates/stats-blocks.md +41 -41
  141. package/dist/docs/templates/table-panel.md +1 -1
  142. package/dist/docs/templates/table-row-animation.md +1 -1
  143. package/dist/docs/templates/usage-cards.md +1 -1
  144. package/dist/docs/utilities/deviceUtils.md +6 -3
  145. package/dist/docs/utilities/featureToggles.md +1 -1
  146. package/dist/docs/utilities/fuelTypeUtils.md +1 -1
  147. package/dist/docs/utilities/routeUtils.md +59 -23
  148. package/dist/docs/utilities/useAfterMount.md +1 -1
  149. package/dist/docs/utilities/useAutoAnimate.md +1 -1
  150. package/dist/docs/utilities/useAverage.md +1 -1
  151. package/dist/docs/utilities/useClickOutside.md +1 -1
  152. package/dist/docs/utilities/useClipboard.md +2 -2
  153. package/dist/docs/utilities/useCount.md +1 -1
  154. package/dist/docs/utilities/useDarkMode.md +1 -1
  155. package/dist/docs/utilities/useDebugInfo.md +4 -4
  156. package/dist/docs/utilities/useEffectOnce.md +1 -1
  157. package/dist/docs/utilities/useElapsedTime.md +1 -1
  158. package/dist/docs/utilities/useElementSize.md +1 -1
  159. package/dist/docs/utilities/useEsc.md +1 -1
  160. package/dist/docs/utilities/useEvent.md +1 -1
  161. package/dist/docs/utilities/useFocusTrap.md +1 -1
  162. package/dist/docs/utilities/useFullscreen.md +1 -1
  163. package/dist/docs/utilities/useHover.md +1 -1
  164. package/dist/docs/utilities/useIncomingPostMessages.md +1 -1
  165. package/dist/docs/utilities/useInterval.md +1 -1
  166. package/dist/docs/utilities/useIsFocusWithin.md +1 -1
  167. package/dist/docs/utilities/useKey.md +7 -5
  168. package/dist/docs/utilities/useLocalStorage.md +1 -1
  169. package/dist/docs/utilities/useLocationSuggestions.md +1 -1
  170. package/dist/docs/utilities/useMax.md +1 -1
  171. package/dist/docs/utilities/useMin.md +1 -1
  172. package/dist/docs/utilities/useMutationObserver.md +1 -1
  173. package/dist/docs/utilities/useOnScreen.md +1 -1
  174. package/dist/docs/utilities/useOnlineStatus.md +1 -1
  175. package/dist/docs/utilities/usePostMessage.md +58 -2
  176. package/dist/docs/utilities/usePostMessageSender.md +1 -1
  177. package/dist/docs/utilities/usePrevious.md +1 -1
  178. package/dist/docs/utilities/useResizeObserver.md +1 -1
  179. package/dist/docs/utilities/useScrollPosition.md +1 -1
  180. package/dist/docs/utilities/useSearch.md +1 -1
  181. package/dist/docs/utilities/useSorting.md +1 -1
  182. package/dist/docs/utilities/useStateWithValidation.md +1 -1
  183. package/dist/docs/utilities/useSum.md +1 -1
  184. package/dist/docs/utilities/useTableExport.md +54 -54
  185. package/dist/docs/utilities/useTableSelection.md +93 -93
  186. package/dist/docs/utilities/useTimeout.md +1 -1
  187. package/dist/docs/utilities/useToggle.md +1 -1
  188. package/dist/docs/utilities/useWindowResize.md +1 -1
  189. package/dist/index.mjs +8 -8
  190. package/dist/version.json +2 -2
  191. package/package.json +6 -6
@@ -3,7 +3,7 @@
3
3
  *Category:* Components
4
4
  *Section:* Map
5
5
  *Source:* https://uikit.developers.rio.cloud/#components/mapSettings
6
- *Captured:* 2026-01-07T12:12:12.746Z
6
+ *Captured:* 2026-02-03T14:05:22.576Z
7
7
 
8
8
  ## Map settings
9
9
 
@@ -99,7 +99,6 @@ import { isEqual, without } from 'es-toolkit/compat';
99
99
  import classNames from 'classnames';
100
100
 
101
101
  import Notification from '@rio-cloud/rio-uikit/Notification';
102
- // biome-ignore lint/suspicious/noShadowRestrictedNames: <explanation>
103
102
  import Map from '@rio-cloud/rio-uikit/Map';
104
103
  import Polygon from '@rio-cloud/rio-uikit/Polygon';
105
104
  import Route from '@rio-cloud/rio-uikit/Route';
@@ -108,7 +107,7 @@ import Marker from '@rio-cloud/rio-uikit/Marker';
108
107
  import InfoBubble from '@rio-cloud/rio-uikit/InfoBubble';
109
108
  import SingleMapMarker from '@rio-cloud/rio-uikit/SingleMapMarker';
110
109
  import ClusterMapMarker from '@rio-cloud/rio-uikit/ClusterMapMarker';
111
- import MarkerLayer from '@rio-cloud/rio-uikit/MarkerLayer';
110
+ import MarkerLayer, { type SimpleClusterTheme } from '@rio-cloud/rio-uikit/MarkerLayer';
112
111
  import EventUtils, { type EventListenerMap } from '@rio-cloud/rio-uikit/EventUtils';
113
112
  import MapSettings from '@rio-cloud/rio-uikit/MapSettings';
114
113
  import MapSettingsItem from '@rio-cloud/rio-uikit/MapSettingsItem';
@@ -187,7 +186,7 @@ const languageOptions: SelectOption[] = [
187
186
  ];
188
187
 
189
188
  const addOrRemove = (layers: string[], value: string) =>
190
- layers.includes(value) ? without(layers, [value]) : [...layers, value];
189
+ layers.includes(value) ? without(layers, value) : [...layers, value];
191
190
 
192
191
  const FullSettingsExample = () => {
193
192
  const [mapType, setMapType] = useState<MapType | undefined>(Map.TYPE_DEFAULT);
@@ -320,7 +319,7 @@ const FullSettingsExample = () => {
320
319
 
321
320
  const handleResetMapPosition = () => setCenter(initialPosition);
322
321
 
323
- const simpleTheme = useMemo(
322
+ const simpleTheme: SimpleClusterTheme = useMemo(
324
323
  () => ({
325
324
  getNoisePresentation: ({ name, type }: Asset) => <SingleMapMarker iconNames={[type]} name={name} />,
326
325
  getClusterPresentation: (assets: Asset[]) => (
@@ -336,7 +335,7 @@ const FullSettingsExample = () => {
336
335
 
337
336
  const eventListenerMap: EventListenerMap = {
338
337
  [EventUtils.MAP_VIEW_CHANGE_END]: (event: MapEvent) => {
339
- const target = event.currentTarget;
338
+ const target = event.currentTarget as H.Map;
340
339
  const api = mapApiRef.current;
341
340
 
342
341
  const lookAtData = target.getViewModel().getLookAtData();
@@ -362,283 +361,273 @@ const FullSettingsExample = () => {
362
361
  };
363
362
 
364
363
  return (
365
- <>
366
- <div className='display-flex-lg gap-15'>
367
- <div className='flex-1-1'>
368
- <Map
369
- mapType={mapType}
370
- mapLayer={mapLayer}
371
- showCluster={showCluster}
372
- credentials={UIKIT_DEMO_CREDENTIALS_ARE_NOT_ALLOWED_IN_PROD_ENVIRONMENT}
373
- eventListenerMap={eventListenerMap}
374
- center={center}
375
- showScaleBar
376
- zoom={currentZoom}
377
- onZoomIn={handleZoomButtons}
378
- onZoomOut={handleZoomButtons}
379
- minZoom={minZoom}
380
- maxZoom={maxZoom}
381
- height={500}
382
- onMapTypeChange={handleMapTypeChanged}
383
- onMapLayerChange={handleMapLayerChanged}
384
- onShowClusterChange={handleClusterChanged}
385
- onIncidentsChange={setIncidents}
386
- enableWebGL={enableWebGL}
387
- enableDevicePixelRatio={enableDevicePixelRatio}
388
- zoomAnimation={false}
389
- language={language}
390
- mapSettings={
391
- <MapSettings
392
- options={[
393
- <MapTypeSettings
394
- key='mapTypeSettings'
395
- tooltip='Change map type'
396
- dropdownHeaderText='Map views'
397
- defaultTypeLabel='Default view'
398
- truckTypeLabel='Truck view'
399
- terrainTypeLabel='Terrain view'
400
- satelliteTypeLabel='Satellite view'
401
- nightTypeLabel='Night view'
402
- />,
403
- <MapClusterSettings
404
- key='mapClusterSettings'
405
- tooltip='Enable or disable marker cluster'
406
- dropdownHeaderText='Vehicle cluster'
407
- clusterEnabledLabel='Enable cluster'
408
- clusterDisabledLabel='Disable cluster'
409
- />,
410
- <MapLayerSettings
411
- key='mapLayerSettingsTraffic'
412
- layers={trafficLayers}
413
- activeLayers={activeTrafficLayers}
414
- tooltip='Toggle various traffic overlays'
415
- />,
416
- <MapAdditionalLayerSettings
417
- key='mapLayerSettingsPoi'
418
- layers={layers}
419
- activeLayers={activePoiLayers}
420
- tooltip='Toggle various POI layers'
421
- />,
422
- <MapBoundingBoxButton
423
- key='mapBoundingBoxButton'
424
- onToggle={handleToggleBoundingBox}
425
- tooltip='Zoom to current Element'
426
- />,
427
- <MapCenterMarkerButton
428
- key='mapCenterMarkerButton'
429
- onToggle={handleToggleCenterMarker}
430
- tooltip='Center current Marker'
431
- />,
432
- <MapLockMarkerButton key='mapLockMarkerButton' />,
433
- ]}
434
- />
435
- }
436
- >
437
- {(api: MapApi) => {
438
- mapApiRef.current = api;
439
- console.log('render example map elements');
440
-
441
- // if needed, render cluster or marker layer here
442
- return (
443
- <>
444
- <Marker
445
- position={markerPosition}
446
- icon={
447
- <SingleMapMarker iconNames={['truck']} markerColor='bg-map-marker-asset' />
448
- }
449
- />
450
- <Polygon
451
- points={polygonPoints}
452
- style={{ strokeColor: STROKE_COLOR, fillColor: FILL_COLOR }}
453
- />
454
- <Route
455
- hasArrows
456
- positions={routePoints}
457
- startIcon={
458
- <SingleMapMarker iconNames={['start']} markerColor='bg-map-marker-route' />
459
- }
460
- endIcon={
461
- <SingleMapMarker iconNames={['finish']} markerColor='bg-map-marker-route' />
462
- }
463
- />
464
- <Circle
465
- position={circlePosition}
466
- radius={5000}
467
- style={{ strokeColor: STROKE_COLOR, fillColor: FILL_COLOR }}
468
- precision={30}
469
- />
470
- <Marker
471
- position={{ lat: 48.56, lng: 11.38 }}
472
- icon={
473
- <SingleMapMarker
474
- iconNames={['truck']}
475
- markerColor='bg-map-marker-asset'
476
- active
477
- />
478
- }
479
- />
480
- <Marker
481
- position={{ lat: 48.56, lng: 11.48 }}
482
- icon={
483
- <SingleMapMarker
484
- iconNames={['factory']}
485
- markerColor='bg-map-marker-poi'
486
- active
487
- />
488
- }
489
- />
490
- <Marker
491
- position={{ lat: 48.56, lng: 11.58 }}
492
- icon={
493
- <SingleMapMarker
494
- iconNames={['geofence']}
495
- markerColor='bg-map-marker-geofence'
496
- active
497
- />
498
- }
499
- />
500
- <Marker
501
- position={{ lat: 48.56, lng: 11.68 }}
502
- icon={
503
- <SingleMapMarker
504
- iconNames={['route']}
505
- markerColor='bg-map-marker-route'
506
- active
507
- />
508
- }
509
- />
510
- <Marker
511
- position={{ lat: 48.45, lng: 11.38 }}
512
- icon={
513
- <SingleMapMarker iconNames={['truck']} markerColor='bg-map-marker-asset' />
514
- }
515
- />
516
- <Marker
517
- position={{ lat: 48.45, lng: 11.48 }}
518
- icon={
519
- <SingleMapMarker iconNames={['factory']} markerColor='bg-map-marker-poi' />
520
- }
521
- />
522
- <Marker
523
- position={{ lat: 48.45, lng: 11.58 }}
524
- icon={
525
- <SingleMapMarker
526
- iconNames={['geofence']}
527
- markerColor='bg-map-marker-geofence'
528
- />
529
- }
530
- />
531
- <Marker
532
- position={{ lat: 48.45, lng: 11.68 }}
533
- icon={
534
- <SingleMapMarker iconNames={['route']} markerColor='bg-map-marker-route' />
535
- }
536
- />
537
- <MarkerLayer data={clusterData} simpleTheme={simpleTheme} eps={500} />
538
- </>
539
- );
540
- }}
541
- </Map>
542
-
543
- <div className='from-group display-flex gap-15 flex-wrap margin-top-15'>
544
- <div className='min-width-150'>
545
- <label className='margin-0'>Map Type</label>
546
- <Select
547
- placeholder='Please select...'
548
- options={mapTypeOptions}
549
- value={mapTypeOptionId ? [mapTypeOptionId] : []}
550
- onChange={handleChangeMapType}
551
- />
552
- </div>
553
- <div className='min-width-200'>
554
- <label className='margin-0'>Map Layer</label>
555
- <Multiselect
556
- placeholder='Please select...'
557
- options={mapLayerOptions}
558
- value={mapLayerOptionIds}
559
- onChange={handleChangeMapLayers}
560
- />
561
- </div>
562
- <div className='min-width-150'>
563
- <label className='margin-0'>Language</label>
564
- <Select options={languageOptions} value={[language]} onChange={handleChangeLanguage} />
565
- </div>
566
- <div className='width-100'>
567
- <label className='margin-0'>Zoom</label>
568
- <NumberControl min={1} max={19} value={currentZoom} step={1} onChange={handleChangeZoom} />
569
- </div>
570
- <div className='width-100'>
571
- <label className='margin-0'>Min zoom</label>
572
- <NumberControl min={1} max={19} value={minZoom} step={1} onChange={handleChangeMinZoom} />
573
- </div>
574
- <div className='width-100'>
575
- <label className='margin-0'>Max zoom</label>
576
- <NumberControl min={1} max={20} value={maxZoom} step={1} onChange={handleChangeMaxZoom} />
577
- </div>
578
- <div className='min-width-100'>
579
- <label className='margin-0'>Map center</label>
580
- <div>
581
- <Button onClick={handleResetMapPosition}>Reset position</Button>
582
- </div>
364
+ <div className='display-flex-lg gap-15'>
365
+ <div className='flex-1-1'>
366
+ <Map
367
+ mapType={mapType}
368
+ mapLayer={mapLayer}
369
+ showCluster={showCluster}
370
+ credentials={UIKIT_DEMO_CREDENTIALS_ARE_NOT_ALLOWED_IN_PROD_ENVIRONMENT}
371
+ eventListenerMap={eventListenerMap}
372
+ center={center}
373
+ showScaleBar
374
+ zoom={currentZoom}
375
+ onZoomIn={handleZoomButtons}
376
+ onZoomOut={handleZoomButtons}
377
+ minZoom={minZoom}
378
+ maxZoom={maxZoom}
379
+ height={500}
380
+ onMapTypeChange={handleMapTypeChanged}
381
+ onMapLayerChange={handleMapLayerChanged}
382
+ onShowClusterChange={handleClusterChanged}
383
+ onIncidentsChange={setIncidents}
384
+ enableWebGL={enableWebGL}
385
+ enableDevicePixelRatio={enableDevicePixelRatio}
386
+ zoomAnimation={false}
387
+ language={language}
388
+ mapSettings={
389
+ <MapSettings
390
+ options={[
391
+ <MapTypeSettings
392
+ key='mapTypeSettings'
393
+ tooltip='Change map type'
394
+ dropdownHeaderText='Map views'
395
+ defaultTypeLabel='Default view'
396
+ truckTypeLabel='Truck view'
397
+ terrainTypeLabel='Terrain view'
398
+ satelliteTypeLabel='Satellite view'
399
+ nightTypeLabel='Night view'
400
+ />,
401
+ <MapClusterSettings
402
+ key='mapClusterSettings'
403
+ tooltip='Enable or disable marker cluster'
404
+ dropdownHeaderText='Vehicle cluster'
405
+ clusterEnabledLabel='Enable cluster'
406
+ clusterDisabledLabel='Disable cluster'
407
+ />,
408
+ <MapLayerSettings
409
+ key='mapLayerSettingsTraffic'
410
+ layers={trafficLayers}
411
+ activeLayers={activeTrafficLayers}
412
+ tooltip='Toggle various traffic overlays'
413
+ />,
414
+ <MapAdditionalLayerSettings
415
+ key='mapLayerSettingsPoi'
416
+ layers={layers}
417
+ activeLayers={activePoiLayers}
418
+ tooltip='Toggle various POI layers'
419
+ />,
420
+ <MapBoundingBoxButton
421
+ key='mapBoundingBoxButton'
422
+ onToggle={handleToggleBoundingBox}
423
+ tooltip='Zoom to current Element'
424
+ />,
425
+ <MapCenterMarkerButton
426
+ key='mapCenterMarkerButton'
427
+ onToggle={handleToggleCenterMarker}
428
+ tooltip='Center current Marker'
429
+ />,
430
+ <MapLockMarkerButton key='mapLockMarkerButton' />,
431
+ ]}
432
+ />
433
+ }
434
+ >
435
+ {(api: MapApi) => {
436
+ mapApiRef.current = api;
437
+ console.log('render example map elements');
438
+
439
+ // if needed, render cluster or marker layer here
440
+ return (
441
+ <>
442
+ <Marker
443
+ position={markerPosition}
444
+ icon={<SingleMapMarker iconNames={['truck']} markerColor='bg-map-marker-asset' />}
445
+ />
446
+ <Polygon
447
+ points={polygonPoints}
448
+ style={{ strokeColor: STROKE_COLOR, fillColor: FILL_COLOR } as H.map.SpatialStyle}
449
+ />
450
+ <Route
451
+ hasArrows
452
+ positions={routePoints}
453
+ startIcon={
454
+ <SingleMapMarker iconNames={['start']} markerColor='bg-map-marker-route' />
455
+ }
456
+ endIcon={
457
+ <SingleMapMarker iconNames={['finish']} markerColor='bg-map-marker-route' />
458
+ }
459
+ />
460
+ <Circle
461
+ position={circlePosition}
462
+ radius={5000}
463
+ style={{ strokeColor: STROKE_COLOR, fillColor: FILL_COLOR } as H.map.SpatialStyle}
464
+ precision={30}
465
+ />
466
+ <Marker
467
+ position={{ lat: 48.56, lng: 11.38 }}
468
+ icon={
469
+ <SingleMapMarker
470
+ iconNames={['truck']}
471
+ markerColor='bg-map-marker-asset'
472
+ active
473
+ />
474
+ }
475
+ />
476
+ <Marker
477
+ position={{ lat: 48.56, lng: 11.48 }}
478
+ icon={
479
+ <SingleMapMarker
480
+ iconNames={['factory']}
481
+ markerColor='bg-map-marker-poi'
482
+ active
483
+ />
484
+ }
485
+ />
486
+ <Marker
487
+ position={{ lat: 48.56, lng: 11.58 }}
488
+ icon={
489
+ <SingleMapMarker
490
+ iconNames={['geofence']}
491
+ markerColor='bg-map-marker-geofence'
492
+ active
493
+ />
494
+ }
495
+ />
496
+ <Marker
497
+ position={{ lat: 48.56, lng: 11.68 }}
498
+ icon={
499
+ <SingleMapMarker
500
+ iconNames={['route']}
501
+ markerColor='bg-map-marker-route'
502
+ active
503
+ />
504
+ }
505
+ />
506
+ <Marker
507
+ position={{ lat: 48.45, lng: 11.38 }}
508
+ icon={<SingleMapMarker iconNames={['truck']} markerColor='bg-map-marker-asset' />}
509
+ />
510
+ <Marker
511
+ position={{ lat: 48.45, lng: 11.48 }}
512
+ icon={<SingleMapMarker iconNames={['factory']} markerColor='bg-map-marker-poi' />}
513
+ />
514
+ <Marker
515
+ position={{ lat: 48.45, lng: 11.58 }}
516
+ icon={
517
+ <SingleMapMarker
518
+ iconNames={['geofence']}
519
+ markerColor='bg-map-marker-geofence'
520
+ />
521
+ }
522
+ />
523
+ <Marker
524
+ position={{ lat: 48.45, lng: 11.68 }}
525
+ icon={<SingleMapMarker iconNames={['route']} markerColor='bg-map-marker-route' />}
526
+ />
527
+ <MarkerLayer data={clusterData} simpleTheme={simpleTheme} eps={500} />
528
+ </>
529
+ );
530
+ }}
531
+ </Map>
532
+
533
+ <div className='from-group display-flex gap-15 flex-wrap margin-top-15'>
534
+ <div className='min-width-150'>
535
+ <label className='margin-0'>Map Type</label>
536
+ <Select
537
+ placeholder='Please select...'
538
+ options={mapTypeOptions}
539
+ value={mapTypeOptionId ? [mapTypeOptionId] : []}
540
+ onChange={handleChangeMapType}
541
+ />
542
+ </div>
543
+ <div className='min-width-200'>
544
+ <label className='margin-0'>Map Layer</label>
545
+ <Multiselect
546
+ placeholder='Please select...'
547
+ options={mapLayerOptions}
548
+ value={mapLayerOptionIds}
549
+ onChange={handleChangeMapLayers}
550
+ />
551
+ </div>
552
+ <div className='min-width-150'>
553
+ <label className='margin-0'>Language</label>
554
+ <Select options={languageOptions} value={[language]} onChange={handleChangeLanguage} />
555
+ </div>
556
+ <div className='width-100'>
557
+ <label className='margin-0'>Zoom</label>
558
+ <NumberControl min={1} max={19} value={currentZoom} step={1} onChange={handleChangeZoom} />
559
+ </div>
560
+ <div className='width-100'>
561
+ <label className='margin-0'>Min zoom</label>
562
+ <NumberControl min={1} max={19} value={minZoom} step={1} onChange={handleChangeMinZoom} />
563
+ </div>
564
+ <div className='width-100'>
565
+ <label className='margin-0'>Max zoom</label>
566
+ <NumberControl min={1} max={20} value={maxZoom} step={1} onChange={handleChangeMaxZoom} />
567
+ </div>
568
+ <div className='min-width-100'>
569
+ <label className='margin-0'>Map center</label>
570
+ <div>
571
+ <Button onClick={handleResetMapPosition}>Reset position</Button>
583
572
  </div>
584
- <div className='min-width-100'>
585
- <label className='margin-0'>Cluster</label>
573
+ </div>
574
+ <div className='min-width-100'>
575
+ <label className='margin-0'>Cluster</label>
576
+ <Checkbox
577
+ checked={showClusterOption}
578
+ onClick={handleChangeCluster}
579
+ className='checkbox padding-y-5'
580
+ >
581
+ Show cluster
582
+ </Checkbox>
583
+ </div>
584
+ <div className='min-width-200'>
585
+ <label className='margin-0'>Rendering</label>
586
+ <div className='display-flex gap-20'>
586
587
  <Checkbox
587
- checked={showClusterOption}
588
- onClick={handleChangeCluster}
588
+ checked={enableWebGL}
589
+ onClick={handleToggleWebGL}
589
590
  className='checkbox padding-y-5'
590
591
  >
591
- Show cluster
592
+ WebGL vector tiles
592
593
  </Checkbox>
593
594
  </div>
594
- <div className='min-width-200'>
595
- <label className='margin-0'>Rendering</label>
596
- <div className='display-flex gap-20'>
597
- <Checkbox
598
- checked={enableWebGL}
599
- onClick={handleToggleWebGL}
600
- className='checkbox padding-y-5'
601
- >
602
- WebGL vector tiles
603
- </Checkbox>
604
- </div>
605
- <div className='display-flex gap-20'>
606
- <Checkbox
607
- checked={enableDevicePixelRatio}
608
- onClick={handleToggleDevicePixelRatio}
609
- className='checkbox padding-y-5'
610
- >
611
- Use device pixel ratio
612
- </Checkbox>
613
- </div>
595
+ <div className='display-flex gap-20'>
596
+ <Checkbox
597
+ checked={enableDevicePixelRatio}
598
+ onClick={handleToggleDevicePixelRatio}
599
+ className='checkbox padding-y-5'
600
+ >
601
+ Use device pixel ratio
602
+ </Checkbox>
614
603
  </div>
615
- <div className='min-width-200'>
616
- <label className='margin-0'>Map center</label>
617
- <div>
618
- <Position latitude={center.lat} longitude={center.lng} />
619
- </div>
604
+ </div>
605
+ <div className='min-width-200'>
606
+ <label className='margin-0'>Map center</label>
607
+ <div>
608
+ <Position latitude={center.lat} longitude={center.lng} />
620
609
  </div>
621
610
  </div>
622
611
  </div>
623
-
624
- {mapLayerOptionIds.includes(MAP_LAYER_INCIDENTS) && (
625
- <IncidentsList
626
- mapLayer={mapLayerOptionIds}
627
- incidents={incidents}
628
- api={mapApiRef.current}
629
- onIncidentSelect={(pos: MapPosition) => {
630
- // at zoom level 16 the incident cluster is dissolved
631
- setCurrentZoom(16);
632
- setCenter(pos);
633
- }}
634
- onPositionChange={(pos: MapPosition, zoom: number) => {
635
- setCenter(pos);
636
- setCurrentZoom(zoom);
637
- }}
638
- />
639
- )}
640
612
  </div>
641
- </>
613
+
614
+ {mapLayerOptionIds.includes(MAP_LAYER_INCIDENTS) && (
615
+ <IncidentsList
616
+ mapLayer={mapLayerOptionIds}
617
+ incidents={incidents}
618
+ api={mapApiRef.current}
619
+ onIncidentSelect={(pos: MapPosition) => {
620
+ // at zoom level 16 the incident cluster is dissolved
621
+ setCurrentZoom(16);
622
+ setCenter(pos);
623
+ }}
624
+ onPositionChange={(pos: MapPosition, zoom: number) => {
625
+ setCenter(pos);
626
+ setCurrentZoom(zoom);
627
+ }}
628
+ />
629
+ )}
630
+ </div>
642
631
  );
643
632
  };
644
633
 
@@ -698,8 +687,8 @@ const IncidentsList = (props: IncidentsListProps) => {
698
687
  // mapApiRef.current?.map.setCenter(pos, true);
699
688
  // mapApiRef.current?.map.setZoom(16, true);
700
689
 
701
- setPreviousPosition(api?.map.getCenter());
702
- setPreviousZoom(api?.map.getZoom());
690
+ setPreviousPosition(api?.map?.getCenter());
691
+ setPreviousZoom(api?.map?.getZoom());
703
692
 
704
693
  onIncidentSelect(pos);
705
694
  };