@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.
- package/README.md +1 -0
- package/dist/doc-metadata.json +97 -97
- package/dist/docs/components/accentBar.md +5 -5
- package/dist/docs/components/activity.md +7 -7
- package/dist/docs/components/animatedNumber.md +10 -10
- package/dist/docs/components/animatedTextReveal.md +42 -43
- package/dist/docs/components/animations.md +42 -34
- package/dist/docs/components/appHeader.md +20 -35
- package/dist/docs/components/appLayout.md +198 -221
- package/dist/docs/components/appNavigationBar.md +21 -21
- package/dist/docs/components/areaCharts.md +38 -38
- package/dist/docs/components/aspectRatioPlaceholder.md +4 -5
- package/dist/docs/components/assetTree.md +887 -614
- package/dist/docs/components/autosuggests.md +4 -4
- package/dist/docs/components/avatar.md +7 -7
- package/dist/docs/components/banner.md +2 -2
- package/dist/docs/components/barCharts.md +173 -173
- package/dist/docs/components/barList.md +19 -41
- package/dist/docs/components/basicMap.md +1 -1
- package/dist/docs/components/bottomSheet.md +74 -74
- package/dist/docs/components/button.md +161 -71
- package/dist/docs/components/buttonToolbar.md +3 -3
- package/dist/docs/components/calendarStripe.md +71 -123
- package/dist/docs/components/card.md +4 -4
- 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 +56 -131
- package/dist/docs/components/clearableInput.md +23 -127
- package/dist/docs/components/collapse.md +14 -16
- package/dist/docs/components/composedCharts.md +31 -31
- package/dist/docs/components/contentLoader.md +125 -122
- package/dist/docs/components/dataTabs.md +103 -93
- package/dist/docs/components/datepickers.md +734 -764
- package/dist/docs/components/dialogs.md +299 -186
- package/dist/docs/components/divider.md +4 -4
- package/dist/docs/components/dropdowns.md +4555 -4498
- package/dist/docs/components/editableContent.md +97 -97
- package/dist/docs/components/expander.md +56 -56
- package/dist/docs/components/fade.md +41 -41
- package/dist/docs/components/fadeExpander.md +4 -4
- package/dist/docs/components/fadeUp.md +8 -10
- package/dist/docs/components/feedback.md +22 -21
- package/dist/docs/components/filePickers.md +25 -25
- package/dist/docs/components/formLabel.md +5 -7
- package/dist/docs/components/groupedItemList.md +37 -37
- package/dist/docs/components/iconList.md +4 -4
- package/dist/docs/components/imagePreloader.md +6 -6
- package/dist/docs/components/labeledElement.md +4 -3
- package/dist/docs/components/licensePlate.md +2 -2
- package/dist/docs/components/lineCharts.md +58 -58
- package/dist/docs/components/listMenu.md +63 -41
- package/dist/docs/components/loadMore.md +17 -17
- package/dist/docs/components/mainNavigation.md +1 -1
- package/dist/docs/components/mapCircle.md +1 -1
- package/dist/docs/components/mapCluster.md +1 -1
- package/dist/docs/components/mapContext.md +1 -1
- package/dist/docs/components/mapDraggableMarker.md +1 -1
- package/dist/docs/components/mapGettingStarted.md +1 -1
- package/dist/docs/components/mapInfoBubble.md +1 -1
- package/dist/docs/components/mapLayerGroup.md +1 -1
- package/dist/docs/components/mapMarker.md +339 -345
- package/dist/docs/components/mapPolygon.md +16 -20
- package/dist/docs/components/mapRoute.md +14 -20
- package/dist/docs/components/mapRouteGenerator.md +1 -1
- package/dist/docs/components/mapSettings.md +263 -274
- package/dist/docs/components/mapUtils.md +3 -5
- package/dist/docs/components/multiselects.md +1 -1
- package/dist/docs/components/noData.md +11 -11
- package/dist/docs/components/notifications.md +1 -1
- package/dist/docs/components/numbercontrol.md +39 -37
- package/dist/docs/components/onboarding.md +18 -38
- package/dist/docs/components/page.md +16 -16
- package/dist/docs/components/pager.md +8 -8
- package/dist/docs/components/pieCharts.md +124 -124
- package/dist/docs/components/popover.md +37 -53
- package/dist/docs/components/position.md +4 -4
- package/dist/docs/components/radialBarCharts.md +506 -506
- package/dist/docs/components/radiobutton.md +209 -191
- package/dist/docs/components/releaseNotes.md +9 -3
- package/dist/docs/components/resizer.md +7 -8
- package/dist/docs/components/responsiveColumnStripe.md +11 -11
- package/dist/docs/components/responsiveVideo.md +5 -5
- package/dist/docs/components/rioglyph.md +11 -11
- package/dist/docs/components/rules.md +118 -92
- package/dist/docs/components/saveableInput.md +366 -356
- package/dist/docs/components/selects.md +9996 -15
- package/dist/docs/components/sidebar.md +22 -23
- package/dist/docs/components/sliders.md +26 -26
- package/dist/docs/components/smoothScrollbars.md +61 -25
- package/dist/docs/components/spinners.md +32 -30
- package/dist/docs/components/states.md +236 -245
- package/dist/docs/components/statsWidgets.md +37 -28
- package/dist/docs/components/statusBar.md +22 -22
- package/dist/docs/components/stepButton.md +2 -2
- package/dist/docs/components/steppedProgressBars.md +45 -45
- package/dist/docs/components/subNavigation.md +3 -3
- package/dist/docs/components/supportMarker.md +1 -1
- package/dist/docs/components/svgImage.md +2 -38
- package/dist/docs/components/switch.md +11 -11
- package/dist/docs/components/tables.md +1 -1
- package/dist/docs/components/tagManager.md +40 -40
- package/dist/docs/components/tags.md +21 -20
- package/dist/docs/components/teaser.md +22 -23
- package/dist/docs/components/timeline.md +1 -1
- package/dist/docs/components/timepicker.md +17 -13
- package/dist/docs/components/toggleButton.md +65 -29
- package/dist/docs/components/tooltip.md +27 -50
- package/dist/docs/components/virtualList.md +75 -75
- package/dist/docs/foundations.md +167 -167
- package/dist/docs/start/changelog.md +23 -1
- package/dist/docs/start/goodtoknow.md +1 -1
- package/dist/docs/start/guidelines/color-combinations.md +1 -1
- package/dist/docs/start/guidelines/custom-css.md +1 -1
- package/dist/docs/start/guidelines/custom-rioglyph.md +1 -1
- package/dist/docs/start/guidelines/formatting.md +1 -1
- package/dist/docs/start/guidelines/iframe.md +80 -27
- package/dist/docs/start/guidelines/obfuscate-data.md +1 -1
- package/dist/docs/start/guidelines/print-css.md +1 -1
- package/dist/docs/start/guidelines/spinner.md +81 -81
- package/dist/docs/start/guidelines/supported-browsers.md +1 -1
- package/dist/docs/start/guidelines/writing.md +1 -1
- package/dist/docs/start/howto.md +9 -9
- package/dist/docs/start/intro.md +1 -1
- package/dist/docs/start/responsiveness.md +1 -1
- package/dist/docs/templates/common-table.md +11 -11
- package/dist/docs/templates/detail-views.md +2 -2
- package/dist/docs/templates/expandable-details.md +1 -1
- package/dist/docs/templates/feature-cards.md +55 -55
- package/dist/docs/templates/form-summary.md +22 -22
- package/dist/docs/templates/form-toggle.md +1 -1
- package/dist/docs/templates/list-blocks.md +197 -197
- package/dist/docs/templates/loading-progress.md +1 -1
- package/dist/docs/templates/options-panel.md +1 -1
- package/dist/docs/templates/panel-variants.md +1 -1
- package/dist/docs/templates/progress-cards.md +1 -1
- package/dist/docs/templates/progress-success.md +1 -1
- package/dist/docs/templates/settings-form.md +23 -23
- package/dist/docs/templates/stats-blocks.md +41 -41
- package/dist/docs/templates/table-panel.md +1 -1
- package/dist/docs/templates/table-row-animation.md +1 -1
- package/dist/docs/templates/usage-cards.md +1 -1
- package/dist/docs/utilities/deviceUtils.md +6 -3
- package/dist/docs/utilities/featureToggles.md +1 -1
- package/dist/docs/utilities/fuelTypeUtils.md +1 -1
- package/dist/docs/utilities/routeUtils.md +59 -23
- 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/useCount.md +1 -1
- package/dist/docs/utilities/useDarkMode.md +1 -1
- package/dist/docs/utilities/useDebugInfo.md +4 -4
- 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 +7 -5
- 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 +58 -2
- package/dist/docs/utilities/usePostMessageSender.md +1 -1
- package/dist/docs/utilities/usePrevious.md +1 -1
- package/dist/docs/utilities/useResizeObserver.md +1 -1
- package/dist/docs/utilities/useScrollPosition.md +1 -1
- package/dist/docs/utilities/useSearch.md +1 -1
- package/dist/docs/utilities/useSorting.md +1 -1
- package/dist/docs/utilities/useStateWithValidation.md +1 -1
- package/dist/docs/utilities/useSum.md +1 -1
- package/dist/docs/utilities/useTableExport.md +54 -54
- package/dist/docs/utilities/useTableSelection.md +93 -93
- package/dist/docs/utilities/useTimeout.md +1 -1
- package/dist/docs/utilities/useToggle.md +1 -1
- package/dist/docs/utilities/useWindowResize.md +1 -1
- package/dist/index.mjs +8 -8
- package/dist/version.json +2 -2
- 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-
|
|
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,
|
|
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='
|
|
367
|
-
<
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
/>
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
<
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
<
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
<
|
|
571
|
-
|
|
572
|
-
<
|
|
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
|
-
|
|
585
|
-
|
|
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={
|
|
588
|
-
onClick={
|
|
588
|
+
checked={enableWebGL}
|
|
589
|
+
onClick={handleToggleWebGL}
|
|
589
590
|
className='checkbox padding-y-5'
|
|
590
591
|
>
|
|
591
|
-
|
|
592
|
+
WebGL vector tiles
|
|
592
593
|
</Checkbox>
|
|
593
594
|
</div>
|
|
594
|
-
<div className='
|
|
595
|
-
<
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
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
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
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
|
|
702
|
-
setPreviousZoom(api?.map
|
|
690
|
+
setPreviousPosition(api?.map?.getCenter());
|
|
691
|
+
setPreviousZoom(api?.map?.getZoom());
|
|
703
692
|
|
|
704
693
|
onIncidentSelect(pos);
|
|
705
694
|
};
|