@rio-cloud/rio-uikit 0.16.2-beta.8 → 0.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.DS_Store +0 -0
- package/AspectRatioPlaceholder.js +2 -0
- package/AspectRatioPlaceholder.ts +5 -0
- package/Map.d.ts +2 -1
- package/ResponsiveColumnStripe.d.ts +5 -0
- package/ResponsiveColumnStripe.js +2 -0
- package/RuleConnector.d.ts +2 -1
- package/RuleContainer.d.ts +3 -2
- package/RulesWrapper.d.ts +2 -1
- package/components/activity/Activity.js +6 -4
- package/components/animatedNumber/AnimatedNumber.js +6 -4
- package/components/applicationHeader/AppMenu.js +6 -3
- package/components/applicationHeader/AppMenuDropdown.js +6 -2
- package/components/applicationHeader/ApplicationHeader.js +16 -8
- package/components/applicationHeader/MobileAppMenu.js +8 -4
- package/components/applicationLayout/ApplicationLayout.js +8 -8
- package/components/applicationLayout/ApplicationLayoutBody.js +6 -3
- package/components/applicationLayout/ApplicationLayoutBodyBanner.js +4 -3
- package/components/applicationLayout/ApplicationLayoutBodyBottomBar.js +6 -4
- package/components/applicationLayout/ApplicationLayoutBodyNavigation.js +6 -4
- package/components/applicationLayout/ApplicationLayoutHeader.js +9 -7
- package/components/aspectRatioPlaceholder/AspectRatioPlaceholder.js +25 -0
- package/components/assetTree/AssetTree.js +6 -3
- package/components/assetTree/TypeCounter.js +6 -4
- package/components/clearableInput/ClearableInput.js +2 -1
- package/components/datepicker/DatePicker.js +8 -4
- package/components/dialog/MediaDialog.js +5 -1
- package/components/dialog/SaveDialog.js +5 -2
- package/components/fade/Fade.js +5 -0
- package/components/filepicker/FilePicker.js +1 -1
- package/components/map/assets/icon_map_settings_bounding_box_active.svg +1 -1
- package/components/map/assets/icon_map_settings_bounding_box_inactive.svg +1 -1
- package/components/map/assets/icon_map_settings_construction_active.svg +1 -1
- package/components/map/assets/icon_map_settings_construction_inactive.svg +1 -1
- package/components/map/assets/icon_map_settings_layer_active.svg +1 -1
- package/components/map/assets/icon_map_settings_layer_inactive.svg +1 -1
- package/components/map/assets/icon_map_settings_maptype_flat_active.svg +1 -1
- package/components/map/assets/icon_map_settings_maptype_flat_inactive.svg +1 -1
- package/components/map/assets/icon_map_settings_maptype_flat_truck_active.svg +1 -1
- package/components/map/assets/icon_map_settings_maptype_flat_truck_inactive.svg +1 -1
- package/components/map/assets/icon_map_settings_maptype_night_active.svg +1 -12
- package/components/map/assets/icon_map_settings_maptype_night_inactive.svg +1 -12
- package/components/map/assets/icon_map_settings_maptype_satelite_active.svg +1 -1
- package/components/map/assets/icon_map_settings_maptype_satelite_inactive.svg +1 -1
- package/components/map/assets/icon_map_settings_maptype_terrain_active.svg +1 -1
- package/components/map/assets/icon_map_settings_maptype_terrain_inactive.svg +1 -1
- package/components/map/assets/icon_map_settings_road_restrictions_active.svg +1 -1
- package/components/map/assets/icon_map_settings_road_restrictions_inactive.svg +1 -1
- package/components/map/assets/icon_map_settings_system_pois_active.svg +1 -1
- package/components/map/assets/icon_map_settings_system_pois_inactive.svg +1 -1
- package/components/map/assets/icon_map_settings_workshop_pois_active.svg +1 -1
- package/components/map/assets/icon_map_settings_workshop_pois_inactive.svg +1 -1
- package/components/map/components/Map.js +47 -36
- package/components/map/components/features/ContextMenu.js +1 -1
- package/components/map/components/features/Route.js +1 -10
- package/components/map/components/features/basics/Circle.js +11 -6
- package/components/map/components/features/basics/MapLayerGroup.js +8 -5
- package/components/map/components/features/basics/Polygon.js +6 -5
- package/components/map/components/features/basics/Polyline.js +42 -40
- package/components/map/components/features/basics/marker/DomMarker.js +9 -3
- package/components/map/components/features/basics/marker/Marker.js +101 -121
- package/components/map/components/features/basics/marker/TextMarker.js +15 -43
- package/components/map/components/features/layers/Layer.js +1 -1
- package/components/map/components/features/layers/MarkerLayer.js +7 -4
- package/components/map/components/features/layers/RoadRestrictionLayer.js +1 -2
- package/components/map/components/features/layers/TrafficLayer.js +2 -2
- package/components/map/components/features/layers/baselayers/DefaultRasterLayer.js +2 -1
- package/components/map/components/features/layers/baselayers/useBaseLayer.js +4 -1
- package/components/map/components/features/layers/clustering/ClusterLayer.js +25 -9
- package/components/map/components/features/settings/builtinSettings/MapTypeSettings.js +18 -3
- package/components/map/icons/MapIcon.js +46 -66
- package/components/map/utils/hooks.js +3 -3
- package/components/mapMarker/ClusterMapMarker.js +16 -20
- package/components/mapMarker/SingleMapMarker.js +16 -30
- package/components/numberControl/NumberControl.js +13 -7
- package/components/numberInput/NumberInput.js +30 -12
- package/components/responsiveColumnStripe/ResponsiveColumnStripe.js +255 -0
- package/components/rules/RuleContainer.js +4 -0
- package/components/rules/RulesWrapper.js +3 -3
- package/hooks/useDarkMode.js +3 -2
- package/hooks/useMutationObserver.js +13 -4
- package/hooks/useScrollPosition.js +6 -7
- package/index.d.ts +29 -29
- package/index.js +4 -0
- package/lib/es/AspectRatioPlaceholder.js +13 -0
- package/lib/es/AspectRatioPlaceholder.ts +5 -0
- package/lib/es/Map.d.ts +2 -1
- package/lib/es/ResponsiveColumnStripe.d.ts +5 -0
- package/lib/es/ResponsiveColumnStripe.js +13 -0
- package/lib/es/RuleConnector.d.ts +2 -1
- package/lib/es/RuleContainer.d.ts +3 -2
- package/lib/es/RulesWrapper.d.ts +2 -1
- package/lib/es/components/activity/Activity.js +9 -4
- package/lib/es/components/animatedNumber/AnimatedNumber.js +5 -3
- package/lib/es/components/applicationHeader/AppMenu.js +6 -3
- package/lib/es/components/applicationHeader/AppMenuDropdown.js +6 -2
- package/lib/es/components/applicationHeader/ApplicationHeader.js +15 -7
- package/lib/es/components/applicationHeader/MobileAppMenu.js +8 -4
- package/lib/es/components/applicationLayout/ApplicationLayout.js +11 -8
- package/lib/es/components/applicationLayout/ApplicationLayoutBody.js +5 -2
- package/lib/es/components/applicationLayout/ApplicationLayoutBodyBanner.js +7 -3
- package/lib/es/components/applicationLayout/ApplicationLayoutBodyBottomBar.js +9 -4
- package/lib/es/components/applicationLayout/ApplicationLayoutBodyNavigation.js +9 -4
- package/lib/es/components/applicationLayout/ApplicationLayoutHeader.js +12 -7
- package/lib/es/components/aspectRatioPlaceholder/AspectRatioPlaceholder.js +33 -0
- package/lib/es/components/assetTree/AssetTree.js +5 -2
- package/lib/es/components/assetTree/TypeCounter.js +9 -4
- package/lib/es/components/clearableInput/ClearableInput.js +2 -1
- package/lib/es/components/datepicker/DatePicker.js +7 -3
- package/lib/es/components/dialog/MediaDialog.js +5 -1
- package/lib/es/components/dialog/SaveDialog.js +5 -2
- package/lib/es/components/fade/Fade.js +5 -0
- package/lib/es/components/filepicker/FilePicker.js +1 -1
- package/lib/es/components/map/assets/icon_map_settings_bounding_box_active.svg +1 -1
- package/lib/es/components/map/assets/icon_map_settings_bounding_box_inactive.svg +1 -1
- package/lib/es/components/map/assets/icon_map_settings_construction_active.svg +1 -1
- package/lib/es/components/map/assets/icon_map_settings_construction_inactive.svg +1 -1
- package/lib/es/components/map/assets/icon_map_settings_layer_active.svg +1 -1
- package/lib/es/components/map/assets/icon_map_settings_layer_inactive.svg +1 -1
- package/lib/es/components/map/assets/icon_map_settings_maptype_flat_active.svg +1 -1
- package/lib/es/components/map/assets/icon_map_settings_maptype_flat_inactive.svg +1 -1
- package/lib/es/components/map/assets/icon_map_settings_maptype_flat_truck_active.svg +1 -1
- package/lib/es/components/map/assets/icon_map_settings_maptype_flat_truck_inactive.svg +1 -1
- package/lib/es/components/map/assets/icon_map_settings_maptype_night_active.svg +1 -12
- package/lib/es/components/map/assets/icon_map_settings_maptype_night_inactive.svg +1 -12
- package/lib/es/components/map/assets/icon_map_settings_maptype_satelite_active.svg +1 -1
- package/lib/es/components/map/assets/icon_map_settings_maptype_satelite_inactive.svg +1 -1
- package/lib/es/components/map/assets/icon_map_settings_maptype_terrain_active.svg +1 -1
- package/lib/es/components/map/assets/icon_map_settings_maptype_terrain_inactive.svg +1 -1
- package/lib/es/components/map/assets/icon_map_settings_road_restrictions_active.svg +1 -1
- package/lib/es/components/map/assets/icon_map_settings_road_restrictions_inactive.svg +1 -1
- package/lib/es/components/map/assets/icon_map_settings_system_pois_active.svg +1 -1
- package/lib/es/components/map/assets/icon_map_settings_system_pois_inactive.svg +1 -1
- package/lib/es/components/map/assets/icon_map_settings_workshop_pois_active.svg +1 -1
- package/lib/es/components/map/assets/icon_map_settings_workshop_pois_inactive.svg +1 -1
- package/lib/es/components/map/components/Map.js +47 -36
- package/lib/es/components/map/components/features/ContextMenu.js +1 -1
- package/lib/es/components/map/components/features/Route.js +1 -10
- package/lib/es/components/map/components/features/basics/Circle.js +10 -5
- package/lib/es/components/map/components/features/basics/MapLayerGroup.js +8 -5
- package/lib/es/components/map/components/features/basics/Polygon.js +6 -5
- package/lib/es/components/map/components/features/basics/Polyline.js +42 -42
- package/lib/es/components/map/components/features/basics/marker/DomMarker.js +8 -3
- package/lib/es/components/map/components/features/basics/marker/Marker.js +105 -120
- package/lib/es/components/map/components/features/basics/marker/TextMarker.js +15 -42
- package/lib/es/components/map/components/features/layers/Layer.js +1 -1
- package/lib/es/components/map/components/features/layers/MarkerLayer.js +7 -4
- package/lib/es/components/map/components/features/layers/RoadRestrictionLayer.js +1 -2
- package/lib/es/components/map/components/features/layers/TrafficLayer.js +2 -2
- package/lib/es/components/map/components/features/layers/baselayers/DefaultRasterLayer.js +2 -1
- package/lib/es/components/map/components/features/layers/baselayers/useBaseLayer.js +4 -1
- package/lib/es/components/map/components/features/layers/clustering/ClusterLayer.js +25 -9
- package/lib/es/components/map/components/features/settings/builtinSettings/MapTypeSettings.js +18 -3
- package/lib/es/components/map/icons/MapIcon.js +46 -66
- package/lib/es/components/map/utils/hooks.js +3 -3
- package/lib/es/components/mapMarker/ClusterMapMarker.js +16 -20
- package/lib/es/components/mapMarker/SingleMapMarker.js +16 -30
- package/lib/es/components/numberControl/NumberControl.js +13 -7
- package/lib/es/components/numberInput/NumberInput.js +31 -12
- package/lib/es/components/responsiveColumnStripe/ResponsiveColumnStripe.js +266 -0
- package/lib/es/components/rules/RuleContainer.js +4 -0
- package/lib/es/components/rules/RulesWrapper.js +3 -3
- package/lib/es/hooks/useDarkMode.js +4 -3
- package/lib/es/hooks/useMutationObserver.js +15 -4
- package/lib/es/hooks/useScrollPosition.js +6 -7
- package/lib/es/index.d.ts +29 -29
- package/lib/es/index.js +24 -0
- package/lib/es/styles/components/Dialog.less +13 -10
- package/lib/es/styles/components/MapMarker.less +224 -14
- package/lib/es/styles/components/MapSettings.less +45 -29
- package/lib/es/styles/components/Notification.less +1 -1
- package/lib/es/styles/design/alerts.less +7 -9
- package/lib/es/styles/design/aspect-ratio.less +1 -0
- package/lib/es/styles/design/blur.less +7 -0
- package/lib/es/styles/design/border.less +51 -14
- package/lib/es/styles/design/callouts.less +12 -11
- package/lib/es/styles/design/colors.less +15 -6
- package/lib/es/styles/design/cols.less +19 -18
- package/lib/es/styles/design/divide.less +165 -0
- package/lib/es/styles/design/divider.less +90 -0
- package/lib/es/styles/design/responsive/_imports.less +1 -0
- package/lib/es/styles/design/responsive/gap.less +0 -8
- package/lib/es/styles/design/responsive/spacing.less +25 -0
- package/lib/es/styles/design/text.less +16 -2
- package/lib/es/styles/mapping/color-map.less +10 -0
- package/lib/es/styles/mapping/spacings-map.less +5 -0
- package/lib/es/styles/rio-uikit-core.less +2 -0
- package/lib/es/styles/variables/colors.json +6 -0
- package/lib/es/styles/variables/concated_css_variables.less +6 -0
- package/lib/es/styles/variables/dark_colors.less +7 -0
- package/lib/es/styles/variables/dark_css_variables_map.less +7 -0
- package/lib/es/styles/variables/light_colors.less +7 -0
- package/lib/es/styles/variables/light_css_variables_map.less +7 -0
- package/lib/es/themes/Volkswagen/components/applicationHeader/VolkswagenApplicationHeader.js +14 -5
- package/lib/es/types.ts +69 -23
- package/lib/es/useDarkMode.d.ts +4 -0
- package/lib/es/useDarkMode.js +13 -0
- package/lib/es/useMutationObserver.d.ts +4 -0
- package/lib/es/useMutationObserver.js +13 -0
- package/lib/es/version.json +1 -1
- package/package.json +2 -2
- package/styles/components/Dialog.less +13 -10
- package/styles/components/MapMarker.less +224 -14
- package/styles/components/MapSettings.less +45 -29
- package/styles/components/Notification.less +1 -1
- package/styles/design/alerts.less +7 -9
- package/styles/design/aspect-ratio.less +1 -0
- package/styles/design/blur.less +7 -0
- package/styles/design/border.less +51 -14
- package/styles/design/callouts.less +12 -11
- package/styles/design/colors.less +15 -6
- package/styles/design/cols.less +19 -18
- package/styles/design/divide.less +165 -0
- package/styles/design/divider.less +90 -0
- package/styles/design/responsive/_imports.less +1 -0
- package/styles/design/responsive/gap.less +0 -8
- package/styles/design/responsive/spacing.less +25 -0
- package/styles/design/text.less +16 -2
- package/styles/mapping/color-map.less +10 -0
- package/styles/mapping/spacings-map.less +5 -0
- package/styles/rio-uikit-core.less +2 -0
- package/styles/variables/colors.json +6 -0
- package/styles/variables/concated_css_variables.less +6 -0
- package/styles/variables/dark_colors.less +7 -0
- package/styles/variables/dark_css_variables_map.less +7 -0
- package/styles/variables/light_colors.less +7 -0
- package/styles/variables/light_css_variables_map.less +7 -0
- package/themes/Volkswagen/components/applicationHeader/VolkswagenApplicationHeader.js +15 -6
- package/types.ts +69 -23
- package/useDarkMode.d.ts +4 -0
- package/useDarkMode.js +2 -0
- package/useMutationObserver.d.ts +4 -0
- package/useMutationObserver.js +2 -0
- package/version.json +1 -1
- package/components/.DS_Store +0 -0
- package/components/map/.DS_Store +0 -0
- package/components/map/components/.DS_Store +0 -0
- package/components/map/components/features/layers/TruckLayer.js +0 -20
- package/components/map/components/features/layers/baselayers/BaseLayer.js +0 -33
- package/components/map/components/features/layers/baselayers/DefaultLayer.js +0 -23
- package/hooks/useHereMap.ts +0 -23
- package/hooks/useScripts.ts +0 -52
- package/lib/.DS_Store +0 -0
- package/lib/es/.DS_Store +0 -0
- package/lib/es/components/.DS_Store +0 -0
- package/lib/es/components/map/components/features/layers/TruckLayer.js +0 -28
- package/lib/es/components/map/components/features/layers/baselayers/BaseLayer.js +0 -41
- package/lib/es/components/map/components/features/layers/baselayers/DefaultLayer.js +0 -30
- package/lib/es/hooks/useHereMap.ts +0 -23
- package/lib/es/hooks/useScripts.ts +0 -52
- package/lib/es/styles/.DS_Store +0 -0
- package/lib/es/styles/mixins/_mixins.less +0 -13
- package/lib/es/styles/mixins/alerts.less +0 -13
- package/lib/es/styles/shared/colors.json +0 -56
- package/lib/es/styles/shared/colors.less +0 -73
- package/lib/es/styles/shared/screens.less +0 -7
- package/lib/es/styles/shared/text.less +0 -23
- package/lib/es/styles/variables.less +0 -186
- package/lib/es/themes/.DS_Store +0 -0
- package/styles/.DS_Store +0 -0
- package/styles/mixins/_mixins.less +0 -13
- package/styles/mixins/alerts.less +0 -13
- package/styles/shared/colors.json +0 -56
- package/styles/shared/colors.less +0 -73
- package/styles/shared/screens.less +0 -7
- package/styles/shared/text.less +0 -23
- package/styles/variables.less +0 -186
- package/themes/.DS_Store +0 -0
- package/themes/Volkswagen/.DS_Store +0 -0
- package/themes/Website/.DS_Store +0 -0
|
@@ -15,6 +15,7 @@ var _isFunction = _interopRequireDefault(require("lodash/fp/isFunction"));
|
|
|
15
15
|
var _map = _interopRequireDefault(require("lodash/fp/map"));
|
|
16
16
|
var _isEmpty = _interopRequireDefault(require("lodash/fp/isEmpty"));
|
|
17
17
|
var _throttle = _interopRequireDefault(require("lodash/fp/throttle"));
|
|
18
|
+
var _cloneDeep = _interopRequireDefault(require("lodash/fp/cloneDeep"));
|
|
18
19
|
var _proptypes = _interopRequireDefault(require("../utils/proptypes"));
|
|
19
20
|
var _addEventListener = _interopRequireDefault(require("../../../utils/addEventListener"));
|
|
20
21
|
require("../herePolyfill");
|
|
@@ -33,7 +34,7 @@ var _useBaseLayer = require("./features/layers/baselayers/useBaseLayer");
|
|
|
33
34
|
var _eventHandling = require("../utils/eventHandling");
|
|
34
35
|
var _context = require("./context");
|
|
35
36
|
var _mapUtils = require("./mapUtils");
|
|
36
|
-
var _useDarkMode = require("../../../hooks/useDarkMode");
|
|
37
|
+
var _useDarkMode = _interopRequireDefault(require("../../../hooks/useDarkMode"));
|
|
37
38
|
var _PropTypes$shape;
|
|
38
39
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
39
40
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -70,14 +71,14 @@ var getBounds = function getBounds(boundingBox) {
|
|
|
70
71
|
right = boundingBox.right;
|
|
71
72
|
return new H.geo.Rect(top, left, bottom, right);
|
|
72
73
|
};
|
|
73
|
-
var getLayer = function getLayer(api, layer, language,
|
|
74
|
+
var getLayer = function getLayer(api, layer, language, enableWebGL) {
|
|
74
75
|
switch (layer) {
|
|
75
76
|
case _constants.MAP_LAYER_TRAFFIC:
|
|
76
77
|
return /*#__PURE__*/_react["default"].createElement(_TrafficLayer["default"], {
|
|
77
78
|
api: api,
|
|
78
79
|
language: language,
|
|
79
80
|
key: layer,
|
|
80
|
-
useWebGL:
|
|
81
|
+
useWebGL: enableWebGL
|
|
81
82
|
});
|
|
82
83
|
case _constants.MAP_LAYER_INCIDENTS:
|
|
83
84
|
return /*#__PURE__*/_react["default"].createElement(_IncidentsLayer["default"], {
|
|
@@ -90,17 +91,17 @@ var getLayer = function getLayer(api, layer, language, useWebGL) {
|
|
|
90
91
|
api: api,
|
|
91
92
|
language: language,
|
|
92
93
|
key: layer,
|
|
93
|
-
useWebGL:
|
|
94
|
+
useWebGL: enableWebGL
|
|
94
95
|
});
|
|
95
96
|
default:
|
|
96
97
|
null;
|
|
97
98
|
}
|
|
98
99
|
};
|
|
99
|
-
var getBaseLayer = function getBaseLayer(api, baseLayer, language,
|
|
100
|
+
var getBaseLayer = function getBaseLayer(api, baseLayer, language, enableWebGL, darkMode) {
|
|
100
101
|
switch (baseLayer) {
|
|
101
102
|
case _constants.MAP_TYPE_DEFAULT:
|
|
102
103
|
{
|
|
103
|
-
return !darkMode &&
|
|
104
|
+
return !darkMode && enableWebGL ? /*#__PURE__*/_react["default"].createElement(_DefaultVectorLayer["default"], {
|
|
104
105
|
api: api,
|
|
105
106
|
language: language,
|
|
106
107
|
key: baseLayer
|
|
@@ -184,7 +185,8 @@ var Map = function Map(props) {
|
|
|
184
185
|
onZoomOut = props.onZoomOut,
|
|
185
186
|
mapSettingsTooltip = props.mapSettingsTooltip,
|
|
186
187
|
mapSettings = props.mapSettings,
|
|
187
|
-
|
|
188
|
+
enableWebGL = props.enableWebGL,
|
|
189
|
+
enableDevicePixelRatio = props.enableDevicePixelRatio,
|
|
188
190
|
darkMode = props.darkMode;
|
|
189
191
|
var mapRef = (0, _react.useRef)(null);
|
|
190
192
|
var _useState = (0, _react.useState)(false),
|
|
@@ -207,33 +209,22 @@ var Map = function Map(props) {
|
|
|
207
209
|
_useState10 = (0, _slicedToArray2["default"])(_useState9, 2),
|
|
208
210
|
showCluster = _useState10[0],
|
|
209
211
|
setShowCluster = _useState10[1];
|
|
210
|
-
var
|
|
211
|
-
(0, _react.useEffect)(function () {
|
|
212
|
-
// Toggle night map only if current map type is default
|
|
213
|
-
if (isDarkMode && baseLayer === _constants.MAP_TYPE_DEFAULT) {
|
|
214
|
-
setBaseLayer(_constants.MAP_TYPE_NIGHT);
|
|
215
|
-
onMapTypeChange(_constants.MAP_TYPE_NIGHT);
|
|
216
|
-
}
|
|
217
|
-
// Toggle back to default map only if current map type is night
|
|
218
|
-
else if (!isDarkMode && baseLayer === _constants.MAP_TYPE_NIGHT) {
|
|
219
|
-
setBaseLayer(_constants.MAP_TYPE_DEFAULT);
|
|
220
|
-
onMapTypeChange(_constants.MAP_TYPE_DEFAULT);
|
|
221
|
-
}
|
|
222
|
-
}, [isDarkMode]);
|
|
223
|
-
var devicePixelRatio = window.devicePixelRatio || 1;
|
|
212
|
+
var devicePixelRatio = enableDevicePixelRatio ? window.devicePixelRatio || 1 : 1;
|
|
224
213
|
(0, _react.useEffect)(function () {
|
|
225
214
|
console.debug('initialize here map');
|
|
226
215
|
var bounds = boundingBox && getBounds(boundingBox);
|
|
227
216
|
var platform = getPlatform(credentials);
|
|
228
217
|
var defaultLayers = platform.createDefaultLayers();
|
|
229
|
-
var defaultLayer = (0, _useBaseLayer.getDefaultBaseLayer)(defaultLayers, baseLayer,
|
|
218
|
+
var defaultLayer = (0, _useBaseLayer.getDefaultBaseLayer)(defaultLayers, baseLayer, enableWebGL);
|
|
230
219
|
|
|
231
220
|
// Instantiate (and display) a map object:
|
|
232
221
|
var mapConfig = {
|
|
233
222
|
zoom: zoom,
|
|
234
223
|
center: center,
|
|
235
224
|
bounds: bounds,
|
|
236
|
-
pixelRatio: devicePixelRatio
|
|
225
|
+
pixelRatio: devicePixelRatio,
|
|
226
|
+
// need to be set for better performence of legacy map
|
|
227
|
+
engineType: enableWebGL ? undefined : H.map.render.RenderEngine.EngineType.P2D
|
|
237
228
|
};
|
|
238
229
|
var hereMap = new H.Map(mapRef.current, defaultLayer, mapConfig);
|
|
239
230
|
|
|
@@ -248,10 +239,12 @@ var Map = function Map(props) {
|
|
|
248
239
|
var hereMapEvents = !disableMapEvents && new H.mapevents.MapEvents(hereMap);
|
|
249
240
|
var hereBehavior = !(disableMapEvents || disableBehavior) && new H.mapevents.Behavior(hereMapEvents);
|
|
250
241
|
(0, _eventHandling.addEventListenerMap)(hereMap, eventListenerMap, hereMap);
|
|
242
|
+
|
|
243
|
+
// The api will be passed to services when using a render function.
|
|
244
|
+
// This allows the service to access the map internals
|
|
251
245
|
setApi({
|
|
252
246
|
credentials: credentials,
|
|
253
247
|
defaultLayers: defaultLayers,
|
|
254
|
-
group: hereMap,
|
|
255
248
|
map: hereMap,
|
|
256
249
|
mapEvents: hereMapEvents,
|
|
257
250
|
behavior: hereBehavior,
|
|
@@ -259,6 +252,7 @@ var Map = function Map(props) {
|
|
|
259
252
|
ui: getHereUi(hereMap, defaultLayers, showScaleBar),
|
|
260
253
|
utils: (0, _mapUtils.createUtils)(hereMap),
|
|
261
254
|
settings: {
|
|
255
|
+
enableWebGL: enableWebGL,
|
|
262
256
|
baseLayer: baseLayer,
|
|
263
257
|
mapLayer: activeLayers,
|
|
264
258
|
showCluster: showCluster
|
|
@@ -279,7 +273,18 @@ var Map = function Map(props) {
|
|
|
279
273
|
hereMap.dispose();
|
|
280
274
|
}
|
|
281
275
|
};
|
|
282
|
-
}, [
|
|
276
|
+
}, [enableWebGL, enableDevicePixelRatio]);
|
|
277
|
+
var isDarkMode = (0, _useDarkMode["default"])();
|
|
278
|
+
(0, _react.useEffect)(function () {
|
|
279
|
+
// Toggle night map only if current map type is default
|
|
280
|
+
if (isDarkMode && baseLayer === _constants.MAP_TYPE_DEFAULT) {
|
|
281
|
+
handleMapTypeChange(_constants.MAP_TYPE_NIGHT);
|
|
282
|
+
}
|
|
283
|
+
// Toggle back to default map only if current map type is night
|
|
284
|
+
else if (!isDarkMode && baseLayer === _constants.MAP_TYPE_NIGHT) {
|
|
285
|
+
handleMapTypeChange(_constants.MAP_TYPE_DEFAULT);
|
|
286
|
+
}
|
|
287
|
+
}, [isDarkMode]);
|
|
283
288
|
|
|
284
289
|
// Update BoundingBox from outside
|
|
285
290
|
(0, _react.useEffect)(function () {
|
|
@@ -318,7 +323,7 @@ var Map = function Map(props) {
|
|
|
318
323
|
|
|
319
324
|
// Update MapType from outside
|
|
320
325
|
(0, _react.useEffect)(function () {
|
|
321
|
-
return
|
|
326
|
+
return handleMapTypeChange(mapType);
|
|
322
327
|
}, [mapType]);
|
|
323
328
|
|
|
324
329
|
// Update MapLayer from outside
|
|
@@ -333,11 +338,13 @@ var Map = function Map(props) {
|
|
|
333
338
|
var handleMapTypeChange = function handleMapTypeChange(newMapType) {
|
|
334
339
|
setBaseLayer(newMapType);
|
|
335
340
|
onMapTypeChange(newMapType, mapType);
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
+
if (api) {
|
|
342
|
+
setApi(_objectSpread(_objectSpread({}, api), {}, {
|
|
343
|
+
settings: _objectSpread(_objectSpread({}, api.settings), {}, {
|
|
344
|
+
baseLayer: newMapType
|
|
345
|
+
})
|
|
346
|
+
}));
|
|
347
|
+
}
|
|
341
348
|
};
|
|
342
349
|
var handleMapLayerChange = function handleMapLayerChange(layer) {
|
|
343
350
|
var removeLayer = function removeLayer(layerToRemove) {
|
|
@@ -383,7 +390,9 @@ var Map = function Map(props) {
|
|
|
383
390
|
style: style,
|
|
384
391
|
ref: mapRef
|
|
385
392
|
}, isMapInitialized && /*#__PURE__*/_react["default"].createElement(_context.MapContext.Provider, {
|
|
386
|
-
value:
|
|
393
|
+
value: {
|
|
394
|
+
api: api
|
|
395
|
+
}
|
|
387
396
|
}, !hideZoomButtons && /*#__PURE__*/_react["default"].createElement(_ZoomButtons["default"], {
|
|
388
397
|
onZoomIn: handleZoomIn,
|
|
389
398
|
onZoomOut: handleZoomOut
|
|
@@ -399,8 +408,8 @@ var Map = function Map(props) {
|
|
|
399
408
|
onShowClusterChange: handleShowClusterChange,
|
|
400
409
|
mapSettingsTooltip: mapSettingsTooltip
|
|
401
410
|
}
|
|
402
|
-
}, mapSettings), getBaseLayer(api, baseLayer, language,
|
|
403
|
-
return getLayer(api, layer, language,
|
|
411
|
+
}, mapSettings), getBaseLayer(api, baseLayer, language, enableWebGL, darkMode), (0, _map["default"])(function (layer) {
|
|
412
|
+
return getLayer(api, layer, language, enableWebGL);
|
|
404
413
|
}, activeLayers), children && /*#__PURE__*/_react["default"].createElement("div", {
|
|
405
414
|
className: 'MapElements'
|
|
406
415
|
}, (0, _isFunction["default"])(children) ? children(api) : enrichChildrenWithApi(children, api))));
|
|
@@ -428,7 +437,8 @@ Map.defaultProps = {
|
|
|
428
437
|
onShowClusterChange: function onShowClusterChange() {},
|
|
429
438
|
onZoomIn: function onZoomIn() {},
|
|
430
439
|
onZoomOut: function onZoomOut() {},
|
|
431
|
-
|
|
440
|
+
enableWebGL: true,
|
|
441
|
+
enableDevicePixelRatio: true,
|
|
432
442
|
darkMode: false
|
|
433
443
|
};
|
|
434
444
|
Map.propTypes = {
|
|
@@ -457,7 +467,8 @@ Map.propTypes = {
|
|
|
457
467
|
getApi: _propTypes["default"].func,
|
|
458
468
|
mapSettingsTooltip: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].node]),
|
|
459
469
|
mapSettings: _propTypes["default"].node,
|
|
460
|
-
|
|
470
|
+
enableWebGL: _propTypes["default"].bool,
|
|
471
|
+
enableDevicePixelRatio: _propTypes["default"].bool,
|
|
461
472
|
darkMode: _propTypes["default"].bool
|
|
462
473
|
};
|
|
463
474
|
var _default = Map;
|
|
@@ -88,7 +88,7 @@ var ContextMenu = function ContextMenu(props) {
|
|
|
88
88
|
contextMenuEvent = props.contextMenuEvent,
|
|
89
89
|
targetPosition = props.targetPosition;
|
|
90
90
|
var mapContext = (0, _react.useContext)(_context.MapContext);
|
|
91
|
-
var _ref = api || mapContext,
|
|
91
|
+
var _ref = api || mapContext.api,
|
|
92
92
|
hereMap = _ref.map;
|
|
93
93
|
|
|
94
94
|
// Use a ref to store the target position used when a map object was clicked with a fixed
|
|
@@ -26,7 +26,6 @@ var TO_LESS_LINE_WIDTH_EXCEPTION_MSG = 'If isBorderIncludedInWidth is set to tru
|
|
|
26
26
|
exports.TO_LESS_LINE_WIDTH_EXCEPTION_MSG = TO_LESS_LINE_WIDTH_EXCEPTION_MSG;
|
|
27
27
|
var LINE_STROKE_COLOR = 'rgba(48, 194, 255, 1)';
|
|
28
28
|
var LINE_STROKE_COLOR_REDUCED = 'rgba(48, 194, 255, 0.5)';
|
|
29
|
-
var BORDER_STROKE_COLOR = 'rgba(255, 255, 255, 1)';
|
|
30
29
|
var BORDER_STROKE_COLOR_REDUCED = 'rgba(255, 255, 255, 0)';
|
|
31
30
|
var defaultStyle = {
|
|
32
31
|
width: 5,
|
|
@@ -35,14 +34,6 @@ var defaultStyle = {
|
|
|
35
34
|
borderColor: 'rgba(54, 144, 174, 1)',
|
|
36
35
|
isBorderIncludedInWidth: false
|
|
37
36
|
};
|
|
38
|
-
var defaultArrowStyle = {
|
|
39
|
-
lineWidth: 10,
|
|
40
|
-
fillColor: 'rgba(42, 55, 64, 1)',
|
|
41
|
-
strokeColor: BORDER_STROKE_COLOR,
|
|
42
|
-
lineDash: [0, 6],
|
|
43
|
-
lineTailCap: 'arrow-tail',
|
|
44
|
-
lineHeadCap: 'arrow-head'
|
|
45
|
-
};
|
|
46
37
|
var alternativeRouteStyle = _objectSpread(_objectSpread({}, defaultStyle), {}, {
|
|
47
38
|
color: 'rgb(218,253,255)'
|
|
48
39
|
});
|
|
@@ -155,7 +146,7 @@ var Route = function Route(props) {
|
|
|
155
146
|
};
|
|
156
147
|
Route.defaultProps = {
|
|
157
148
|
hasArrows: true,
|
|
158
|
-
arrowStyle:
|
|
149
|
+
arrowStyle: {},
|
|
159
150
|
isReduced: false,
|
|
160
151
|
isRouteAlternative: false,
|
|
161
152
|
markers: []
|
|
@@ -21,25 +21,30 @@ var Circle = function Circle(_ref) {
|
|
|
21
21
|
precision = _ref$precision === void 0 ? 60 : _ref$precision,
|
|
22
22
|
style = _ref.style,
|
|
23
23
|
eventListenerMap = _ref.eventListenerMap;
|
|
24
|
-
var
|
|
24
|
+
var _useContext = (0, _react.useContext)(_context.MapContext),
|
|
25
|
+
api = _useContext.api;
|
|
25
26
|
var _useState = (0, _react.useState)(),
|
|
26
27
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
27
28
|
circle = _useState2[0],
|
|
28
29
|
setCircle = _useState2[1];
|
|
30
|
+
|
|
31
|
+
// Create a new circle and check for changes on the map itself.
|
|
32
|
+
// The map instance may change due to rendering changes like webgl vs raster.
|
|
33
|
+
// In this case, add the circle to the new map instance otherwise it will be gone.
|
|
29
34
|
(0, _react.useEffect)(function () {
|
|
30
35
|
var newCircle = new H.map.Circle(position, radius, {
|
|
31
36
|
style: style,
|
|
32
37
|
precision: parseFloat(precision)
|
|
33
38
|
});
|
|
34
39
|
setCircle(newCircle);
|
|
35
|
-
|
|
40
|
+
api.map.addObject(newCircle);
|
|
36
41
|
return function () {
|
|
37
|
-
if (
|
|
38
|
-
|
|
42
|
+
if (api.map.getObjects().includes(newCircle)) {
|
|
43
|
+
api.map.removeObject(newCircle);
|
|
39
44
|
}
|
|
40
45
|
newCircle.dispose();
|
|
41
46
|
};
|
|
42
|
-
}, []);
|
|
47
|
+
}, [api.map]);
|
|
43
48
|
(0, _hooks.useUpdateProp)(circle, 'setCenter', position);
|
|
44
49
|
(0, _hooks.useUpdateProp)(circle, 'setStyle', style);
|
|
45
50
|
(0, _hooks.useUpdateProp)(circle, 'setRadius', radius);
|
|
@@ -21,6 +21,7 @@ var MapLayerGroup = function MapLayerGroup(_ref) {
|
|
|
21
21
|
maxZoom = _ref.maxZoom,
|
|
22
22
|
isVisible = _ref.isVisible;
|
|
23
23
|
var context = (0, _react.useContext)(_context.MapContext);
|
|
24
|
+
var api = context.api;
|
|
24
25
|
var _useState = (0, _react.useState)(),
|
|
25
26
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
26
27
|
group = _useState2[0],
|
|
@@ -35,19 +36,21 @@ var MapLayerGroup = function MapLayerGroup(_ref) {
|
|
|
35
36
|
max: parseFloat(maxZoom)
|
|
36
37
|
});
|
|
37
38
|
newGroup.setVisibility(isVisible);
|
|
38
|
-
|
|
39
|
+
api.map.addObject(newGroup);
|
|
39
40
|
setGroup(newGroup);
|
|
40
41
|
var newChildApi = _objectSpread(_objectSpread({}, context), {}, {
|
|
41
|
-
|
|
42
|
+
api: _objectSpread(_objectSpread({}, api), {}, {
|
|
43
|
+
group: newGroup
|
|
44
|
+
})
|
|
42
45
|
});
|
|
43
46
|
setChildApi(newChildApi);
|
|
44
47
|
return function () {
|
|
45
|
-
if (
|
|
46
|
-
|
|
48
|
+
if (api.map.getObjects().includes(newGroup)) {
|
|
49
|
+
api.map.removeObject(newGroup);
|
|
47
50
|
}
|
|
48
51
|
newGroup.dispose();
|
|
49
52
|
};
|
|
50
|
-
}, []);
|
|
53
|
+
}, [api.map]);
|
|
51
54
|
(0, _react.useEffect)(function () {
|
|
52
55
|
if (group) {
|
|
53
56
|
group.setVisibility(isVisible);
|
|
@@ -29,7 +29,8 @@ var Polygon = function Polygon(_ref) {
|
|
|
29
29
|
_ref$style = _ref.style,
|
|
30
30
|
style = _ref$style === void 0 ? H.map.SpatialStyle.DEFAULT_STYLE : _ref$style,
|
|
31
31
|
eventListenerMap = _ref.eventListenerMap;
|
|
32
|
-
var
|
|
32
|
+
var _useContext = (0, _react.useContext)(_context.MapContext),
|
|
33
|
+
api = _useContext.api;
|
|
33
34
|
var _useState = (0, _react.useState)(),
|
|
34
35
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
35
36
|
polygon = _useState2[0],
|
|
@@ -38,15 +39,15 @@ var Polygon = function Polygon(_ref) {
|
|
|
38
39
|
var newPolygon = new H.map.Polygon(createGeometry(points), {
|
|
39
40
|
style: style
|
|
40
41
|
});
|
|
41
|
-
|
|
42
|
+
api.map.addObject(newPolygon);
|
|
42
43
|
setPolygon(newPolygon);
|
|
43
44
|
return function () {
|
|
44
|
-
if (
|
|
45
|
-
|
|
45
|
+
if (api.map.getObjects().includes(newPolygon)) {
|
|
46
|
+
api.map.removeObject(newPolygon);
|
|
46
47
|
}
|
|
47
48
|
newPolygon.dispose();
|
|
48
49
|
};
|
|
49
|
-
}, []);
|
|
50
|
+
}, [api.map]);
|
|
50
51
|
(0, _react.useEffect)(function () {
|
|
51
52
|
if (polygon) {
|
|
52
53
|
polygon.setGeometry(createGeometry(points));
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports["default"] = exports.WRONG_GEOMETRY_PROPS_EXCEPTION_MSG = exports.MISSING_GEOMETRY_PROPS_EXCEPTION_MSG = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
8
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
10
|
var _react = require("react");
|
|
10
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -12,8 +13,8 @@ var _context = require("../../context");
|
|
|
12
13
|
var _MapException = _interopRequireDefault(require("../../../exceptions/MapException"));
|
|
13
14
|
var _hooks = require("../../../utils/hooks");
|
|
14
15
|
var _eventHandling = require("../../../utils/eventHandling");
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
18
|
var MISSING_GEOMETRY_PROPS_EXCEPTION_MSG = 'Error in Polyline: Polyline without geometry makes no sense';
|
|
18
19
|
exports.MISSING_GEOMETRY_PROPS_EXCEPTION_MSG = MISSING_GEOMETRY_PROPS_EXCEPTION_MSG;
|
|
19
20
|
var WRONG_GEOMETRY_PROPS_EXCEPTION_MSG = 'Error in Polyline: property geometry must be of type H.geo.LineString';
|
|
@@ -25,7 +26,8 @@ var Polyline = function Polyline(_ref) {
|
|
|
25
26
|
_ref$style = _ref.style,
|
|
26
27
|
style = _ref$style === void 0 ? H.map.SpatialStyle.DEFAULT_STYLE : _ref$style,
|
|
27
28
|
eventListenerMap = _ref.eventListenerMap;
|
|
28
|
-
var
|
|
29
|
+
var _useContext = (0, _react.useContext)(_context.MapContext),
|
|
30
|
+
api = _useContext.api;
|
|
29
31
|
var _useState = (0, _react.useState)(),
|
|
30
32
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
31
33
|
polyline = _useState2[0],
|
|
@@ -42,18 +44,39 @@ var Polyline = function Polyline(_ref) {
|
|
|
42
44
|
style: style
|
|
43
45
|
});
|
|
44
46
|
if (hasArrows) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
var routeArrows;
|
|
48
|
+
if (api.settings.enableWebGL) {
|
|
49
|
+
// Create a patterned polyline
|
|
50
|
+
var arrowLineStyle = new H.map.SpatialStyle(_objectSpread(_objectSpread({}, arrowStyle), {}, {
|
|
51
|
+
lineWidth: 10,
|
|
52
|
+
strokeColor: 'rgba(0, 0, 0, 0.8)',
|
|
53
|
+
lineDash: [0, 3],
|
|
54
|
+
lineDashOffset: 1.6,
|
|
55
|
+
lineTailCap: 'arrow-tail',
|
|
56
|
+
lineHeadCap: 'arrow-head'
|
|
57
|
+
}));
|
|
58
|
+
routeArrows = new H.map.Polyline(geometry, {
|
|
59
|
+
style: arrowLineStyle
|
|
60
|
+
});
|
|
61
|
+
} else {
|
|
62
|
+
// Non WebGL way - Create a patterned polyline
|
|
63
|
+
var defaultArrowStyle = {
|
|
64
|
+
lineWidth: 2,
|
|
65
|
+
fillColor: 'rgba(42, 55, 64, 1)',
|
|
66
|
+
strokeColor: 'rgba(0, 0, 0, 0.8)',
|
|
67
|
+
lineDash: [0, 4],
|
|
68
|
+
lineTailCap: 'arrow-tail',
|
|
69
|
+
lineHeadCap: 'arrow-head'
|
|
70
|
+
};
|
|
71
|
+
var _arrowLineStyle = new H.map.SpatialStyle({
|
|
72
|
+
lineWidth: 10,
|
|
73
|
+
strokeColor: 'rgba(255, 255, 255, 0)'
|
|
74
|
+
});
|
|
75
|
+
routeArrows = new H.map.Polyline(geometry, {
|
|
76
|
+
style: _arrowLineStyle,
|
|
77
|
+
arrows: defaultArrowStyle
|
|
78
|
+
});
|
|
79
|
+
}
|
|
57
80
|
|
|
58
81
|
// create a group that represents the route line and contains
|
|
59
82
|
// outline and the pattern
|
|
@@ -61,43 +84,20 @@ var Polyline = function Polyline(_ref) {
|
|
|
61
84
|
} else {
|
|
62
85
|
lineGroup.addObjects([line]);
|
|
63
86
|
}
|
|
64
|
-
|
|
87
|
+
api.map.addObject(lineGroup);
|
|
65
88
|
setPolyline(lineGroup);
|
|
66
89
|
return function () {
|
|
67
|
-
// cleanup
|
|
68
|
-
//console.log('cleanup polyline');
|
|
69
|
-
|
|
70
90
|
(0, _eventHandling.removeEventListenerMap)(lineGroup);
|
|
71
91
|
lineGroup.forEach(function (singleLine) {
|
|
72
92
|
lineGroup.removeObject(singleLine);
|
|
73
93
|
singleLine.dispose();
|
|
74
94
|
});
|
|
75
|
-
if (
|
|
76
|
-
|
|
95
|
+
if (api.map.getObjects().includes(lineGroup)) {
|
|
96
|
+
api.map.removeObject(lineGroup);
|
|
77
97
|
}
|
|
78
98
|
lineGroup.dispose();
|
|
79
99
|
};
|
|
80
|
-
}, [geometry, style, hasArrows, arrowStyle]);
|
|
81
|
-
|
|
82
|
-
/*useEffect(() => {
|
|
83
|
-
if (polyline) {
|
|
84
|
-
polyline.forEach((line, index) => {
|
|
85
|
-
if (index === 0) {
|
|
86
|
-
line.setStyle(style);
|
|
87
|
-
} else {
|
|
88
|
-
line.setStyle(arrowStyle);
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
}, [style, arrowStyle]);*/
|
|
93
|
-
|
|
94
|
-
/*useEffect(() => {
|
|
95
|
-
if (polyline) {
|
|
96
|
-
polyline.forEach(line => line.setGeometry(geometry));
|
|
97
|
-
}
|
|
98
|
-
}, [geometry]);*/
|
|
99
|
-
|
|
100
|
-
//useUpdateProp(polyline, 'setStyle', style);
|
|
100
|
+
}, [api.map, geometry, style, hasArrows, arrowStyle]);
|
|
101
101
|
(0, _hooks.useUpdateEventListenerMap)(polyline, eventListenerMap);
|
|
102
102
|
return null;
|
|
103
103
|
};
|
|
@@ -16,6 +16,11 @@ var _proptypes = _interopRequireDefault(require("../../../../utils/proptypes"));
|
|
|
16
16
|
var _eventHandling = require("../../../../utils/eventHandling");
|
|
17
17
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
18
18
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
19
|
+
// Should be deprecated...
|
|
20
|
+
// Here Documentation:
|
|
21
|
+
// It should be only used where small numbers of markers with dynamic style and/or scripted icons are to be displayed
|
|
22
|
+
// on the map (for example animated interactive SVG). Otherwise a H.map.Marker should be preferred for performance reasons.
|
|
23
|
+
//
|
|
19
24
|
var DomMarker = /*#__PURE__*/function (_React$Component) {
|
|
20
25
|
(0, _inherits2["default"])(DomMarker, _React$Component);
|
|
21
26
|
var _super = _createSuper(DomMarker);
|
|
@@ -27,7 +32,7 @@ var DomMarker = /*#__PURE__*/function (_React$Component) {
|
|
|
27
32
|
_this.marker = new H.map.DomMarker(_this.convertPosition(props.position), {
|
|
28
33
|
icon: icon
|
|
29
34
|
});
|
|
30
|
-
context.api.
|
|
35
|
+
context.api.map.addObject(_this.marker);
|
|
31
36
|
(0, _eventHandling.addEventListenerMap)(_this.marker, props.eventListenerMap, _this.context.api.map);
|
|
32
37
|
return _this;
|
|
33
38
|
}
|
|
@@ -54,8 +59,8 @@ var DomMarker = /*#__PURE__*/function (_React$Component) {
|
|
|
54
59
|
key: "componentWillUnmount",
|
|
55
60
|
value: function componentWillUnmount() {
|
|
56
61
|
(0, _eventHandling.removeEventListenerMap)(this.marker);
|
|
57
|
-
if (this.context.api.
|
|
58
|
-
this.context.api.
|
|
62
|
+
if (this.context.api.map.includes(this.marker)) {
|
|
63
|
+
this.context.api.map.removeObject(this.marker);
|
|
59
64
|
}
|
|
60
65
|
this.marker.dispose();
|
|
61
66
|
}
|