@rio-cloud/rio-uikit 0.16.2-beta.3 → 0.16.2-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.DS_Store +0 -0
- package/components/.DS_Store +0 -0
- package/components/autosuggest/AutoSuggest.js +2 -2
- package/components/filepicker/FilePicker.js +5 -4
- package/components/map/.DS_Store +0 -0
- package/components/map/assets/icon_map_settings_maptype_night_active.svg +12 -0
- package/components/map/assets/icon_map_settings_maptype_night_inactive.svg +12 -0
- package/components/map/components/.DS_Store +0 -0
- package/components/map/components/Map.js +54 -44
- package/components/map/components/constants.js +2 -4
- package/components/map/components/features/layers/baselayers/DefaultRasterLayer.js +4 -5
- package/components/map/components/features/layers/baselayers/DefaultVectorLayer.js +4 -3
- package/components/map/components/features/layers/baselayers/FleetStyleLayer.js +2 -2
- package/components/map/components/features/layers/baselayers/NightLayer.js +17 -0
- package/components/map/components/features/layers/baselayers/SatelliteLayer.js +2 -2
- package/components/map/components/features/layers/baselayers/TerrainLayer.js +2 -2
- package/components/map/components/features/layers/baselayers/useBaseLayer.js +27 -15
- package/components/map/components/features/settings/builtinSettings/MapTypeSettings.js +9 -3
- package/components/map/components/mapUtils.js +37 -7
- package/components/map/icons/MapIcon.js +64 -0
- package/components/mapMarker/SingleMapMarker.js +6 -0
- package/components/numberControl/NumberControl.js +34 -11
- package/components/numberInput/NumberInput.js +52 -50
- package/hooks/useDarkMode.js +29 -0
- package/hooks/useElementSize.js +1 -1
- package/hooks/useFullscreen.js +37 -41
- package/hooks/useMutationObserver.js +29 -0
- 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/autosuggest/AutoSuggest.js +2 -2
- package/lib/es/components/filepicker/FilePicker.js +5 -4
- package/lib/es/components/map/assets/icon_map_settings_maptype_night_active.svg +12 -0
- package/lib/es/components/map/assets/icon_map_settings_maptype_night_inactive.svg +12 -0
- package/lib/es/components/map/components/Map.js +53 -43
- package/lib/es/components/map/components/constants.js +3 -4
- package/lib/es/components/map/components/features/layers/baselayers/DefaultRasterLayer.js +4 -5
- package/lib/es/components/map/components/features/layers/baselayers/DefaultVectorLayer.js +4 -3
- package/lib/es/components/map/components/features/layers/baselayers/FleetStyleLayer.js +2 -2
- package/lib/es/components/map/components/features/layers/baselayers/NightLayer.js +23 -0
- package/lib/es/components/map/components/features/layers/baselayers/SatelliteLayer.js +2 -2
- package/lib/es/components/map/components/features/layers/baselayers/TerrainLayer.js +2 -2
- package/lib/es/components/map/components/features/layers/baselayers/useBaseLayer.js +28 -16
- package/lib/es/components/map/components/features/settings/builtinSettings/MapTypeSettings.js +7 -1
- package/lib/es/components/map/components/mapUtils.js +37 -7
- package/lib/es/components/map/icons/MapIcon.js +67 -1
- package/lib/es/components/mapMarker/SingleMapMarker.js +6 -0
- package/lib/es/components/numberControl/NumberControl.js +33 -10
- package/lib/es/components/numberInput/NumberInput.js +51 -50
- package/lib/es/hooks/useDarkMode.js +37 -0
- package/lib/es/hooks/useElementSize.js +1 -1
- package/lib/es/hooks/useFullscreen.js +37 -41
- package/lib/es/hooks/useMutationObserver.js +35 -0
- package/lib/es/styles/.DS_Store +0 -0
- package/lib/es/styles/components/Dialog.less +1 -1
- package/lib/es/styles/mapping/color-map.less +11 -11
- package/lib/es/themes/.DS_Store +0 -0
- package/lib/es/themes/Website/styles/rio-website.less +10 -5
- package/lib/es/types.ts +8 -2
- package/lib/es/utils/colorScheme.js +12 -3
- package/lib/es/utils/init.js +32 -34
- package/lib/es/version.json +1 -1
- package/package.json +33 -33
- package/styles/.DS_Store +0 -0
- package/styles/components/Dialog.less +1 -1
- package/styles/mapping/color-map.less +11 -11
- package/themes/.DS_Store +0 -0
- package/themes/Volkswagen/.DS_Store +0 -0
- package/themes/Website/.DS_Store +0 -0
- package/themes/Website/styles/rio-website.less +10 -5
- package/types.ts +8 -2
- package/utils/colorScheme.js +7 -3
- package/utils/init.js +32 -34
- package/version.json +1 -1
|
@@ -12,7 +12,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _reactDropzone = _interopRequireWildcard(require("react-dropzone"));
|
|
14
14
|
var _Button = _interopRequireDefault(require("../button/Button"));
|
|
15
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
16
15
|
var _excluded = ["label", "accept", "multiple", "maxSize", "displayMode", "onPick", "className", "children"];
|
|
17
16
|
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); }
|
|
18
17
|
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; }
|
|
@@ -33,7 +32,10 @@ var FilePicker = function FilePicker(props) {
|
|
|
33
32
|
var showButton = isButton || isFull;
|
|
34
33
|
var showDropzone = isDropzone || isFull;
|
|
35
34
|
var handleDrop = (0, _react.useCallback)(function (acceptedFiles, rejectedFiles) {
|
|
36
|
-
var
|
|
35
|
+
var hasImagesType = Object.keys(accept).some(function (mimeType) {
|
|
36
|
+
return mimeType.startsWith('image');
|
|
37
|
+
});
|
|
38
|
+
var files = hasImagesType ? acceptedFiles.map(function (file) {
|
|
37
39
|
return Object.assign(file, {
|
|
38
40
|
preview: URL.createObjectURL(file)
|
|
39
41
|
});
|
|
@@ -70,7 +72,6 @@ FilePicker.defaultProps = {
|
|
|
70
72
|
displayMode: 'button',
|
|
71
73
|
multiple: true,
|
|
72
74
|
label: 'Select Files',
|
|
73
|
-
accept: '',
|
|
74
75
|
onPick: function onPick() {},
|
|
75
76
|
className: ''
|
|
76
77
|
};
|
|
@@ -78,7 +79,7 @@ FilePicker.propTypes = {
|
|
|
78
79
|
displayMode: _propTypes["default"].string /* Display mode: 'dropzone' / 'button' / 'full' */,
|
|
79
80
|
multiple: _propTypes["default"].bool /* Allow multiple file selections or not */,
|
|
80
81
|
label: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].node]) /* Text to display on Button */,
|
|
81
|
-
accept: _propTypes["default"].
|
|
82
|
+
accept: _propTypes["default"].object /* Object list of accepted Mime Types as keys and file extensions array as value */,
|
|
82
83
|
maxSize: _propTypes["default"].number /* Maximum File Size */,
|
|
83
84
|
onPick: _propTypes["default"].func /* Pick callback */,
|
|
84
85
|
className: _propTypes["default"].string /* Custom className for the displayed component (dropzone/button) */,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M0 20.322L19.98 31.644L39.96 20.322L19.98 9L0 20.322ZM5.363 22.178C5.363 22.178 2.01 20.254 2.01 20.256L5.363 18.354L8.717 20.254L5.363 22.178V22.178ZM8.98 24.24L5.626 22.317L8.98 20.417L12.333 22.316L8.98 24.24ZM12.614 26.277C12.614 26.277 9.261 24.352 9.261 24.354L12.614 22.454L15.967 24.352L12.614 26.277V26.277ZM16.25 28.317L12.897 26.394L16.25 24.494L19.603 26.393L16.25 28.317V28.317ZM19.887 30.392L16.534 28.469L19.887 26.569L23.241 28.468L19.887 30.392ZM9.11 20.128C9.11 20.128 5.757 18.204 5.757 18.206L9.11 16.304L12.464 18.204L9.11 20.128V20.128ZM12.727 22.19L9.373 20.267L12.727 18.367L16.08 20.266L12.727 22.19V22.19ZM16.361 24.227L13.008 22.304L16.361 20.404L19.714 22.303L16.361 24.227V24.227ZM19.997 26.267C19.997 26.267 16.644 24.343 16.644 24.345L19.997 22.443L23.35 24.343L19.997 26.267V26.267ZM23.634 28.342L20.28 26.419L23.633 24.519L26.987 26.418L23.633 28.342H23.634V28.342ZM12.76 18.038C12.76 18.038 9.407 16.114 9.407 16.116L12.76 14.214L16.113 16.114L12.76 18.038ZM16.376 20.1L13.023 18.177L16.376 16.277L19.729 18.176L16.376 20.1ZM20.011 22.137C20.011 22.137 16.658 20.212 16.658 20.214L20.011 18.313L23.364 20.213L20.011 22.137V22.137ZM23.647 24.177L20.294 22.254L23.647 20.354L27 22.253L23.647 24.177ZM27.284 26.252L23.931 24.329L27.284 22.429L30.637 24.328L27.284 26.252V26.252ZM16.367 15.964L13.014 14.041L16.367 12.141L19.721 14.04L16.367 15.964V15.964ZM19.983 18.026L16.63 16.102L19.983 14.202L23.337 16.101L19.983 18.025V18.026ZM23.618 20.063C23.618 20.063 20.265 18.138 20.265 18.14L23.618 16.239L26.971 18.139L23.618 20.063ZM27.254 22.103L23.901 20.18L27.254 18.28L30.607 20.179L27.254 22.103V22.103ZM30.891 24.178C30.891 24.178 27.538 22.253 27.538 22.255L30.891 20.355L34.244 22.253L30.891 24.178V24.178ZM20.061 13.835C20.061 13.835 16.707 11.91 16.707 11.912L20.06 10.011L23.413 11.911L20.06 13.835H20.061V13.835ZM23.676 15.896C23.676 15.896 20.323 13.972 20.323 13.974L23.676 12.073L27.03 13.972L23.676 15.896ZM27.311 17.933C27.311 17.933 23.958 16.009 23.958 16.011L27.311 14.109L30.664 16.009L27.311 17.933ZM30.947 19.973C30.947 19.973 27.594 18.049 27.594 18.051L30.947 16.15L34.3 18.05L30.947 19.973V19.973ZM34.584 22.048C34.584 22.048 31.231 20.124 31.231 20.126L34.584 18.225L37.937 20.124L34.584 22.048Z" fill="#30B4C0"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.352 3.14533C12.4221 3.2154 12.4698 3.3047 12.489 3.40192C12.5082 3.49913 12.4981 3.59987 12.46 3.69133C12.1552 4.42281 11.9989 5.20757 12 6C12 7.5913 12.6321 9.11742 13.7574 10.2426C14.8826 11.3679 16.4087 12 18 12C18.7924 12.0011 19.5772 11.8448 20.3087 11.54C20.4001 11.5019 20.5007 11.4919 20.5978 11.5111C20.695 11.5303 20.7842 11.5779 20.8543 11.6478C20.9243 11.7178 20.972 11.807 20.9913 11.9041C21.0106 12.0012 21.0006 12.1019 20.9627 12.1933C20.4307 13.4688 19.5332 14.5584 18.3831 15.3248C17.2331 16.0911 15.882 16.5 14.5 16.5C10.634 16.5 7.5 13.366 7.5 9.5C7.5 6.588 9.278 4.092 11.8067 3.03733C11.898 2.99935 11.9986 2.98933 12.0957 3.00856C12.1928 3.02778 12.282 3.07538 12.352 3.14533V3.14533Z" fill="#30B4C0"/>
|
|
4
|
+
<g clip-path="url(#clip0_1_2)">
|
|
5
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M25.5 4.25C25.5815 4.25002 25.6607 4.27657 25.7258 4.32565C25.7908 4.37473 25.8381 4.44365 25.8605 4.522L26.267 5.945C26.3545 6.25146 26.5187 6.53055 26.7441 6.75591C26.9695 6.98128 27.2485 7.14548 27.555 7.233L28.978 7.6395C29.0563 7.66193 29.1252 7.70924 29.1742 7.77428C29.2232 7.83932 29.2497 7.91855 29.2497 8C29.2497 8.08145 29.2232 8.16068 29.1742 8.22572C29.1252 8.29076 29.0563 8.33807 28.978 8.3605L27.555 8.767C27.2485 8.85452 26.9695 9.01872 26.7441 9.24409C26.5187 9.46945 26.3545 9.74854 26.267 10.055L25.8605 11.478C25.8381 11.5563 25.7908 11.6252 25.7257 11.6742C25.6607 11.7232 25.5815 11.7497 25.5 11.7497C25.4186 11.7497 25.3393 11.7232 25.2743 11.6742C25.2092 11.6252 25.1619 11.5563 25.1395 11.478L24.733 10.055C24.6455 9.74854 24.4813 9.46945 24.2559 9.24409C24.0306 9.01872 23.7515 8.85452 23.445 8.767L22.022 8.3605C21.9437 8.33807 21.8748 8.29076 21.8258 8.22572C21.7768 8.16068 21.7503 8.08145 21.7503 8C21.7503 7.91855 21.7768 7.83932 21.8258 7.77428C21.8748 7.70924 21.9437 7.66193 22.022 7.6395L23.445 7.233C23.7515 7.14548 24.0306 6.98128 24.2559 6.75591C24.4813 6.53055 24.6455 6.25146 24.733 5.945L25.1395 4.522C25.1619 4.44365 25.2092 4.37473 25.2742 4.32565C25.3393 4.27657 25.4185 4.25002 25.5 4.25ZM30 2.75C30.0837 2.74995 30.1649 2.77788 30.2309 2.82934C30.2968 2.8808 30.3437 2.95284 30.364 3.034L30.493 3.552C30.611 4.022 30.978 4.389 31.448 4.507L31.966 4.636C32.0473 4.65614 32.1195 4.70293 32.1712 4.7689C32.2228 4.83487 32.2508 4.91623 32.2508 5C32.2508 5.08377 32.2228 5.16513 32.1712 5.2311C32.1195 5.29707 32.0473 5.34386 31.966 5.364L31.448 5.493C30.978 5.611 30.611 5.978 30.493 6.448L30.364 6.966C30.3439 7.04731 30.2971 7.11954 30.2311 7.17117C30.1651 7.22279 30.0838 7.25084 30 7.25084C29.9162 7.25084 29.8349 7.22279 29.7689 7.17117C29.7029 7.11954 29.6561 7.04731 29.636 6.966L29.507 6.448C29.4493 6.21721 29.33 6.00645 29.1618 5.83824C28.9936 5.67003 28.7828 5.55069 28.552 5.493L28.034 5.364C27.9527 5.34386 27.8805 5.29707 27.8288 5.2311C27.7772 5.16513 27.7492 5.08377 27.7492 5C27.7492 4.91623 27.7772 4.83487 27.8288 4.7689C27.8805 4.70293 27.9527 4.65614 28.034 4.636L28.552 4.507C28.7828 4.44931 28.9936 4.32997 29.1618 4.16176C29.33 3.99355 29.4493 3.78279 29.507 3.552L29.636 3.034C29.6563 2.95284 29.7032 2.8808 29.7691 2.82934C29.8351 2.77788 29.9163 2.74995 30 2.75V2.75ZM29.25 9.5C29.3288 9.49995 29.4055 9.52471 29.4694 9.57075C29.5333 9.61679 29.5811 9.68178 29.606 9.7565L29.803 10.348C29.878 10.5715 30.053 10.7475 30.277 10.822L30.8685 11.0195C30.943 11.0445 31.0077 11.0923 31.0536 11.1561C31.0995 11.2198 31.1242 11.2964 31.1242 11.375C31.1242 11.4536 31.0995 11.5302 31.0536 11.5939C31.0077 11.6577 30.943 11.7055 30.8685 11.7305L30.277 11.928C30.0535 12.003 29.8775 12.178 29.803 12.402L29.6055 12.9935C29.5805 13.068 29.5327 13.1327 29.4689 13.1786C29.4052 13.2245 29.3286 13.2491 29.25 13.2491C29.1714 13.2491 29.0949 13.2245 29.0311 13.1786C28.9673 13.1327 28.9195 13.068 28.8945 12.9935L28.697 12.402C28.6602 12.2916 28.5982 12.1914 28.5159 12.1091C28.4336 12.0268 28.3334 11.9648 28.223 11.928L27.6315 11.7305C27.557 11.7055 27.4923 11.6577 27.4464 11.5939C27.4005 11.5302 27.3759 11.4536 27.3759 11.375C27.3759 11.2964 27.4005 11.2198 27.4464 11.1561C27.4923 11.0923 27.557 11.0445 27.6315 11.0195L28.223 10.822C28.4465 10.747 28.6225 10.572 28.697 10.348L28.8945 9.7565C28.9194 9.68186 28.9671 9.61693 29.0309 9.57089C29.0947 9.52486 29.1713 9.50006 29.25 9.5V9.5Z" fill="#30B4C0"/>
|
|
6
|
+
</g>
|
|
7
|
+
<defs>
|
|
8
|
+
<clipPath id="clip0_1_2">
|
|
9
|
+
<rect width="12" height="12" fill="white" transform="translate(21 2)"/>
|
|
10
|
+
</clipPath>
|
|
11
|
+
</defs>
|
|
12
|
+
</svg>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.0199966 20.2L20 31.522L39.98 20.2L20 8.878L0.0199966 20.2ZM5.383 22.056C5.383 22.056 2.03 20.132 2.03 20.134L5.383 18.232L8.737 20.132L5.383 22.056V22.056ZM9 24.118L5.646 22.195L9 20.295L12.353 22.194L9 24.118ZM12.634 26.155C12.634 26.155 9.281 24.23 9.281 24.232L12.634 22.332L15.987 24.23L12.634 26.155V26.155ZM16.27 28.195L12.917 26.272L16.27 24.372L19.623 26.271L16.27 28.195V28.195ZM19.907 30.27L16.554 28.347L19.907 26.447L23.261 28.346L19.907 30.27ZM9.13 20.006C9.13 20.006 5.777 18.082 5.777 18.084L9.13 16.182L12.484 18.082L9.13 20.006V20.006ZM12.747 22.068L9.393 20.145L12.747 18.245L16.1 20.144L12.747 22.068V22.068ZM16.381 24.105L13.028 22.182L16.381 20.282L19.734 22.181L16.381 24.105V24.105ZM20.017 26.145C20.017 26.145 16.664 24.221 16.664 24.223L20.017 22.321L23.37 24.221L20.017 26.145V26.145ZM23.654 28.22L20.3 26.297L23.653 24.397L27.007 26.296L23.653 28.22H23.654V28.22ZM12.78 17.916C12.78 17.916 9.427 15.992 9.427 15.994L12.78 14.092L16.133 15.992L12.78 17.916ZM16.396 19.978L13.043 18.055L16.396 16.155L19.749 18.054L16.396 19.978ZM20.031 22.015C20.031 22.015 16.678 20.09 16.678 20.092L20.031 18.191L23.384 20.091L20.031 22.015V22.015ZM23.667 24.055L20.314 22.132L23.667 20.232L27.02 22.131L23.667 24.055ZM27.304 26.13L23.951 24.207L27.304 22.307L30.657 24.206L27.304 26.13V26.13ZM16.387 15.842L13.034 13.919L16.387 12.019L19.741 13.918L16.387 15.842V15.842ZM20.003 17.904L16.65 15.98L20.003 14.08L23.357 15.979L20.003 17.903V17.904ZM23.638 19.941C23.638 19.941 20.285 18.016 20.285 18.018L23.638 16.117L26.991 18.017L23.638 19.941ZM27.274 21.981L23.921 20.058L27.274 18.158L30.627 20.057L27.274 21.981V21.981ZM30.911 24.056C30.911 24.056 27.558 22.131 27.558 22.133L30.911 20.233L34.264 22.131L30.911 24.056V24.056ZM20.081 13.713C20.081 13.713 16.727 11.788 16.727 11.79L20.08 9.889L23.433 11.789L20.08 13.713H20.081V13.713ZM23.696 15.774C23.696 15.774 20.343 13.85 20.343 13.852L23.696 11.951L27.05 13.85L23.696 15.774ZM27.331 17.811C27.331 17.811 23.978 15.887 23.978 15.889L27.331 13.987L30.684 15.887L27.331 17.811ZM30.967 19.851C30.967 19.851 27.614 17.927 27.614 17.929L30.967 16.028L34.32 17.928L30.967 19.851V19.851ZM34.604 21.926C34.604 21.926 31.251 20.002 31.251 20.004L34.604 18.103L37.957 20.002L34.604 21.926Z" fill="#939BA8"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.352 3.14533C12.4221 3.2154 12.4698 3.3047 12.489 3.40192C12.5082 3.49913 12.4981 3.59987 12.46 3.69133C12.1552 4.42281 11.9989 5.20757 12 6C12 7.5913 12.6321 9.11742 13.7574 10.2426C14.8826 11.3679 16.4087 12 18 12C18.7924 12.0011 19.5772 11.8448 20.3087 11.54C20.4001 11.5019 20.5007 11.4919 20.5978 11.5111C20.695 11.5303 20.7842 11.5779 20.8543 11.6478C20.9243 11.7178 20.972 11.807 20.9913 11.9041C21.0106 12.0012 21.0006 12.1019 20.9627 12.1933C20.4307 13.4688 19.5332 14.5584 18.3831 15.3248C17.2331 16.0911 15.882 16.5 14.5 16.5C10.634 16.5 7.5 13.366 7.5 9.5C7.5 6.588 9.278 4.092 11.8067 3.03733C11.898 2.99935 11.9986 2.98933 12.0957 3.00856C12.1928 3.02778 12.282 3.07538 12.352 3.14533V3.14533Z" fill="#939BA8"/>
|
|
4
|
+
<g clip-path="url(#clip0_1_4)">
|
|
5
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M25.5 4.25C25.5815 4.25002 25.6607 4.27657 25.7258 4.32565C25.7908 4.37473 25.8381 4.44365 25.8605 4.522L26.267 5.945C26.3545 6.25146 26.5187 6.53055 26.7441 6.75591C26.9694 6.98128 27.2485 7.14548 27.555 7.233L28.978 7.6395C29.0563 7.66193 29.1252 7.70924 29.1742 7.77428C29.2232 7.83932 29.2497 7.91855 29.2497 8C29.2497 8.08145 29.2232 8.16068 29.1742 8.22572C29.1252 8.29076 29.0563 8.33807 28.978 8.3605L27.555 8.767C27.2485 8.85452 26.9694 9.01872 26.7441 9.24409C26.5187 9.46945 26.3545 9.74854 26.267 10.055L25.8605 11.478C25.8381 11.5563 25.7908 11.6252 25.7257 11.6742C25.6607 11.7232 25.5814 11.7497 25.5 11.7497C25.4185 11.7497 25.3393 11.7232 25.2743 11.6742C25.2092 11.6252 25.1619 11.5563 25.1395 11.478L24.733 10.055C24.6455 9.74854 24.4813 9.46945 24.2559 9.24409C24.0305 9.01872 23.7515 8.85452 23.445 8.767L22.022 8.3605C21.9437 8.33807 21.8748 8.29076 21.8258 8.22572C21.7768 8.16068 21.7503 8.08145 21.7503 8C21.7503 7.91855 21.7768 7.83932 21.8258 7.77428C21.8748 7.70924 21.9437 7.66193 22.022 7.6395L23.445 7.233C23.7515 7.14548 24.0305 6.98128 24.2559 6.75591C24.4813 6.53055 24.6455 6.25146 24.733 5.945L25.1395 4.522C25.1619 4.44365 25.2092 4.37473 25.2742 4.32565C25.3393 4.27657 25.4185 4.25002 25.5 4.25ZM30 2.75C30.0837 2.74995 30.1649 2.77788 30.2309 2.82934C30.2968 2.8808 30.3437 2.95284 30.364 3.034L30.493 3.552C30.611 4.022 30.978 4.389 31.448 4.507L31.966 4.636C32.0473 4.65614 32.1195 4.70293 32.1712 4.7689C32.2228 4.83487 32.2508 4.91623 32.2508 5C32.2508 5.08377 32.2228 5.16513 32.1712 5.2311C32.1195 5.29707 32.0473 5.34386 31.966 5.364L31.448 5.493C30.978 5.611 30.611 5.978 30.493 6.448L30.364 6.966C30.3439 7.04731 30.2971 7.11954 30.2311 7.17117C30.1651 7.22279 30.0838 7.25084 30 7.25084C29.9162 7.25084 29.8349 7.22279 29.7689 7.17117C29.7029 7.11954 29.6561 7.04731 29.636 6.966L29.507 6.448C29.4493 6.21721 29.33 6.00645 29.1618 5.83824C28.9935 5.67003 28.7828 5.55069 28.552 5.493L28.034 5.364C27.9527 5.34386 27.8805 5.29707 27.8288 5.2311C27.7772 5.16513 27.7492 5.08377 27.7492 5C27.7492 4.91623 27.7772 4.83487 27.8288 4.7689C27.8805 4.70293 27.9527 4.65614 28.034 4.636L28.552 4.507C28.7828 4.44931 28.9935 4.32997 29.1618 4.16176C29.33 3.99355 29.4493 3.78279 29.507 3.552L29.636 3.034C29.6563 2.95284 29.7032 2.8808 29.7691 2.82934C29.8351 2.77788 29.9163 2.74995 30 2.75V2.75ZM29.25 9.5C29.3288 9.49995 29.4055 9.52471 29.4694 9.57075C29.5333 9.61679 29.5811 9.68178 29.606 9.7565L29.803 10.348C29.878 10.5715 30.053 10.7475 30.277 10.822L30.8685 11.0195C30.943 11.0445 31.0077 11.0923 31.0536 11.1561C31.0995 11.2198 31.1241 11.2964 31.1241 11.375C31.1241 11.4536 31.0995 11.5302 31.0536 11.5939C31.0077 11.6577 30.943 11.7055 30.8685 11.7305L30.277 11.928C30.0535 12.003 29.8775 12.178 29.803 12.402L29.6055 12.9935C29.5805 13.068 29.5327 13.1327 29.4689 13.1786C29.4051 13.2245 29.3286 13.2491 29.25 13.2491C29.1714 13.2491 29.0948 13.2245 29.0311 13.1786C28.9673 13.1327 28.9195 13.068 28.8945 12.9935L28.697 12.402C28.6602 12.2916 28.5982 12.1914 28.5159 12.1091C28.4336 12.0268 28.3334 11.9648 28.223 11.928L27.6315 11.7305C27.557 11.7055 27.4923 11.6577 27.4464 11.5939C27.4005 11.5302 27.3758 11.4536 27.3758 11.375C27.3758 11.2964 27.4005 11.2198 27.4464 11.1561C27.4923 11.0923 27.557 11.0445 27.6315 11.0195L28.223 10.822C28.4465 10.747 28.6225 10.572 28.697 10.348L28.8945 9.7565C28.9194 9.68186 28.9671 9.61693 29.0309 9.57089C29.0947 9.52486 29.1713 9.50006 29.25 9.5V9.5Z" fill="#939BA8"/>
|
|
6
|
+
</g>
|
|
7
|
+
<defs>
|
|
8
|
+
<clipPath id="clip0_1_4">
|
|
9
|
+
<rect width="12" height="12" fill="white" transform="translate(21 2)"/>
|
|
10
|
+
</clipPath>
|
|
11
|
+
</defs>
|
|
12
|
+
</svg>
|
|
@@ -28,9 +28,12 @@ var _DefaultRasterLayer = _interopRequireDefault(require("./features/layers/base
|
|
|
28
28
|
var _FleetStyleLayer = _interopRequireDefault(require("./features/layers/baselayers/FleetStyleLayer"));
|
|
29
29
|
var _SatelliteLayer = _interopRequireDefault(require("./features/layers/baselayers/SatelliteLayer"));
|
|
30
30
|
var _TerrainLayer = _interopRequireDefault(require("./features/layers/baselayers/TerrainLayer"));
|
|
31
|
+
var _NightLayer = _interopRequireDefault(require("./features/layers/baselayers/NightLayer"));
|
|
32
|
+
var _useBaseLayer = require("./features/layers/baselayers/useBaseLayer");
|
|
31
33
|
var _eventHandling = require("../utils/eventHandling");
|
|
32
34
|
var _context = require("./context");
|
|
33
35
|
var _mapUtils = require("./mapUtils");
|
|
36
|
+
var _useDarkMode = require("../../../hooks/useDarkMode");
|
|
34
37
|
var _PropTypes$shape;
|
|
35
38
|
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); }
|
|
36
39
|
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; }
|
|
@@ -50,19 +53,6 @@ var getPlatform = function getPlatform(credentials) {
|
|
|
50
53
|
app_code: credentials.app_code
|
|
51
54
|
});
|
|
52
55
|
};
|
|
53
|
-
|
|
54
|
-
// Obtain the default map types from the platform object:
|
|
55
|
-
var createDefaultLayers = function createDefaultLayers(platform, language, darkMode) {
|
|
56
|
-
return platform.createDefaultLayers({
|
|
57
|
-
lg: language,
|
|
58
|
-
lg2: 'de',
|
|
59
|
-
// Only needed for a raster based map
|
|
60
|
-
tileSize: _constants.TILE_SIZE,
|
|
61
|
-
ppi: (0, _mapUtils.getPPI)(),
|
|
62
|
-
// default style for default raster layer
|
|
63
|
-
style: !darkMode && 'mini'
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
56
|
var getHereUi = function getHereUi(hereMap, defaultLayers, showScaleBar) {
|
|
67
57
|
var hereUi = H.ui.UI.createDefault(hereMap, defaultLayers);
|
|
68
58
|
if (hereUi) {
|
|
@@ -110,7 +100,7 @@ var getBaseLayer = function getBaseLayer(api, baseLayer, language, useWebGL, dar
|
|
|
110
100
|
switch (baseLayer) {
|
|
111
101
|
case _constants.MAP_TYPE_DEFAULT:
|
|
112
102
|
{
|
|
113
|
-
return useWebGL ? /*#__PURE__*/_react["default"].createElement(_DefaultVectorLayer["default"], {
|
|
103
|
+
return !darkMode && useWebGL ? /*#__PURE__*/_react["default"].createElement(_DefaultVectorLayer["default"], {
|
|
114
104
|
api: api,
|
|
115
105
|
language: language,
|
|
116
106
|
key: baseLayer
|
|
@@ -139,6 +129,12 @@ var getBaseLayer = function getBaseLayer(api, baseLayer, language, useWebGL, dar
|
|
|
139
129
|
language: language,
|
|
140
130
|
key: baseLayer
|
|
141
131
|
});
|
|
132
|
+
case _constants.MAP_TYPE_NIGHT:
|
|
133
|
+
return /*#__PURE__*/_react["default"].createElement(_NightLayer["default"], {
|
|
134
|
+
api: api,
|
|
135
|
+
language: language,
|
|
136
|
+
key: baseLayer
|
|
137
|
+
});
|
|
142
138
|
default:
|
|
143
139
|
null;
|
|
144
140
|
}
|
|
@@ -162,14 +158,6 @@ var getStyle = function getStyle(height, width) {
|
|
|
162
158
|
}
|
|
163
159
|
return style;
|
|
164
160
|
};
|
|
165
|
-
|
|
166
|
-
// https://developer.here.com/documentation/maps/3.1.37.0/api_reference/H.service.Platform.html#createDefaultLayers
|
|
167
|
-
var getMapRenderingEngine = function getMapRenderingEngine(defaultLayers, useWebGL, darkMode) {
|
|
168
|
-
if (useWebGL) {
|
|
169
|
-
return defaultLayers.vector.normal.map;
|
|
170
|
-
}
|
|
171
|
-
return darkMode ? defaultLayers.raster.normal.mapnight : defaultLayers.raster.normal.map;
|
|
172
|
-
};
|
|
173
161
|
var Map = function Map(props) {
|
|
174
162
|
var children = props.children,
|
|
175
163
|
credentials = props.credentials,
|
|
@@ -219,22 +207,35 @@ var Map = function Map(props) {
|
|
|
219
207
|
_useState10 = (0, _slicedToArray2["default"])(_useState9, 2),
|
|
220
208
|
showCluster = _useState10[0],
|
|
221
209
|
setShowCluster = _useState10[1];
|
|
210
|
+
var isDarkMode = (0, _useDarkMode.useDarkMode)();
|
|
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]);
|
|
222
223
|
var devicePixelRatio = window.devicePixelRatio || 1;
|
|
223
224
|
(0, _react.useEffect)(function () {
|
|
224
|
-
|
|
225
|
-
var defaultLayers = createDefaultLayers(platform, language, darkMode);
|
|
225
|
+
console.debug('initialize here map');
|
|
226
226
|
var bounds = boundingBox && getBounds(boundingBox);
|
|
227
|
-
var
|
|
227
|
+
var platform = getPlatform(credentials);
|
|
228
|
+
var defaultLayers = platform.createDefaultLayers();
|
|
229
|
+
var defaultLayer = (0, _useBaseLayer.getDefaultBaseLayer)(defaultLayers, baseLayer, useWebGL);
|
|
228
230
|
|
|
229
231
|
// Instantiate (and display) a map object:
|
|
230
|
-
var
|
|
232
|
+
var mapConfig = {
|
|
231
233
|
zoom: zoom,
|
|
232
234
|
center: center,
|
|
233
235
|
bounds: bounds,
|
|
234
|
-
pixelRatio: devicePixelRatio
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
});
|
|
236
|
+
pixelRatio: devicePixelRatio
|
|
237
|
+
};
|
|
238
|
+
var hereMap = new H.Map(mapRef.current, defaultLayer, mapConfig);
|
|
238
239
|
|
|
239
240
|
// Add a resize listener to make sure that the map occupies the whole container
|
|
240
241
|
var resizeListener = (0, _addEventListener["default"])(window, 'resize', (0, _throttle["default"])(RESIZE_THROTTLE, function () {
|
|
@@ -278,7 +279,7 @@ var Map = function Map(props) {
|
|
|
278
279
|
hereMap.dispose();
|
|
279
280
|
}
|
|
280
281
|
};
|
|
281
|
-
}, [useWebGL
|
|
282
|
+
}, [useWebGL]);
|
|
282
283
|
|
|
283
284
|
// Update BoundingBox from outside
|
|
284
285
|
(0, _react.useEffect)(function () {
|
|
@@ -293,17 +294,25 @@ var Map = function Map(props) {
|
|
|
293
294
|
}
|
|
294
295
|
}, [boundingBox]);
|
|
295
296
|
|
|
296
|
-
// Update Zoom from outside
|
|
297
|
+
// Update Zoom from outside if value is different
|
|
297
298
|
(0, _react.useEffect)(function () {
|
|
298
|
-
if (api
|
|
299
|
-
|
|
299
|
+
if (!api) {
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
var currentMapZoom = api.utils.getZoom();
|
|
303
|
+
if (zoom && currentMapZoom !== zoom) {
|
|
304
|
+
api.utils.setZoom(zoom, zoomAnimation);
|
|
300
305
|
}
|
|
301
306
|
}, [zoom]);
|
|
302
307
|
|
|
303
|
-
// Update Lat & Lng from outside
|
|
308
|
+
// Update Lat & Lng from outside if value is different
|
|
304
309
|
(0, _react.useEffect)(function () {
|
|
305
|
-
if (api && center) {
|
|
306
|
-
|
|
310
|
+
if (!(api && center)) {
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
var currentMapCenter = api.utils.getCenter();
|
|
314
|
+
if (currentMapCenter.lat !== center.lat || currentMapCenter.lng !== center.lng) {
|
|
315
|
+
api.utils.setCenter(center, zoomAnimation);
|
|
307
316
|
}
|
|
308
317
|
}, [center]);
|
|
309
318
|
|
|
@@ -355,22 +364,22 @@ var Map = function Map(props) {
|
|
|
355
364
|
}));
|
|
356
365
|
};
|
|
357
366
|
var handleZoomIn = function handleZoomIn() {
|
|
358
|
-
var z =
|
|
367
|
+
var z = api.utils.getZoom();
|
|
359
368
|
var newZoom = z + 1;
|
|
360
369
|
onZoomIn(newZoom, z);
|
|
361
|
-
api.
|
|
370
|
+
api.utils.setZoom(newZoom, zoomAnimation);
|
|
362
371
|
};
|
|
363
372
|
var handleZoomOut = function handleZoomOut() {
|
|
364
|
-
var z =
|
|
373
|
+
var z = api.utils.getZoom();
|
|
365
374
|
var newZoom = z - 1;
|
|
366
375
|
onZoomOut(newZoom, z);
|
|
367
|
-
api.
|
|
376
|
+
api.utils.setZoom(newZoom, zoomAnimation);
|
|
368
377
|
};
|
|
369
378
|
var style = getStyle(height, width);
|
|
370
379
|
var autoHeightClass = (0, _isEmpty["default"])(style) ? 'height-100pct' : '';
|
|
371
380
|
var hideZoomButtons = disableBehavior;
|
|
372
381
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
373
|
-
className: "Map position-relative ".concat(autoHeightClass),
|
|
382
|
+
className: "Map position-relative map-type-".concat(baseLayer.toLowerCase(), " ").concat(autoHeightClass),
|
|
374
383
|
style: style,
|
|
375
384
|
ref: mapRef
|
|
376
385
|
}, isMapInitialized && /*#__PURE__*/_react["default"].createElement(_context.MapContext.Provider, {
|
|
@@ -400,6 +409,7 @@ Map.TYPE_DEFAULT = _constants.MAP_TYPE_DEFAULT;
|
|
|
400
409
|
Map.TYPE_FLEET_STYLE = _constants.MAP_TYPE_FLEET_STYLE;
|
|
401
410
|
Map.TYPE_SATELLITE = _constants.MAP_TYPE_SATELLITE;
|
|
402
411
|
Map.TYPE_TERRAIN = _constants.MAP_TYPE_TERRAIN;
|
|
412
|
+
Map.TYPE_NIGHT = _constants.MAP_TYPE_NIGHT;
|
|
403
413
|
Map.LAYER_INCIDENTS = _constants.MAP_LAYER_INCIDENTS;
|
|
404
414
|
Map.LAYER_TRAFFIC = _constants.MAP_LAYER_TRAFFIC;
|
|
405
415
|
Map.LAYER_ROAD_RESTRICTIONS = _constants.MAP_LAYER_ROAD_RESTRICTIONS;
|
|
@@ -435,7 +445,7 @@ Map.propTypes = {
|
|
|
435
445
|
hideMapSettings: _propTypes["default"].bool,
|
|
436
446
|
hideClusterSettings: _propTypes["default"].bool,
|
|
437
447
|
hideMapLayerSettings: _propTypes["default"].bool,
|
|
438
|
-
mapType: _propTypes["default"].oneOf([Map.TYPE_DEFAULT, Map.TYPE_FLEET_STYLE, Map.TYPE_SATELLITE, Map.TYPE_TERRAIN]),
|
|
448
|
+
mapType: _propTypes["default"].oneOf([Map.TYPE_DEFAULT, Map.TYPE_FLEET_STYLE, Map.TYPE_SATELLITE, Map.TYPE_TERRAIN, Map.TYPE_NIGHT]),
|
|
439
449
|
mapLayer: _propTypes["default"].arrayOf(_propTypes["default"].string),
|
|
440
450
|
showCluster: _propTypes["default"].bool,
|
|
441
451
|
showScaleBar: _propTypes["default"].bool,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TILE_TYPE = exports.TILE_SIZE = exports.MAP_TYPE_TERRAIN = exports.MAP_TYPE_SATELLITE = exports.MAP_TYPE_FLEET_STYLE = exports.MAP_TYPE_DEFAULT = exports.MAP_LAYER_TRAFFIC = exports.MAP_LAYER_ROAD_RESTRICTIONS = exports.MAP_LAYER_INCIDENTS = exports.HIGH_RES_PPI = exports.FORMAT = void 0;
|
|
6
|
+
exports.TILE_TYPE = exports.TILE_SIZE = exports.MAP_TYPE_TERRAIN = exports.MAP_TYPE_SATELLITE = exports.MAP_TYPE_NIGHT = exports.MAP_TYPE_FLEET_STYLE = exports.MAP_TYPE_DEFAULT = exports.MAP_LAYER_TRAFFIC = exports.MAP_LAYER_ROAD_RESTRICTIONS = exports.MAP_LAYER_INCIDENTS = exports.HIGH_RES_PPI = exports.FORMAT = void 0;
|
|
7
7
|
var MAP_TYPE_DEFAULT = 'DEFAULT';
|
|
8
8
|
exports.MAP_TYPE_DEFAULT = MAP_TYPE_DEFAULT;
|
|
9
9
|
var MAP_TYPE_FLEET_STYLE = 'FLEET_STYLE';
|
|
@@ -12,6 +12,8 @@ var MAP_TYPE_SATELLITE = 'SATELLITE';
|
|
|
12
12
|
exports.MAP_TYPE_SATELLITE = MAP_TYPE_SATELLITE;
|
|
13
13
|
var MAP_TYPE_TERRAIN = 'TERRAIN';
|
|
14
14
|
exports.MAP_TYPE_TERRAIN = MAP_TYPE_TERRAIN;
|
|
15
|
+
var MAP_TYPE_NIGHT = 'NIGHT';
|
|
16
|
+
exports.MAP_TYPE_NIGHT = MAP_TYPE_NIGHT;
|
|
15
17
|
var MAP_LAYER_INCIDENTS = 'INCIDENTS';
|
|
16
18
|
exports.MAP_LAYER_INCIDENTS = MAP_LAYER_INCIDENTS;
|
|
17
19
|
var MAP_LAYER_TRAFFIC = 'TRAFFIC';
|
|
@@ -25,7 +27,4 @@ exports.TILE_SIZE = TILE_SIZE;
|
|
|
25
27
|
var TILE_TYPE = 'maptile';
|
|
26
28
|
exports.TILE_TYPE = TILE_TYPE;
|
|
27
29
|
var HIGH_RES_PPI = 320;
|
|
28
|
-
|
|
29
|
-
// https://3.base.maps.ls.hereapi.com/maptile/2.1/maptile/da6f196b15/normal.day/11/1086/709/256/png8?xnlp=CL_JSMv3.1.37.0&apikey=Kls87GMD8WOPMBac1vgJ0eWYpSw1YzSXtXNcWHtZf5w&style=alps&lg=eng
|
|
30
|
-
// https://3.base.maps.ls.hereapi.com/maptile/2.1/maptile/da6f196b15/normal.day/11/1086/709/256/png8?xnlp=CL_JSMv3.1.37.0&apikey=Kls87GMD8WOPMBac1vgJ0eWYpSw1YzSXtXNcWHtZf5w&ppi=320&lg=en&lg2=de
|
|
31
30
|
exports.HIGH_RES_PPI = HIGH_RES_PPI;
|
|
@@ -5,18 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _useBaseLayer = require("./useBaseLayer");
|
|
8
|
+
var _constants = require("../../../constants");
|
|
8
9
|
// https://developer.here.com/documentation/map-tile/dev_guide/topics/resource-info.html
|
|
9
10
|
|
|
10
11
|
var DefaultRasterLayer = function DefaultRasterLayer(props) {
|
|
11
12
|
var api = props.api,
|
|
12
|
-
language = props.language
|
|
13
|
-
darkMode = props.darkMode;
|
|
13
|
+
language = props.language;
|
|
14
14
|
(0, _useBaseLayer.useBaseLayer)({
|
|
15
15
|
api: api,
|
|
16
16
|
language: language,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
additionalParameters: !darkMode && {
|
|
17
|
+
mapType: _constants.MAP_TYPE_DEFAULT,
|
|
18
|
+
additionalParameters: {
|
|
20
19
|
style: 'alps'
|
|
21
20
|
}
|
|
22
21
|
});
|
|
@@ -5,15 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _useBaseLayer = require("./useBaseLayer");
|
|
8
|
+
var _constants = require("../../../constants");
|
|
8
9
|
var DefaultVectorLayer = function DefaultVectorLayer(props) {
|
|
9
10
|
var api = props.api,
|
|
10
11
|
language = props.language;
|
|
11
12
|
(0, _useBaseLayer.useBaseLayer)({
|
|
12
13
|
api: api,
|
|
13
14
|
language: language,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
mapType: _constants.MAP_TYPE_DEFAULT,
|
|
16
|
+
additionalParameters: {},
|
|
17
|
+
isWebGL: true
|
|
17
18
|
});
|
|
18
19
|
return null;
|
|
19
20
|
};
|
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _useBaseLayer = require("./useBaseLayer");
|
|
8
|
+
var _constants = require("../../../constants");
|
|
8
9
|
var FleetStyleLayer = function FleetStyleLayer(props) {
|
|
9
10
|
var api = props.api,
|
|
10
11
|
language = props.language;
|
|
11
12
|
(0, _useBaseLayer.useBaseLayer)({
|
|
12
13
|
api: api,
|
|
13
14
|
language: language,
|
|
14
|
-
|
|
15
|
-
scheme: 'normal.day',
|
|
15
|
+
mapType: _constants.MAP_TYPE_FLEET_STYLE,
|
|
16
16
|
additionalParameters: {
|
|
17
17
|
style: 'fleet'
|
|
18
18
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _useBaseLayer = require("./useBaseLayer");
|
|
8
|
+
var _constants = require("../../../constants");
|
|
9
|
+
// https://developer.here.com/documentation/map-tile/dev_guide/topics/resource-info.html
|
|
10
|
+
|
|
11
|
+
var NightLayer = function NightLayer(props) {
|
|
12
|
+
var api = props.api,
|
|
13
|
+
language = props.language;
|
|
14
|
+
(0, _useBaseLayer.useBaseLayer)({
|
|
15
|
+
api: api,
|
|
16
|
+
language: language,
|
|
17
|
+
mapType: _constants.MAP_TYPE_NIGHT,
|
|
18
|
+
additionalParameters: {}
|
|
19
|
+
});
|
|
20
|
+
return null;
|
|
21
|
+
};
|
|
22
|
+
var _default = NightLayer;
|
|
23
|
+
exports["default"] = _default;
|
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _useBaseLayer = require("./useBaseLayer");
|
|
8
|
+
var _constants = require("../../../constants");
|
|
8
9
|
var SatelliteLayer = function SatelliteLayer(props) {
|
|
9
10
|
var api = props.api,
|
|
10
11
|
language = props.language;
|
|
11
12
|
(0, _useBaseLayer.useBaseLayer)({
|
|
12
13
|
api: api,
|
|
13
14
|
language: language,
|
|
14
|
-
|
|
15
|
-
scheme: 'hybrid.day',
|
|
15
|
+
mapType: _constants.MAP_TYPE_SATELLITE,
|
|
16
16
|
additionalParameters: {
|
|
17
17
|
style: 'default'
|
|
18
18
|
}
|
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _useBaseLayer = require("./useBaseLayer");
|
|
8
|
+
var _constants = require("../../../constants");
|
|
8
9
|
var TerrainLayer = function TerrainLayer(props) {
|
|
9
10
|
var api = props.api,
|
|
10
11
|
language = props.language;
|
|
11
12
|
(0, _useBaseLayer.useBaseLayer)({
|
|
12
13
|
api: api,
|
|
13
14
|
language: language,
|
|
14
|
-
|
|
15
|
-
scheme: 'terrain.day',
|
|
15
|
+
mapType: _constants.MAP_TYPE_TERRAIN,
|
|
16
16
|
additionalParameter: {
|
|
17
17
|
style: 'default'
|
|
18
18
|
}
|
|
@@ -4,26 +4,43 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.useBaseLayer = void 0;
|
|
7
|
+
exports.useBaseLayer = exports.getDefaultBaseLayer = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
var _localization = require("../../../../utils/localization");
|
|
12
|
-
var _constants = require("../../../constants");
|
|
13
12
|
var _mapUtils = require("../../../mapUtils");
|
|
13
|
+
var _constants = require("../../../constants");
|
|
14
14
|
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; }
|
|
15
15
|
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; }
|
|
16
|
+
// Obtain the default map types from the platform object:
|
|
17
|
+
var getDefaultBaseLayer = function getDefaultBaseLayer(defaultLayers, mapType, useWebGL) {
|
|
18
|
+
if (mapType === _constants.MAP_TYPE_SATELLITE) {
|
|
19
|
+
return defaultLayers.raster.satellite.map;
|
|
20
|
+
}
|
|
21
|
+
if (mapType === _constants.MAP_TYPE_TERRAIN) {
|
|
22
|
+
return defaultLayers.raster.terrain.map;
|
|
23
|
+
}
|
|
24
|
+
if (mapType === _constants.MAP_TYPE_FLEET_STYLE) {
|
|
25
|
+
return defaultLayers.raster.normal.map;
|
|
26
|
+
}
|
|
27
|
+
if (mapType === _constants.MAP_TYPE_NIGHT) {
|
|
28
|
+
return defaultLayers.raster.normal.mapnight;
|
|
29
|
+
}
|
|
30
|
+
if (useWebGL) {
|
|
31
|
+
return defaultLayers.vector.normal.map;
|
|
32
|
+
}
|
|
33
|
+
return defaultLayers.raster.normal.map;
|
|
34
|
+
};
|
|
35
|
+
exports.getDefaultBaseLayer = getDefaultBaseLayer;
|
|
16
36
|
var useBaseLayer = function useBaseLayer(props) {
|
|
17
37
|
var api = props.api,
|
|
18
|
-
_props$mapTileService = props.mapTileServiceType,
|
|
19
|
-
mapTileServiceType = _props$mapTileService === void 0 ? 'base' : _props$mapTileService,
|
|
20
|
-
_props$tileType = props.tileType,
|
|
21
|
-
tileType = _props$tileType === void 0 ? 'maptile' : _props$tileType,
|
|
22
|
-
scheme = props.scheme,
|
|
23
38
|
_props$additionalPara = props.additionalParameters,
|
|
24
39
|
additionalParameters = _props$additionalPara === void 0 ? {} : _props$additionalPara,
|
|
25
|
-
|
|
26
|
-
|
|
40
|
+
language = props.language,
|
|
41
|
+
_props$isWebGL = props.isWebGL,
|
|
42
|
+
isWebGL = _props$isWebGL === void 0 ? false : _props$isWebGL,
|
|
43
|
+
mapType = props.mapType;
|
|
27
44
|
var _useState = (0, _react.useState)(),
|
|
28
45
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
29
46
|
baseLayer = _useState2[0],
|
|
@@ -34,13 +51,8 @@ var useBaseLayer = function useBaseLayer(props) {
|
|
|
34
51
|
lg: (0, _localization.mapToLongLocale)(language),
|
|
35
52
|
ppi: (0, _mapUtils.getPPI)()
|
|
36
53
|
});
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
// Function signature: createTileLayer(tileType, scheme, tileSize, format, opt_additionalParameters, opt_opacity, opt_dark, opt_options)
|
|
42
|
-
// See: https://developer.here.com/documentation/maps/3.1.37.0/api_reference/H.service.MapTileService.html#createTileLayer
|
|
43
|
-
var newBaseLayer = mapTiler.createTileLayer(tileType, scheme, _constants.TILE_SIZE, _constants.FORMAT, additionalParametersWithLocale, 1, false, options);
|
|
54
|
+
var defaultLayers = api.platform.createDefaultLayers(additionalParametersWithLocale);
|
|
55
|
+
var newBaseLayer = getDefaultBaseLayer(defaultLayers, mapType, isWebGL);
|
|
44
56
|
api.map.setBaseLayer(newBaseLayer);
|
|
45
57
|
setBaseLayer(newBaseLayer);
|
|
46
58
|
}
|
package/lib/es/components/map/components/features/settings/builtinSettings/MapTypeSettings.js
CHANGED
|
@@ -27,7 +27,8 @@ var MapTypeSettings = function MapTypeSettings(props) {
|
|
|
27
27
|
isDefault: mapType === _constants.MAP_TYPE_DEFAULT,
|
|
28
28
|
isFleetStyle: mapType === _constants.MAP_TYPE_FLEET_STYLE,
|
|
29
29
|
isTerrain: mapType === _constants.MAP_TYPE_TERRAIN,
|
|
30
|
-
isSatellite: mapType === _constants.MAP_TYPE_SATELLITE
|
|
30
|
+
isSatellite: mapType === _constants.MAP_TYPE_SATELLITE,
|
|
31
|
+
isNight: mapType === _constants.MAP_TYPE_NIGHT
|
|
31
32
|
};
|
|
32
33
|
}, [mapType]);
|
|
33
34
|
var getIcon = function getIcon(currentType) {
|
|
@@ -51,6 +52,11 @@ var MapTypeSettings = function MapTypeSettings(props) {
|
|
|
51
52
|
name: _MapIcon.MAP_TYPE_SATELITE_INACTIVE
|
|
52
53
|
});
|
|
53
54
|
}
|
|
55
|
+
if (currentType.isNight) {
|
|
56
|
+
return /*#__PURE__*/_react["default"].createElement(_MapIcon.MapIcon, {
|
|
57
|
+
name: _MapIcon.MAP_TYPE_NIGHT_INACTIVE
|
|
58
|
+
});
|
|
59
|
+
}
|
|
54
60
|
};
|
|
55
61
|
return /*#__PURE__*/_react["default"].createElement(_MapSettingsTile["default"], (0, _extends2["default"])({
|
|
56
62
|
className: "MapTypeSettings",
|
|
@@ -96,8 +96,21 @@ var createUtils = function createUtils(mapApi) {
|
|
|
96
96
|
lng: center.lng
|
|
97
97
|
};
|
|
98
98
|
},
|
|
99
|
+
setCenter: function setCenter(position, animate) {
|
|
100
|
+
mapApi.getViewModel().setLookAtData({
|
|
101
|
+
position: position
|
|
102
|
+
}, animate);
|
|
103
|
+
},
|
|
99
104
|
getZoom: function getZoom() {
|
|
100
|
-
|
|
105
|
+
var _mapApi$getViewModel$ = mapApi.getViewModel().getLookAtData(),
|
|
106
|
+
zoom = _mapApi$getViewModel$.zoom;
|
|
107
|
+
return Math.round(zoom);
|
|
108
|
+
},
|
|
109
|
+
setZoom: function setZoom(zoom) {
|
|
110
|
+
var zoomAnimation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
111
|
+
mapApi.getViewModel().setLookAtData({
|
|
112
|
+
zoom: zoom
|
|
113
|
+
}, zoomAnimation);
|
|
101
114
|
},
|
|
102
115
|
getViewPort: function getViewPort() {
|
|
103
116
|
var viewPort = mapApi.getViewPort();
|
|
@@ -118,16 +131,33 @@ var createUtils = function createUtils(mapApi) {
|
|
|
118
131
|
};
|
|
119
132
|
},
|
|
120
133
|
getBounds: function getBounds() {
|
|
121
|
-
var _mapApi$getViewModel$ = mapApi.getViewModel().getLookAtData(),
|
|
122
|
-
bounds = _mapApi$getViewModel
|
|
134
|
+
var _mapApi$getViewModel$2 = mapApi.getViewModel().getLookAtData(),
|
|
135
|
+
bounds = _mapApi$getViewModel$2.bounds;
|
|
136
|
+
|
|
137
|
+
// TODO: remove old 3.0 version after all Services use the latest Map
|
|
138
|
+
if (bounds.getTopLeft) {
|
|
139
|
+
return {
|
|
140
|
+
topLeft: {
|
|
141
|
+
lng: bounds.getTopLeft().lng,
|
|
142
|
+
lat: bounds.getTopLeft().lat
|
|
143
|
+
},
|
|
144
|
+
bottomRight: {
|
|
145
|
+
lng: bounds.getBottomRight().lng,
|
|
146
|
+
lat: bounds.getBottomRight().lat
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// HERE Maps API for JavaScript 3.1
|
|
152
|
+
var boundingBox = bounds.getBoundingBox();
|
|
123
153
|
return {
|
|
124
154
|
topLeft: {
|
|
125
|
-
lng:
|
|
126
|
-
lat:
|
|
155
|
+
lng: boundingBox.getTopLeft().lng,
|
|
156
|
+
lat: boundingBox.getTopLeft().lat
|
|
127
157
|
},
|
|
128
158
|
bottomRight: {
|
|
129
|
-
lng:
|
|
130
|
-
lat:
|
|
159
|
+
lng: boundingBox.getBottomRight().lng,
|
|
160
|
+
lat: boundingBox.getBottomRight().lat
|
|
131
161
|
}
|
|
132
162
|
};
|
|
133
163
|
},
|