@rio-cloud/rio-uikit 2.0.0 → 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.
Files changed (205) hide show
  1. package/components/actionBarItem/ActionBarItem.d.ts +2 -2
  2. package/components/actionBarItem/ActionBarItem.js.map +1 -1
  3. package/components/applicationHeader/ApplicationHeader.d.ts +6 -7
  4. package/components/applicationHeader/ApplicationHeader.js.map +1 -1
  5. package/components/applicationLayout/SubNavigation.d.ts +7 -0
  6. package/components/applicationLayout/SubNavigation.js.map +1 -1
  7. package/components/assetTree/AssetTree.d.ts +7 -0
  8. package/components/assetTree/AssetTree.js.map +1 -1
  9. package/components/assetTree/Tree.d.ts +15 -0
  10. package/components/assetTree/Tree.js.map +1 -1
  11. package/components/assetTree/TreeIcon.d.ts +30 -0
  12. package/components/assetTree/TreeIcon.js +16 -0
  13. package/components/assetTree/TreeIcon.js.map +1 -0
  14. package/components/assetTree/TreeLeaf.js +22 -22
  15. package/components/assetTree/TreeLeaf.js.map +1 -1
  16. package/components/assetTree/TreeNode.js +25 -25
  17. package/components/assetTree/TreeNode.js.map +1 -1
  18. package/components/assetTree/TreeSearch.d.ts +2 -0
  19. package/components/assetTree/TreeSearch.js.map +1 -1
  20. package/components/barList/BarList.d.ts +26 -0
  21. package/components/barList/BarList.js.map +1 -1
  22. package/components/bottomSheet/BottomSheet.d.ts +17 -3
  23. package/components/bottomSheet/BottomSheet.js.map +1 -1
  24. package/components/bottomSheet/TimedBottomSheet.d.ts +10 -0
  25. package/components/bottomSheet/TimedBottomSheet.js.map +1 -1
  26. package/components/calendarStripe/CalendarStripe.d.ts +1 -1
  27. package/components/calendarStripe/CalendarStripe.js +34 -36
  28. package/components/calendarStripe/CalendarStripe.js.map +1 -1
  29. package/components/charts/Area.d.ts +2 -2
  30. package/components/charts/Area.js.map +1 -1
  31. package/components/charts/Line.d.ts +2 -2
  32. package/components/charts/Line.js.map +1 -1
  33. package/components/checkbox/Checkbox.d.ts +0 -3
  34. package/components/checkbox/Checkbox.js.map +1 -1
  35. package/components/clearableInput/ClearableInput.d.ts +21 -20
  36. package/components/clearableInput/ClearableInput.js.map +1 -1
  37. package/components/collapse/Collapse.d.ts +3 -0
  38. package/components/collapse/Collapse.js +12 -12
  39. package/components/collapse/Collapse.js.map +1 -1
  40. package/components/contentLoader/ContentLoader.d.ts +10 -2
  41. package/components/contentLoader/ContentLoader.js.map +1 -1
  42. package/components/dataTabs/DataTabs.d.ts +6 -0
  43. package/components/dataTabs/DataTabs.js.map +1 -1
  44. package/components/datepicker/DatePicker.d.ts +2 -2
  45. package/components/datepicker/DatePicker.js +31 -31
  46. package/components/datepicker/DatePicker.js.map +1 -1
  47. package/components/dialog/ConfirmationDialog.d.ts +22 -0
  48. package/components/dialog/ConfirmationDialog.js.map +1 -1
  49. package/components/dialog/Dialog.d.ts +13 -1
  50. package/components/dialog/Dialog.js.map +1 -1
  51. package/components/dialog/ReleaseNotesDialog.d.ts +3 -3
  52. package/components/dialog/ReleaseNotesDialog.js.map +1 -1
  53. package/components/dropdown/ButtonDropdown.d.ts +4 -0
  54. package/components/dropdown/ButtonDropdown.js +51 -51
  55. package/components/dropdown/ButtonDropdown.js.map +1 -1
  56. package/components/dropdown/DropdownSubmenu.d.ts +4 -0
  57. package/components/dropdown/DropdownSubmenu.js.map +1 -1
  58. package/components/editableContent/EditableContent.d.ts +6 -0
  59. package/components/editableContent/EditableContent.js.map +1 -1
  60. package/components/expander/ExpanderList.d.ts +3 -0
  61. package/components/expander/ExpanderList.js.map +1 -1
  62. package/components/expander/ExpanderPanel.d.ts +14 -4
  63. package/components/expander/ExpanderPanel.js.map +1 -1
  64. package/components/fade/Fade.d.ts +1 -1
  65. package/components/fade/Fade.js.map +1 -1
  66. package/components/filepicker/FilePicker.d.ts +0 -2
  67. package/components/filepicker/FilePicker.js.map +1 -1
  68. package/components/groupedItemList/GroupedItemList.d.ts +10 -7
  69. package/components/groupedItemList/GroupedItemList.js.map +1 -1
  70. package/components/listMenu/ListMenu.js.map +1 -1
  71. package/components/listMenu/ListMenuGroup.d.ts +2 -1
  72. package/components/listMenu/ListMenuGroup.js.map +1 -1
  73. package/components/map/components/Map.js.map +1 -1
  74. package/components/map/components/constants.js.map +1 -1
  75. package/components/map/components/features/ContextMenuItem.d.ts +1 -1
  76. package/components/map/components/features/ContextMenuItem.js +2 -17
  77. package/components/map/components/features/ContextMenuItem.js.map +1 -1
  78. package/components/map/components/features/basics/Polyline.d.ts +4 -1
  79. package/components/map/components/features/basics/Polyline.js +1 -1
  80. package/components/map/components/features/basics/Polyline.js.map +1 -1
  81. package/components/map/components/features/layers/MarkerLayer.d.ts +3 -1
  82. package/components/map/components/features/layers/MarkerLayer.js.map +1 -1
  83. package/components/map/components/features/layers/clustering/ClusterLayer.js +1 -1
  84. package/components/map/components/features/layers/clustering/ClusterLayer.js.map +1 -1
  85. package/components/map/components/features/layers/clustering/SimpleClusterLayer.d.ts +3 -2
  86. package/components/map/components/features/layers/clustering/SimpleClusterLayer.js.map +1 -1
  87. package/components/map/components/features/layers/overlayLayers/RoadRestrictionLayer.js +7 -7
  88. package/components/map/components/features/layers/overlayLayers/RoadRestrictionLayer.js.map +1 -1
  89. package/components/map/components/features/layers/overlayLayers/TrafficLayer.js +4 -4
  90. package/components/map/components/features/layers/overlayLayers/TrafficLayer.js.map +1 -1
  91. package/components/map/utils/clustering.d.ts +6 -1
  92. package/components/map/utils/clustering.js +25 -19
  93. package/components/map/utils/clustering.js.map +1 -1
  94. package/components/map/utils/rendering.d.ts +1 -1
  95. package/components/map/utils/rendering.js +23 -23
  96. package/components/map/utils/rendering.js.map +1 -1
  97. package/components/menuItems/MenuItem.d.ts +23 -0
  98. package/components/menuItems/MenuItem.js.map +1 -1
  99. package/components/notification/Notification.js +4 -4
  100. package/components/notification/Notification.js.map +1 -1
  101. package/components/onboarding/OnboardingTip.d.ts +18 -12
  102. package/components/onboarding/OnboardingTip.js.map +1 -1
  103. package/components/overlay/OverlayTrigger.d.ts +43 -1
  104. package/components/overlay/OverlayTrigger.js.map +1 -1
  105. package/components/pager/Pager.d.ts +3 -0
  106. package/components/pager/Pager.js.map +1 -1
  107. package/components/popover/Popover.d.ts +1 -0
  108. package/components/popover/Popover.js.map +1 -1
  109. package/components/preloader/ImagePreloader.d.ts +1 -1
  110. package/components/preloader/ImagePreloader.js.map +1 -1
  111. package/components/radiobutton/RadioButton.d.ts +9 -5
  112. package/components/radiobutton/RadioButton.js.map +1 -1
  113. package/components/releaseNotes/ReleaseNotes.d.ts +0 -3
  114. package/components/releaseNotes/ReleaseNotes.js.map +1 -1
  115. package/components/resizer/Resizer.d.ts +17 -3
  116. package/components/resizer/Resizer.js.map +1 -1
  117. package/components/rioglyph/Rioglyph.d.ts +20 -8
  118. package/components/rioglyph/Rioglyph.js.map +1 -1
  119. package/components/rules/RulesWrapper.js +1 -1
  120. package/components/rules/RulesWrapper.js.map +1 -1
  121. package/components/saveableInput/SaveableDateInput.d.ts +20 -2
  122. package/components/saveableInput/SaveableDateInput.js.map +1 -1
  123. package/components/saveableInput/SaveableInput.d.ts +10 -2
  124. package/components/saveableInput/SaveableInput.js.map +1 -1
  125. package/components/selects/BaseSelectDropdown.js +90 -79
  126. package/components/selects/BaseSelectDropdown.js.map +1 -1
  127. package/components/selects/Select.d.ts +5 -0
  128. package/components/selects/Select.js +94 -94
  129. package/components/selects/Select.js.map +1 -1
  130. package/components/sidebars/Sidebar.d.ts +19 -3
  131. package/components/sidebars/Sidebar.js.map +1 -1
  132. package/components/slider/RangeSlider.d.ts +15 -0
  133. package/components/slider/RangeSlider.js.map +1 -1
  134. package/components/slider/Slider.d.ts +9 -0
  135. package/components/slider/Slider.js.map +1 -1
  136. package/components/smoothScrollbars/SmoothScrollbars.d.ts +44 -0
  137. package/components/smoothScrollbars/SmoothScrollbars.js.map +1 -1
  138. package/components/spinner/Spinner.d.ts +3 -3
  139. package/components/spinner/Spinner.js.map +1 -1
  140. package/components/states/BaseStateProps.d.ts +6 -2
  141. package/components/states/StateIcon.d.ts +14 -1
  142. package/components/states/StateIcon.js.map +1 -1
  143. package/components/statsWidget/StatsWidget.d.ts +2 -0
  144. package/components/statsWidget/StatsWidget.js.map +1 -1
  145. package/components/statsWidget/StatsWidgetBody.d.ts +1 -0
  146. package/components/statsWidget/StatsWidgetBody.js.map +1 -1
  147. package/components/statsWidget/StatsWidgetNumber.d.ts +2 -0
  148. package/components/statsWidget/StatsWidgetNumber.js.map +1 -1
  149. package/components/statusBar/StatusBar.d.ts +2 -31
  150. package/components/statusBar/StatusBar.js.map +1 -1
  151. package/components/statusBar/StatusBarIcon.d.ts +2 -2
  152. package/components/statusBar/StatusBarIcon.js.map +1 -1
  153. package/components/statusBar/StatusBarLabel.d.ts +2 -2
  154. package/components/statusBar/StatusBarLabel.js.map +1 -1
  155. package/components/statusBar/StatusBarProgressBar.d.ts +1 -1
  156. package/components/statusBar/StatusBarProgressBar.js.map +1 -1
  157. package/components/statusBar/{StatusBar.types.d.ts → StatusBarProps.d.ts} +44 -2
  158. package/components/steppedProgressBar/SteppedProgressBar.d.ts +1 -1
  159. package/components/steppedProgressBar/SteppedProgressBar.js.map +1 -1
  160. package/components/switch/Switch.d.ts +13 -1
  161. package/components/switch/Switch.js.map +1 -1
  162. package/components/table/SortArrowDown.d.ts +1 -1
  163. package/components/table/SortArrowDown.js.map +1 -1
  164. package/components/table/SortArrowUp.d.ts +1 -1
  165. package/components/table/SortArrowUp.js.map +1 -1
  166. package/components/table/TableSettingsDialog.d.ts +5 -0
  167. package/components/table/TableSettingsDialog.js +119 -109
  168. package/components/table/TableSettingsDialog.js.map +1 -1
  169. package/components/table/TableSettingsDialogFooter.js +9 -9
  170. package/components/table/TableSettingsDialogFooter.js.map +1 -1
  171. package/components/table/TableViewToggles.d.ts +21 -1
  172. package/components/table/TableViewToggles.js.map +1 -1
  173. package/components/tag/Tag.d.ts +7 -2
  174. package/components/tag/Tag.js.map +1 -1
  175. package/components/tagManager/TagManager.d.ts +15 -0
  176. package/components/tagManager/TagManager.js.map +1 -1
  177. package/components/tagManager/TagManagerTag.d.ts +9 -0
  178. package/components/teaser/Teaser.d.ts +57 -55
  179. package/components/teaser/Teaser.js.map +1 -1
  180. package/components/teaser/TeaserContainer.d.ts +1 -1
  181. package/components/teaser/TeaserContainer.js.map +1 -1
  182. package/components/tooltip/SimpleTooltip.d.ts +22 -4
  183. package/components/tooltip/SimpleTooltip.js.map +1 -1
  184. package/components/tooltip/Tooltip.d.ts +22 -2
  185. package/components/tooltip/Tooltip.js.map +1 -1
  186. package/components/video/ResponsiveVideo.d.ts +8 -3
  187. package/components/video/ResponsiveVideo.js.map +1 -1
  188. package/hooks/useKey.d.ts +1 -1
  189. package/hooks/useKey.js.map +1 -1
  190. package/hooks/useOnboarding.d.ts +86 -80
  191. package/hooks/useOnboarding.js.map +1 -1
  192. package/hooks/useTableExport.js.map +1 -1
  193. package/hooks/useUncontrollable.d.ts +1 -1
  194. package/hooks/useUncontrollable.js.map +1 -1
  195. package/package.json +12 -14
  196. package/utils/colorScheme.js +14 -13
  197. package/utils/colorScheme.js.map +1 -1
  198. package/utils/cssuseragent.js.map +1 -1
  199. package/utils/scrollItemIntoView.js +12 -11
  200. package/utils/scrollItemIntoView.js.map +1 -1
  201. package/utils/urlFeatureToggles.js +19 -20
  202. package/utils/urlFeatureToggles.js.map +1 -1
  203. package/version.d.ts +1 -1
  204. package/version.js +1 -1
  205. package/version.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Map.js","sources":["../../../../src/components/map/components/Map.tsx"],"sourcesContent":["import { useRef, useState, useEffect, type CSSProperties } from 'react';\nimport { isEmpty } from 'es-toolkit/compat';\nimport { isEqual } from 'es-toolkit/predicate';\n\nimport {\n MAP_TYPE_DEFAULT,\n MAP_TYPE_FLEET_STYLE,\n MAP_TYPE_SATELLITE,\n MAP_TYPE_TERRAIN,\n MAP_TYPE_NIGHT,\n MAP_LAYER_INCIDENTS,\n MAP_LAYER_TRAFFIC,\n MAP_LAYER_ROAD_RESTRICTIONS,\n DEFAULT_MIN_ZOOM,\n DEFAULT_MAX_ZOOM,\n DEFAULT_PIXEL_RATIO,\n} from './constants';\n\nimport { addEventListenerMap, removeEventListenerMap } from '../utils/eventHandling';\nimport { MapContext } from './MapContext';\nimport { createUtils, getMapBounds } from '../utils/mapUtils';\nimport { getHereUi } from '../utils/mapUi';\nimport useDarkMode from '../../../hooks/useDarkMode';\nimport MapZoom from './features/MapZoom';\nimport MapOverlayLayers from './features/layers/MapOverlayLayers';\nimport MapSize from './MapSize';\nimport MapPosition from './MapPosition';\nimport MapElements from './MapElements';\nimport type { MapApi, MapLayer, MapProps, MapType } from '../utils/mapTypes';\nimport { getPlatform, getEngineType, getBaseLayer } from '../utils/rendering';\n\n// biome-ignore lint/suspicious/noShadowRestrictedNames: <explanation>\nconst Map = (props: MapProps) => {\n const {\n children,\n credentials,\n width,\n height,\n language: lang = 'en',\n center,\n zoom,\n zoomAnimation = false,\n boundingBox,\n hideClusterSettings = false,\n hideMapLayerSettings = false,\n disableMapEvents,\n disableBehavior = false,\n disableZoomMomentum = true,\n eventListenerMap,\n mapType = MAP_TYPE_DEFAULT,\n mapLayer = [],\n showCluster: externalShowCluster = true,\n showScaleBar = false,\n onMapLayerChange = () => {},\n onMapTypeChange = () => {},\n onShowClusterChange = () => {},\n onZoomIn = () => {},\n onZoomOut = () => {},\n onIncidentsChange = () => {},\n mapSettingsTooltip,\n mapSettings,\n enableWebGL = true,\n enableDevicePixelRatio = true,\n pixelRatio = DEFAULT_PIXEL_RATIO,\n minZoom = DEFAULT_MIN_ZOOM,\n maxZoom = DEFAULT_MAX_ZOOM,\n } = props;\n\n let safeMaxZoom = maxZoom;\n\n if (minZoom > maxZoom) {\n // Avoid crashing the map for invalid zoom limits\n safeMaxZoom = DEFAULT_MAX_ZOOM;\n console.error('Invalid condition for zoom limits: min <= max)');\n }\n\n const mapRef = useRef<HTMLDivElement>(null);\n\n const [isMapInitialized, setMapInitialized] = useState(false);\n\n const [api, setApi] = useState<MapApi>();\n\n const [baseLayer, setBaseLayer] = useState<MapType>(mapType);\n const [activeLayers, setActiveLayers] = useState<MapLayer[]>(mapLayer);\n const [showCluster, setShowCluster] = useState(externalShowCluster);\n\n const devicePixelRatio = enableDevicePixelRatio ? window.devicePixelRatio || pixelRatio : pixelRatio;\n\n // Only short locale is supported by HERE Map\n const language = (locale => (locale === 'nb' ? 'no' : locale))(lang.split('-')[0].toLowerCase());\n\n useEffect(() => {\n let allMapObjects: H.map.Object[] = [];\n\n if (api?.map) {\n allMapObjects = api.map.getObjects();\n console.debug('re-initialize here map');\n } else {\n console.debug('initialize here map');\n }\n\n if (api?.map) {\n // Cleanup any previously initialized map before doing anything else\n console.debug('disposing previous map');\n removeEventListenerMap(api.map);\n\n if (api.mapEvents) {\n api.mapEvents.dispose();\n }\n\n api.map.dispose();\n }\n\n const bounds = boundingBox && getMapBounds(boundingBox);\n\n // Initialize communication with the platform\n const platform = getPlatform(credentials);\n\n // Specify engine type. In this example, we use HARP rendering engine, which is capable\n // of rendering vector data using the style configuration exported from the HERE Style Editor.\n // HARP engine is not the default engine, and it's not included in the mapsjs-core.js module.\n // To use this engine, you need to include mapsjs-harp.js file to your HTML page\n const engineType = getEngineType(baseLayer, enableWebGL);\n\n // Obtain the default map types from the platform object\n // @ts-ignore-next-line: according to the Here docs, the engine type exists\n // see https://www.here.com/docs/bundle/maps-api-for-javascript-developer-guide/page/topics/harp-migrate.html\n const defaultLayers = platform.createDefaultLayers({ engineType, lg: language, pois: true });\n\n getBaseLayer({\n baseLayerName: baseLayer,\n defaultLayers,\n enableWebGL,\n platform,\n engineType,\n vehicleRestrictions: activeLayers.includes(MAP_LAYER_ROAD_RESTRICTIONS),\n language,\n minZoom,\n maxZoom: safeMaxZoom,\n }).then(defaultLayerMap => {\n // Initialize the map\n const hereMap = new H.Map(mapRef.current as Element, defaultLayerMap.baseLayer, {\n zoom,\n center,\n bounds,\n engineType,\n pixelRatio: devicePixelRatio,\n fixedCenter: true,\n });\n\n if (defaultLayerMap.overlayLayer) {\n // Special case for satellite map where we render street labels and road signs as well as additional pois as vector data\n // hereMap.setBaseLayer(defaultLayerMap.baseLayer);\n hereMap.addLayer(defaultLayerMap.overlayLayer);\n }\n\n setMapInitialized(true);\n\n let hereMapEvents: H.mapevents.MapEvents | false = false;\n let hereBehavior: H.mapevents.Behavior | undefined;\n\n if (!disableMapEvents) {\n // Enable the map event system\n hereMapEvents = new H.mapevents.MapEvents(hereMap);\n }\n\n if (!(disableMapEvents || disableBehavior)) {\n hereBehavior = new H.mapevents.Behavior(hereMapEvents as H.mapevents.MapEvents);\n // @ts-ignore-next-line\n hereBehavior.disable(H.mapevents.Behavior.Feature.FRACTIONAL_ZOOM);\n\n if (disableZoomMomentum) {\n // Disable the inertia that occurs on WebGL maps when scrolling/zooming.\n // This resulted in a very high scroll sensitivity.\n // @ts-ignore-next-line\n hereBehavior.disable(H.mapevents.Behavior.Feature.ZOOM_MOMENTUM);\n }\n }\n\n addEventListenerMap(hereMap, eventListenerMap, hereMap);\n\n const hereUi = getHereUi(hereMap, defaultLayers, showScaleBar, language);\n\n // The api will be passed to services when using a render function.\n // This allows the service to access the map internals\n setApi({\n credentials,\n defaultLayers,\n map: hereMap,\n mapEvents: hereMapEvents,\n behavior: hereBehavior,\n platform,\n ui: hereUi,\n utils: createUtils(hereMap),\n // Put settings back into the map API object so the invoking service\n // can check on these settings for instance inside a test\n settings: {\n enableWebGL,\n baseLayer,\n activeLayers,\n showCluster,\n minZoom,\n maxZoom: safeMaxZoom,\n },\n });\n\n if (allMapObjects) {\n // If the base layer changed, re-add all previous objects again,\n // otherwise the map would be empty\n hereMap.addObjects(allMapObjects);\n }\n });\n }, [enableWebGL, enableDevicePixelRatio, language, baseLayer, minZoom, maxZoom]);\n\n const isDarkMode = useDarkMode();\n useEffect(() => {\n // Toggle night map only if current map type is default\n if (isDarkMode && baseLayer === MAP_TYPE_DEFAULT) {\n handleMapTypeChange(MAP_TYPE_NIGHT);\n }\n // Toggle back to default map only if current map type is night\n else if (!isDarkMode && baseLayer === MAP_TYPE_NIGHT) {\n handleMapTypeChange(MAP_TYPE_DEFAULT);\n }\n }, [isDarkMode, language]);\n\n // Update MapType from outside\n useEffect(() => handleMapTypeChange(mapType), [mapType]);\n\n // Update MapLayer from outside\n const [previousMapLayer, setPreviousMapLayer] = useState(mapLayer);\n if (!isEqual(mapLayer, previousMapLayer)) {\n setActiveLayers(mapLayer);\n setPreviousMapLayer(mapLayer);\n }\n\n // Update Cluster setting from outside\n useEffect(() => setShowCluster(externalShowCluster), [externalShowCluster]);\n\n const handleMapTypeChange = (newMapType: MapType) => {\n setBaseLayer(newMapType);\n onMapTypeChange(newMapType, mapType);\n };\n\n const handleMapLayerChange = (layer: MapLayer) => {\n const removeLayer = (layerToRemove: string) => activeLayers.filter(item => item !== layerToRemove);\n const newActiveLayers = activeLayers.includes(layer) ? removeLayer(layer) : [...activeLayers, layer];\n setActiveLayers(newActiveLayers);\n onMapLayerChange(newActiveLayers, activeLayers);\n };\n\n const handleShowClusterChange = (newShowCluster: boolean) => {\n setShowCluster(newShowCluster);\n onShowClusterChange(newShowCluster);\n };\n\n // Note: For performance reasons, we deactivate pointer events and hence CSS style recalculation for the\n // the body. Having for instance many assets in the tree causes a performance loss when clicking on the map\n // to move it and zoom in/out since the map triggers a style invalidation and recalculation and\n // due to the nature of the AssetTree with it's hundreds DOM nodes, applying the CSS selectors\n // takes time.\n const handleMapInteractionStart = () => {\n document.querySelector('.AssetTree')?.classList.add('pointer-events-none');\n };\n const handleMapInteractionEnd = () => {\n document.querySelector('.AssetTree')?.classList.remove('pointer-events-none');\n };\n\n const style: CSSProperties = {};\n if (height) {\n style.height = height;\n }\n if (width) {\n style.width = width;\n }\n const autoHeightClass = isEmpty(style) ? 'height-100pct' : '';\n\n return (\n <div\n className={`Map position-relative map-type-${baseLayer.toLowerCase()} ${autoHeightClass}`}\n style={style}\n ref={mapRef}\n onTouchStart={handleMapInteractionStart}\n onTouchEnd={handleMapInteractionEnd}\n onMouseEnter={handleMapInteractionStart}\n onMouseOut={handleMapInteractionEnd}\n onBlur={handleMapInteractionEnd}\n >\n {isMapInitialized && api && (\n <MapContext.Provider\n value={{\n api,\n language,\n enableWebGL,\n showCluster,\n activeLayers,\n baseLayer,\n hideMapLayerSettings,\n hideClusterSettings,\n onMapTypeChange: handleMapTypeChange,\n onMapLayerChange: handleMapLayerChange,\n onShowClusterChange: handleShowClusterChange,\n mapSettingsTooltip,\n onIncidentsChange,\n devicePixelRatio,\n }}\n >\n <MapPosition api={api} boundingBox={boundingBox} center={center} zoomAnimation={zoomAnimation} />\n <MapSize api={api} />\n <MapZoom\n zoom={zoom}\n hideZoomButtons={disableBehavior}\n onZoomIn={onZoomIn}\n onZoomOut={onZoomOut}\n zoomAnimation={zoomAnimation}\n />\n {mapSettings && mapSettings}\n <MapOverlayLayers layers={activeLayers} />\n <MapElements api={api}>{children}</MapElements>\n </MapContext.Provider>\n )}\n </div>\n );\n};\n\nMap.TYPE_DEFAULT = MAP_TYPE_DEFAULT;\nMap.TYPE_FLEET_STYLE = MAP_TYPE_FLEET_STYLE;\nMap.TYPE_SATELLITE = MAP_TYPE_SATELLITE;\nMap.TYPE_TERRAIN = MAP_TYPE_TERRAIN;\nMap.TYPE_NIGHT = MAP_TYPE_NIGHT;\n\nMap.LAYER_INCIDENTS = MAP_LAYER_INCIDENTS;\nMap.LAYER_TRAFFIC = MAP_LAYER_TRAFFIC;\nMap.LAYER_ROAD_RESTRICTIONS = MAP_LAYER_ROAD_RESTRICTIONS;\n\nexport default Map;\n"],"names":["Map","props","children","credentials","width","height","lang","center","zoom","zoomAnimation","boundingBox","hideClusterSettings","hideMapLayerSettings","disableMapEvents","disableBehavior","disableZoomMomentum","eventListenerMap","mapType","MAP_TYPE_DEFAULT","mapLayer","externalShowCluster","showScaleBar","onMapLayerChange","onMapTypeChange","onShowClusterChange","onZoomIn","onZoomOut","onIncidentsChange","mapSettingsTooltip","mapSettings","enableWebGL","enableDevicePixelRatio","pixelRatio","DEFAULT_PIXEL_RATIO","minZoom","DEFAULT_MIN_ZOOM","maxZoom","DEFAULT_MAX_ZOOM","safeMaxZoom","mapRef","useRef","isMapInitialized","setMapInitialized","useState","api","setApi","baseLayer","setBaseLayer","activeLayers","setActiveLayers","showCluster","setShowCluster","devicePixelRatio","language","locale","useEffect","allMapObjects","removeEventListenerMap","bounds","getMapBounds","platform","getPlatform","engineType","getEngineType","defaultLayers","getBaseLayer","MAP_LAYER_ROAD_RESTRICTIONS","defaultLayerMap","hereMap","hereMapEvents","hereBehavior","addEventListenerMap","hereUi","getHereUi","createUtils","isDarkMode","useDarkMode","handleMapTypeChange","MAP_TYPE_NIGHT","previousMapLayer","setPreviousMapLayer","isEqual","newMapType","handleMapLayerChange","layer","removeLayer","layerToRemove","item","newActiveLayers","handleShowClusterChange","newShowCluster","handleMapInteractionStart","handleMapInteractionEnd","style","autoHeightClass","isEmpty","jsx","jsxs","MapContext","MapPosition","MapSize","MapZoom","MapOverlayLayers","MapElements","MAP_TYPE_FLEET_STYLE","MAP_TYPE_SATELLITE","MAP_TYPE_TERRAIN","MAP_LAYER_INCIDENTS","MAP_LAYER_TRAFFIC"],"mappings":";;;;;;;;;;;;;;;;AAgCA,MAAMA,IAAM,CAACC,MAAoB;AAC7B,QAAM;AAAA,IACF,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAUC,IAAO;AAAA,IACjB,QAAAC;AAAA,IACA,MAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,aAAAC;AAAA,IACA,qBAAAC,KAAsB;AAAA,IACtB,sBAAAC,KAAuB;AAAA,IACvB,kBAAAC;AAAA,IACA,iBAAAC,IAAkB;AAAA,IAClB,qBAAAC,KAAsB;AAAA,IACtB,kBAAAC;AAAA,IACA,SAAAC,IAAUC;AAAA,IACV,UAAAC,IAAW,CAAA;AAAA,IACX,aAAaC,IAAsB;AAAA,I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;AAAA,cAACK;AAAA,cAAA;AAAA,gBACG,MAAA7F;AAAA,gBACA,iBAAiBM;AAAA,gBACjB,UAAAW;AAAA,gBACA,WAAAC;AAAA,gBACA,eAAAjB;AAAA,cAAA;AAAA,YAAA;AAAA,YAEHoB,KAAeA;AAAA,YAChB,gBAAAmE,EAACM,IAAA,EAAiB,QAAQtD,EAAA,CAAc;AAAA,YACxC,gBAAAgD,EAACO,IAAA,EAAY,KAAA3D,GAAW,UAAA1C,EAAA,CAAS;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACrC;AAAA,EAAA;AAIhB;AAEAF,EAAI,eAAekB;AACnBlB,EAAI,mBAAmBwG;AACvBxG,EAAI,iBAAiByG;AACrBzG,EAAI,eAAe0G;AACnB1G,EAAI,aAAa8E;AAEjB9E,EAAI,kBAAkB2G;AACtB3G,EAAI,gBAAgB4G;AACpB5G,EAAI,0BAA0BkE;"}
1
+ {"version":3,"file":"Map.js","sources":["../../../../src/components/map/components/Map.tsx"],"sourcesContent":["import { useRef, useState, useEffect, type CSSProperties } from 'react';\nimport { isEmpty } from 'es-toolkit/compat';\nimport { isEqual } from 'es-toolkit/predicate';\n\nimport {\n MAP_TYPE_DEFAULT,\n MAP_TYPE_FLEET_STYLE,\n MAP_TYPE_SATELLITE,\n MAP_TYPE_TERRAIN,\n MAP_TYPE_NIGHT,\n MAP_LAYER_INCIDENTS,\n MAP_LAYER_TRAFFIC,\n MAP_LAYER_ROAD_RESTRICTIONS,\n DEFAULT_MIN_ZOOM,\n DEFAULT_MAX_ZOOM,\n DEFAULT_PIXEL_RATIO,\n} from './constants';\n\nimport { addEventListenerMap, removeEventListenerMap } from '../utils/eventHandling';\nimport { MapContext } from './MapContext';\nimport { createUtils, getMapBounds } from '../utils/mapUtils';\nimport { getHereUi } from '../utils/mapUi';\nimport useDarkMode from '../../../hooks/useDarkMode';\nimport MapZoom from './features/MapZoom';\nimport MapOverlayLayers from './features/layers/MapOverlayLayers';\nimport MapSize from './MapSize';\nimport MapPosition from './MapPosition';\nimport MapElements from './MapElements';\nimport type { MapApi, MapLayer, MapProps, MapType } from '../utils/mapTypes';\nimport { getPlatform, getEngineType, getBaseLayer } from '../utils/rendering';\n\nconst Map = (props: MapProps) => {\n const {\n children,\n credentials,\n width,\n height,\n language: lang = 'en',\n center,\n zoom,\n zoomAnimation = false,\n boundingBox,\n hideClusterSettings = false,\n hideMapLayerSettings = false,\n disableMapEvents,\n disableBehavior = false,\n disableZoomMomentum = true,\n eventListenerMap,\n mapType = MAP_TYPE_DEFAULT,\n mapLayer = [],\n showCluster: externalShowCluster = true,\n showScaleBar = false,\n onMapLayerChange = () => {},\n onMapTypeChange = () => {},\n onShowClusterChange = () => {},\n onZoomIn = () => {},\n onZoomOut = () => {},\n onIncidentsChange = () => {},\n mapSettingsTooltip,\n mapSettings,\n enableWebGL = true,\n enableDevicePixelRatio = true,\n pixelRatio = DEFAULT_PIXEL_RATIO,\n minZoom = DEFAULT_MIN_ZOOM,\n maxZoom = DEFAULT_MAX_ZOOM,\n } = props;\n\n let safeMaxZoom = maxZoom;\n\n if (minZoom > maxZoom) {\n // Avoid crashing the map for invalid zoom limits\n safeMaxZoom = DEFAULT_MAX_ZOOM;\n console.error('Invalid condition for zoom limits: min <= max)');\n }\n\n const mapRef = useRef<HTMLDivElement>(null);\n\n const [isMapInitialized, setMapInitialized] = useState(false);\n\n const [api, setApi] = useState<MapApi>();\n\n const [baseLayer, setBaseLayer] = useState<MapType>(mapType);\n const [activeLayers, setActiveLayers] = useState<MapLayer[]>(mapLayer);\n const [showCluster, setShowCluster] = useState(externalShowCluster);\n\n const devicePixelRatio = enableDevicePixelRatio ? window.devicePixelRatio || pixelRatio : pixelRatio;\n\n // Only short locale is supported by HERE Map\n const language = (locale => (locale === 'nb' ? 'no' : locale))(lang.split('-')[0].toLowerCase());\n\n useEffect(() => {\n let allMapObjects: H.map.Object[] = [];\n\n if (api?.map) {\n allMapObjects = api.map.getObjects();\n console.debug('re-initialize here map');\n } else {\n console.debug('initialize here map');\n }\n\n if (api?.map) {\n // Cleanup any previously initialized map before doing anything else\n console.debug('disposing previous map');\n removeEventListenerMap(api.map);\n\n if (api.mapEvents) {\n api.mapEvents.dispose();\n }\n\n api.map.dispose();\n }\n\n const bounds = boundingBox && getMapBounds(boundingBox);\n\n // Initialize communication with the platform\n const platform = getPlatform(credentials);\n\n // Specify engine type. In this example, we use HARP rendering engine, which is capable\n // of rendering vector data using the style configuration exported from the HERE Style Editor.\n // HARP engine is not the default engine, and it's not included in the mapsjs-core.js module.\n // To use this engine, you need to include mapsjs-harp.js file to your HTML page\n const engineType = getEngineType(baseLayer, enableWebGL);\n\n // Obtain the default map types from the platform object\n // @ts-expect-error-next-line: according to the Here docs, the engine type exists\n // see https://www.here.com/docs/bundle/maps-api-for-javascript-developer-guide/page/topics/harp-migrate.html\n const defaultLayers = platform.createDefaultLayers({ engineType, lg: language, pois: true });\n\n getBaseLayer({\n baseLayerName: baseLayer,\n defaultLayers,\n enableWebGL,\n platform,\n engineType,\n vehicleRestrictions: activeLayers.includes(MAP_LAYER_ROAD_RESTRICTIONS),\n language,\n minZoom,\n maxZoom: safeMaxZoom,\n }).then(defaultLayerMap => {\n // Initialize the map\n const hereMap = new H.Map(mapRef.current as Element, defaultLayerMap.baseLayer, {\n zoom,\n center,\n bounds,\n engineType,\n pixelRatio: devicePixelRatio,\n fixedCenter: true,\n });\n\n if (defaultLayerMap.overlayLayer) {\n // Special case for satellite map where we render street labels and road signs as well as additional pois as vector data\n // hereMap.setBaseLayer(defaultLayerMap.baseLayer);\n hereMap.addLayer(defaultLayerMap.overlayLayer);\n }\n\n setMapInitialized(true);\n\n let hereMapEvents: H.mapevents.MapEvents | false = false;\n let hereBehavior: H.mapevents.Behavior | undefined;\n\n if (!disableMapEvents) {\n // Enable the map event system\n hereMapEvents = new H.mapevents.MapEvents(hereMap);\n }\n\n if (!(disableMapEvents || disableBehavior)) {\n hereBehavior = new H.mapevents.Behavior(hereMapEvents as H.mapevents.MapEvents);\n // @ts-expect-error-next-line\n hereBehavior.disable(H.mapevents.Behavior.Feature.FRACTIONAL_ZOOM);\n\n if (disableZoomMomentum) {\n // Disable the inertia that occurs on WebGL maps when scrolling/zooming.\n // This resulted in a very high scroll sensitivity.\n // @ts-expect-error-next-line\n hereBehavior.disable(H.mapevents.Behavior.Feature.ZOOM_MOMENTUM);\n }\n }\n\n addEventListenerMap(hereMap, eventListenerMap, hereMap);\n\n const hereUi = getHereUi(hereMap, defaultLayers, showScaleBar, language);\n\n // The api will be passed to services when using a render function.\n // This allows the service to access the map internals\n setApi({\n credentials,\n defaultLayers,\n map: hereMap,\n mapEvents: hereMapEvents,\n behavior: hereBehavior,\n platform,\n ui: hereUi,\n utils: createUtils(hereMap),\n // Put settings back into the map API object so the invoking service\n // can check on these settings for instance inside a test\n settings: {\n enableWebGL,\n baseLayer,\n activeLayers,\n showCluster,\n minZoom,\n maxZoom: safeMaxZoom,\n },\n });\n\n if (allMapObjects) {\n // If the base layer changed, re-add all previous objects again,\n // otherwise the map would be empty\n hereMap.addObjects(allMapObjects);\n }\n });\n }, [enableWebGL, enableDevicePixelRatio, language, baseLayer, minZoom, maxZoom]);\n\n const isDarkMode = useDarkMode();\n useEffect(() => {\n // Toggle night map only if current map type is default\n if (isDarkMode && baseLayer === MAP_TYPE_DEFAULT) {\n handleMapTypeChange(MAP_TYPE_NIGHT);\n }\n // Toggle back to default map only if current map type is night\n else if (!isDarkMode && baseLayer === MAP_TYPE_NIGHT) {\n handleMapTypeChange(MAP_TYPE_DEFAULT);\n }\n }, [isDarkMode, language]);\n\n // Update MapType from outside\n useEffect(() => handleMapTypeChange(mapType), [mapType]);\n\n // Update MapLayer from outside\n const [previousMapLayer, setPreviousMapLayer] = useState(mapLayer);\n if (!isEqual(mapLayer, previousMapLayer)) {\n setActiveLayers(mapLayer);\n setPreviousMapLayer(mapLayer);\n }\n\n // Update Cluster setting from outside\n useEffect(() => setShowCluster(externalShowCluster), [externalShowCluster]);\n\n const handleMapTypeChange = (newMapType: MapType) => {\n setBaseLayer(newMapType);\n onMapTypeChange(newMapType, mapType);\n };\n\n const handleMapLayerChange = (layer: MapLayer) => {\n const removeLayer = (layerToRemove: string) => activeLayers.filter(item => item !== layerToRemove);\n const newActiveLayers = activeLayers.includes(layer) ? removeLayer(layer) : [...activeLayers, layer];\n setActiveLayers(newActiveLayers);\n onMapLayerChange(newActiveLayers, activeLayers);\n };\n\n const handleShowClusterChange = (newShowCluster: boolean) => {\n setShowCluster(newShowCluster);\n onShowClusterChange(newShowCluster);\n };\n\n // Note: For performance reasons, we deactivate pointer events and hence CSS style recalculation for the\n // the body. Having for instance many assets in the tree causes a performance loss when clicking on the map\n // to move it and zoom in/out since the map triggers a style invalidation and recalculation and\n // due to the nature of the AssetTree with it's hundreds DOM nodes, applying the CSS selectors\n // takes time.\n const handleMapInteractionStart = () => {\n document.querySelector('.AssetTree')?.classList.add('pointer-events-none');\n };\n const handleMapInteractionEnd = () => {\n document.querySelector('.AssetTree')?.classList.remove('pointer-events-none');\n };\n\n const style: CSSProperties = {};\n if (height) {\n style.height = height;\n }\n if (width) {\n style.width = width;\n }\n const autoHeightClass = isEmpty(style) ? 'height-100pct' : '';\n\n return (\n <div\n className={`Map position-relative map-type-${baseLayer.toLowerCase()} ${autoHeightClass}`}\n style={style}\n ref={mapRef}\n onTouchStart={handleMapInteractionStart}\n onTouchEnd={handleMapInteractionEnd}\n onMouseEnter={handleMapInteractionStart}\n onMouseOut={handleMapInteractionEnd}\n onBlur={handleMapInteractionEnd}\n >\n {isMapInitialized && api && (\n <MapContext.Provider\n value={{\n api,\n language,\n enableWebGL,\n showCluster,\n activeLayers,\n baseLayer,\n hideMapLayerSettings,\n hideClusterSettings,\n onMapTypeChange: handleMapTypeChange,\n onMapLayerChange: handleMapLayerChange,\n onShowClusterChange: handleShowClusterChange,\n mapSettingsTooltip,\n onIncidentsChange,\n devicePixelRatio,\n }}\n >\n <MapPosition api={api} boundingBox={boundingBox} center={center} zoomAnimation={zoomAnimation} />\n <MapSize api={api} />\n <MapZoom\n zoom={zoom}\n hideZoomButtons={disableBehavior}\n onZoomIn={onZoomIn}\n onZoomOut={onZoomOut}\n zoomAnimation={zoomAnimation}\n />\n {mapSettings && mapSettings}\n <MapOverlayLayers layers={activeLayers} />\n <MapElements api={api}>{children}</MapElements>\n </MapContext.Provider>\n )}\n </div>\n );\n};\n\nMap.TYPE_DEFAULT = MAP_TYPE_DEFAULT;\nMap.TYPE_FLEET_STYLE = MAP_TYPE_FLEET_STYLE;\nMap.TYPE_SATELLITE = MAP_TYPE_SATELLITE;\nMap.TYPE_TERRAIN = MAP_TYPE_TERRAIN;\nMap.TYPE_NIGHT = MAP_TYPE_NIGHT;\n\nMap.LAYER_INCIDENTS = MAP_LAYER_INCIDENTS;\nMap.LAYER_TRAFFIC = MAP_LAYER_TRAFFIC;\nMap.LAYER_ROAD_RESTRICTIONS = MAP_LAYER_ROAD_RESTRICTIONS;\n\nexport default Map;\n"],"names":["Map","props","children","credentials","width","height","lang","center","zoom","zoomAnimation","boundingBox","hideClusterSettings","hideMapLayerSettings","disableMapEvents","disableBehavior","disableZoomMomentum","eventListenerMap","mapType","MAP_TYPE_DEFAULT","mapLayer","externalShowCluster","showScaleBar","onMapLayerChange","onMapTypeChange","onShowClusterChange","onZoomIn","onZoomOut","onIncidentsChange","mapSettingsTooltip","mapSettings","enableWebGL","enableDevicePixelRatio","pixelRatio","DEFAULT_PIXEL_RATIO","minZoom","DEFAULT_MIN_ZOOM","maxZoom","DEFAULT_MAX_ZOOM","safeMaxZoom","mapRef","useRef","isMapInitialized","setMapInitialized","useState","api","setApi","baseLayer","setBaseLayer","activeLayers","setActiveLayers","showCluster","setShowCluster","devicePixelRatio","language","locale","useEffect","allMapObjects","removeEventListenerMap","bounds","getMapBounds","platform","getPlatform","engineType","getEngineType","defaultLayers","getBaseLayer","MAP_LAYER_ROAD_RESTRICTIONS","defaultLayerMap","hereMap","hereMapEvents","hereBehavior","addEventListenerMap","hereUi","getHereUi","createUtils","isDarkMode","useDarkMode","handleMapTypeChange","MAP_TYPE_NIGHT","previousMapLayer","setPreviousMapLayer","isEqual","newMapType","handleMapLayerChange","layer","removeLayer","layerToRemove","item","newActiveLayers","handleShowClusterChange","newShowCluster","handleMapInteractionStart","handleMapInteractionEnd","style","autoHeightClass","isEmpty","jsx","jsxs","MapContext","MapPosition","MapSize","MapZoom","MapOverlayLayers","MapElements","MAP_TYPE_FLEET_STYLE","MAP_TYPE_SATELLITE","MAP_TYPE_TERRAIN","MAP_LAYER_INCIDENTS","MAP_LAYER_TRAFFIC"],"mappings":";;;;;;;;;;;;;;;;AA+BA,MAAMA,IAAM,CAACC,MAAoB;AAC7B,QAAM;AAAA,IACF,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAUC,IAAO;AAAA,IACjB,QAAAC;AAAA,IACA,MAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,aAAAC;AAAA,IACA,qBAAAC,KAAsB;AAAA,IACtB,sBAAAC,KAAuB;AAAA,IACvB,kBAAAC;AAAA,IACA,iBAAAC,IAAkB;AAAA,IAClB,qBAAAC,KAAsB;AAAA,IACtB,kBAAAC;AAAA,IACA,SAAAC,IAAUC;AAAA,IACV,UAAAC,IAAW,CAAA;AAAA,IACX,aAAaC,IAAsB;AAAA,IACnC,cAAAC,KAAe;AAAA,IACf,kBAAAC,KAAmB,MAAM;AAAA,IAAC;AAAA,IAC1B,iBAAAC,KAAkB,MAAM;AAAA,IAAC;AAAA,IACzB,qBAAAC,KAAsB,MAAM;AAAA,IAAC;AAAA,IAC7B,UAAAC,KAAW,MAAM;AAAA,IAAC;AAAA,IAClB,WAAAC,KAAY,MAAM;AAAA,IAAC;AAAA,IACnB,mBAAAC,KAAoB,MAAM;AAAA,IAAC;AAAA,IAC3B,oBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,wBAAAC,I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hB;AAEAF,EAAI,eAAekB;AACnBlB,EAAI,mBAAmBwG;AACvBxG,EAAI,iBAAiByG;AACrBzG,EAAI,eAAe0G;AACnB1G,EAAI,aAAa8E;AAEjB9E,EAAI,kBAAkB2G;AACtB3G,EAAI,gBAAgB4G;AACpB5G,EAAI,0BAA0BkE;"}
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../src/components/map/components/constants.ts"],"sourcesContent":["import type { MapType } from '../utils/mapTypes';\n\nexport const MAP_TYPE_DEFAULT: MapType = 'DEFAULT';\nexport const MAP_TYPE_FLEET_STYLE: MapType = 'FLEET_STYLE';\nexport const MAP_TYPE_SATELLITE: MapType = 'SATELLITE';\nexport const MAP_TYPE_TERRAIN: MapType = 'TERRAIN';\nexport const MAP_TYPE_NIGHT: MapType = 'NIGHT';\n\nexport const MAP_LAYER_INCIDENTS = 'INCIDENTS';\nexport const MAP_LAYER_TRAFFIC = 'TRAFFIC';\nexport const MAP_LAYER_ROAD_RESTRICTIONS = 'ROAD_RESTRICTIONS';\n\n// outdated?\nexport const FORMAT = 'png8';\nexport const TILE_SIZE = 256;\nexport const TILE_TYPE = 'maptile';\n\nexport const NO_CREDENTIALS_ERROR_MESSAGE = 'Cannot instantiate the Map. Missing credentials property.';\n\n// @ts-ignore-next-line\n// biome-ignore lint/complexity/useLiteralKeys: <explanation>\nexport const ENGINE_TYPE_HARP = H.Map.EngineType['HARP'];\nexport const ENGINE_TYPE_P2D = H.Map.EngineType.P2D;\n\nexport const DEFAULT_TILE_SIZE = 512;\nexport const DEFAULT_RASTER_LAYER_FORMAT = 'png'; // 'jpeg';\n\nexport const DEFAULT_MIN_ZOOM = 3;\nexport const DEFAULT_MAX_ZOOM = 20;\n\nexport const DEFAULT_PIXEL_RATIO = 2;\n"],"names":["MAP_TYPE_DEFAULT","MAP_TYPE_FLEET_STYLE","MAP_TYPE_SATELLITE","MAP_TYPE_TERRAIN","MAP_TYPE_NIGHT","MAP_LAYER_INCIDENTS","MAP_LAYER_TRAFFIC","MAP_LAYER_ROAD_RESTRICTIONS","ENGINE_TYPE_HARP","ENGINE_TYPE_P2D","DEFAULT_TILE_SIZE","DEFAULT_RASTER_LAYER_FORMAT","DEFAULT_MIN_ZOOM","DEFAULT_MAX_ZOOM","DEFAULT_PIXEL_RATIO"],"mappings":"AAEO,MAAMA,IAA4B,WAC5BC,IAAgC,eAChCC,IAA8B,aAC9BC,IAA4B,WAC5BC,IAA0B,SAE1BC,IAAsB,aACtBC,IAAoB,WACpBC,IAA8B,qBAW9BC,IAAmB,EAAE,IAAI,WAAW,MACpCC,IAAkB,EAAE,IAAI,WAAW,KAEnCC,IAAoB,KACpBC,IAA8B,OAE9BC,IAAmB,GACnBC,IAAmB,IAEnBC,IAAsB;"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../src/components/map/components/constants.ts"],"sourcesContent":["import type { MapType } from '../utils/mapTypes';\n\nexport const MAP_TYPE_DEFAULT: MapType = 'DEFAULT';\nexport const MAP_TYPE_FLEET_STYLE: MapType = 'FLEET_STYLE';\nexport const MAP_TYPE_SATELLITE: MapType = 'SATELLITE';\nexport const MAP_TYPE_TERRAIN: MapType = 'TERRAIN';\nexport const MAP_TYPE_NIGHT: MapType = 'NIGHT';\n\nexport const MAP_LAYER_INCIDENTS = 'INCIDENTS';\nexport const MAP_LAYER_TRAFFIC = 'TRAFFIC';\nexport const MAP_LAYER_ROAD_RESTRICTIONS = 'ROAD_RESTRICTIONS';\n\n// outdated?\nexport const FORMAT = 'png8';\nexport const TILE_SIZE = 256;\nexport const TILE_TYPE = 'maptile';\n\nexport const NO_CREDENTIALS_ERROR_MESSAGE = 'Cannot instantiate the Map. Missing credentials property.';\n\n// @ts-expect-error-next-line\n// biome-ignore lint/complexity/useLiteralKeys: here map has not added HARP to EngineType but it works like this\nexport const ENGINE_TYPE_HARP = H.Map.EngineType['HARP'];\nexport const ENGINE_TYPE_P2D = H.Map.EngineType.P2D;\n\nexport const DEFAULT_TILE_SIZE = 512;\nexport const DEFAULT_RASTER_LAYER_FORMAT = 'png'; // 'jpeg';\n\nexport const DEFAULT_MIN_ZOOM = 3;\nexport const DEFAULT_MAX_ZOOM = 20;\n\nexport const DEFAULT_PIXEL_RATIO = 2;\n"],"names":["MAP_TYPE_DEFAULT","MAP_TYPE_FLEET_STYLE","MAP_TYPE_SATELLITE","MAP_TYPE_TERRAIN","MAP_TYPE_NIGHT","MAP_LAYER_INCIDENTS","MAP_LAYER_TRAFFIC","MAP_LAYER_ROAD_RESTRICTIONS","ENGINE_TYPE_HARP","ENGINE_TYPE_P2D","DEFAULT_TILE_SIZE","DEFAULT_RASTER_LAYER_FORMAT","DEFAULT_MIN_ZOOM","DEFAULT_MAX_ZOOM","DEFAULT_PIXEL_RATIO"],"mappings":"AAEO,MAAMA,IAA4B,WAC5BC,IAAgC,eAChCC,IAA8B,aAC9BC,IAA4B,WAC5BC,IAA0B,SAE1BC,IAAsB,aACtBC,IAAoB,WACpBC,IAA8B,qBAW9BC,IAAmB,EAAE,IAAI,WAAW,MACpCC,IAAkB,EAAE,IAAI,WAAW,KAEnCC,IAAoB,KACpBC,IAA8B,OAE9BC,IAAmB,GACnBC,IAAmB,IAEnBC,IAAsB;"}
@@ -8,5 +8,5 @@ export type ContextMenuItemProps = {
8
8
  className?: string;
9
9
  labelClassName?: string;
10
10
  };
11
- declare const ContextMenuItem: (props: ContextMenuItemProps) => H.util.ContextItem;
11
+ declare const ContextMenuItem: (_: ContextMenuItemProps) => null;
12
12
  export default ContextMenuItem;
@@ -1,20 +1,5 @@
1
- import { noop as n } from "es-toolkit/function";
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
- r as default
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 { noop } from 'es-toolkit/function';\n\nimport 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\nconst ContextMenuItem = (props: ContextMenuItemProps) => {\n // Note: not all defined props are passed to the Here ContextItem are used in ContextMenu component\n const {\n label = '',\n disabled = false,\n callback = noop,\n // hasSpinner = false,\n // className = '',\n // labelClassName = '',\n } = props;\n\n return new H.util.ContextItem({\n label,\n disabled,\n callback: callback as any,\n });\n};\n\nexport default ContextMenuItem;\n"],"names":["ContextMenuItem","props","label","disabled","callback","noop"],"mappings":";AAcA,MAAMA,IAAkB,CAACC,MAAgC;AAErD,QAAM;AAAA,IACF,OAAAC,IAAQ;AAAA,IACR,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAWC;AAAA;AAAA;AAAA;AAAA,EAAA,IAIXJ;AAEJ,SAAO,IAAI,EAAE,KAAK,YAAY;AAAA,IAC1B,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,EAAA,CACH;AACL;"}
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 = H.map.Polyline.Options;
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-ignore-next-line - the types are outdated here
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 = H.map.Polyline.Options;\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-ignore-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,yEAaEC,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
+ {"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,EAA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S,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?: ClusterTheme;
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?: ClusterTheme;\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":";;;;AAgBA,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
+ {"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, t) => 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) => {
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\n// import ReactDomServer from 'react-dom/server';\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, index: number): 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","index","convertData","data","converterFunc","value","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":";;;AA8BA,MAAMA,IAAwC,CAACC,GAAeC,MAC1D,IAAI,EAAE,WAAW,UAAUD,EAAI,KAAKA,EAAI,KAAK,GAAGA,CAAG,GAEjDE,IAAc,CAACC,GAAgBC,IAA+BL,MAChEI,EAAK,IAAI,CAACE,GAAOJ,MAAkCG,EAAcC,GAAmBJ,CAAK,CAAC,GAExFK,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,a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G,CAACd,GAAWC,GAASC,GAASK,EAAI,GAAG,CAAC,GAGzCS,EAAgB,MAAM;AAClB,IAAIP,KACAA,EAAS,cAAcnB,EAAYC,GAAMQ,CAAa,CAAC;AAAA,EAE/D,GAAG,CAACR,GAAMQ,CAAa,CAAC,GAExBkB,EAAcR,GAAU,YAAYN,CAAY,GAChDe,EAA0BT,GAAUL,CAAgB,GAE7C;AACX;"}
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 { ClusterTheme, ClusterLayerProps } from './ClusterLayer';
1
+ import { ClusterLayerProps } from './ClusterLayer';
2
+ import { SimpleClusterTheme } from '../../../../utils/clustering';
2
3
  export type SimpleClusterLayerProps = Omit<ClusterLayerProps, 'clusterTheme'> & {
3
- simpleTheme?: ClusterTheme;
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 ClusterTheme, type ClusterLayerProps } from './ClusterLayer';\nimport { wrapSimpleTheme } from '../../../../utils/clustering';\n\nexport type SimpleClusterLayerProps = Omit<ClusterLayerProps, 'clusterTheme'> & {\n simpleTheme?: ClusterTheme;\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
+ {"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 R } from "../../../constants.js";
3
- import T from "./Layer.js";
4
- import { useMapContext as y } from "../../../MapContext.js";
5
- import { isVectorBased as E } from "../../../../utils/rendering.js";
6
- const _ = (e, r) => (t, i, o, a) => {
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 } = y(), o = E(r, t) ? R : c, a = _(o, i);
23
- return /* @__PURE__ */ L(T, { ...e, createLayer: a });
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: any | string, devicePixelRatio: number) =>\n (api: MapApi, useWebGL: boolean, baseLayerName: string, language: string) => {\n // @ts-ignore-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-ignore-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,GAA0BC,MAC3B,CAACC,GAAaC,GAAmBC,GAAuBC,MAAqB;AAEzE,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;"}
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
- }, E = (e, r, a) => {
23
+ }, _ = (e, r, a) => {
24
24
  const t = new H.service.trafficVectorTile.Provider(
25
- // @ts-ignore-next-line
25
+ // @ts-expect-error-next-line
26
26
  e.platform?.getTrafficVectorTileService({ layer: "flow" }),
27
- // @ts-ignore-next-line
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) ? E : L;
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, useWebGL: boolean, baseLayerName: string, language: string) => {\n // Traffic\n const baseTrafficUrl = new H.service.Url('https', 'traffic.maps.hereapi.com');\n\n // @ts-ignore-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-ignore-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-ignore-next-line\n const providerTrafficFlow = new H.service.trafficVectorTile.Provider(\n // @ts-ignore-next-line\n api.platform?.getTrafficVectorTileService({ layer: 'flow' }),\n // @ts-ignore-next-line\n new H.map.render.harp.Style({}),\n { engineType: ENGINE_TYPE_HARP }\n );\n\n // @ts-ignore-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,GAAmBC,GAAuBC,MAAqB;AAE1G,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,GAAmBC,MAA0B;AAExF,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
+ {"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: ClusterTheme) => ClusterTheme;
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, e = null, o = null, r = null;
3
+ let t = null, n = null, e = null, r = null;
4
4
  return a.forEachDataPoint((s) => {
5
- const n = s.getPosition();
6
- (t === null || t > n.lat) && (t = n.lat), (e === null || e > n.lng) && (e = n.lng), (o === null || o < n.lat) && (o = n.lat), (r === null || r < n.lng) && (r = n.lng);
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
- }, p = {
13
+ }, M = {
14
14
  getBoundingBoxForCluster: g
15
- }, c = (a) => (t) => {
16
- const e = [];
17
- t.forEachDataPoint((n) => e.push(n.getData()));
18
- const o = i(a(e, t.getPosition())), r = l(o) ? H.map.DomMarker : H.map.Marker, s = new r(t.getPosition(), {
19
- icon: o,
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 s.setData(t), s;
26
- }, m = (a) => (t) => {
27
- const e = i(a(t.getData(), t.getPosition())), o = l(e) ? H.map.DomMarker : H.map.Marker, r = new o(t.getPosition(), {
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 r.setData(t), r;
33
- }, M = (a) => ({
34
- getClusterPresentation: c(a.getClusterPresentation),
35
- getNoisePresentation: m(a.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
- p as ClusterUtils,
39
- M as wrapSimpleTheme
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: any, position: H.geo.Point) => H.map.Object) => {\n return (cluster: Cluster): H.map.Marker => {\n const clusterElements: T[] = [];\n\n cluster.forEachDataPoint((point: NoisePoint) => clusterElements.push(point.getData()));\n\n const clusterIcon = getOrCreateIcon(func(clusterElements, cluster.getPosition())) as any;\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) => {\n return (noisePoint: NoisePoint): H.map.Marker => {\n const noiseIcon = getOrCreateIcon(func(noisePoint.getData(), noisePoint.getPosition())) as any;\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: ClusterTheme): 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","clusterIcon","getOrCreateIcon","MarkerConstructor","isDomMakerNeeded","clusterMarker","wrapNoisePresentation","noisePoint","noiseIcon","noiseMarker","wrapSimpleTheme","theme"],"mappings":";AASA,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,CAAIC,MACzB,CAACT,MAAmC;AACvC,QAAMU,IAAuB,CAAA;AAE7B,EAAAV,EAAQ,iBAAiB,CAACW,MAAsBD,EAAgB,KAAKC,EAAM,QAAA,CAAS,CAAC;AAErF,QAAMC,IAAcC,EAAgBJ,EAAKC,GAAiBV,EAAQ,YAAA,CAAa,CAAC,GAC1Ec,IAAoBC,EAAiBH,CAAW,IAAI,EAAE,IAAI,YAAY,EAAE,IAAI,QAE5EI,IAAgB,IAAIF,EAAkBd,EAAQ,eAAe;AAAA,IAC/D,MAAMY;AAAA;AAAA;AAAA,IAIN,KAAKZ,EAAQ,WAAA;AAAA,IACb,KAAKA,EAAQ,WAAA;AAAA,EAAW,CAC3B;AAGD,SAAAgB,EAAc,QAAQhB,CAAO,GAEtBgB;AACX,GAGEC,IAAwB,CAAIR,MACvB,CAACS,MAAyC;AAC7C,QAAMC,IAAYN,EAAgBJ,EAAKS,EAAW,WAAWA,EAAW,YAAA,CAAa,CAAC,GAChFJ,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,OAAuC;AAAA,EACnE,wBAAwBd,EAAwBc,EAAM,sBAAsB;AAAA,EAC5E,sBAAsBL,EAAsBK,EAAM,oBAAoB;AAC1E;"}
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, vehicleRestrictions, minZoom, maxZoom, }: BaseLayer) => Promise<BaseLayerResponse>;
23
+ export declare const getBaseLayer: ({ baseLayerName, defaultLayers, enableWebGL, platform, engineType, language, minZoom, maxZoom, }: BaseLayer) => Promise<BaseLayerResponse>;