@rio-cloud/rio-uikit 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/actionBarItem/ActionBarItem.d.ts +2 -2
- package/components/actionBarItem/ActionBarItem.js.map +1 -1
- package/components/applicationHeader/ApplicationHeader.d.ts +6 -7
- package/components/applicationHeader/ApplicationHeader.js.map +1 -1
- package/components/applicationLayout/SubNavigation.d.ts +7 -0
- package/components/applicationLayout/SubNavigation.js.map +1 -1
- package/components/assetTree/AssetTree.d.ts +7 -0
- package/components/assetTree/AssetTree.js.map +1 -1
- package/components/assetTree/Tree.d.ts +15 -0
- package/components/assetTree/Tree.js.map +1 -1
- package/components/assetTree/TreeIcon.d.ts +30 -0
- package/components/assetTree/TreeIcon.js +16 -0
- package/components/assetTree/TreeIcon.js.map +1 -0
- package/components/assetTree/TreeLeaf.js +22 -22
- package/components/assetTree/TreeLeaf.js.map +1 -1
- package/components/assetTree/TreeNode.js +25 -25
- package/components/assetTree/TreeNode.js.map +1 -1
- package/components/assetTree/TreeSearch.d.ts +2 -0
- package/components/assetTree/TreeSearch.js.map +1 -1
- package/components/barList/BarList.d.ts +26 -0
- package/components/barList/BarList.js.map +1 -1
- package/components/bottomSheet/BottomSheet.d.ts +17 -3
- package/components/bottomSheet/BottomSheet.js.map +1 -1
- package/components/bottomSheet/TimedBottomSheet.d.ts +10 -0
- package/components/bottomSheet/TimedBottomSheet.js.map +1 -1
- package/components/calendarStripe/CalendarStripe.d.ts +1 -1
- package/components/calendarStripe/CalendarStripe.js +34 -36
- package/components/calendarStripe/CalendarStripe.js.map +1 -1
- package/components/charts/Area.d.ts +2 -2
- package/components/charts/Area.js.map +1 -1
- package/components/charts/Line.d.ts +2 -2
- package/components/charts/Line.js.map +1 -1
- package/components/checkbox/Checkbox.d.ts +0 -3
- package/components/checkbox/Checkbox.js.map +1 -1
- package/components/clearableInput/ClearableInput.d.ts +21 -20
- package/components/clearableInput/ClearableInput.js.map +1 -1
- package/components/collapse/Collapse.d.ts +3 -0
- package/components/collapse/Collapse.js +12 -12
- package/components/collapse/Collapse.js.map +1 -1
- package/components/contentLoader/ContentLoader.d.ts +10 -2
- package/components/contentLoader/ContentLoader.js.map +1 -1
- package/components/dataTabs/DataTabs.d.ts +6 -0
- package/components/dataTabs/DataTabs.js.map +1 -1
- package/components/dialog/ConfirmationDialog.d.ts +22 -0
- package/components/dialog/ConfirmationDialog.js.map +1 -1
- package/components/dialog/Dialog.d.ts +13 -1
- package/components/dialog/Dialog.js.map +1 -1
- package/components/dialog/ReleaseNotesDialog.d.ts +3 -3
- package/components/dialog/ReleaseNotesDialog.js.map +1 -1
- package/components/dropdown/ButtonDropdown.d.ts +4 -0
- package/components/dropdown/ButtonDropdown.js +51 -51
- package/components/dropdown/ButtonDropdown.js.map +1 -1
- package/components/dropdown/DropdownSubmenu.d.ts +4 -0
- package/components/dropdown/DropdownSubmenu.js.map +1 -1
- package/components/editableContent/EditableContent.d.ts +6 -0
- package/components/editableContent/EditableContent.js.map +1 -1
- package/components/expander/ExpanderList.d.ts +3 -0
- package/components/expander/ExpanderList.js.map +1 -1
- package/components/expander/ExpanderPanel.d.ts +14 -4
- package/components/expander/ExpanderPanel.js.map +1 -1
- package/components/fade/Fade.d.ts +1 -1
- package/components/fade/Fade.js.map +1 -1
- package/components/filepicker/FilePicker.d.ts +0 -2
- package/components/filepicker/FilePicker.js.map +1 -1
- package/components/groupedItemList/GroupedItemList.d.ts +10 -7
- package/components/groupedItemList/GroupedItemList.js.map +1 -1
- package/components/listMenu/ListMenu.js.map +1 -1
- package/components/listMenu/ListMenuGroup.d.ts +2 -1
- package/components/listMenu/ListMenuGroup.js.map +1 -1
- package/components/map/components/Map.js.map +1 -1
- package/components/map/components/constants.js.map +1 -1
- package/components/map/components/features/ContextMenuItem.d.ts +1 -1
- package/components/map/components/features/ContextMenuItem.js +2 -17
- package/components/map/components/features/ContextMenuItem.js.map +1 -1
- package/components/map/components/features/basics/Polyline.d.ts +4 -1
- package/components/map/components/features/basics/Polyline.js +1 -1
- package/components/map/components/features/basics/Polyline.js.map +1 -1
- package/components/map/components/features/layers/MarkerLayer.d.ts +3 -1
- package/components/map/components/features/layers/MarkerLayer.js.map +1 -1
- package/components/map/components/features/layers/clustering/ClusterLayer.js +1 -1
- package/components/map/components/features/layers/clustering/ClusterLayer.js.map +1 -1
- package/components/map/components/features/layers/clustering/SimpleClusterLayer.d.ts +3 -2
- package/components/map/components/features/layers/clustering/SimpleClusterLayer.js.map +1 -1
- package/components/map/components/features/layers/overlayLayers/RoadRestrictionLayer.js +7 -7
- package/components/map/components/features/layers/overlayLayers/RoadRestrictionLayer.js.map +1 -1
- package/components/map/components/features/layers/overlayLayers/TrafficLayer.js +4 -4
- package/components/map/components/features/layers/overlayLayers/TrafficLayer.js.map +1 -1
- package/components/map/utils/clustering.d.ts +6 -1
- package/components/map/utils/clustering.js +25 -19
- package/components/map/utils/clustering.js.map +1 -1
- package/components/map/utils/rendering.d.ts +1 -1
- package/components/map/utils/rendering.js +23 -23
- package/components/map/utils/rendering.js.map +1 -1
- package/components/menuItems/MenuItem.d.ts +23 -0
- package/components/menuItems/MenuItem.js.map +1 -1
- package/components/notification/Notification.js +4 -4
- package/components/notification/Notification.js.map +1 -1
- package/components/onboarding/OnboardingTip.d.ts +18 -12
- package/components/onboarding/OnboardingTip.js.map +1 -1
- package/components/overlay/OverlayTrigger.d.ts +43 -1
- package/components/overlay/OverlayTrigger.js.map +1 -1
- package/components/pager/Pager.d.ts +3 -0
- package/components/pager/Pager.js.map +1 -1
- package/components/popover/Popover.d.ts +1 -0
- package/components/popover/Popover.js.map +1 -1
- package/components/preloader/ImagePreloader.d.ts +1 -1
- package/components/preloader/ImagePreloader.js.map +1 -1
- package/components/radiobutton/RadioButton.d.ts +9 -5
- package/components/radiobutton/RadioButton.js.map +1 -1
- package/components/releaseNotes/ReleaseNotes.d.ts +0 -3
- package/components/releaseNotes/ReleaseNotes.js.map +1 -1
- package/components/resizer/Resizer.d.ts +17 -3
- package/components/resizer/Resizer.js.map +1 -1
- package/components/rioglyph/Rioglyph.d.ts +20 -8
- package/components/rioglyph/Rioglyph.js.map +1 -1
- package/components/rules/RulesWrapper.js +1 -1
- package/components/rules/RulesWrapper.js.map +1 -1
- package/components/saveableInput/SaveableDateInput.d.ts +20 -2
- package/components/saveableInput/SaveableDateInput.js.map +1 -1
- package/components/saveableInput/SaveableInput.d.ts +10 -2
- package/components/saveableInput/SaveableInput.js.map +1 -1
- package/components/selects/BaseSelectDropdown.js +90 -79
- package/components/selects/BaseSelectDropdown.js.map +1 -1
- package/components/selects/Select.d.ts +5 -0
- package/components/selects/Select.js +94 -94
- package/components/selects/Select.js.map +1 -1
- package/components/sidebars/Sidebar.d.ts +19 -3
- package/components/sidebars/Sidebar.js.map +1 -1
- package/components/slider/RangeSlider.d.ts +15 -0
- package/components/slider/RangeSlider.js.map +1 -1
- package/components/slider/Slider.d.ts +9 -0
- package/components/slider/Slider.js.map +1 -1
- package/components/smoothScrollbars/SmoothScrollbars.d.ts +44 -0
- package/components/smoothScrollbars/SmoothScrollbars.js.map +1 -1
- package/components/spinner/Spinner.d.ts +3 -3
- package/components/spinner/Spinner.js.map +1 -1
- package/components/states/BaseStateProps.d.ts +6 -2
- package/components/states/StateIcon.d.ts +14 -1
- package/components/states/StateIcon.js.map +1 -1
- package/components/statsWidget/StatsWidget.d.ts +2 -0
- package/components/statsWidget/StatsWidget.js.map +1 -1
- package/components/statsWidget/StatsWidgetBody.d.ts +1 -0
- package/components/statsWidget/StatsWidgetBody.js.map +1 -1
- package/components/statsWidget/StatsWidgetNumber.d.ts +2 -0
- package/components/statsWidget/StatsWidgetNumber.js.map +1 -1
- package/components/statusBar/StatusBar.d.ts +2 -31
- package/components/statusBar/StatusBar.js.map +1 -1
- package/components/statusBar/StatusBarIcon.d.ts +2 -2
- package/components/statusBar/StatusBarIcon.js.map +1 -1
- package/components/statusBar/StatusBarLabel.d.ts +2 -2
- package/components/statusBar/StatusBarLabel.js.map +1 -1
- package/components/statusBar/StatusBarProgressBar.d.ts +1 -1
- package/components/statusBar/StatusBarProgressBar.js.map +1 -1
- package/components/statusBar/{StatusBar.types.d.ts → StatusBarProps.d.ts} +44 -2
- package/components/steppedProgressBar/SteppedProgressBar.d.ts +1 -1
- package/components/steppedProgressBar/SteppedProgressBar.js.map +1 -1
- package/components/switch/Switch.d.ts +13 -1
- package/components/switch/Switch.js.map +1 -1
- package/components/table/SortArrowDown.d.ts +1 -1
- package/components/table/SortArrowDown.js.map +1 -1
- package/components/table/SortArrowUp.d.ts +1 -1
- package/components/table/SortArrowUp.js.map +1 -1
- package/components/table/TableSettingsDialog.d.ts +5 -0
- package/components/table/TableSettingsDialog.js +119 -109
- package/components/table/TableSettingsDialog.js.map +1 -1
- package/components/table/TableSettingsDialogFooter.js +9 -9
- package/components/table/TableSettingsDialogFooter.js.map +1 -1
- package/components/table/TableViewToggles.d.ts +21 -1
- package/components/table/TableViewToggles.js.map +1 -1
- package/components/tag/Tag.d.ts +7 -2
- package/components/tag/Tag.js.map +1 -1
- package/components/tagManager/TagManager.d.ts +15 -0
- package/components/tagManager/TagManager.js.map +1 -1
- package/components/tagManager/TagManagerTag.d.ts +9 -0
- package/components/teaser/Teaser.d.ts +57 -55
- package/components/teaser/Teaser.js.map +1 -1
- package/components/teaser/TeaserContainer.d.ts +1 -1
- package/components/teaser/TeaserContainer.js.map +1 -1
- package/components/tooltip/SimpleTooltip.d.ts +22 -4
- package/components/tooltip/SimpleTooltip.js.map +1 -1
- package/components/tooltip/Tooltip.d.ts +22 -2
- package/components/tooltip/Tooltip.js.map +1 -1
- package/components/video/ResponsiveVideo.d.ts +8 -3
- package/components/video/ResponsiveVideo.js.map +1 -1
- package/hooks/useKey.d.ts +1 -1
- package/hooks/useKey.js.map +1 -1
- package/hooks/useOnboarding.d.ts +86 -80
- package/hooks/useOnboarding.js.map +1 -1
- package/hooks/useTableExport.js.map +1 -1
- package/hooks/useUncontrollable.d.ts +1 -1
- package/hooks/useUncontrollable.js.map +1 -1
- package/package.json +12 -14
- package/utils/colorScheme.js +14 -13
- package/utils/colorScheme.js.map +1 -1
- package/utils/cssuseragent.js.map +1 -1
- package/utils/scrollItemIntoView.js +12 -11
- package/utils/scrollItemIntoView.js.map +1 -1
- package/utils/urlFeatureToggles.js +19 -20
- package/utils/urlFeatureToggles.js.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
|
@@ -1,20 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
const r = (t) => {
|
|
3
|
-
const {
|
|
4
|
-
label: e = "",
|
|
5
|
-
disabled: o = !1,
|
|
6
|
-
callback: l = n
|
|
7
|
-
// hasSpinner = false,
|
|
8
|
-
// className = '',
|
|
9
|
-
// labelClassName = '',
|
|
10
|
-
} = t;
|
|
11
|
-
return new H.util.ContextItem({
|
|
12
|
-
label: e,
|
|
13
|
-
disabled: o,
|
|
14
|
-
callback: l
|
|
15
|
-
});
|
|
16
|
-
};
|
|
1
|
+
const e = (t) => null;
|
|
17
2
|
export {
|
|
18
|
-
|
|
3
|
+
e as default
|
|
19
4
|
};
|
|
20
5
|
//# sourceMappingURL=ContextMenuItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenuItem.js","sources":["../../../../../src/components/map/components/features/ContextMenuItem.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"ContextMenuItem.js","sources":["../../../../../src/components/map/components/features/ContextMenuItem.tsx"],"sourcesContent":["import type { Position } from '../../utils/mapTypes';\n\nexport type ContextMenuItemProps = {\n label: string;\n disabled?: boolean;\n callback?: (position: Position) => void;\n hasSpinner?: boolean;\n icon?: string;\n className?: string;\n labelClassName?: string;\n};\n\n// This component is only used as a typed container for props.\n// The actual HERE ContextItem is built inside ContextMenu.tsx.\nconst ContextMenuItem = (_: ContextMenuItemProps) => null;\n\nexport default ContextMenuItem;\n"],"names":["ContextMenuItem","_"],"mappings":"AAcA,MAAMA,IAAkB,CAACC,MAA4B;"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { EventListenerMap } from '../../../utils/eventHandling';
|
|
2
2
|
export declare const MISSING_GEOMETRY_PROPS_EXCEPTION_MSG = "Error in Polyline: Polyline without geometry makes no sense";
|
|
3
3
|
export declare const WRONG_GEOMETRY_PROPS_EXCEPTION_MSG = "Error in Polyline: property geometry must be of type H.geo.LineString";
|
|
4
|
-
export type ArrowStyle =
|
|
4
|
+
export type ArrowStyle = {
|
|
5
|
+
fillColor?: string;
|
|
6
|
+
strokeColor?: string;
|
|
7
|
+
};
|
|
5
8
|
export type PolylineProps = {
|
|
6
9
|
hasArrows?: boolean;
|
|
7
10
|
arrowStyle?: ArrowStyle;
|
|
@@ -27,7 +27,7 @@ const M = "Error in Polyline: Polyline without geometry makes no sense", C = "Er
|
|
|
27
27
|
strokeColor: "rgba(42, 55, 64, 1)",
|
|
28
28
|
lineWidth: 5,
|
|
29
29
|
lineDash: [1.8, 4],
|
|
30
|
-
// @ts-
|
|
30
|
+
// @ts-expect-error-next-line - the types are outdated here
|
|
31
31
|
lineDashImage: H.map.SpatialStyle.DashImage.ARROW,
|
|
32
32
|
...a
|
|
33
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Polyline.js","sources":["../../../../../../src/components/map/components/features/basics/Polyline.tsx"],"sourcesContent":["import { useState, useEffect } from 'react';\n\nimport { useMapContext } from '../../MapContext';\nimport MapException from '../../../exceptions/MapException';\n\nimport { useUpdateEventListenerMap } from '../../../utils/hooks';\nimport { removeEventListenerMap, type EventListenerMap } from '../../../utils/eventHandling';\nimport { isVectorBased } from '../../../utils/rendering';\n\nexport const MISSING_GEOMETRY_PROPS_EXCEPTION_MSG = 'Error in Polyline: Polyline without geometry makes no sense';\nexport const WRONG_GEOMETRY_PROPS_EXCEPTION_MSG =\n 'Error in Polyline: property geometry must be of type H.geo.LineString';\n\nexport type ArrowStyle =
|
|
1
|
+
{"version":3,"file":"Polyline.js","sources":["../../../../../../src/components/map/components/features/basics/Polyline.tsx"],"sourcesContent":["import { useState, useEffect } from 'react';\n\nimport { useMapContext } from '../../MapContext';\nimport MapException from '../../../exceptions/MapException';\n\nimport { useUpdateEventListenerMap } from '../../../utils/hooks';\nimport { removeEventListenerMap, type EventListenerMap } from '../../../utils/eventHandling';\nimport { isVectorBased } from '../../../utils/rendering';\n\nexport const MISSING_GEOMETRY_PROPS_EXCEPTION_MSG = 'Error in Polyline: Polyline without geometry makes no sense';\nexport const WRONG_GEOMETRY_PROPS_EXCEPTION_MSG =\n 'Error in Polyline: property geometry must be of type H.geo.LineString';\n\nexport type ArrowStyle = {\n fillColor?: string;\n strokeColor?: string;\n};\n\nexport type PolylineProps = {\n hasArrows?: boolean;\n arrowStyle?: ArrowStyle;\n geometry: H.geo.LineString;\n style?: H.map.SpatialStyle;\n customData?: object;\n eventListenerMap?: EventListenerMap;\n};\n\nconst Polyline = (props: PolylineProps) => {\n const {\n geometry,\n hasArrows,\n arrowStyle,\n style = H.map.SpatialStyle.DEFAULT_STYLE,\n customData,\n eventListenerMap,\n } = props;\n\n const { api, enableWebGL, baseLayer } = useMapContext();\n\n const [polyline, setPolyline] = useState<H.map.Group>();\n\n if (!geometry) {\n throw new MapException(MISSING_GEOMETRY_PROPS_EXCEPTION_MSG);\n }\n\n if (!(geometry instanceof H.geo.LineString)) {\n throw new MapException(WRONG_GEOMETRY_PROPS_EXCEPTION_MSG);\n }\n\n useEffect(() => {\n const lineGroup = new H.map.Group({ data: customData });\n const line = new H.map.Polyline(geometry, { style });\n\n if (hasArrows) {\n let routeArrows: H.map.Polyline;\n\n if (isVectorBased(enableWebGL, baseLayer)) {\n // WebGL way - Create a patterned polyline\n routeArrows = new H.map.Polyline(geometry, {\n style: {\n strokeColor: 'rgba(42, 55, 64, 1)',\n lineWidth: 5,\n lineDash: [1.8, 4],\n // @ts-expect-error-next-line - the types are outdated here\n lineDashImage: H.map.SpatialStyle.DashImage.ARROW,\n ...arrowStyle,\n },\n });\n } else {\n // Pixel map way - Create a patterned polyline\n const defaultArrowStyle = {\n lineWidth: 2,\n fillColor: 'rgba(42, 55, 64, 1)',\n strokeColor: 'rgba(0, 0, 0, 0.8)',\n lineDash: [0, 4],\n lineTailCap: 'arrow-tail',\n lineHeadCap: 'arrow-head',\n ...arrowStyle,\n };\n\n const arrowLineStyle = new H.map.SpatialStyle({\n lineWidth: 10,\n strokeColor: 'rgba(255, 255, 255, 0)',\n });\n\n routeArrows = new H.map.Polyline(geometry, { style: arrowLineStyle, arrows: defaultArrowStyle });\n }\n\n // create a group that represents the route line and contains\n // outline and the pattern\n lineGroup.addObjects([line, routeArrows]);\n } else {\n lineGroup.addObjects([line]);\n }\n\n api.map?.addObject(lineGroup);\n setPolyline(lineGroup);\n\n return () => {\n removeEventListenerMap(lineGroup);\n\n lineGroup.forEach(singleLine => {\n lineGroup.removeObject(singleLine);\n singleLine.dispose();\n });\n\n if (api.map?.getObjects().includes(lineGroup)) {\n api.map.removeObject(lineGroup);\n }\n lineGroup.dispose();\n };\n }, [api.map, geometry, style, hasArrows, arrowStyle]);\n\n useUpdateEventListenerMap(polyline, eventListenerMap);\n\n return null;\n};\n\nexport default Polyline;\n"],"names":["MISSING_GEOMETRY_PROPS_EXCEPTION_MSG","WRONG_GEOMETRY_PROPS_EXCEPTION_MSG","Polyline","props","geometry","hasArrows","arrowStyle","style","customData","eventListenerMap","api","enableWebGL","baseLayer","useMapContext","polyline","setPolyline","useState","MapException","useEffect","lineGroup","line","routeArrows","isVectorBased","defaultArrowStyle","arrowLineStyle","removeEventListenerMap","singleLine","useUpdateEventListenerMap"],"mappings":";;;;;;AASO,MAAMA,IAAuC,+DACvCC,IACT,yEAgBEC,IAAW,CAACC,MAAyB;AACvC,QAAM;AAAA,IACF,UAAAC;AAAA,IACA,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC,IAAQ,EAAE,IAAI,aAAa;AAAA,IAC3B,YAAAC;AAAA,IACA,kBAAAC;AAAA,EAAA,IACAN,GAEE,EAAE,KAAAO,GAAK,aAAAC,GAAa,WAAAC,EAAA,IAAcC,EAAA,GAElC,CAACC,GAAUC,CAAW,IAAIC,EAAA;AAEhC,MAAI,CAACZ;AACD,UAAM,IAAIa,EAAajB,CAAoC;AAG/D,MAAI,EAAEI,aAAoB,EAAE,IAAI;AAC5B,UAAM,IAAIa,EAAahB,CAAkC;AAG7D,SAAAiB,EAAU,MAAM;AACZ,UAAMC,IAAY,IAAI,EAAE,IAAI,MAAM,EAAE,MAAMX,GAAY,GAChDY,IAAO,IAAI,EAAE,IAAI,SAAShB,GAAU,EAAE,OAAAG,GAAO;AAEnD,QAAIF,GAAW;AACX,UAAIgB;AAEJ,UAAIC,EAAcX,GAAaC,CAAS;AAEpC,QAAAS,IAAc,IAAI,EAAE,IAAI,SAASjB,GAAU;AAAA,UACvC,OAAO;AAAA,YACH,aAAa;AAAA,YACb,WAAW;AAAA,YACX,UAAU,CAAC,KAAK,CAAC;AAAA;AAAA,YAEjB,eAAe,EAAE,IAAI,aAAa,UAAU;AAAA,YAC5C,GAAGE;AAAA,UAAA;AAAA,QACP,CACH;AAAA,WACE;AAEH,cAAMiB,IAAoB;AAAA,UACtB,WAAW;AAAA,UACX,WAAW;AAAA,UACX,aAAa;AAAA,UACb,UAAU,CAAC,GAAG,CAAC;AAAA,UACf,aAAa;AAAA,UACb,aAAa;AAAA,UACb,GAAGjB;AAAA,QAAA,GAGDkB,IAAiB,IAAI,EAAE,IAAI,aAAa;AAAA,UAC1C,WAAW;AAAA,UACX,aAAa;AAAA,QAAA,CAChB;AAED,QAAAH,IAAc,IAAI,EAAE,IAAI,SAASjB,GAAU,EAAE,OAAOoB,GAAgB,QAAQD,GAAmB;AAAA,MACnG;AAIA,MAAAJ,EAAU,WAAW,CAACC,GAAMC,CAAW,CAAC;AAAA,IAC5C;AACI,MAAAF,EAAU,WAAW,CAACC,CAAI,CAAC;AAG/B,WAAAV,EAAI,KAAK,UAAUS,CAAS,GAC5BJ,EAAYI,CAAS,GAEd,MAAM;AACT,MAAAM,EAAuBN,CAAS,GAEhCA,EAAU,QAAQ,CAAAO,MAAc;AAC5B,QAAAP,EAAU,aAAaO,CAAU,GACjCA,EAAW,QAAA;AAAA,MACf,CAAC,GAEGhB,EAAI,KAAK,WAAA,EAAa,SAASS,CAAS,KACxCT,EAAI,IAAI,aAAaS,CAAS,GAElCA,EAAU,QAAA;AAAA,IACd;AAAA,EACJ,GAAG,CAACT,EAAI,KAAKN,GAAUG,GAAOF,GAAWC,CAAU,CAAC,GAEpDqB,EAA0Bb,GAAUL,CAAgB,GAE7C;AACX;"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { default as ClusterLayer, ClusterTheme } from './clustering/ClusterLayer';
|
|
3
|
+
import { SimpleClusterTheme } from '../../../utils/clustering';
|
|
4
|
+
export type { ClusterTheme, SimpleClusterTheme };
|
|
3
5
|
export type MarkerLayerProps = React.ComponentProps<typeof ClusterLayer> & {
|
|
4
|
-
simpleTheme?:
|
|
6
|
+
simpleTheme?: SimpleClusterTheme;
|
|
5
7
|
clusterDissolvable?: boolean;
|
|
6
8
|
clusterStrategy?: 'FASTGRID' | 'GRID' | 'DYNAMICGRID';
|
|
7
9
|
eps?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkerLayer.js","sources":["../../../../../../src/components/map/components/features/layers/MarkerLayer.tsx"],"sourcesContent":["import type React from 'react';\n\nimport ClusterLayer, { type ClusterTheme } from './clustering/ClusterLayer';\nimport { wrapSimpleTheme } from '../../../utils/clustering';\nimport { useMapContext } from '../../MapContext';\n\nexport type MarkerLayerProps = React.ComponentProps<typeof ClusterLayer> & {\n simpleTheme?:
|
|
1
|
+
{"version":3,"file":"MarkerLayer.js","sources":["../../../../../../src/components/map/components/features/layers/MarkerLayer.tsx"],"sourcesContent":["import type React from 'react';\n\nimport ClusterLayer, { type ClusterTheme } from './clustering/ClusterLayer';\nimport { wrapSimpleTheme, type SimpleClusterTheme } from '../../../utils/clustering';\nimport { useMapContext } from '../../MapContext';\n\nexport type { ClusterTheme, SimpleClusterTheme };\n\nexport type MarkerLayerProps = React.ComponentProps<typeof ClusterLayer> & {\n simpleTheme?: SimpleClusterTheme;\n clusterDissolvable?: boolean;\n clusterStrategy?: 'FASTGRID' | 'GRID' | 'DYNAMICGRID';\n eps?: number;\n};\n\n/*\n * Not very different to the SimpleClusterLayer, but with a different intention.\n */\nconst MarkerLayer = (props: MarkerLayerProps) => {\n const mapContext = useMapContext();\n\n const { simpleTheme, clusterDissolvable = true, ...rest } = props;\n\n // Norbert: Not an ideal solution\n const showCluster = !clusterDissolvable || mapContext.showCluster;\n const newProps = {\n clusterTheme: simpleTheme && wrapSimpleTheme(simpleTheme),\n ...rest,\n };\n return <ClusterLayer {...newProps} minWeight={showCluster ? undefined : 1000000000} />;\n};\n\nexport default MarkerLayer;\n"],"names":["MarkerLayer","props","mapContext","useMapContext","simpleTheme","clusterDissolvable","rest","showCluster","newProps","wrapSimpleTheme","ClusterLayer"],"mappings":";;;;AAkBA,MAAMA,IAAc,CAACC,MAA4B;AAC7C,QAAMC,IAAaC,EAAA,GAEb,EAAE,aAAAC,GAAa,oBAAAC,IAAqB,IAAM,GAAGC,MAASL,GAGtDM,IAAc,CAACF,KAAsBH,EAAW,aAChDM,IAAW;AAAA,IACb,cAAcJ,KAAeK,EAAgBL,CAAW;AAAA,IACxD,GAAGE;AAAA,EAAA;AAEP,2BAAQI,GAAA,EAAc,GAAGF,GAAU,WAAWD,IAAc,SAAY,KAAY;AACxF;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState as D, useEffect as L, useLayoutEffect as P } from "react";
|
|
2
2
|
import { useMapContext as f } from "../../../MapContext.js";
|
|
3
3
|
import { useUpdateProp as E, useUpdateEventListenerMap as I } from "../../../../utils/hooks.js";
|
|
4
|
-
const T = (e
|
|
4
|
+
const T = (e) => new H.clustering.DataPoint(e.lat, e.lng, 1, e), p = (e, t = T) => e.map((r, n) => t(r, n)), C = new H.clustering.Provider([]).getTheme(), R = (e) => {
|
|
5
5
|
switch (e) {
|
|
6
6
|
case "GRID":
|
|
7
7
|
return H.clustering.Provider.Strategy.GRID;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClusterLayer.js","sources":["../../../../../../../src/components/map/components/features/layers/clustering/ClusterLayer.tsx"],"sourcesContent":["import { useState, useEffect, useLayoutEffect } from 'react';\n\
|
|
1
|
+
{"version":3,"file":"ClusterLayer.js","sources":["../../../../../../../src/components/map/components/features/layers/clustering/ClusterLayer.tsx"],"sourcesContent":["import { useState, useEffect, useLayoutEffect } from 'react';\n\nimport { useMapContext } from '../../../MapContext';\nimport { useUpdateProp, useUpdateEventListenerMap } from '../../../../utils/hooks';\nimport type { EventListenerMap } from '../../../../utils/eventHandling';\nexport type ClusterStrategy = 'FASTGRID' | 'GRID' | 'DYNAMICGRID';\n\nexport type ClusterTheme = H.clustering.ITheme;\n\nexport type Position = {\n lat: number;\n lng: number;\n};\n\nexport type DataConverter = (data: Position, index: number) => H.clustering.DataPoint;\n\nexport type ClusterLayerProps = {\n data: object[];\n dataConverter?: DataConverter;\n minWeight?: string | number;\n minZoom?: string | number;\n maxZoom?: string | number;\n clusterTheme?: ClusterTheme | undefined;\n eventListenerMap?: EventListenerMap;\n clusterStrategy?: ClusterStrategy;\n eps?: number;\n};\n\nconst DEFAULT_DATA_CONVERTER: DataConverter = (pos: Position): H.clustering.DataPoint =>\n new H.clustering.DataPoint(pos.lat, pos.lng, 1, pos);\n\nconst convertData = (data: object[], converterFunc: DataConverter = DEFAULT_DATA_CONVERTER) =>\n data.map((value, index): H.clustering.DataPoint => converterFunc(value as Position, index));\n\nconst DEFAULT_CLUSTER_THEME = new H.clustering.Provider([]).getTheme();\n\nconst getClusterStrategy = (strategy?: ClusterStrategy): H.clustering.Provider.Strategy => {\n switch (strategy) {\n case 'GRID':\n return H.clustering.Provider.Strategy.GRID;\n case 'DYNAMICGRID':\n return H.clustering.Provider.Strategy.DYNAMICGRID;\n default:\n return H.clustering.Provider.Strategy.FASTGRID;\n }\n};\n\n// TODO: replace some cluster marker like for POIs with SVG MarkerIcons instead of rendering DomMarker\n// to increase rendering performance, especially, when rendering hundreds of marker like for charging stations\n\n// const noiseSvg =\n// '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"20px\" width=\"20px\"><circle cx=\"5px\" cy=\"5px\" r=\"5px\" fill=\"green\" /></svg>';\n\n// Create an icon to represent the noise points\n// Note that same icon will be used for all noise points\n// const noiseIcon = new H.map.Icon(noiseSvg, {\n// size: { w: 20, h: 20 },\n// anchor: { x: 10, y: 10 },\n// });\n\n// SVG template to use for cluster icons\n// const clusterSvgTemplate = `<svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" xmlns=\"http://www.w3.org/2000/svg\" style=\"cursor: pointer\">\n// <circle cx=\"20\" cy=\"20\" r=\"19.5\" fill=\"#B23672\" stroke=\"#B23672\"/>\n// <g transform=\"translate(20,24.6)\">\n// <text fill=\"white\" font-family=\"'Source Sans Pro', Helvetica, sans-serif\" font-size=\"15\" font-weight=\"500\" text-anchor=\"middle\">\n// {text}\n// </text>\n// </g>\n// </svg>`;\n\nconst ClusterLayer = (props: ClusterLayerProps) => {\n const {\n data,\n dataConverter,\n minWeight,\n minZoom,\n maxZoom,\n clusterTheme = DEFAULT_CLUSTER_THEME,\n eventListenerMap,\n clusterStrategy,\n eps = 100,\n } = props;\n\n const { api } = useMapContext();\n\n const [provider, setProvider] = useState<H.clustering.Provider | undefined>();\n\n useEffect(() => {\n // const reactIcon = new H.map.DomIcon(\n // ReactDomServer.renderToStaticMarkup(\n // <div className='bg-info padding-x-5 padding-y-2 border rounded shadow-default'>test</div>\n // )\n // );\n\n const clusterProviderOptions: H.clustering.Provider.Options = {\n clusteringOptions: {\n strategy: getClusterStrategy(clusterStrategy),\n eps,\n minWeight: minWeight ? Number.parseInt(minWeight as string, 10) : 2,\n },\n min: minZoom ? Number.parseInt(minZoom as string, 10) : 0,\n max: maxZoom ? Number.parseInt(maxZoom as string, 10) : 22,\n theme: clusterTheme,\n // theme: {\n // getClusterPresentation: cluster => {\n // // Use cluster weight to change the icon size\n // const weight = cluster.getWeight();\n // // Calculate circle size\n // const radius = weight; // * 5;\n // const diameter = radius * 2;\n\n // // Replace variables in the icon template\n // const svgString = clusterSvgTemplate.replace(/\\{text\\}/g, String(weight));\n // // .replace(/\\{diameter\\}/g, String(diameter));\n\n // // Create an icon\n // // Note that we create a different icon depending from the weight of the cluster\n // const clusterIcon = new H.map.Icon(svgString);\n\n // // Create a marker for the cluster\n // const clusterMarker = new H.map.Marker(cluster.getPosition(), {\n // icon: clusterIcon,\n\n // // Set min/max zoom with values from the cluster, otherwise\n // // clusters will be shown at all zoom levels\n // min: cluster.getMinZoom(),\n // max: cluster.getMaxZoom(),\n // });\n\n // // Bind cluster data to the marker\n // clusterMarker.setData(cluster);\n\n // return clusterMarker;\n // },\n // getNoisePresentation: noisePoint => {\n // // Create a marker for noise points:\n // const noiseMarker = new H.map.DomMarker(noisePoint.getPosition(), {\n // // icon: noiseIcon,\n // icon: reactIcon,\n\n // // Use min zoom from a noise point to show it correctly at certain zoom levels\n // min: noisePoint.getMinZoom(),\n // });\n\n // // Bind noise point data to the marker:\n // noiseMarker.setData(noisePoint);\n // return noiseMarker;\n // },\n // },\n };\n\n const newProvider = new H.clustering.Provider(convertData(data, dataConverter), clusterProviderOptions);\n const objectLayer = new H.map.layer.ObjectLayer(newProvider);\n\n api.map?.addLayer(objectLayer);\n\n setProvider(newProvider);\n\n return () => {\n api.map?.removeLayer(objectLayer);\n objectLayer.dispose();\n newProvider.dispose();\n };\n }, [minWeight, minZoom, maxZoom, api.map]);\n\n // Effect to update data points of provider\n useLayoutEffect(() => {\n if (provider) {\n provider.setDataPoints(convertData(data, dataConverter));\n }\n }, [data, dataConverter]);\n\n useUpdateProp(provider, 'setTheme', clusterTheme);\n useUpdateEventListenerMap(provider, eventListenerMap);\n\n return null;\n};\n\nexport default ClusterLayer;\n"],"names":["DEFAULT_DATA_CONVERTER","pos","convertData","data","converterFunc","value","index","DEFAULT_CLUSTER_THEME","getClusterStrategy","strategy","ClusterLayer","props","dataConverter","minWeight","minZoom","maxZoom","clusterTheme","eventListenerMap","clusterStrategy","eps","api","useMapContext","provider","setProvider","useState","useEffect","clusterProviderOptions","newProvider","objectLayer","useLayoutEffect","useUpdateProp","useUpdateEventListenerMap"],"mappings":";;;AA4BA,MAAMA,IAAwC,CAACC,MAC3C,IAAI,EAAE,WAAW,UAAUA,EAAI,KAAKA,EAAI,KAAK,GAAGA,CAAG,GAEjDC,IAAc,CAACC,GAAgBC,IAA+BJ,MAChEG,EAAK,IAAI,CAACE,GAAOC,MAAkCF,EAAcC,GAAmBC,CAAK,CAAC,GAExFC,IAAwB,IAAI,EAAE,WAAW,SAAS,CAAA,CAAE,EAAE,SAAA,GAEtDC,IAAqB,CAACC,MAA+D;AACvF,UAAQA,GAAA;AAAA,IACJ,KAAK;AACD,aAAO,EAAE,WAAW,SAAS,SAAS;AAAA,IAC1C,KAAK;AACD,aAAO,EAAE,WAAW,SAAS,SAAS;AAAA,IAC1C;AACI,aAAO,EAAE,WAAW,SAAS,SAAS;AAAA,EAAA;AAElD,GAyBMC,IAAe,CAACC,MAA6B;AAC/C,QAAM;AAAA,IACF,MAAAR;AAAA,IACA,eAAAS;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,SAAAC;AAAA,IACA,cAAAC,IAAeT;AAAA,IACf,kBAAAU;AAAA,IACA,iBAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,EAAA,IACNR,GAEE,EAAE,KAAAS,EAAA,IAAQC,EAAA,GAEV,CAACC,GAAUC,CAAW,IAAIC,EAAA;AAEhC,SAAAC,EAAU,MAAM;AAOZ,UAAMC,IAAwD;AAAA,MAC1D,mBAAmB;AAAA,QACf,UAAUlB,EAAmBU,CAAe;AAAA,QAC5C,KAAAC;AAAA,QACA,WAAWN,IAAY,OAAO,SAASA,GAAqB,EAAE,IAAI;AAAA,MAAA;AAAA,MAEtE,KAAKC,IAAU,OAAO,SAASA,GAAmB,EAAE,IAAI;AAAA,MACxD,KAAKC,IAAU,OAAO,SAASA,GAAmB,EAAE,IAAI;AAAA,MACxD,OAAOC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAA,GAiDLW,IAAc,IAAI,EAAE,WAAW,SAASzB,EAAYC,GAAMS,CAAa,GAAGc,CAAsB,GAChGE,IAAc,IAAI,EAAE,IAAI,MAAM,YAAYD,CAAW;AAE3D,WAAAP,EAAI,KAAK,SAASQ,CAAW,GAE7BL,EAAYI,CAAW,GAEhB,MAAM;AACT,MAAAP,EAAI,KAAK,YAAYQ,CAAW,GAChCA,EAAY,QAAA,GACZD,EAAY,QAAA;AAAA,IAChB;AAAA,EACJ,GAAG,CAACd,GAAWC,GAASC,GAASK,EAAI,GAAG,CAAC,GAGzCS,EAAgB,MAAM;AAClB,IAAIP,KACAA,EAAS,cAAcpB,EAAYC,GAAMS,CAAa,CAAC;AAAA,EAE/D,GAAG,CAACT,GAAMS,CAAa,CAAC,GAExBkB,EAAcR,GAAU,YAAYN,CAAY,GAChDe,EAA0BT,GAAUL,CAAgB,GAE7C;AACX;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ClusterLayerProps } from './ClusterLayer';
|
|
2
|
+
import { SimpleClusterTheme } from '../../../../utils/clustering';
|
|
2
3
|
export type SimpleClusterLayerProps = Omit<ClusterLayerProps, 'clusterTheme'> & {
|
|
3
|
-
simpleTheme?:
|
|
4
|
+
simpleTheme?: SimpleClusterTheme;
|
|
4
5
|
};
|
|
5
6
|
declare const SimpleClusterLayer: (props: SimpleClusterLayerProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
export default SimpleClusterLayer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleClusterLayer.js","sources":["../../../../../../../src/components/map/components/features/layers/clustering/SimpleClusterLayer.tsx"],"sourcesContent":["import ClusterLayer, { type
|
|
1
|
+
{"version":3,"file":"SimpleClusterLayer.js","sources":["../../../../../../../src/components/map/components/features/layers/clustering/SimpleClusterLayer.tsx"],"sourcesContent":["import ClusterLayer, { type ClusterLayerProps } from './ClusterLayer';\nimport { type SimpleClusterTheme, wrapSimpleTheme } from '../../../../utils/clustering';\n\nexport type SimpleClusterLayerProps = Omit<ClusterLayerProps, 'clusterTheme'> & {\n simpleTheme?: SimpleClusterTheme;\n};\n\nconst SimpleClusterLayer = (props: SimpleClusterLayerProps) => {\n const { simpleTheme, ...rest } = props;\n return <ClusterLayer {...rest} clusterTheme={simpleTheme && wrapSimpleTheme(simpleTheme)} />;\n};\n\nexport default SimpleClusterLayer;\n"],"names":["SimpleClusterLayer","props","simpleTheme","rest","jsx","ClusterLayer","wrapSimpleTheme"],"mappings":";;;AAOA,MAAMA,IAAqB,CAACC,MAAmC;AAC3D,QAAM,EAAE,aAAAC,GAAa,GAAGC,EAAA,IAASF;AACjC,SAAO,gBAAAG,EAACC,KAAc,GAAGF,GAAM,cAAcD,KAAeI,EAAgBJ,CAAW,GAAG;AAC9F;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as L } from "react/jsx-runtime";
|
|
2
|
-
import { DEFAULT_RASTER_LAYER_FORMAT as f, ENGINE_TYPE_P2D as c, DEFAULT_TILE_SIZE as m, ENGINE_TYPE_HARP as
|
|
3
|
-
import
|
|
4
|
-
import { useMapContext as
|
|
5
|
-
import { isVectorBased as
|
|
6
|
-
const
|
|
2
|
+
import { DEFAULT_RASTER_LAYER_FORMAT as f, ENGINE_TYPE_P2D as c, DEFAULT_TILE_SIZE as m, ENGINE_TYPE_HARP as _ } from "../../../constants.js";
|
|
3
|
+
import R from "./Layer.js";
|
|
4
|
+
import { useMapContext as T } from "../../../MapContext.js";
|
|
5
|
+
import { isVectorBased as y } from "../../../../utils/rendering.js";
|
|
6
|
+
const E = (e, r) => (t, i, o, a) => {
|
|
7
7
|
const s = t.platform?.getRasterTileService({
|
|
8
8
|
resource: "blank",
|
|
9
9
|
format: f,
|
|
@@ -19,8 +19,8 @@ const _ = (e, r) => (t, i, o, a) => {
|
|
|
19
19
|
}), l = new H.map.layer.TileLayer(n);
|
|
20
20
|
return console.log("createRoadRestrictionLayer"), l;
|
|
21
21
|
}, b = (e) => {
|
|
22
|
-
const { enableWebGL: r, baseLayer: t, devicePixelRatio: i } =
|
|
23
|
-
return /* @__PURE__ */ L(
|
|
22
|
+
const { enableWebGL: r, baseLayer: t, devicePixelRatio: i } = T(), o = y(r, t) ? _ : c, a = E(o, i);
|
|
23
|
+
return /* @__PURE__ */ L(R, { ...e, createLayer: a });
|
|
24
24
|
};
|
|
25
25
|
export {
|
|
26
26
|
b as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoadRestrictionLayer.js","sources":["../../../../../../../src/components/map/components/features/layers/overlayLayers/RoadRestrictionLayer.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: required for JSX runtime compatibility with older toolchains\nimport React from 'react';\n\nimport { DEFAULT_RASTER_LAYER_FORMAT, DEFAULT_TILE_SIZE, ENGINE_TYPE_HARP, ENGINE_TYPE_P2D } from '../../../constants';\nimport Layer from './Layer';\nimport { useMapContext } from '../../../MapContext';\nimport type { MapApi } from '../../../../utils/mapTypes';\nimport { isVectorBased } from '../../../../utils/rendering';\n\n// Layer for rendering truck road signs\nconst createRoadRestrictionLayer =\n (engineType:
|
|
1
|
+
{"version":3,"file":"RoadRestrictionLayer.js","sources":["../../../../../../../src/components/map/components/features/layers/overlayLayers/RoadRestrictionLayer.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: required for JSX runtime compatibility with older toolchains\nimport React from 'react';\n\nimport { DEFAULT_RASTER_LAYER_FORMAT, DEFAULT_TILE_SIZE, ENGINE_TYPE_HARP, ENGINE_TYPE_P2D } from '../../../constants';\nimport Layer from './Layer';\nimport { useMapContext } from '../../../MapContext';\nimport type { MapApi } from '../../../../utils/mapTypes';\nimport { isVectorBased } from '../../../../utils/rendering';\n\n// Layer for rendering truck road signs\nconst createRoadRestrictionLayer =\n (engineType: H.Map.EngineType | string, devicePixelRatio: number) =>\n (api: MapApi, _useWebGL: boolean, _baseLayerName: string, language: string) => {\n // @ts-expect-error-next-line: according to the Here docs, the engine type exists\n const trafficTileService = api.platform?.getRasterTileService({\n resource: 'blank',\n format: DEFAULT_RASTER_LAYER_FORMAT,\n queryParams: {\n lang: language,\n // Increase size of road sign for pixel maps and high resolutions, otherwise the icons are too small\n ppi: engineType === ENGINE_TYPE_P2D && devicePixelRatio > 1 ? 200 : 100,\n features: 'vehicle_restrictions:active_and_inactive',\n },\n });\n\n // @ts-expect-error-next-line: according to the Here docs, the engine type exists\n const trafficTileProvider1 = new H.service.rasterTile.Provider(trafficTileService, {\n engineType,\n tileSize: DEFAULT_TILE_SIZE,\n });\n\n const trafficTileLayer = new H.map.layer.TileLayer(trafficTileProvider1);\n\n console.log('createRoadRestrictionLayer');\n\n return trafficTileLayer;\n };\n\nexport type RoadRestrictionLayerProps = Omit<React.ComponentProps<typeof Layer>, 'createLayer'> & {};\n\nconst RoadRestrictionLayer = (props: RoadRestrictionLayerProps) => {\n const { enableWebGL, baseLayer, devicePixelRatio } = useMapContext();\n\n const engineType = isVectorBased(enableWebGL, baseLayer) ? ENGINE_TYPE_HARP : ENGINE_TYPE_P2D;\n\n const restrictionLayerCreator = createRoadRestrictionLayer(engineType, devicePixelRatio);\n\n return <Layer {...props} createLayer={restrictionLayerCreator} />;\n};\n\nexport default RoadRestrictionLayer;\n"],"names":["createRoadRestrictionLayer","engineType","devicePixelRatio","api","_useWebGL","_baseLayerName","language","trafficTileService","DEFAULT_RASTER_LAYER_FORMAT","ENGINE_TYPE_P2D","trafficTileProvider1","DEFAULT_TILE_SIZE","trafficTileLayer","RoadRestrictionLayer","props","enableWebGL","baseLayer","useMapContext","isVectorBased","ENGINE_TYPE_HARP","restrictionLayerCreator","jsx","Layer"],"mappings":";;;;;AAUA,MAAMA,IACF,CAACC,GAAuCC,MACxC,CAACC,GAAaC,GAAoBC,GAAwBC,MAAqB;AAE3E,QAAMC,IAAqBJ,EAAI,UAAU,qBAAqB;AAAA,IAC1D,UAAU;AAAA,IACV,QAAQK;AAAA,IACR,aAAa;AAAA,MACT,MAAMF;AAAA;AAAA,MAEN,KAAKL,MAAeQ,KAAmBP,IAAmB,IAAI,MAAM;AAAA,MACpE,UAAU;AAAA,IAAA;AAAA,EACd,CACH,GAGKQ,IAAuB,IAAI,EAAE,QAAQ,WAAW,SAASH,GAAoB;AAAA,IAC/E,YAAAN;AAAA,IACA,UAAUU;AAAA,EAAA,CACb,GAEKC,IAAmB,IAAI,EAAE,IAAI,MAAM,UAAUF,CAAoB;AAEvE,iBAAQ,IAAI,4BAA4B,GAEjCE;AACX,GAIEC,IAAuB,CAACC,MAAqC;AAC/D,QAAM,EAAE,aAAAC,GAAa,WAAAC,GAAW,kBAAAd,EAAA,IAAqBe,EAAA,GAE/ChB,IAAaiB,EAAcH,GAAaC,CAAS,IAAIG,IAAmBV,GAExEW,IAA0BpB,EAA2BC,GAAYC,CAAgB;AAEvF,SAAO,gBAAAmB,EAACC,GAAA,EAAO,GAAGR,GAAO,aAAaM,GAAyB;AACnE;"}
|
|
@@ -20,17 +20,17 @@ const L = (e, r, a, t) => {
|
|
|
20
20
|
tileSize: n
|
|
21
21
|
});
|
|
22
22
|
return new H.map.layer.TileLayer(c);
|
|
23
|
-
},
|
|
23
|
+
}, _ = (e, r, a) => {
|
|
24
24
|
const t = new H.service.trafficVectorTile.Provider(
|
|
25
|
-
// @ts-
|
|
25
|
+
// @ts-expect-error-next-line
|
|
26
26
|
e.platform?.getTrafficVectorTileService({ layer: "flow" }),
|
|
27
|
-
// @ts-
|
|
27
|
+
// @ts-expect-error-next-line
|
|
28
28
|
new H.map.render.harp.Style({}),
|
|
29
29
|
{ engineType: s }
|
|
30
30
|
);
|
|
31
31
|
return new H.map.layer.TileLayer(t, { min: 2, max: 24 });
|
|
32
32
|
}, P = (e) => {
|
|
33
|
-
const r = T(), a = m(r.enableWebGL, r.baseLayer) ?
|
|
33
|
+
const r = T(), a = m(r.enableWebGL, r.baseLayer) ? _ : L;
|
|
34
34
|
return /* @__PURE__ */ f(p, { ...e, createLayer: a });
|
|
35
35
|
};
|
|
36
36
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrafficLayer.js","sources":["../../../../../../../src/components/map/components/features/layers/overlayLayers/TrafficLayer.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: required for JSX runtime compatibility with older toolchains\nimport React from 'react';\n\nimport { DEFAULT_RASTER_LAYER_FORMAT, DEFAULT_TILE_SIZE, ENGINE_TYPE_HARP, ENGINE_TYPE_P2D } from '../../../constants';\nimport Layer from './Layer';\nimport type { MapApi } from '../../../../utils/mapTypes';\nimport { useMapContext } from '../../../MapContext';\nimport { isVectorBased } from '../../../../utils/rendering';\n\nconst createRasterTrafficLayer = (api: MapApi,
|
|
1
|
+
{"version":3,"file":"TrafficLayer.js","sources":["../../../../../../../src/components/map/components/features/layers/overlayLayers/TrafficLayer.tsx"],"sourcesContent":["// biome-ignore lint/style/useImportType: required for JSX runtime compatibility with older toolchains\nimport React from 'react';\n\nimport { DEFAULT_RASTER_LAYER_FORMAT, DEFAULT_TILE_SIZE, ENGINE_TYPE_HARP, ENGINE_TYPE_P2D } from '../../../constants';\nimport Layer from './Layer';\nimport type { MapApi } from '../../../../utils/mapTypes';\nimport { useMapContext } from '../../../MapContext';\nimport { isVectorBased } from '../../../../utils/rendering';\n\nconst createRasterTrafficLayer = (api: MapApi, _useWebGL: boolean, _baseLayerName: string, language: string) => {\n // Traffic\n const baseTrafficUrl = new H.service.Url('https', 'traffic.maps.hereapi.com');\n\n // @ts-expect-error-next-line: according to the Here docs, the engine type exists\n const trafficTileService = api.platform?.getRasterTileService({\n baseUrl: baseTrafficUrl,\n format: DEFAULT_RASTER_LAYER_FORMAT,\n path: 'v3',\n resource: 'flow',\n queryParams: {\n apikey: api.credentials?.apikey,\n lang: language,\n ppi: 400,\n style: 'explore.day',\n },\n });\n\n // @ts-expect-error-next-line: according to the Here docs, the engine type exists\n const trafficTileProvider = new H.service.rasterTile.Provider(trafficTileService, {\n engineType: ENGINE_TYPE_P2D,\n tileSize: DEFAULT_TILE_SIZE,\n });\n\n const trafficTileLayer = new H.map.layer.TileLayer(trafficTileProvider);\n\n return trafficTileLayer;\n};\n\nconst createVectorTrafficLayer = (api: MapApi, _useWebGL: boolean, _baseLayerName: string) => {\n // @ts-expect-error-next-line\n const providerTrafficFlow = new H.service.trafficVectorTile.Provider(\n // @ts-expect-error-next-line\n api.platform?.getTrafficVectorTileService({ layer: 'flow' }),\n // @ts-expect-error-next-line\n new H.map.render.harp.Style({}),\n { engineType: ENGINE_TYPE_HARP }\n );\n\n // @ts-expect-error-next-line:\n const trafficFlowLayer = new H.map.layer.TileLayer(providerTrafficFlow, { min: 2, max: 24 });\n\n return trafficFlowLayer;\n};\n\nexport type TrafficLayerProps = Omit<React.ComponentProps<typeof Layer>, 'createLayer'> & {};\n\nconst TrafficLayer = (props: TrafficLayerProps) => {\n const mapContext = useMapContext();\n\n const layerCreator = isVectorBased(mapContext.enableWebGL, mapContext.baseLayer)\n ? createVectorTrafficLayer\n : createRasterTrafficLayer;\n\n return <Layer {...props} createLayer={layerCreator} />;\n};\n\nexport default TrafficLayer;\n"],"names":["createRasterTrafficLayer","api","_useWebGL","_baseLayerName","language","baseTrafficUrl","trafficTileService","DEFAULT_RASTER_LAYER_FORMAT","trafficTileProvider","ENGINE_TYPE_P2D","DEFAULT_TILE_SIZE","createVectorTrafficLayer","providerTrafficFlow","ENGINE_TYPE_HARP","TrafficLayer","props","mapContext","useMapContext","layerCreator","isVectorBased","jsx","Layer"],"mappings":";;;;;AASA,MAAMA,IAA2B,CAACC,GAAaC,GAAoBC,GAAwBC,MAAqB;AAE5G,QAAMC,IAAiB,IAAI,EAAE,QAAQ,IAAI,SAAS,0BAA0B,GAGtEC,IAAqBL,EAAI,UAAU,qBAAqB;AAAA,IAC1D,SAASI;AAAA,IACT,QAAQE;AAAA,IACR,MAAM;AAAA,IACN,UAAU;AAAA,IACV,aAAa;AAAA,MACT,QAAQN,EAAI,aAAa;AAAA,MACzB,MAAMG;AAAA,MACN,KAAK;AAAA,MACL,OAAO;AAAA,IAAA;AAAA,EACX,CACH,GAGKI,IAAsB,IAAI,EAAE,QAAQ,WAAW,SAASF,GAAoB;AAAA,IAC9E,YAAYG;AAAA,IACZ,UAAUC;AAAA,EAAA,CACb;AAID,SAFyB,IAAI,EAAE,IAAI,MAAM,UAAUF,CAAmB;AAG1E,GAEMG,IAA2B,CAACV,GAAaC,GAAoBC,MAA2B;AAE1F,QAAMS,IAAsB,IAAI,EAAE,QAAQ,kBAAkB;AAAA;AAAA,IAExDX,EAAI,UAAU,4BAA4B,EAAE,OAAO,QAAQ;AAAA;AAAA,IAE3D,IAAI,EAAE,IAAI,OAAO,KAAK,MAAM,CAAA,CAAE;AAAA,IAC9B,EAAE,YAAYY,EAAA;AAAA,EAAiB;AAMnC,SAFyB,IAAI,EAAE,IAAI,MAAM,UAAUD,GAAqB,EAAE,KAAK,GAAG,KAAK,GAAA,CAAI;AAG/F,GAIME,IAAe,CAACC,MAA6B;AAC/C,QAAMC,IAAaC,EAAA,GAEbC,IAAeC,EAAcH,EAAW,aAAaA,EAAW,SAAS,IACzEL,IACAX;AAEN,SAAO,gBAAAoB,EAACC,GAAA,EAAO,GAAGN,GAAO,aAAaG,GAAc;AACxD;"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import { MarkerIcon } from '../components/features/basics/Marker';
|
|
1
2
|
import { ClusterTheme } from '../components/features/layers/clustering/ClusterLayer';
|
|
2
3
|
export type Cluster = H.clustering.ICluster;
|
|
3
4
|
export type DataPoint = H.clustering.DataPoint;
|
|
4
5
|
export type NoisePoint = H.clustering.INoisePoint;
|
|
5
6
|
export type Theme = H.clustering.ITheme | undefined;
|
|
7
|
+
export type SimpleClusterTheme<T = any> = {
|
|
8
|
+
getClusterPresentation: (data: T[], position: H.geo.Point) => H.map.Object | MarkerIcon;
|
|
9
|
+
getNoisePresentation: (data: T, position: H.geo.Point) => H.map.Object | MarkerIcon;
|
|
10
|
+
};
|
|
6
11
|
export declare const ClusterUtils: {
|
|
7
12
|
getBoundingBoxForCluster: (cluster: Cluster) => H.geo.Rect;
|
|
8
13
|
};
|
|
9
|
-
export declare const wrapSimpleTheme: (theme:
|
|
14
|
+
export declare const wrapSimpleTheme: (theme: SimpleClusterTheme) => ClusterTheme;
|
|
@@ -1,41 +1,47 @@
|
|
|
1
1
|
import { getOrCreateIcon as i, isDomMakerNeeded as l } from "../components/features/basics/Marker.js";
|
|
2
2
|
const g = (a) => {
|
|
3
|
-
let t = null,
|
|
3
|
+
let t = null, n = null, e = null, r = null;
|
|
4
4
|
return a.forEachDataPoint((s) => {
|
|
5
|
-
const
|
|
6
|
-
(t === null || t >
|
|
5
|
+
const o = s.getPosition();
|
|
6
|
+
(t === null || t > o.lat) && (t = o.lat), (n === null || n > o.lng) && (n = o.lng), (e === null || e < o.lat) && (e = o.lat), (r === null || r < o.lng) && (r = o.lng);
|
|
7
7
|
}), new H.geo.Rect(
|
|
8
|
-
o,
|
|
9
8
|
e,
|
|
9
|
+
n,
|
|
10
10
|
t,
|
|
11
11
|
r
|
|
12
12
|
);
|
|
13
|
-
},
|
|
13
|
+
}, M = {
|
|
14
14
|
getBoundingBoxForCluster: g
|
|
15
|
-
},
|
|
16
|
-
const
|
|
17
|
-
t.forEachDataPoint((
|
|
18
|
-
const
|
|
19
|
-
|
|
15
|
+
}, m = (a) => (t) => {
|
|
16
|
+
const n = [];
|
|
17
|
+
t.forEachDataPoint((c) => n.push(c.getData()));
|
|
18
|
+
const e = a(n, t.getPosition());
|
|
19
|
+
if (e instanceof H.map.Object)
|
|
20
|
+
return e;
|
|
21
|
+
const r = i(e), s = l(r) ? H.map.DomMarker : H.map.Marker, o = new s(t.getPosition(), {
|
|
22
|
+
icon: r,
|
|
20
23
|
// Set min/max zoom with values from the cluster, otherwise
|
|
21
24
|
// clusters will be shown at all zoom levels
|
|
22
25
|
min: t.getMinZoom(),
|
|
23
26
|
max: t.getMaxZoom()
|
|
24
27
|
});
|
|
25
|
-
return
|
|
26
|
-
},
|
|
27
|
-
const
|
|
28
|
+
return o.setData(t), o;
|
|
29
|
+
}, u = (a) => (t) => {
|
|
30
|
+
const n = a(t.getData(), t.getPosition());
|
|
31
|
+
if (n instanceof H.map.Object)
|
|
32
|
+
return n;
|
|
33
|
+
const e = i(n), r = l(e) ? H.map.DomMarker : H.map.Marker, s = new r(t.getPosition(), {
|
|
28
34
|
icon: e,
|
|
29
35
|
// Use min zoom from a noise point to show it correctly at certain zoom levels
|
|
30
36
|
min: t.getMinZoom()
|
|
31
37
|
});
|
|
32
|
-
return
|
|
33
|
-
},
|
|
34
|
-
getClusterPresentation:
|
|
35
|
-
getNoisePresentation:
|
|
38
|
+
return s.setData(t), s;
|
|
39
|
+
}, f = (a) => ({
|
|
40
|
+
getClusterPresentation: m(a.getClusterPresentation),
|
|
41
|
+
getNoisePresentation: u(a.getNoisePresentation)
|
|
36
42
|
});
|
|
37
43
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
44
|
+
M as ClusterUtils,
|
|
45
|
+
f as wrapSimpleTheme
|
|
40
46
|
};
|
|
41
47
|
//# sourceMappingURL=clustering.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clustering.js","sources":["../../../../src/components/map/utils/clustering.ts"],"sourcesContent":["import { getOrCreateIcon, isDomMakerNeeded } from '../components/features/basics/Marker';\nimport type { ClusterTheme } from '../components/features/layers/clustering/ClusterLayer';\n\nexport type Cluster = H.clustering.ICluster;\nexport type DataPoint = H.clustering.DataPoint;\nexport type NoisePoint = H.clustering.INoisePoint;\n\nexport type Theme = H.clustering.ITheme | undefined;\n\nconst getBoundingBoxForCluster = (cluster: Cluster): H.geo.Rect => {\n let minLat: number | null = null;\n let minLng: number | null = null;\n let maxLat: number | null = null;\n let maxLng: number | null = null;\n\n cluster.forEachDataPoint((dataPoint: NoisePoint) => {\n const position = dataPoint.getPosition();\n if (minLat === null || minLat > position.lat) {\n minLat = position.lat;\n }\n if (minLng === null || minLng > position.lng) {\n minLng = position.lng;\n }\n if (maxLat === null || maxLat < position.lat) {\n maxLat = position.lat;\n }\n if (maxLng === null || maxLng < position.lng) {\n maxLng = position.lng;\n }\n });\n\n return new H.geo.Rect(\n maxLat as unknown as number,\n minLng as unknown as number,\n minLat as unknown as number,\n maxLng as unknown as number\n );\n};\n\nexport const ClusterUtils = {\n getBoundingBoxForCluster,\n};\n\nconst wrapClusterPresentation = <T>(func: (clusterElements:
|
|
1
|
+
{"version":3,"file":"clustering.js","sources":["../../../../src/components/map/utils/clustering.ts"],"sourcesContent":["import { getOrCreateIcon, isDomMakerNeeded, type MarkerIcon } from '../components/features/basics/Marker';\nimport type { ClusterTheme } from '../components/features/layers/clustering/ClusterLayer';\n\nexport type Cluster = H.clustering.ICluster;\nexport type DataPoint = H.clustering.DataPoint;\nexport type NoisePoint = H.clustering.INoisePoint;\n\nexport type Theme = H.clustering.ITheme | undefined;\n\n// biome-ignore lint/suspicious/noExplicitAny: keep it less strict\nexport type SimpleClusterTheme<T = any> = {\n getClusterPresentation: (data: T[], position: H.geo.Point) => H.map.Object | MarkerIcon;\n getNoisePresentation: (data: T, position: H.geo.Point) => H.map.Object | MarkerIcon;\n};\n\nconst getBoundingBoxForCluster = (cluster: Cluster): H.geo.Rect => {\n let minLat: number | null = null;\n let minLng: number | null = null;\n let maxLat: number | null = null;\n let maxLng: number | null = null;\n\n cluster.forEachDataPoint((dataPoint: NoisePoint) => {\n const position = dataPoint.getPosition();\n if (minLat === null || minLat > position.lat) {\n minLat = position.lat;\n }\n if (minLng === null || minLng > position.lng) {\n minLng = position.lng;\n }\n if (maxLat === null || maxLat < position.lat) {\n maxLat = position.lat;\n }\n if (maxLng === null || maxLng < position.lng) {\n maxLng = position.lng;\n }\n });\n\n return new H.geo.Rect(\n maxLat as unknown as number,\n minLng as unknown as number,\n minLat as unknown as number,\n maxLng as unknown as number\n );\n};\n\nexport const ClusterUtils = {\n getBoundingBoxForCluster,\n};\n\nconst wrapClusterPresentation = <T>(\n func: (clusterElements: T[], position: H.geo.Point) => H.map.Object | MarkerIcon\n) => {\n return (cluster: Cluster): H.map.Marker => {\n const clusterElements: T[] = [];\n\n cluster.forEachDataPoint((point: NoisePoint) => clusterElements.push(point.getData()));\n\n const presentation = func(clusterElements, cluster.getPosition());\n if (presentation instanceof H.map.Object) {\n return presentation as H.map.Marker;\n }\n\n const clusterIcon = getOrCreateIcon(presentation);\n const MarkerConstructor = isDomMakerNeeded(clusterIcon) ? H.map.DomMarker : H.map.Marker;\n\n const clusterMarker = new MarkerConstructor(cluster.getPosition(), {\n icon: clusterIcon,\n\n // Set min/max zoom with values from the cluster, otherwise\n // clusters will be shown at all zoom levels\n min: cluster.getMinZoom(),\n max: cluster.getMaxZoom(),\n });\n\n // Bind cluster data to the marker\n clusterMarker.setData(cluster);\n\n return clusterMarker;\n };\n};\n\nconst wrapNoisePresentation = <T>(func: (data: T, position: H.geo.Point) => H.map.Object | MarkerIcon) => {\n return (noisePoint: NoisePoint): H.map.Marker => {\n const presentation = func(noisePoint.getData(), noisePoint.getPosition());\n if (presentation instanceof H.map.Object) {\n return presentation as H.map.Marker;\n }\n\n const noiseIcon = getOrCreateIcon(presentation);\n const MarkerConstructor = isDomMakerNeeded(noiseIcon) ? H.map.DomMarker : H.map.Marker;\n\n const noiseMarker = new MarkerConstructor(noisePoint.getPosition(), {\n icon: noiseIcon,\n\n // Use min zoom from a noise point to show it correctly at certain zoom levels\n min: noisePoint.getMinZoom(),\n });\n\n // Bind noise point data to the marker:\n noiseMarker.setData(noisePoint);\n\n return noiseMarker;\n };\n};\n\nexport const wrapSimpleTheme = (theme: SimpleClusterTheme): ClusterTheme => ({\n getClusterPresentation: wrapClusterPresentation(theme.getClusterPresentation),\n getNoisePresentation: wrapNoisePresentation(theme.getNoisePresentation),\n});\n"],"names":["getBoundingBoxForCluster","cluster","minLat","minLng","maxLat","maxLng","dataPoint","position","ClusterUtils","wrapClusterPresentation","func","clusterElements","point","presentation","clusterIcon","getOrCreateIcon","MarkerConstructor","isDomMakerNeeded","clusterMarker","wrapNoisePresentation","noisePoint","noiseIcon","noiseMarker","wrapSimpleTheme","theme"],"mappings":";AAeA,MAAMA,IAA2B,CAACC,MAAiC;AAC/D,MAAIC,IAAwB,MACxBC,IAAwB,MACxBC,IAAwB,MACxBC,IAAwB;AAE5B,SAAAJ,EAAQ,iBAAiB,CAACK,MAA0B;AAChD,UAAMC,IAAWD,EAAU,YAAA;AAC3B,KAAIJ,MAAW,QAAQA,IAASK,EAAS,SACrCL,IAASK,EAAS,OAElBJ,MAAW,QAAQA,IAASI,EAAS,SACrCJ,IAASI,EAAS,OAElBH,MAAW,QAAQA,IAASG,EAAS,SACrCH,IAASG,EAAS,OAElBF,MAAW,QAAQA,IAASE,EAAS,SACrCF,IAASE,EAAS;AAAA,EAE1B,CAAC,GAEM,IAAI,EAAE,IAAI;AAAA,IACbH;AAAA,IACAD;AAAA,IACAD;AAAA,IACAG;AAAA,EAAA;AAER,GAEaG,IAAe;AAAA,EACxB,0BAAAR;AACJ,GAEMS,IAA0B,CAC5BC,MAEO,CAACT,MAAmC;AACvC,QAAMU,IAAuB,CAAA;AAE7B,EAAAV,EAAQ,iBAAiB,CAACW,MAAsBD,EAAgB,KAAKC,EAAM,QAAA,CAAS,CAAC;AAErF,QAAMC,IAAeH,EAAKC,GAAiBV,EAAQ,aAAa;AAChE,MAAIY,aAAwB,EAAE,IAAI;AAC9B,WAAOA;AAGX,QAAMC,IAAcC,EAAgBF,CAAY,GAC1CG,IAAoBC,EAAiBH,CAAW,IAAI,EAAE,IAAI,YAAY,EAAE,IAAI,QAE5EI,IAAgB,IAAIF,EAAkBf,EAAQ,eAAe;AAAA,IAC/D,MAAMa;AAAA;AAAA;AAAA,IAIN,KAAKb,EAAQ,WAAA;AAAA,IACb,KAAKA,EAAQ,WAAA;AAAA,EAAW,CAC3B;AAGD,SAAAiB,EAAc,QAAQjB,CAAO,GAEtBiB;AACX,GAGEC,IAAwB,CAAIT,MACvB,CAACU,MAAyC;AAC7C,QAAMP,IAAeH,EAAKU,EAAW,WAAWA,EAAW,aAAa;AACxE,MAAIP,aAAwB,EAAE,IAAI;AAC9B,WAAOA;AAGX,QAAMQ,IAAYN,EAAgBF,CAAY,GACxCG,IAAoBC,EAAiBI,CAAS,IAAI,EAAE,IAAI,YAAY,EAAE,IAAI,QAE1EC,IAAc,IAAIN,EAAkBI,EAAW,eAAe;AAAA,IAChE,MAAMC;AAAA;AAAA,IAGN,KAAKD,EAAW,WAAA;AAAA,EAAW,CAC9B;AAGD,SAAAE,EAAY,QAAQF,CAAU,GAEvBE;AACX,GAGSC,IAAkB,CAACC,OAA6C;AAAA,EACzE,wBAAwBf,EAAwBe,EAAM,sBAAsB;AAAA,EAC5E,sBAAsBL,EAAsBK,EAAM,oBAAoB;AAC1E;"}
|
|
@@ -20,4 +20,4 @@ export type BaseLayerResponse = {
|
|
|
20
20
|
baseLayer: H.map.layer.Layer;
|
|
21
21
|
overlayLayer?: H.map.layer.Layer;
|
|
22
22
|
};
|
|
23
|
-
export declare const getBaseLayer: ({ baseLayerName, defaultLayers, enableWebGL, platform, engineType, language,
|
|
23
|
+
export declare const getBaseLayer: ({ baseLayerName, defaultLayers, enableWebGL, platform, engineType, language, minZoom, maxZoom, }: BaseLayer) => Promise<BaseLayerResponse>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MAP_TYPE_TERRAIN as _, MAP_TYPE_FLEET_STYLE as v, ENGINE_TYPE_HARP as M, ENGINE_TYPE_P2D as
|
|
2
|
-
const
|
|
1
|
+
import { MAP_TYPE_TERRAIN as _, MAP_TYPE_FLEET_STYLE as v, ENGINE_TYPE_HARP as M, ENGINE_TYPE_P2D as l, MAP_TYPE_DEFAULT as p, MAP_TYPE_NIGHT as A, MAP_TYPE_SATELLITE as d, DEFAULT_RASTER_LAYER_FORMAT as L } from "../components/constants.js";
|
|
2
|
+
const h = () => window.devicePixelRatio >= 1.7 ? 200 : 100, u = (r, e) => r && e !== _ && e !== v, w = (r) => (
|
|
3
3
|
// Initiate and authenticate your connection to the HERE platform:
|
|
4
4
|
new H.service.Platform({
|
|
5
5
|
apikey: r.apikey ?? "",
|
|
@@ -11,31 +11,30 @@ const L = () => window.devicePixelRatio >= 1.7 ? 200 : 100, w = (r, e) => r && e
|
|
|
11
11
|
tileSize: 512
|
|
12
12
|
}), s = new H.map.layer.TileLayer(n);
|
|
13
13
|
return s.setMin(a), s.setMax(t), s;
|
|
14
|
-
},
|
|
15
|
-
format:
|
|
14
|
+
}, E = (r, e, a, t) => r?.getRasterTileService({
|
|
15
|
+
format: L,
|
|
16
16
|
queryParams: {
|
|
17
17
|
// https://www.here.com/docs/bundle/raster-tile-api-migration-guide/page/README.html#5-language
|
|
18
18
|
lang: t,
|
|
19
|
-
ppi:
|
|
19
|
+
ppi: h(),
|
|
20
20
|
style: e,
|
|
21
21
|
features: a
|
|
22
22
|
}
|
|
23
|
-
}),
|
|
23
|
+
}), S = (r, e) => {
|
|
24
24
|
switch (r) {
|
|
25
25
|
case v:
|
|
26
26
|
case _:
|
|
27
|
-
return
|
|
27
|
+
return l;
|
|
28
28
|
default:
|
|
29
|
-
return e ? M :
|
|
29
|
+
return e ? M : l;
|
|
30
30
|
}
|
|
31
|
-
},
|
|
31
|
+
}, b = async ({
|
|
32
32
|
baseLayerName: r,
|
|
33
33
|
defaultLayers: e,
|
|
34
34
|
enableWebGL: a,
|
|
35
35
|
platform: t,
|
|
36
36
|
engineType: n,
|
|
37
37
|
language: s,
|
|
38
|
-
vehicleRestrictions: R,
|
|
39
38
|
minZoom: i,
|
|
40
39
|
maxZoom: c
|
|
41
40
|
}) => {
|
|
@@ -55,6 +54,7 @@ const L = () => window.devicePixelRatio >= 1.7 ? 200 : 100, w = (r, e) => r && e
|
|
|
55
54
|
};
|
|
56
55
|
await t.createHybridLayers(
|
|
57
56
|
y,
|
|
57
|
+
// biome-ignore lint/suspicious/noExplicitAny: whatever layer type
|
|
58
58
|
(o) => (o.raster.setMin(i), o.raster.setMax(c), o.vector.setMin(i), o.vector.setMax(c), {
|
|
59
59
|
baseLayer: o.raster,
|
|
60
60
|
overlayLayer: o.vector
|
|
@@ -64,7 +64,7 @@ const L = () => window.devicePixelRatio >= 1.7 ? 200 : 100, w = (r, e) => r && e
|
|
|
64
64
|
}
|
|
65
65
|
return {
|
|
66
66
|
baseLayer: P(
|
|
67
|
-
|
|
67
|
+
E(t, "explore.satellite.day", T, s),
|
|
68
68
|
n,
|
|
69
69
|
i,
|
|
70
70
|
c
|
|
@@ -74,7 +74,7 @@ const L = () => window.devicePixelRatio >= 1.7 ? 200 : 100, w = (r, e) => r && e
|
|
|
74
74
|
case _:
|
|
75
75
|
return {
|
|
76
76
|
baseLayer: P(
|
|
77
|
-
|
|
77
|
+
E(t, "topo.day", T, s),
|
|
78
78
|
n,
|
|
79
79
|
i,
|
|
80
80
|
c
|
|
@@ -83,19 +83,19 @@ const L = () => window.devicePixelRatio >= 1.7 ? 200 : 100, w = (r, e) => r && e
|
|
|
83
83
|
case v:
|
|
84
84
|
return {
|
|
85
85
|
baseLayer: P(
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
E(t, "logistics.day", T, s),
|
|
87
|
+
l,
|
|
88
88
|
i,
|
|
89
89
|
c
|
|
90
90
|
)
|
|
91
91
|
};
|
|
92
92
|
case A:
|
|
93
93
|
return a ? (e?.vector.normal.mapnight.setMin(i), e?.vector.normal.mapnight.setMax(c), {
|
|
94
|
-
// @ts-
|
|
94
|
+
// @ts-expect-error-next-line "vector.normal.mapnight" is newer than the types
|
|
95
95
|
baseLayer: e.vector.normal.mapnight
|
|
96
96
|
}) : {
|
|
97
97
|
baseLayer: P(
|
|
98
|
-
|
|
98
|
+
E(t, "explore.night", T, s),
|
|
99
99
|
n,
|
|
100
100
|
i,
|
|
101
101
|
c
|
|
@@ -104,7 +104,7 @@ const L = () => window.devicePixelRatio >= 1.7 ? 200 : 100, w = (r, e) => r && e
|
|
|
104
104
|
default:
|
|
105
105
|
return {
|
|
106
106
|
baseLayer: P(
|
|
107
|
-
|
|
107
|
+
E(t, "explore.day", T, s),
|
|
108
108
|
n,
|
|
109
109
|
i,
|
|
110
110
|
c
|
|
@@ -113,12 +113,12 @@ const L = () => window.devicePixelRatio >= 1.7 ? 200 : 100, w = (r, e) => r && e
|
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
115
|
export {
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
b as getBaseLayer,
|
|
117
|
+
E as getBaseRasterTileService,
|
|
118
118
|
P as getBaseTileLayer,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
S as getEngineType,
|
|
120
|
+
h as getPPI,
|
|
121
|
+
w as getPlatform,
|
|
122
|
+
u as isVectorBased
|
|
123
123
|
};
|
|
124
124
|
//# sourceMappingURL=rendering.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rendering.js","sources":["../../../../src/components/map/utils/rendering.ts"],"sourcesContent":["import {\n DEFAULT_RASTER_LAYER_FORMAT,\n MAP_TYPE_FLEET_STYLE,\n MAP_TYPE_TERRAIN,\n ENGINE_TYPE_P2D,\n ENGINE_TYPE_HARP,\n MAP_TYPE_DEFAULT,\n MAP_TYPE_NIGHT,\n MAP_TYPE_SATELLITE,\n} from '../components/constants';\nimport type { MapCredentials, MapType } from './mapTypes';\n\n// https://www.here.com/docs/bundle/raster-tile-api-migration-guide/page/README.html#6-pixels-per-inch-ppi\n// Note: higher PPI image tiles result in larger label size and show more label on the map\n// HERE Raster Tile API v3: 100, 200, 200 or 400, 400\nexport const getPPI = () => (window.devicePixelRatio >= 1.7 ? 200 : 100);\n\n// Even if webgl is enabled, some base layer cannot be rendered in HARP properly\nexport const isVectorBased = (enableWebGL: boolean, baseLayer: MapType) =>\n enableWebGL && baseLayer !== MAP_TYPE_TERRAIN && baseLayer !== MAP_TYPE_FLEET_STYLE;\n\n// See Migration guide: https://developer.here.com/documentation/maps/3.1.37.0/dev_guide/topics/migration.html\nexport const getPlatform = (credentials: MapCredentials) =>\n // Initiate and authenticate your connection to the HERE platform:\n new H.service.Platform({\n apikey: credentials.apikey ?? '',\n useHTTPS: location.protocol === 'https:',\n });\n\nexport const getBaseTileLayer = <T>(\n rasterTileService: T,\n engineType: H.Map.EngineType,\n minZoom: number,\n maxZoom: number\n) => {\n // @ts-ignore-next-line \"H.service.rasterTile\" is newer that the types\n const rasterTileProvider = new H.service.rasterTile.Provider(rasterTileService, {\n engineType,\n tileSize: 512,\n });\n\n const rasterTileLayer = new H.map.layer.TileLayer(rasterTileProvider);\n\n // force the tile layer minimum zoom (furthest away possible) and maximum zoom (nearest) to the desired level\n rasterTileLayer.setMin(minZoom);\n rasterTileLayer.setMax(maxZoom);\n\n return rasterTileLayer;\n};\n\nexport const getBaseRasterTileService = (\n platform: H.service.Platform,\n style: string,\n features: string,\n lang: string\n) => {\n // @ts-ignore-next-line \"getRasterTileService\" is newer that the types\n return platform?.getRasterTileService({\n format: DEFAULT_RASTER_LAYER_FORMAT,\n queryParams: {\n // https://www.here.com/docs/bundle/raster-tile-api-migration-guide/page/README.html#5-language\n lang,\n ppi: getPPI(),\n style,\n features,\n },\n });\n};\n\nexport const getEngineType = (baseLayerName: string, enableWebGL: boolean) => {\n switch (baseLayerName) {\n case MAP_TYPE_FLEET_STYLE:\n case MAP_TYPE_TERRAIN:\n return ENGINE_TYPE_P2D;\n default:\n return enableWebGL ? ENGINE_TYPE_HARP : ENGINE_TYPE_P2D;\n }\n};\n\nexport type BaseLayer = {\n baseLayerName: string;\n defaultLayers: H.service.DefaultLayers;\n enableWebGL: boolean;\n platform: H.service.Platform;\n engineType: H.Map.EngineType;\n language: string;\n vehicleRestrictions: boolean;\n minZoom: number;\n maxZoom: number;\n};\n\nexport type BaseLayerResponse = { baseLayer: H.map.layer.Layer; overlayLayer?: H.map.layer.Layer };\n\nexport const getBaseLayer = async ({\n baseLayerName,\n defaultLayers,\n enableWebGL,\n platform,\n engineType,\n language,\n vehicleRestrictions,\n minZoom,\n maxZoom,\n}: BaseLayer): Promise<BaseLayerResponse> => {\n const restriction = 'disabled'; // vehicleRestrictions ? 'active_and_inactive' : 'disabled';\n const features = `pois:all,environmental_zones:all,congestion_zones:all,vehicle_restrictions:${restriction}`;\n\n if (enableWebGL && baseLayerName === MAP_TYPE_DEFAULT) {\n defaultLayers?.vector.normal.map.setMin(minZoom);\n defaultLayers?.vector.normal.map.setMax(maxZoom);\n\n return {\n baseLayer: defaultLayers?.vector.normal.map,\n };\n }\n switch (baseLayerName) {\n case MAP_TYPE_SATELLITE: {\n if (enableWebGL) {\n // This is a workaround for setting the min and max zoom limit for satellite map\n // since the setMin/setMax cannot be set on the \"defaultLayers.hybrid.liteday.raster\".\n // The HERE support suggested to create a hybrid layer for that and set the zoom limits\n // on the two layers.\n const hybridStyleConfig = {\n base: {\n style: 'oslo',\n scheme: 'hybrid.day',\n },\n };\n\n // This method creates hybrid map layers. A hybrid map consists of raster satellite base layer and vector layers on top.\n // Layers created by this method can be used only when the Map is instantiated with H.Map.EngineType.HARP engineType.\n // See https://www.here.com/docs/bundle/maps-api-for-javascript-api-reference/page/H.service.Platform_4.html#createHybridLayers\n // @ts-ignore-next-line\n await platform.createHybridLayers(\n hybridStyleConfig,\n (layers: any) => {\n layers.raster.setMin(minZoom);\n layers.raster.setMax(maxZoom);\n\n layers.vector.setMin(minZoom);\n layers.vector.setMax(maxZoom);\n\n return {\n baseLayer: layers.raster,\n overlayLayer: layers.vector,\n };\n },\n console.error\n );\n }\n return {\n baseLayer: getBaseTileLayer(\n getBaseRasterTileService(platform, 'explore.satellite.day', features, language),\n engineType,\n minZoom,\n maxZoom\n ),\n };\n }\n case MAP_TYPE_TERRAIN: {\n return {\n baseLayer: getBaseTileLayer(\n getBaseRasterTileService(platform, 'topo.day', features, language),\n engineType,\n minZoom,\n maxZoom\n ),\n };\n }\n case MAP_TYPE_FLEET_STYLE: {\n return {\n baseLayer: getBaseTileLayer(\n getBaseRasterTileService(platform, 'logistics.day', features, language),\n ENGINE_TYPE_P2D,\n minZoom,\n maxZoom\n ),\n };\n }\n case MAP_TYPE_NIGHT: {\n if (enableWebGL) {\n // @ts-ignore-next-line \"setMin\" is working on \"vector.normal.mapnight\"\n defaultLayers?.vector.normal.mapnight.setMin(minZoom);\n // @ts-ignore-next-line \"setMax\" is working on \"vector.normal.mapnight\"\n defaultLayers?.vector.normal.mapnight.setMax(maxZoom);\n\n return {\n // @ts-ignore-next-line \"vector.normal.mapnight\" is newer than the types\n baseLayer: defaultLayers.vector.normal.mapnight,\n };\n }\n return {\n baseLayer: getBaseTileLayer(\n getBaseRasterTileService(platform, 'explore.night', features, language),\n engineType,\n minZoom,\n maxZoom\n ),\n };\n }\n default: {\n // As a replacement for \"defaultLayers?.raster.normal.map\" which uses the old and deprecated\n // H.service.MapTileService, we use the Raster Tile Service v3 instead\n return {\n baseLayer: getBaseTileLayer(\n getBaseRasterTileService(platform, 'explore.day', features, language),\n engineType,\n minZoom,\n maxZoom\n ),\n };\n }\n }\n};\n"],"names":["getPPI","isVectorBased","enableWebGL","baseLayer","MAP_TYPE_TERRAIN","MAP_TYPE_FLEET_STYLE","getPlatform","credentials","getBaseTileLayer","rasterTileService","engineType","minZoom","maxZoom","rasterTileProvider","rasterTileLayer","getBaseRasterTileService","platform","style","features","lang","DEFAULT_RASTER_LAYER_FORMAT","getEngineType","baseLayerName","ENGINE_TYPE_P2D","ENGINE_TYPE_HARP","getBaseLayer","defaultLayers","language","vehicleRestrictions","MAP_TYPE_DEFAULT","MAP_TYPE_SATELLITE","hybridStyleConfig","layers","MAP_TYPE_NIGHT"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"rendering.js","sources":["../../../../src/components/map/utils/rendering.ts"],"sourcesContent":["import {\n DEFAULT_RASTER_LAYER_FORMAT,\n MAP_TYPE_FLEET_STYLE,\n MAP_TYPE_TERRAIN,\n ENGINE_TYPE_P2D,\n ENGINE_TYPE_HARP,\n MAP_TYPE_DEFAULT,\n MAP_TYPE_NIGHT,\n MAP_TYPE_SATELLITE,\n} from '../components/constants';\nimport type { MapCredentials, MapType } from './mapTypes';\n\n// https://www.here.com/docs/bundle/raster-tile-api-migration-guide/page/README.html#6-pixels-per-inch-ppi\n// Note: higher PPI image tiles result in larger label size and show more label on the map\n// HERE Raster Tile API v3: 100, 200, 200 or 400, 400\nexport const getPPI = () => (window.devicePixelRatio >= 1.7 ? 200 : 100);\n\n// Even if webgl is enabled, some base layer cannot be rendered in HARP properly\nexport const isVectorBased = (enableWebGL: boolean, baseLayer: MapType) =>\n enableWebGL && baseLayer !== MAP_TYPE_TERRAIN && baseLayer !== MAP_TYPE_FLEET_STYLE;\n\n// See Migration guide: https://developer.here.com/documentation/maps/3.1.37.0/dev_guide/topics/migration.html\nexport const getPlatform = (credentials: MapCredentials) =>\n // Initiate and authenticate your connection to the HERE platform:\n new H.service.Platform({\n apikey: credentials.apikey ?? '',\n useHTTPS: location.protocol === 'https:',\n });\n\nexport const getBaseTileLayer = <T>(\n rasterTileService: T,\n engineType: H.Map.EngineType,\n minZoom: number,\n maxZoom: number\n) => {\n // @ts-expect-error-next-line \"H.service.rasterTile\" is newer that the types\n const rasterTileProvider = new H.service.rasterTile.Provider(rasterTileService, {\n engineType,\n tileSize: 512,\n });\n\n const rasterTileLayer = new H.map.layer.TileLayer(rasterTileProvider);\n\n // force the tile layer minimum zoom (furthest away possible) and maximum zoom (nearest) to the desired level\n rasterTileLayer.setMin(minZoom);\n rasterTileLayer.setMax(maxZoom);\n\n return rasterTileLayer;\n};\n\nexport const getBaseRasterTileService = (\n platform: H.service.Platform,\n style: string,\n features: string,\n lang: string\n) => {\n // @ts-expect-error-next-line \"getRasterTileService\" is newer that the types\n return platform?.getRasterTileService({\n format: DEFAULT_RASTER_LAYER_FORMAT,\n queryParams: {\n // https://www.here.com/docs/bundle/raster-tile-api-migration-guide/page/README.html#5-language\n lang,\n ppi: getPPI(),\n style,\n features,\n },\n });\n};\n\nexport const getEngineType = (baseLayerName: string, enableWebGL: boolean) => {\n switch (baseLayerName) {\n case MAP_TYPE_FLEET_STYLE:\n case MAP_TYPE_TERRAIN:\n return ENGINE_TYPE_P2D;\n default:\n return enableWebGL ? ENGINE_TYPE_HARP : ENGINE_TYPE_P2D;\n }\n};\n\nexport type BaseLayer = {\n baseLayerName: string;\n defaultLayers: H.service.DefaultLayers;\n enableWebGL: boolean;\n platform: H.service.Platform;\n engineType: H.Map.EngineType;\n language: string;\n vehicleRestrictions: boolean;\n minZoom: number;\n maxZoom: number;\n};\n\nexport type BaseLayerResponse = { baseLayer: H.map.layer.Layer; overlayLayer?: H.map.layer.Layer };\n\nexport const getBaseLayer = async ({\n baseLayerName,\n defaultLayers,\n enableWebGL,\n platform,\n engineType,\n language,\n minZoom,\n maxZoom,\n}: BaseLayer): Promise<BaseLayerResponse> => {\n const restriction = 'disabled'; // vehicleRestrictions ? 'active_and_inactive' : 'disabled';\n const features = `pois:all,environmental_zones:all,congestion_zones:all,vehicle_restrictions:${restriction}`;\n\n if (enableWebGL && baseLayerName === MAP_TYPE_DEFAULT) {\n defaultLayers?.vector.normal.map.setMin(minZoom);\n defaultLayers?.vector.normal.map.setMax(maxZoom);\n\n return {\n baseLayer: defaultLayers?.vector.normal.map,\n };\n }\n switch (baseLayerName) {\n case MAP_TYPE_SATELLITE: {\n if (enableWebGL) {\n // This is a workaround for setting the min and max zoom limit for satellite map\n // since the setMin/setMax cannot be set on the \"defaultLayers.hybrid.liteday.raster\".\n // The HERE support suggested to create a hybrid layer for that and set the zoom limits\n // on the two layers.\n const hybridStyleConfig = {\n base: {\n style: 'oslo',\n scheme: 'hybrid.day',\n },\n };\n\n // This method creates hybrid map layers. A hybrid map consists of raster satellite base layer and vector layers on top.\n // Layers created by this method can be used only when the Map is instantiated with H.Map.EngineType.HARP engineType.\n // See https://www.here.com/docs/bundle/maps-api-for-javascript-api-reference/page/H.service.Platform_4.html#createHybridLayers\n // @ts-expect-error-next-line\n await platform.createHybridLayers(\n hybridStyleConfig,\n // biome-ignore lint/suspicious/noExplicitAny: whatever layer type\n (layers: any) => {\n layers.raster.setMin(minZoom);\n layers.raster.setMax(maxZoom);\n\n layers.vector.setMin(minZoom);\n layers.vector.setMax(maxZoom);\n\n return {\n baseLayer: layers.raster,\n overlayLayer: layers.vector,\n };\n },\n console.error\n );\n }\n return {\n baseLayer: getBaseTileLayer(\n getBaseRasterTileService(platform, 'explore.satellite.day', features, language),\n engineType,\n minZoom,\n maxZoom\n ),\n };\n }\n case MAP_TYPE_TERRAIN: {\n return {\n baseLayer: getBaseTileLayer(\n getBaseRasterTileService(platform, 'topo.day', features, language),\n engineType,\n minZoom,\n maxZoom\n ),\n };\n }\n case MAP_TYPE_FLEET_STYLE: {\n return {\n baseLayer: getBaseTileLayer(\n getBaseRasterTileService(platform, 'logistics.day', features, language),\n ENGINE_TYPE_P2D,\n minZoom,\n maxZoom\n ),\n };\n }\n case MAP_TYPE_NIGHT: {\n if (enableWebGL) {\n // @ts-expect-error-next-line \"setMin\" is working on \"vector.normal.mapnight\"\n defaultLayers?.vector.normal.mapnight.setMin(minZoom);\n // @ts-expect-error-next-line \"setMax\" is working on \"vector.normal.mapnight\"\n defaultLayers?.vector.normal.mapnight.setMax(maxZoom);\n\n return {\n // @ts-expect-error-next-line \"vector.normal.mapnight\" is newer than the types\n baseLayer: defaultLayers.vector.normal.mapnight,\n };\n }\n return {\n baseLayer: getBaseTileLayer(\n getBaseRasterTileService(platform, 'explore.night', features, language),\n engineType,\n minZoom,\n maxZoom\n ),\n };\n }\n default: {\n // As a replacement for \"defaultLayers?.raster.normal.map\" which uses the old and deprecated\n // H.service.MapTileService, we use the Raster Tile Service v3 instead\n return {\n baseLayer: getBaseTileLayer(\n getBaseRasterTileService(platform, 'explore.day', features, language),\n engineType,\n minZoom,\n maxZoom\n ),\n };\n }\n }\n};\n"],"names":["getPPI","isVectorBased","enableWebGL","baseLayer","MAP_TYPE_TERRAIN","MAP_TYPE_FLEET_STYLE","getPlatform","credentials","getBaseTileLayer","rasterTileService","engineType","minZoom","maxZoom","rasterTileProvider","rasterTileLayer","getBaseRasterTileService","platform","style","features","lang","DEFAULT_RASTER_LAYER_FORMAT","getEngineType","baseLayerName","ENGINE_TYPE_P2D","ENGINE_TYPE_HARP","getBaseLayer","defaultLayers","language","MAP_TYPE_DEFAULT","MAP_TYPE_SATELLITE","hybridStyleConfig","layers","MAP_TYPE_NIGHT"],"mappings":"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"}
|