@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
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
7
|
-
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; } }
|
|
8
1
|
/* eslint-disable no-undef */
|
|
9
|
-
import React from 'react';
|
|
2
|
+
import React, { useContext, useEffect, useState, useRef } from 'react';
|
|
10
3
|
import ReactDomServer from 'react-dom/server';
|
|
11
4
|
import PropTypes from 'prop-types';
|
|
12
5
|
import mapProps from '../../../../utils/proptypes';
|
|
13
|
-
import { addEventListenerMap, removeEventListenerMap
|
|
6
|
+
import { addEventListenerMap, removeEventListenerMap } from '../../../../utils/eventHandling';
|
|
14
7
|
import MapException from '../../../../exceptions/MapException';
|
|
15
8
|
import { MapContext } from '../../../context';
|
|
16
9
|
export var isHMapIcon = function isHMapIcon(icon) {
|
|
@@ -23,127 +16,114 @@ export function getOrCreateIcon(icon) {
|
|
|
23
16
|
if (!icon || isHMapIcon(icon) || icon instanceof H.map.DomIcon) {
|
|
24
17
|
return;
|
|
25
18
|
}
|
|
26
|
-
var renderedIcon = /*#__PURE__*/React.isValidElement(icon) ? ReactDomServer.renderToStaticMarkup(icon) : icon;
|
|
19
|
+
var renderedIcon = /*#__PURE__*/React.isValidElement(icon) ? ReactDomServer.renderToStaticMarkup( /*#__PURE__*/React.cloneElement(icon)) : icon;
|
|
27
20
|
return new H.map.DomIcon(renderedIcon);
|
|
28
21
|
}
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
_this.setupMarker(props);
|
|
38
|
-
return _this;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// eslint-disable-next-line camelcase
|
|
42
|
-
_createClass(Marker, [{
|
|
43
|
-
key: "UNSAFE_componentWillReceiveProps",
|
|
44
|
-
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
45
|
-
var _this$props = this.props,
|
|
46
|
-
position = _this$props.position,
|
|
47
|
-
customData = _this$props.customData,
|
|
48
|
-
icon = _this$props.icon;
|
|
49
|
-
checkAndUpdateEventListenerMap(this.marker, this.props, nextProps);
|
|
50
|
-
if (position !== nextProps.position) {
|
|
51
|
-
this.marker.setGeometry(this.getConvertedPosition(nextProps));
|
|
52
|
-
}
|
|
53
|
-
this.marker.draggable = !!nextProps.draggable;
|
|
54
|
-
if (customData !== nextProps.customData) {
|
|
55
|
-
this.marker.setData(nextProps.customData);
|
|
56
|
-
}
|
|
57
|
-
if (icon !== nextProps.icon) {
|
|
58
|
-
if (isDomMakerNeeded(icon) !== isDomMakerNeeded(nextProps.icon)) {
|
|
59
|
-
// icon type changed so we need to change the marker type
|
|
60
|
-
this.destroyMarker();
|
|
61
|
-
this.setupMarker(nextProps);
|
|
62
|
-
} else {
|
|
63
|
-
this.marker.setIcon(getOrCreateIcon(nextProps.icon));
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}, {
|
|
68
|
-
key: "shouldComponentUpdate",
|
|
69
|
-
value: function shouldComponentUpdate() {
|
|
70
|
-
return false;
|
|
71
|
-
}
|
|
72
|
-
}, {
|
|
73
|
-
key: "componentWillUnmount",
|
|
74
|
-
value: function componentWillUnmount() {
|
|
75
|
-
this.destroyMarker();
|
|
76
|
-
}
|
|
77
|
-
}, {
|
|
78
|
-
key: "render",
|
|
79
|
-
value: function render() {
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
}, {
|
|
83
|
-
key: "setupMarker",
|
|
84
|
-
value: function setupMarker(nextProps) {
|
|
85
|
-
var _this$props2 = this.props,
|
|
86
|
-
customData = _this$props2.customData,
|
|
87
|
-
draggable = _this$props2.draggable;
|
|
88
|
-
var MarkerConstructor = isDomMakerNeeded(nextProps.icon) ? H.map.DomMarker : H.map.Marker;
|
|
89
|
-
this.marker = new MarkerConstructor(this.getConvertedPosition(nextProps), {
|
|
90
|
-
icon: getOrCreateIcon(nextProps.icon)
|
|
91
|
-
});
|
|
92
|
-
this.marker.setData(customData);
|
|
93
|
-
this.marker.draggable = !!draggable;
|
|
94
|
-
this.context.group.addObject(this.marker);
|
|
95
|
-
addEventListenerMap(this.marker, nextProps.eventListenerMap, this.context.map);
|
|
22
|
+
var convertPosition = function convertPosition(pos) {
|
|
23
|
+
return Array.isArray(pos) ? new H.geo.MultiPoint(pos) : pos;
|
|
24
|
+
};
|
|
25
|
+
var checkPositionProperties = function checkPositionProperties(position) {
|
|
26
|
+
['lat', 'lng'].forEach(function (propertyName) {
|
|
27
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
28
|
+
if (!position.hasOwnProperty(propertyName)) {
|
|
29
|
+
throw new MapException("Error in Marker: position object requires property \"".concat(propertyName, "\""));
|
|
96
30
|
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
var getPosition = function getPosition(position) {
|
|
34
|
+
if (!position) {
|
|
35
|
+
throw new MapException('Error in Marker: invalid position property');
|
|
36
|
+
}
|
|
37
|
+
if (Array.isArray(position)) {
|
|
38
|
+
position.forEach(function (pos) {
|
|
39
|
+
return checkPositionProperties(pos);
|
|
40
|
+
});
|
|
41
|
+
} else {
|
|
42
|
+
checkPositionProperties(position);
|
|
43
|
+
}
|
|
44
|
+
return position;
|
|
45
|
+
};
|
|
46
|
+
var getConvertedPosition = function getConvertedPosition(position) {
|
|
47
|
+
return convertPosition(getPosition(position));
|
|
48
|
+
};
|
|
49
|
+
var setupMarker = function setupMarker(props, api) {
|
|
50
|
+
var position = props.position,
|
|
51
|
+
customData = props.customData,
|
|
52
|
+
icon = props.icon,
|
|
53
|
+
draggable = props.draggable,
|
|
54
|
+
eventListenerMap = props.eventListenerMap;
|
|
55
|
+
var MarkerConstructor = isDomMakerNeeded(icon) ? H.map.DomMarker : H.map.Marker;
|
|
56
|
+
var marker = new MarkerConstructor(getConvertedPosition(position), {
|
|
57
|
+
icon: getOrCreateIcon(icon, api.settings.baseLayer)
|
|
58
|
+
});
|
|
59
|
+
marker.setData(customData);
|
|
60
|
+
marker.draggable = !!draggable;
|
|
61
|
+
api.map.addObject(marker);
|
|
62
|
+
addEventListenerMap(marker, eventListenerMap, api.map);
|
|
63
|
+
return marker;
|
|
64
|
+
};
|
|
65
|
+
var destroyMarker = function destroyMarker(marker, api) {
|
|
66
|
+
removeEventListenerMap(marker);
|
|
67
|
+
if (api.map.getObjects().includes(marker)) {
|
|
68
|
+
api.map.removeObject(marker);
|
|
69
|
+
}
|
|
70
|
+
marker.dispose();
|
|
71
|
+
};
|
|
72
|
+
var Marker = function Marker(props) {
|
|
73
|
+
var position = props.position,
|
|
74
|
+
customData = props.customData,
|
|
75
|
+
icon = props.icon,
|
|
76
|
+
eventListenerMap = props.eventListenerMap;
|
|
77
|
+
var _useContext = useContext(MapContext),
|
|
78
|
+
api = _useContext.api;
|
|
79
|
+
var markerRef = useRef();
|
|
80
|
+
useEffect(function () {
|
|
81
|
+
markerRef.current = setupMarker(props, api);
|
|
82
|
+
return function () {
|
|
83
|
+
if (markerRef.current) {
|
|
84
|
+
destroyMarker(markerRef.current, api);
|
|
85
|
+
markerRef.current = undefined;
|
|
103
86
|
}
|
|
104
|
-
|
|
87
|
+
};
|
|
88
|
+
}, []);
|
|
89
|
+
|
|
90
|
+
// Update marker position
|
|
91
|
+
useEffect(function () {
|
|
92
|
+
if (markerRef.current) {
|
|
93
|
+
markerRef.current.setGeometry(getConvertedPosition(position));
|
|
105
94
|
}
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
95
|
+
}, [position, markerRef.current]);
|
|
96
|
+
|
|
97
|
+
// Update marker custom data
|
|
98
|
+
useEffect(function () {
|
|
99
|
+
if (markerRef.current) {
|
|
100
|
+
markerRef.current.setData(customData);
|
|
110
101
|
}
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (Array.isArray(position)) {
|
|
120
|
-
position.forEach(function (pos) {
|
|
121
|
-
return _this2.checkPositionProperties(pos);
|
|
122
|
-
});
|
|
123
|
-
} else {
|
|
124
|
-
this.checkPositionProperties(position);
|
|
125
|
-
}
|
|
126
|
-
return position;
|
|
102
|
+
}, [customData, markerRef.current]);
|
|
103
|
+
|
|
104
|
+
// Update EventListenerMap
|
|
105
|
+
useEffect(function () {
|
|
106
|
+
if (markerRef.current) {
|
|
107
|
+
// use exports to make methods accessible for stubbing
|
|
108
|
+
var mapApi = removeEventListenerMap(markerRef.current);
|
|
109
|
+
addEventListenerMap(markerRef.current, eventListenerMap, mapApi);
|
|
127
110
|
}
|
|
128
|
-
},
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
throw new MapException("Error in Marker: position object requires property \"".concat(propertyName, "\""));
|
|
135
|
-
}
|
|
136
|
-
});
|
|
111
|
+
}, [eventListenerMap, markerRef.current]);
|
|
112
|
+
|
|
113
|
+
// If icon type changed, we need to change the marker type
|
|
114
|
+
useEffect(function () {
|
|
115
|
+
if (!(markerRef.current && icon)) {
|
|
116
|
+
return;
|
|
137
117
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
118
|
+
if (isDomMakerNeeded(icon)) {
|
|
119
|
+
destroyMarker(markerRef.current, api);
|
|
120
|
+
markerRef.current = setupMarker(props, api);
|
|
121
|
+
} else {
|
|
122
|
+
markerRef.current.setIcon(getOrCreateIcon(icon));
|
|
142
123
|
}
|
|
143
|
-
}]);
|
|
144
|
-
return
|
|
145
|
-
}
|
|
146
|
-
Marker.contextType = MapContext;
|
|
124
|
+
}, [icon, markerRef.current]);
|
|
125
|
+
return null;
|
|
126
|
+
};
|
|
147
127
|
Marker.propTypes = {
|
|
148
128
|
position: PropTypes.oneOfType([mapProps.position, mapProps.positions]).isRequired,
|
|
149
129
|
icon: mapProps.icon,
|
|
@@ -1,56 +1,28 @@
|
|
|
1
1
|
import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
|
-
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; } }
|
|
10
3
|
import React from 'react';
|
|
11
|
-
// import ReactDomServer from 'react-dom/server';
|
|
12
4
|
import PropTypes from 'prop-types';
|
|
13
5
|
import MapException from '../../../../exceptions/MapException';
|
|
14
6
|
import mapProps from '../../../../utils/proptypes';
|
|
15
7
|
import Marker from './Marker';
|
|
16
8
|
export var emptyTextException = 'Error in TextMarker: TextMarker without text makes no sense';
|
|
17
9
|
export var wrongTypeException = 'Error in TextMarker: property text must be string type';
|
|
18
|
-
var TextMarker =
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
var TextMarker = function TextMarker(props) {
|
|
11
|
+
var other = _extends({}, (_objectDestructuringEmpty(props), props));
|
|
12
|
+
var textDiv = "<div class=\"bg-white padding-x-5 padding-y-3 border border-color-darker shadow-accent\">".concat(getText(props.text), "</div>");
|
|
13
|
+
return /*#__PURE__*/React.createElement(Marker, _extends({}, other, {
|
|
14
|
+
icon: textDiv
|
|
15
|
+
}));
|
|
16
|
+
};
|
|
17
|
+
var getText = function getText(text) {
|
|
18
|
+
if (!text) {
|
|
19
|
+
throw new MapException(emptyTextException);
|
|
20
|
+
}
|
|
21
|
+
if (typeof text !== 'string') {
|
|
22
|
+
throw new MapException(wrongTypeException);
|
|
24
23
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
value: function render() {
|
|
28
|
-
var other = _extends({}, (_objectDestructuringEmpty(this.props), this.props));
|
|
29
|
-
|
|
30
|
-
// const textDiv = ReactDomServer.renderToStaticMarkup(
|
|
31
|
-
// <div style={{ border: '1px solid black', padding: '0 2px' }}>{this.getText()}</div>
|
|
32
|
-
// );
|
|
33
|
-
|
|
34
|
-
var textDiv = "<div>".concat(this.getText(), "</div>");
|
|
35
|
-
return /*#__PURE__*/React.createElement(Marker, _extends({}, other, {
|
|
36
|
-
icon: textDiv
|
|
37
|
-
}));
|
|
38
|
-
}
|
|
39
|
-
}, {
|
|
40
|
-
key: "getText",
|
|
41
|
-
value: function getText() {
|
|
42
|
-
var text = this.props.text;
|
|
43
|
-
if (!text) {
|
|
44
|
-
throw new MapException(emptyTextException);
|
|
45
|
-
}
|
|
46
|
-
if (typeof text !== 'string') {
|
|
47
|
-
throw new MapException(wrongTypeException);
|
|
48
|
-
}
|
|
49
|
-
return text;
|
|
50
|
-
}
|
|
51
|
-
}]);
|
|
52
|
-
return TextMarker;
|
|
53
|
-
}(React.PureComponent);
|
|
24
|
+
return text;
|
|
25
|
+
};
|
|
54
26
|
TextMarker.propTypes = {
|
|
55
27
|
position: PropTypes.oneOfType([mapProps.position, mapProps.positions]).isRequired,
|
|
56
28
|
text: PropTypes.string.isRequired
|
|
@@ -16,13 +16,15 @@ import { MapContext } from '../../context';
|
|
|
16
16
|
* Not very different to the SimpleClusterLayer, but with a different intention.
|
|
17
17
|
*/
|
|
18
18
|
var MarkerLayer = function MarkerLayer(props) {
|
|
19
|
-
var
|
|
19
|
+
var _useContext = useContext(MapContext),
|
|
20
|
+
api = _useContext.api;
|
|
20
21
|
var simpleTheme = props.simpleTheme,
|
|
21
22
|
_props$clusterDissolv = props.clusterDissolvable,
|
|
22
23
|
clusterDissolvable = _props$clusterDissolv === void 0 ? true : _props$clusterDissolv,
|
|
23
24
|
rest = _objectWithoutProperties(props, _excluded);
|
|
25
|
+
|
|
24
26
|
// Norbert: Not an ideal solution
|
|
25
|
-
var showCluster = !clusterDissolvable || getOr(true, 'settings.showCluster',
|
|
27
|
+
var showCluster = !clusterDissolvable || getOr(true, 'settings.showCluster', api);
|
|
26
28
|
var newProps = _objectSpread({
|
|
27
29
|
clusterTheme: simpleTheme && wrapSimpleTheme(simpleTheme)
|
|
28
30
|
}, rest);
|
|
@@ -31,8 +33,9 @@ var MarkerLayer = function MarkerLayer(props) {
|
|
|
31
33
|
}));
|
|
32
34
|
};
|
|
33
35
|
MarkerLayer.propTypes = {
|
|
34
|
-
// api: mapProps.api,
|
|
35
36
|
simpleTheme: mapProps.clusterTheme,
|
|
36
|
-
clusterDissolvable: PropTypes.bool
|
|
37
|
+
clusterDissolvable: PropTypes.bool,
|
|
38
|
+
clusterStrategy: PropTypes.oneOf(['FASTGRID', 'GRID', 'DYNAMICGRID']),
|
|
39
|
+
eps: PropTypes.number
|
|
37
40
|
};
|
|
38
41
|
export default MarkerLayer;
|
|
@@ -3,7 +3,6 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
var _excluded = ["useWebGL"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { FORMAT, TILE_SIZE } from '../../constants';
|
|
6
|
-
import { getPPI } from '../../mapUtils';
|
|
7
6
|
import Layer from './Layer';
|
|
8
7
|
var createRoadRestrictionLayer = function createRoadRestrictionLayer(useWebGL) {
|
|
9
8
|
return function (api, language) {
|
|
@@ -12,7 +11,7 @@ var createRoadRestrictionLayer = function createRoadRestrictionLayer(useWebGL) {
|
|
|
12
11
|
}).createTileLayer('truckonlytile', 'normal.day', TILE_SIZE, FORMAT, {
|
|
13
12
|
style: 'default',
|
|
14
13
|
lg: language,
|
|
15
|
-
ppi:
|
|
14
|
+
ppi: undefined
|
|
16
15
|
});
|
|
17
16
|
};
|
|
18
17
|
};
|
|
@@ -4,7 +4,7 @@ var _excluded = ["useWebGL"];
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { FORMAT, TILE_SIZE } from '../../constants';
|
|
6
6
|
import Layer from './Layer';
|
|
7
|
-
var
|
|
7
|
+
var createWebGlTrafficLayer = function createWebGlTrafficLayer(api, language) {
|
|
8
8
|
// use new Here 3.1 API traffic layer for WebGL
|
|
9
9
|
// https://developer.here.com/documentation/maps/3.1.37.0/dev_guide/topics/migration.html
|
|
10
10
|
|
|
@@ -26,7 +26,7 @@ var createRasterTrafficLayer = function createRasterTrafficLayer(api, language)
|
|
|
26
26
|
var TrafficLayer = function TrafficLayer(props) {
|
|
27
27
|
var useWebGL = props.useWebGL,
|
|
28
28
|
remainingProps = _objectWithoutProperties(props, _excluded);
|
|
29
|
-
var createLayerCallback = useWebGL ?
|
|
29
|
+
var createLayerCallback = useWebGL ? createWebGlTrafficLayer : createRasterTrafficLayer;
|
|
30
30
|
return /*#__PURE__*/React.createElement(Layer, _extends({}, remainingProps, {
|
|
31
31
|
createLayer: createLayerCallback
|
|
32
32
|
}));
|
|
@@ -11,7 +11,8 @@ var DefaultRasterLayer = function DefaultRasterLayer(props) {
|
|
|
11
11
|
language: language,
|
|
12
12
|
mapType: MAP_TYPE_DEFAULT,
|
|
13
13
|
additionalParameters: {
|
|
14
|
-
|
|
14
|
+
// should not be used as Vector map does not support it it would different anyhow
|
|
15
|
+
//style: 'alps',
|
|
15
16
|
}
|
|
16
17
|
});
|
|
17
18
|
return null;
|
|
@@ -42,7 +42,10 @@ export var useBaseLayer = function useBaseLayer(props) {
|
|
|
42
42
|
if (!baseLayer) {
|
|
43
43
|
var additionalParametersWithLocale = _objectSpread(_objectSpread({}, additionalParameters), {}, {
|
|
44
44
|
lg: mapToLongLocale(language),
|
|
45
|
-
ppi: getPPI()
|
|
45
|
+
// ppi: getPPI(),
|
|
46
|
+
|
|
47
|
+
// need to be set for better performence of legacy map
|
|
48
|
+
engineType: isWebGL ? undefined : H.map.render.RenderEngine.EngineType.P2D
|
|
46
49
|
});
|
|
47
50
|
var defaultLayers = api.platform.createDefaultLayers(additionalParametersWithLocale);
|
|
48
51
|
var newBaseLayer = getDefaultBaseLayer(defaultLayers, mapType, isWebGL);
|
|
@@ -12,6 +12,16 @@ var convertData = function convertData(data, converterFunc) {
|
|
|
12
12
|
return data.map(converterFunc ? converterFunc : DEFAULT_DATA_CONVERTER);
|
|
13
13
|
};
|
|
14
14
|
var DEFAULT_CLUSTER_THEME = new H.clustering.Provider([]).getTheme();
|
|
15
|
+
var getClusterStrategy = function getClusterStrategy(strategy) {
|
|
16
|
+
switch (strategy) {
|
|
17
|
+
case 'GRID':
|
|
18
|
+
return H.clustering.Provider.Strategy.GRID;
|
|
19
|
+
case 'DYNAMICGRID':
|
|
20
|
+
return H.clustering.Provider.Strategy.DYNAMICGRID;
|
|
21
|
+
default:
|
|
22
|
+
return H.clustering.Provider.Strategy.FASTGRID;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
15
25
|
var ClusterLayer = function ClusterLayer(_ref) {
|
|
16
26
|
var data = _ref.data,
|
|
17
27
|
dataConverter = _ref.dataConverter,
|
|
@@ -20,8 +30,12 @@ var ClusterLayer = function ClusterLayer(_ref) {
|
|
|
20
30
|
maxZoom = _ref.maxZoom,
|
|
21
31
|
_ref$clusterTheme = _ref.clusterTheme,
|
|
22
32
|
clusterTheme = _ref$clusterTheme === void 0 ? DEFAULT_CLUSTER_THEME : _ref$clusterTheme,
|
|
23
|
-
eventListenerMap = _ref.eventListenerMap
|
|
24
|
-
|
|
33
|
+
eventListenerMap = _ref.eventListenerMap,
|
|
34
|
+
clusterStrategy = _ref.clusterStrategy,
|
|
35
|
+
_ref$eps = _ref.eps,
|
|
36
|
+
eps = _ref$eps === void 0 ? 100 : _ref$eps;
|
|
37
|
+
var _useContext = useContext(MapContext),
|
|
38
|
+
api = _useContext.api;
|
|
25
39
|
var _useState = useState(),
|
|
26
40
|
_useState2 = _slicedToArray(_useState, 2),
|
|
27
41
|
provider = _useState2[0],
|
|
@@ -29,8 +43,8 @@ var ClusterLayer = function ClusterLayer(_ref) {
|
|
|
29
43
|
useEffect(function () {
|
|
30
44
|
var newProviderOptions = {
|
|
31
45
|
clusteringOptions: {
|
|
32
|
-
strategy:
|
|
33
|
-
eps:
|
|
46
|
+
strategy: getClusterStrategy(clusterStrategy),
|
|
47
|
+
eps: eps,
|
|
34
48
|
minWeight: minWeight ? parseInt(minWeight, 10) : 2
|
|
35
49
|
},
|
|
36
50
|
min: minZoom ? parseInt(minZoom, 10) : 0,
|
|
@@ -41,14 +55,14 @@ var ClusterLayer = function ClusterLayer(_ref) {
|
|
|
41
55
|
};
|
|
42
56
|
var newProvider = new H.clustering.Provider(convertData(data, dataConverter), newProviderOptions);
|
|
43
57
|
var objectLayer = new H.map.layer.ObjectLayer(newProvider);
|
|
44
|
-
|
|
58
|
+
api.map.addLayer(objectLayer);
|
|
45
59
|
setProvider(newProvider);
|
|
46
60
|
return function () {
|
|
47
|
-
|
|
61
|
+
api.map.removeLayer(objectLayer);
|
|
48
62
|
objectLayer.dispose();
|
|
49
63
|
newProvider.dispose();
|
|
50
64
|
};
|
|
51
|
-
}, [minWeight, minZoom, maxZoom]);
|
|
65
|
+
}, [minWeight, minZoom, maxZoom, api.map]);
|
|
52
66
|
|
|
53
67
|
// Effect to update data points of provider
|
|
54
68
|
useLayoutEffect(function () {
|
|
@@ -57,7 +71,7 @@ var ClusterLayer = function ClusterLayer(_ref) {
|
|
|
57
71
|
}
|
|
58
72
|
}, [data, dataConverter]);
|
|
59
73
|
useUpdateProp(provider, 'setTheme', clusterTheme);
|
|
60
|
-
useUpdateEventListenerMap(provider, eventListenerMap,
|
|
74
|
+
useUpdateEventListenerMap(provider, eventListenerMap, api.map);
|
|
61
75
|
return null;
|
|
62
76
|
};
|
|
63
77
|
ClusterLayer.propTpyes = {
|
|
@@ -67,6 +81,8 @@ ClusterLayer.propTpyes = {
|
|
|
67
81
|
minZoom: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
68
82
|
maxZoom: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
69
83
|
clusterTheme: mapProps.clusterTheme,
|
|
70
|
-
eventListenerMap: PropTypes.object
|
|
84
|
+
eventListenerMap: PropTypes.object,
|
|
85
|
+
clusterStrategy: PropTypes.oneOf(['FASTGRID', 'GRID', 'DYNAMICGRID']),
|
|
86
|
+
eps: PropTypes.number
|
|
71
87
|
};
|
|
72
88
|
export default ClusterLayer;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["mapType", "onMapTypeChange"];
|
|
3
|
+
var _excluded = ["mapType", "onMapTypeChange", "enableNightMap"];
|
|
4
4
|
import React, { useMemo } from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { MAP_TYPE_DEFAULT, MAP_TYPE_FLEET_STYLE, MAP_TYPE_NIGHT, MAP_TYPE_SATELLITE, MAP_TYPE_TERRAIN } from '../../../constants';
|
|
@@ -11,6 +11,7 @@ import { MapIcon, MAP_TYPE_FLAT_ACTIVE, MAP_TYPE_FLAT_INACTIVE, MAP_TYPE_FLAT_TR
|
|
|
11
11
|
var MapTypeSettings = function MapTypeSettings(props) {
|
|
12
12
|
var mapType = props.mapType,
|
|
13
13
|
onMapTypeChange = props.onMapTypeChange,
|
|
14
|
+
enableNightMap = props.enableNightMap,
|
|
14
15
|
remainingProps = _objectWithoutProperties(props, _excluded);
|
|
15
16
|
var type = useMemo(function () {
|
|
16
17
|
return {
|
|
@@ -51,7 +52,19 @@ var MapTypeSettings = function MapTypeSettings(props) {
|
|
|
51
52
|
return /*#__PURE__*/React.createElement(MapSettingsTile, _extends({
|
|
52
53
|
className: "MapTypeSettings",
|
|
53
54
|
inactiveIcon: getIcon(type),
|
|
54
|
-
panel: /*#__PURE__*/React.createElement(MapSettingsPanel, null, /*#__PURE__*/React.createElement(MapSettingsItem, {
|
|
55
|
+
panel: /*#__PURE__*/React.createElement(MapSettingsPanel, null, enableNightMap && /*#__PURE__*/React.createElement(MapSettingsItem, {
|
|
56
|
+
className: "MapTypeNight",
|
|
57
|
+
onClick: function onClick() {
|
|
58
|
+
return onMapTypeChange(MAP_TYPE_NIGHT);
|
|
59
|
+
},
|
|
60
|
+
isActive: type.isNight,
|
|
61
|
+
activeIcon: /*#__PURE__*/React.createElement(MapIcon, {
|
|
62
|
+
name: MAP_TYPE_NIGHT_ACTIVE
|
|
63
|
+
}),
|
|
64
|
+
inactiveIcon: /*#__PURE__*/React.createElement(MapIcon, {
|
|
65
|
+
name: MAP_TYPE_NIGHT_INACTIVE
|
|
66
|
+
})
|
|
67
|
+
}), /*#__PURE__*/React.createElement(MapSettingsItem, {
|
|
55
68
|
className: "MapTypeSatelite",
|
|
56
69
|
onClick: function onClick() {
|
|
57
70
|
return onMapTypeChange(MAP_TYPE_SATELLITE);
|
|
@@ -104,10 +117,12 @@ var MapTypeSettings = function MapTypeSettings(props) {
|
|
|
104
117
|
};
|
|
105
118
|
MapTypeSettings.displayName = 'MapTypeSettings';
|
|
106
119
|
MapTypeSettings.defaultProps = {
|
|
107
|
-
onMapTypeChange: function onMapTypeChange() {}
|
|
120
|
+
onMapTypeChange: function onMapTypeChange() {},
|
|
121
|
+
enableNightMap: true
|
|
108
122
|
};
|
|
109
123
|
MapTypeSettings.propTypes = {
|
|
110
124
|
mapType: PropTypes.string,
|
|
125
|
+
enableNightMap: PropTypes.bool,
|
|
111
126
|
onMapTypeChange: PropTypes.func
|
|
112
127
|
};
|
|
113
128
|
export default MapTypeSettings;
|