@rio-cloud/rio-uikit 0.16.1 → 0.16.2-beta.3
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/ColorScheme.d.ts +4 -0
- package/ColorScheme.js +2 -0
- package/Colors.js +1 -1
- package/TruckLayer.js +1 -1
- package/components/assetTree/Tree.js +1 -1
- package/components/charts/chartHelper.js +1 -1
- package/components/map/components/Map.js +147 -130
- package/components/map/components/constants.js +4 -1
- package/components/map/components/features/layers/RoadRestrictionLayer.js +26 -0
- package/components/map/components/features/layers/TrafficLayer.js +19 -6
- package/components/map/components/features/layers/baselayers/DefaultRasterLayer.js +20 -0
- package/components/map/components/features/layers/baselayers/DefaultVectorLayer.js +14 -0
- package/components/map/components/features/layers/baselayers/FleetStyleLayer.js +13 -17
- package/components/map/components/features/layers/baselayers/SatelliteLayer.js +13 -17
- package/components/map/components/features/layers/baselayers/TerrainLayer.js +13 -17
- package/components/map/components/features/layers/baselayers/useBaseLayer.js +41 -0
- package/components/map/components/mapUtils.js +4 -1
- package/components/mapMarker/ClusterMapMarker.js +2 -2
- package/components/mapMarker/SingleMapMarker.js +2 -2
- package/components/sidebars/Sidebar.js +2 -2
- package/hooks/useHereMap.ts +23 -0
- package/hooks/useScripts.ts +52 -0
- package/hooks/useScrollPosition.js +72 -0
- package/index.js +4 -1
- package/lib/es/ColorScheme.d.ts +4 -0
- package/lib/es/ColorScheme.js +18 -0
- package/lib/es/Colors.js +1 -1
- package/lib/es/TruckLayer.js +2 -2
- package/lib/es/components/assetTree/Tree.js +1 -1
- package/lib/es/components/charts/chartHelper.js +1 -1
- package/lib/es/components/map/components/Map.js +145 -125
- package/lib/es/components/map/components/constants.js +3 -0
- package/lib/es/components/map/components/features/layers/RoadRestrictionLayer.js +34 -0
- package/lib/es/components/map/components/features/layers/TrafficLayer.js +18 -6
- package/lib/es/components/map/components/features/layers/baselayers/DefaultRasterLayer.js +26 -0
- package/lib/es/components/map/components/features/layers/baselayers/DefaultVectorLayer.js +21 -0
- package/lib/es/components/map/components/features/layers/baselayers/FleetStyleLayer.js +13 -18
- package/lib/es/components/map/components/features/layers/baselayers/SatelliteLayer.js +13 -18
- package/lib/es/components/map/components/features/layers/baselayers/TerrainLayer.js +13 -18
- package/lib/es/components/map/components/features/layers/baselayers/useBaseLayer.js +49 -0
- package/lib/es/components/map/components/mapUtils.js +6 -3
- package/lib/es/components/mapMarker/ClusterMapMarker.js +2 -2
- package/lib/es/components/mapMarker/SingleMapMarker.js +2 -2
- package/lib/es/components/sidebars/Sidebar.js +2 -2
- package/lib/es/hooks/useHereMap.ts +23 -0
- package/lib/es/hooks/useScripts.ts +52 -0
- package/lib/es/hooks/useScrollPosition.js +80 -0
- package/lib/es/index.js +24 -1
- package/lib/es/mapIndex.js +2 -2
- package/lib/es/styles/components/Activity.less +9 -10
- package/lib/es/styles/components/ApplicationHeader.less +24 -29
- package/lib/es/styles/components/ApplicationLayout.less +7 -7
- package/lib/es/styles/components/AssetTree.less +30 -28
- package/lib/es/styles/components/AutoSuggest.less +2 -2
- package/lib/es/styles/components/BottomSheet.less +1 -2
- package/lib/es/styles/components/Carousel.less +13 -9
- package/lib/es/styles/components/Checkbox.less +15 -16
- package/lib/es/styles/components/ClearableInput.less +3 -3
- package/lib/es/styles/components/Counter.less +12 -12
- package/lib/es/styles/components/DataTabs.less +2 -2
- package/lib/es/styles/components/DatePicker.less +27 -27
- package/lib/es/styles/components/Dialog.less +15 -11
- package/lib/es/styles/components/Dropdown.less +11 -11
- package/lib/es/styles/components/Expander.less +7 -7
- package/lib/es/styles/components/ListMenu.less +8 -8
- package/lib/es/styles/components/MapHere.less +3 -2
- package/lib/es/styles/components/MapMarker.less +16 -17
- package/lib/es/styles/components/MapSettings.less +5 -5
- package/lib/es/styles/components/NoData.less +1 -1
- package/lib/es/styles/components/Notification.less +12 -12
- package/lib/es/styles/components/RadioButton.less +11 -12
- package/lib/es/styles/components/Resizer.less +1 -1
- package/lib/es/styles/components/Select.less +16 -26
- package/lib/es/styles/components/Sidebar.less +29 -21
- package/lib/es/styles/components/Slider.less +18 -18
- package/lib/es/styles/components/Spinner.less +6 -6
- package/lib/es/styles/components/StatsWidget.less +5 -5
- package/lib/es/styles/components/SteppedProgressBar.less +32 -29
- package/lib/es/styles/components/SupportMarker.less +1 -1
- package/lib/es/styles/components/Switch.less +8 -8
- package/lib/es/styles/components/TableSettingsDialog.less +7 -7
- package/lib/es/styles/components/TableToolbar.less +1 -1
- package/lib/es/styles/components/Tag.less +10 -10
- package/lib/es/styles/components/Timeline.less +3 -3
- package/lib/es/styles/components/Tooltip.less +10 -10
- package/lib/es/styles/design/badges.less +10 -10
- package/lib/es/styles/design/border.less +1 -1
- package/lib/es/styles/design/breadcrumbs.less +2 -2
- package/lib/es/styles/design/button-groups.less +25 -1
- package/lib/es/styles/design/buttons.less +53 -109
- package/lib/es/styles/design/callouts.less +3 -3
- package/lib/es/styles/design/code.less +4 -6
- package/lib/es/styles/design/colors.less +20 -20
- package/lib/es/styles/design/form-input-groups.less +4 -4
- package/lib/es/styles/design/form-inputs.less +33 -31
- package/lib/es/styles/design/images.less +2 -2
- package/lib/es/styles/design/labels.less +11 -11
- package/lib/es/styles/design/list-group.less +14 -12
- package/lib/es/styles/design/navs.less +27 -27
- package/lib/es/styles/design/normalize.less +0 -9
- package/lib/es/styles/design/pagination.less +10 -10
- package/lib/es/styles/design/panels.less +10 -10
- package/lib/es/styles/design/popovers.less +8 -8
- package/lib/es/styles/design/progress-bars.less +8 -8
- package/lib/es/styles/design/shadows.less +14 -7
- package/lib/es/styles/design/tables.less +68 -106
- package/lib/es/styles/design/text.less +5 -19
- package/lib/es/styles/design/theme.less +10 -10
- package/lib/es/styles/design/thumbnails.less +2 -2
- package/lib/es/styles/design/type.less +4 -4
- package/lib/es/styles/design/wells.less +1 -1
- package/lib/es/styles/mapping/color-map.less +65 -64
- package/lib/es/styles/mixins/_imports.less +14 -0
- package/lib/es/styles/mixins/buttons.less +24 -56
- package/lib/es/styles/mixins/forms.less +19 -55
- package/lib/es/styles/mixins/hsl.less +19 -0
- package/lib/es/styles/mixins/panels.less +2 -2
- package/lib/es/styles/print/print.less +7 -7
- package/lib/es/styles/rio-uikit-core.less +2 -2
- package/lib/es/styles/rio-uikit-print-utilities.less +2 -2
- package/lib/es/styles/rio-uikit-responsive-utilities.less +2 -2
- package/lib/es/styles/variables/_index.less +196 -0
- package/lib/es/styles/variables/colors.json +67 -0
- package/lib/es/styles/variables/concated_css_variables.less +66 -0
- package/lib/es/styles/variables/dark_colors.less +88 -0
- package/lib/es/styles/variables/dark_css_variables.less +28 -0
- package/lib/es/styles/variables/dark_css_variables_map.less +96 -0
- package/lib/es/styles/variables/light_colors.less +92 -0
- package/lib/es/styles/variables/light_css_variables.less +17 -0
- package/lib/es/styles/variables/light_css_variables_map.less +100 -0
- package/lib/es/styles/variables/screens.less +7 -0
- package/lib/es/styles/variables/text.less +23 -0
- package/lib/es/themes/BuyButton/styles/rio-buyButton.less +13 -8
- package/lib/es/themes/MAN/styles/man-uikit.less +3 -0
- package/lib/es/themes/SCANIA/styles/scania-uikit.less +3 -0
- package/lib/es/themes/Volkswagen/styles/vw-uikit.less +21 -30
- package/lib/es/themes/Website/styles/rio-website.less +145 -120
- package/lib/es/themes/Xmas/styles/rio-xmas.less +59 -29
- package/lib/es/types.ts +6 -1
- package/lib/es/useScrollPosition.d.ts +4 -0
- package/lib/es/useScrollPosition.js +13 -0
- package/lib/es/utils/colorScheme.js +59 -0
- package/lib/es/utils/init.js +2 -0
- package/lib/es/version.json +1 -1
- package/mapIndex.js +1 -1
- package/package.json +4 -3
- package/styles/components/Activity.less +9 -10
- package/styles/components/ApplicationHeader.less +24 -29
- package/styles/components/ApplicationLayout.less +7 -7
- package/styles/components/AssetTree.less +30 -28
- package/styles/components/AutoSuggest.less +2 -2
- package/styles/components/BottomSheet.less +1 -2
- package/styles/components/Carousel.less +13 -9
- package/styles/components/Checkbox.less +15 -16
- package/styles/components/ClearableInput.less +3 -3
- package/styles/components/Counter.less +12 -12
- package/styles/components/DataTabs.less +2 -2
- package/styles/components/DatePicker.less +27 -27
- package/styles/components/Dialog.less +15 -11
- package/styles/components/Dropdown.less +11 -11
- package/styles/components/Expander.less +7 -7
- package/styles/components/ListMenu.less +8 -8
- package/styles/components/MapHere.less +3 -2
- package/styles/components/MapMarker.less +16 -17
- package/styles/components/MapSettings.less +5 -5
- package/styles/components/NoData.less +1 -1
- package/styles/components/Notification.less +12 -12
- package/styles/components/RadioButton.less +11 -12
- package/styles/components/Resizer.less +1 -1
- package/styles/components/Select.less +16 -26
- package/styles/components/Sidebar.less +29 -21
- package/styles/components/Slider.less +18 -18
- package/styles/components/Spinner.less +6 -6
- package/styles/components/StatsWidget.less +5 -5
- package/styles/components/SteppedProgressBar.less +32 -29
- package/styles/components/SupportMarker.less +1 -1
- package/styles/components/Switch.less +8 -8
- package/styles/components/TableSettingsDialog.less +7 -7
- package/styles/components/TableToolbar.less +1 -1
- package/styles/components/Tag.less +10 -10
- package/styles/components/Timeline.less +3 -3
- package/styles/components/Tooltip.less +10 -10
- package/styles/design/badges.less +10 -10
- package/styles/design/border.less +1 -1
- package/styles/design/breadcrumbs.less +2 -2
- package/styles/design/button-groups.less +25 -1
- package/styles/design/buttons.less +53 -109
- package/styles/design/callouts.less +3 -3
- package/styles/design/code.less +4 -6
- package/styles/design/colors.less +20 -20
- package/styles/design/form-input-groups.less +4 -4
- package/styles/design/form-inputs.less +33 -31
- package/styles/design/images.less +2 -2
- package/styles/design/labels.less +11 -11
- package/styles/design/list-group.less +14 -12
- package/styles/design/navs.less +27 -27
- package/styles/design/normalize.less +0 -9
- package/styles/design/pagination.less +10 -10
- package/styles/design/panels.less +10 -10
- package/styles/design/popovers.less +8 -8
- package/styles/design/progress-bars.less +8 -8
- package/styles/design/shadows.less +14 -7
- package/styles/design/tables.less +68 -106
- package/styles/design/text.less +5 -19
- package/styles/design/theme.less +10 -10
- package/styles/design/thumbnails.less +2 -2
- package/styles/design/type.less +4 -4
- package/styles/design/wells.less +1 -1
- package/styles/mapping/color-map.less +65 -64
- package/styles/mixins/_imports.less +14 -0
- package/styles/mixins/buttons.less +24 -56
- package/styles/mixins/forms.less +19 -55
- package/styles/mixins/hsl.less +19 -0
- package/styles/mixins/panels.less +2 -2
- package/styles/print/print.less +7 -7
- package/styles/rio-uikit-core.less +2 -2
- package/styles/rio-uikit-print-utilities.less +2 -2
- package/styles/rio-uikit-responsive-utilities.less +2 -2
- package/styles/variables/_index.less +196 -0
- package/styles/variables/colors.json +67 -0
- package/styles/variables/concated_css_variables.less +66 -0
- package/styles/variables/dark_colors.less +88 -0
- package/styles/variables/dark_css_variables.less +28 -0
- package/styles/variables/dark_css_variables_map.less +96 -0
- package/styles/variables/light_colors.less +92 -0
- package/styles/variables/light_css_variables.less +17 -0
- package/styles/variables/light_css_variables_map.less +100 -0
- package/styles/variables/screens.less +7 -0
- package/styles/variables/text.less +23 -0
- package/themes/BuyButton/styles/rio-buyButton.less +13 -8
- package/themes/MAN/styles/man-uikit.less +3 -0
- package/themes/SCANIA/styles/scania-uikit.less +3 -0
- package/themes/Volkswagen/styles/vw-uikit.less +21 -30
- package/themes/Website/styles/rio-website.less +145 -120
- package/themes/Xmas/styles/rio-xmas.less +59 -29
- package/types.ts +6 -1
- package/useScrollPosition.d.ts +4 -0
- package/useScrollPosition.js +2 -0
- package/utils/colorScheme.js +50 -0
- package/utils/init.js +2 -0
- package/version.json +1 -1
|
@@ -22,8 +22,9 @@ var _constants = require("./constants");
|
|
|
22
22
|
var _ZoomButtons = _interopRequireDefault(require("./features/settings/ZoomButtons"));
|
|
23
23
|
var _IncidentsLayer = _interopRequireDefault(require("./features/layers/IncidentsLayer"));
|
|
24
24
|
var _TrafficLayer = _interopRequireDefault(require("./features/layers/TrafficLayer"));
|
|
25
|
-
var
|
|
26
|
-
var
|
|
25
|
+
var _RoadRestrictionLayer = _interopRequireDefault(require("./features/layers/RoadRestrictionLayer"));
|
|
26
|
+
var _DefaultVectorLayer = _interopRequireDefault(require("./features/layers/baselayers/DefaultVectorLayer"));
|
|
27
|
+
var _DefaultRasterLayer = _interopRequireDefault(require("./features/layers/baselayers/DefaultRasterLayer"));
|
|
27
28
|
var _FleetStyleLayer = _interopRequireDefault(require("./features/layers/baselayers/FleetStyleLayer"));
|
|
28
29
|
var _SatelliteLayer = _interopRequireDefault(require("./features/layers/baselayers/SatelliteLayer"));
|
|
29
30
|
var _TerrainLayer = _interopRequireDefault(require("./features/layers/baselayers/TerrainLayer"));
|
|
@@ -35,10 +36,43 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
35
36
|
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; }
|
|
36
37
|
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; }
|
|
37
38
|
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; }
|
|
38
|
-
var NO_CREDENTIALS_ERROR_MESSAGE = 'Cannot instantiate
|
|
39
|
+
var NO_CREDENTIALS_ERROR_MESSAGE = 'Cannot instantiate the Map. Missing credentials property.';
|
|
39
40
|
exports.NO_CREDENTIALS_ERROR_MESSAGE = NO_CREDENTIALS_ERROR_MESSAGE;
|
|
40
41
|
var RESIZE_THROTTLE = 1100; // 100 more than the ApplicationLayout handler
|
|
41
42
|
|
|
43
|
+
// Note: "apikey" used by Here v3.1 whereas "app_id" and "app_code" are used by the 3.0 API
|
|
44
|
+
// The Here API 3.1 works a little different and by default uses WebGL rendering
|
|
45
|
+
// See Migration guide: https://developer.here.com/documentation/maps/3.1.37.0/dev_guide/topics/migration.html
|
|
46
|
+
var getPlatform = function getPlatform(credentials) {
|
|
47
|
+
return new H.service.Platform({
|
|
48
|
+
apikey: credentials.apikey || credentials.api_key,
|
|
49
|
+
app_id: credentials.app_id,
|
|
50
|
+
app_code: credentials.app_code
|
|
51
|
+
});
|
|
52
|
+
};
|
|
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
|
+
var getHereUi = function getHereUi(hereMap, defaultLayers, showScaleBar) {
|
|
67
|
+
var hereUi = H.ui.UI.createDefault(hereMap, defaultLayers);
|
|
68
|
+
if (hereUi) {
|
|
69
|
+
hereUi.getControl('scalebar').setVisibility(showScaleBar);
|
|
70
|
+
hereUi.getControl('scalebar').setAlignment('bottom-left');
|
|
71
|
+
hereUi.getControl('mapsettings').setVisibility(false);
|
|
72
|
+
hereUi.removeControl('zoom');
|
|
73
|
+
}
|
|
74
|
+
return hereUi;
|
|
75
|
+
};
|
|
42
76
|
var getBounds = function getBounds(boundingBox) {
|
|
43
77
|
var top = boundingBox.top,
|
|
44
78
|
left = boundingBox.left,
|
|
@@ -46,41 +80,47 @@ var getBounds = function getBounds(boundingBox) {
|
|
|
46
80
|
right = boundingBox.right;
|
|
47
81
|
return new H.geo.Rect(top, left, bottom, right);
|
|
48
82
|
};
|
|
49
|
-
var getLayer = function getLayer(api, layer, language) {
|
|
83
|
+
var getLayer = function getLayer(api, layer, language, useWebGL) {
|
|
50
84
|
switch (layer) {
|
|
51
85
|
case _constants.MAP_LAYER_TRAFFIC:
|
|
52
86
|
return /*#__PURE__*/_react["default"].createElement(_TrafficLayer["default"], {
|
|
53
87
|
api: api,
|
|
54
88
|
language: language,
|
|
55
89
|
key: layer,
|
|
56
|
-
|
|
90
|
+
useWebGL: useWebGL
|
|
57
91
|
});
|
|
58
92
|
case _constants.MAP_LAYER_INCIDENTS:
|
|
59
93
|
return /*#__PURE__*/_react["default"].createElement(_IncidentsLayer["default"], {
|
|
60
94
|
api: api,
|
|
61
95
|
language: language,
|
|
62
|
-
key: layer
|
|
63
|
-
layerIndex: 2
|
|
96
|
+
key: layer
|
|
64
97
|
});
|
|
65
98
|
case _constants.MAP_LAYER_ROAD_RESTRICTIONS:
|
|
66
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
99
|
+
return /*#__PURE__*/_react["default"].createElement(_RoadRestrictionLayer["default"], {
|
|
67
100
|
api: api,
|
|
68
101
|
language: language,
|
|
69
102
|
key: layer,
|
|
70
|
-
|
|
103
|
+
useWebGL: useWebGL
|
|
71
104
|
});
|
|
72
105
|
default:
|
|
73
106
|
null;
|
|
74
107
|
}
|
|
75
108
|
};
|
|
76
|
-
var getBaseLayer = function getBaseLayer(api, baseLayer, language) {
|
|
109
|
+
var getBaseLayer = function getBaseLayer(api, baseLayer, language, useWebGL, darkMode) {
|
|
77
110
|
switch (baseLayer) {
|
|
78
111
|
case _constants.MAP_TYPE_DEFAULT:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
112
|
+
{
|
|
113
|
+
return useWebGL ? /*#__PURE__*/_react["default"].createElement(_DefaultVectorLayer["default"], {
|
|
114
|
+
api: api,
|
|
115
|
+
language: language,
|
|
116
|
+
key: baseLayer
|
|
117
|
+
}) : /*#__PURE__*/_react["default"].createElement(_DefaultRasterLayer["default"], {
|
|
118
|
+
api: api,
|
|
119
|
+
language: language,
|
|
120
|
+
key: baseLayer,
|
|
121
|
+
darkMode: darkMode
|
|
122
|
+
});
|
|
123
|
+
}
|
|
84
124
|
case _constants.MAP_TYPE_FLEET_STYLE:
|
|
85
125
|
return /*#__PURE__*/_react["default"].createElement(_FleetStyleLayer["default"], {
|
|
86
126
|
api: api,
|
|
@@ -103,7 +143,7 @@ var getBaseLayer = function getBaseLayer(api, baseLayer, language) {
|
|
|
103
143
|
null;
|
|
104
144
|
}
|
|
105
145
|
};
|
|
106
|
-
var
|
|
146
|
+
var enrichChildrenWithApi = function enrichChildrenWithApi(children, api) {
|
|
107
147
|
return _react["default"].Children.map(children, function (child) {
|
|
108
148
|
if (child) {
|
|
109
149
|
return /*#__PURE__*/_react["default"].cloneElement(child, {
|
|
@@ -122,6 +162,14 @@ var getStyle = function getStyle(height, width) {
|
|
|
122
162
|
}
|
|
123
163
|
return style;
|
|
124
164
|
};
|
|
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
|
+
};
|
|
125
173
|
var Map = function Map(props) {
|
|
126
174
|
var children = props.children,
|
|
127
175
|
credentials = props.credentials,
|
|
@@ -147,7 +195,9 @@ var Map = function Map(props) {
|
|
|
147
195
|
onZoomIn = props.onZoomIn,
|
|
148
196
|
onZoomOut = props.onZoomOut,
|
|
149
197
|
mapSettingsTooltip = props.mapSettingsTooltip,
|
|
150
|
-
mapSettings = props.mapSettings
|
|
198
|
+
mapSettings = props.mapSettings,
|
|
199
|
+
useWebGL = props.useWebGL,
|
|
200
|
+
darkMode = props.darkMode;
|
|
151
201
|
var mapRef = (0, _react.useRef)(null);
|
|
152
202
|
var _useState = (0, _react.useState)(false),
|
|
153
203
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
@@ -155,107 +205,80 @@ var Map = function Map(props) {
|
|
|
155
205
|
setMapInitialized = _useState2[1];
|
|
156
206
|
var _useState3 = (0, _react.useState)(),
|
|
157
207
|
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
var _useState5 = (0, _react.useState)(),
|
|
208
|
+
api = _useState4[0],
|
|
209
|
+
setApi = _useState4[1];
|
|
210
|
+
var _useState5 = (0, _react.useState)(mapType),
|
|
161
211
|
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
var _useState7 = (0, _react.useState)(
|
|
212
|
+
baseLayer = _useState6[0],
|
|
213
|
+
setBaseLayer = _useState6[1];
|
|
214
|
+
var _useState7 = (0, _react.useState)(mapLayer),
|
|
165
215
|
_useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
var _useState9 = (0, _react.useState)(
|
|
216
|
+
activeLayers = _useState8[0],
|
|
217
|
+
setActiveLayers = _useState8[1];
|
|
218
|
+
var _useState9 = (0, _react.useState)(externalShowCluster),
|
|
169
219
|
_useState10 = (0, _slicedToArray2["default"])(_useState9, 2),
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
var
|
|
173
|
-
_useState12 = (0, _slicedToArray2["default"])(_useState11, 2),
|
|
174
|
-
showCluster = _useState12[0],
|
|
175
|
-
setShowCluster = _useState12[1];
|
|
220
|
+
showCluster = _useState10[0],
|
|
221
|
+
setShowCluster = _useState10[1];
|
|
222
|
+
var devicePixelRatio = window.devicePixelRatio || 1;
|
|
176
223
|
(0, _react.useEffect)(function () {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
app_id: credentials.app_id,
|
|
182
|
-
app_code: credentials.app_code
|
|
183
|
-
});
|
|
184
|
-
setHerePlatform(platform);
|
|
185
|
-
var defaultLayers = platform.createDefaultLayers({
|
|
186
|
-
tileSize: _constants.TILE_SIZE,
|
|
187
|
-
ppi: window.devicePixelRatio > 1 ? _constants.HIGH_RES_PPI : undefined,
|
|
188
|
-
lg: language,
|
|
189
|
-
lg2: 'en'
|
|
190
|
-
});
|
|
191
|
-
var bounds = boundingBox && getBounds(boundingBox);
|
|
192
|
-
var newHereMap = new H.Map(mapRef.current, defaultLayers.raster.normal.map, {
|
|
193
|
-
zoom: zoom,
|
|
194
|
-
center: center,
|
|
195
|
-
bounds: bounds,
|
|
196
|
-
// Removed window.devicePixelRatio || 1 since it was zooming out when devicePixelRatio > 1
|
|
197
|
-
pixelRatio: 1,
|
|
198
|
-
// need to be set for better performence of legacy map
|
|
199
|
-
engineType: H.map.render.RenderEngine.EngineType.P2D
|
|
200
|
-
});
|
|
224
|
+
var platform = getPlatform(credentials);
|
|
225
|
+
var defaultLayers = createDefaultLayers(platform, language, darkMode);
|
|
226
|
+
var bounds = boundingBox && getBounds(boundingBox);
|
|
227
|
+
var mapRenderingEngine = getMapRenderingEngine(defaultLayers, useWebGL, darkMode);
|
|
201
228
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
229
|
+
// Instantiate (and display) a map object:
|
|
230
|
+
var hereMap = new H.Map(mapRef.current, mapRenderingEngine, {
|
|
231
|
+
zoom: zoom,
|
|
232
|
+
center: center,
|
|
233
|
+
bounds: bounds,
|
|
234
|
+
pixelRatio: devicePixelRatio,
|
|
235
|
+
// Need to be set for better performence of raster based map
|
|
236
|
+
engineType: useWebGL ? undefined : H.map.render.RenderEngine.EngineType.P2D
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
// Add a resize listener to make sure that the map occupies the whole container
|
|
240
|
+
var resizeListener = (0, _addEventListener["default"])(window, 'resize', (0, _throttle["default"])(RESIZE_THROTTLE, function () {
|
|
241
|
+
return hereMap.getViewPort().resize();
|
|
242
|
+
}));
|
|
243
|
+
var orientationChangeListener = (0, _addEventListener["default"])(window, 'orientationchange', (0, _throttle["default"])(RESIZE_THROTTLE, function () {
|
|
244
|
+
return hereMap.getViewPort().resize();
|
|
245
|
+
}));
|
|
246
|
+
setMapInitialized(true);
|
|
247
|
+
var hereMapEvents = !disableMapEvents && new H.mapevents.MapEvents(hereMap);
|
|
248
|
+
var hereBehavior = !(disableMapEvents || disableBehavior) && new H.mapevents.Behavior(hereMapEvents);
|
|
249
|
+
(0, _eventHandling.addEventListenerMap)(hereMap, eventListenerMap, hereMap);
|
|
250
|
+
setApi({
|
|
251
|
+
credentials: credentials,
|
|
252
|
+
defaultLayers: defaultLayers,
|
|
253
|
+
group: hereMap,
|
|
254
|
+
map: hereMap,
|
|
255
|
+
mapEvents: hereMapEvents,
|
|
256
|
+
behavior: hereBehavior,
|
|
257
|
+
platform: platform,
|
|
258
|
+
ui: getHereUi(hereMap, defaultLayers, showScaleBar),
|
|
259
|
+
utils: (0, _mapUtils.createUtils)(hereMap),
|
|
260
|
+
settings: {
|
|
224
261
|
baseLayer: baseLayer,
|
|
225
262
|
mapLayer: activeLayers,
|
|
226
263
|
showCluster: showCluster
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
behavior: newHereBehavior,
|
|
235
|
-
platform: platform,
|
|
236
|
-
ui: hereUi,
|
|
237
|
-
settings: newSettings,
|
|
238
|
-
utils: (0, _mapUtils.createUtils)(newHereMap)
|
|
239
|
-
});
|
|
240
|
-
return function () {
|
|
241
|
-
if (newHereMap) {
|
|
242
|
-
(0, _eventHandling.removeEventListenerMap)(newHereMap);
|
|
243
|
-
if (newHereMapEvents) {
|
|
244
|
-
newHereMapEvents.dispose();
|
|
245
|
-
}
|
|
246
|
-
if (resizeListener) {
|
|
247
|
-
resizeListener.remove();
|
|
248
|
-
}
|
|
249
|
-
if (orientationChangeListener) {
|
|
250
|
-
orientationChangeListener.remove();
|
|
251
|
-
}
|
|
252
|
-
//console.log('Destroy map', newHereMap);
|
|
253
|
-
newHereMap.dispose();
|
|
254
|
-
// setTimeout(() => newHereMap.dispose(), 0);
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
return function () {
|
|
267
|
+
if (hereMap) {
|
|
268
|
+
(0, _eventHandling.removeEventListenerMap)(hereMap);
|
|
269
|
+
if (hereMapEvents) {
|
|
270
|
+
hereMapEvents.dispose();
|
|
255
271
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
272
|
+
if (resizeListener) {
|
|
273
|
+
resizeListener.remove();
|
|
274
|
+
}
|
|
275
|
+
if (orientationChangeListener) {
|
|
276
|
+
orientationChangeListener.remove();
|
|
277
|
+
}
|
|
278
|
+
hereMap.dispose();
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
}, [useWebGL, darkMode]);
|
|
259
282
|
|
|
260
283
|
// Update BoundingBox from outside
|
|
261
284
|
(0, _react.useEffect)(function () {
|
|
@@ -332,25 +355,17 @@ var Map = function Map(props) {
|
|
|
332
355
|
}));
|
|
333
356
|
};
|
|
334
357
|
var handleZoomIn = function handleZoomIn() {
|
|
335
|
-
var z = api.map.getZoom();
|
|
358
|
+
var z = Math.round(api.map.getZoom());
|
|
336
359
|
var newZoom = z + 1;
|
|
337
360
|
onZoomIn(newZoom, z);
|
|
338
361
|
api.map.setZoom(newZoom, true);
|
|
339
362
|
};
|
|
340
363
|
var handleZoomOut = function handleZoomOut() {
|
|
341
|
-
var z = api.map.getZoom();
|
|
364
|
+
var z = Math.round(api.map.getZoom());
|
|
342
365
|
var newZoom = z - 1;
|
|
343
366
|
onZoomOut(newZoom, z);
|
|
344
367
|
api.map.setZoom(newZoom, true);
|
|
345
368
|
};
|
|
346
|
-
var renderChildren = function renderChildren() {
|
|
347
|
-
if (!children) {
|
|
348
|
-
return null;
|
|
349
|
-
}
|
|
350
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
351
|
-
className: 'MapElements'
|
|
352
|
-
}, (0, _isFunction["default"])(children) ? children(api) : enhanceChildren(children, api));
|
|
353
|
-
};
|
|
354
369
|
var style = getStyle(height, width);
|
|
355
370
|
var autoHeightClass = (0, _isEmpty["default"])(style) ? 'height-100pct' : '';
|
|
356
371
|
var hideZoomButtons = disableBehavior;
|
|
@@ -375,11 +390,12 @@ var Map = function Map(props) {
|
|
|
375
390
|
onShowClusterChange: handleShowClusterChange,
|
|
376
391
|
mapSettingsTooltip: mapSettingsTooltip
|
|
377
392
|
}
|
|
378
|
-
}, mapSettings), getBaseLayer(api, baseLayer, language), (0, _map["default"])(function (layer) {
|
|
379
|
-
return getLayer(api, layer, language);
|
|
380
|
-
}, activeLayers),
|
|
393
|
+
}, mapSettings), getBaseLayer(api, baseLayer, language, useWebGL, darkMode), (0, _map["default"])(function (layer) {
|
|
394
|
+
return getLayer(api, layer, language, useWebGL);
|
|
395
|
+
}, activeLayers), children && /*#__PURE__*/_react["default"].createElement("div", {
|
|
396
|
+
className: 'MapElements'
|
|
397
|
+
}, (0, _isFunction["default"])(children) ? children(api) : enrichChildrenWithApi(children, api))));
|
|
381
398
|
};
|
|
382
|
-
;
|
|
383
399
|
Map.TYPE_DEFAULT = _constants.MAP_TYPE_DEFAULT;
|
|
384
400
|
Map.TYPE_FLEET_STYLE = _constants.MAP_TYPE_FLEET_STYLE;
|
|
385
401
|
Map.TYPE_SATELLITE = _constants.MAP_TYPE_SATELLITE;
|
|
@@ -401,7 +417,9 @@ Map.defaultProps = {
|
|
|
401
417
|
onMapLayerChange: function onMapLayerChange() {},
|
|
402
418
|
onShowClusterChange: function onShowClusterChange() {},
|
|
403
419
|
onZoomIn: function onZoomIn() {},
|
|
404
|
-
onZoomOut: function onZoomOut() {}
|
|
420
|
+
onZoomOut: function onZoomOut() {},
|
|
421
|
+
useWebGL: false,
|
|
422
|
+
darkMode: false
|
|
405
423
|
};
|
|
406
424
|
Map.propTypes = {
|
|
407
425
|
credentials: _propTypes["default"].shape((_PropTypes$shape = {}, (0, _defineProperty2["default"])(_PropTypes$shape, 'app_id', _propTypes["default"].string), (0, _defineProperty2["default"])(_PropTypes$shape, 'app_code', _propTypes["default"].string), (0, _defineProperty2["default"])(_PropTypes$shape, 'api_key', _propTypes["default"].string), (0, _defineProperty2["default"])(_PropTypes$shape, "apikey", _propTypes["default"].string), _PropTypes$shape)).isRequired,
|
|
@@ -428,7 +446,9 @@ Map.propTypes = {
|
|
|
428
446
|
onZoomOut: _propTypes["default"].func,
|
|
429
447
|
getApi: _propTypes["default"].func,
|
|
430
448
|
mapSettingsTooltip: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].node]),
|
|
431
|
-
mapSettings: _propTypes["default"].node
|
|
449
|
+
mapSettings: _propTypes["default"].node,
|
|
450
|
+
useWebGL: _propTypes["default"].bool,
|
|
451
|
+
darkMode: _propTypes["default"].bool
|
|
432
452
|
};
|
|
433
453
|
var _default = Map;
|
|
434
454
|
exports["default"] = _default;
|
|
@@ -25,4 +25,7 @@ exports.TILE_SIZE = TILE_SIZE;
|
|
|
25
25
|
var TILE_TYPE = 'maptile';
|
|
26
26
|
exports.TILE_TYPE = TILE_TYPE;
|
|
27
27
|
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
|
|
28
31
|
exports.HIGH_RES_PPI = HIGH_RES_PPI;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
+
var _constants = require("../../constants");
|
|
11
|
+
var _mapUtils = require("../../mapUtils");
|
|
12
|
+
var _Layer = _interopRequireDefault(require("./Layer"));
|
|
13
|
+
var _excluded = ["useWebGL"];
|
|
14
|
+
var createRoadRestrictionLayer = function createRoadRestrictionLayer(useWebGL) {
|
|
15
|
+
return function (api, language) {
|
|
16
|
+
return api.platform.getMapTileService({
|
|
17
|
+
type: 'base'
|
|
18
|
+
}).createTileLayer('truckonlytile', 'normal.day', _constants.TILE_SIZE, _constants.FORMAT, {
|
|
19
|
+
style: 'default',
|
|
20
|
+
lg: language,
|
|
21
|
+
ppi: useWebGL ? undefined : (0, _mapUtils.getPPI)()
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
var RoadRestrictionLayer = function RoadRestrictionLayer(props) {
|
|
26
|
+
var useWebGL = props.useWebGL,
|
|
27
|
+
remainingProps = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
28
|
+
var createLayer = createRoadRestrictionLayer(useWebGL);
|
|
29
|
+
return /*#__PURE__*/React.createElement(_Layer["default"], (0, _extends2["default"])({}, remainingProps, {
|
|
30
|
+
createLayer: createLayer
|
|
31
|
+
}));
|
|
32
|
+
};
|
|
33
|
+
var _default = RoadRestrictionLayer;
|
|
34
|
+
exports["default"] = _default;
|
|
@@ -6,13 +6,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports["default"] = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _constants = require("../../constants");
|
|
11
11
|
var _Layer = _interopRequireDefault(require("./Layer"));
|
|
12
|
-
|
|
12
|
+
var _excluded = ["useWebGL"];
|
|
13
|
+
var createVebGlTrafficLayer = function createVebGlTrafficLayer(api, language) {
|
|
14
|
+
// use new Here 3.1 API traffic layer for WebGL
|
|
15
|
+
// https://developer.here.com/documentation/maps/3.1.37.0/dev_guide/topics/migration.html
|
|
13
16
|
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
// Create a traffic service and a corresponding provider.
|
|
18
|
+
var service = api.platform.getTrafficService();
|
|
19
|
+
var provider = new H.service.traffic.flow.Provider(service);
|
|
20
|
+
|
|
21
|
+
// Create a tile layer that can be added to the map
|
|
22
|
+
return new H.map.layer.TileLayer(provider);
|
|
23
|
+
};
|
|
24
|
+
var createRasterTrafficLayer = function createRasterTrafficLayer(api, language) {
|
|
16
25
|
return api.platform.getMapTileService({
|
|
17
26
|
type: 'traffic'
|
|
18
27
|
}).createTileLayer('flowtile', 'normal.day.grey', _constants.TILE_SIZE, _constants.FORMAT, {
|
|
@@ -21,8 +30,11 @@ var createTrafficLayer = function createTrafficLayer(api, language) {
|
|
|
21
30
|
});
|
|
22
31
|
};
|
|
23
32
|
var TrafficLayer = function TrafficLayer(props) {
|
|
24
|
-
|
|
25
|
-
|
|
33
|
+
var useWebGL = props.useWebGL,
|
|
34
|
+
remainingProps = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
35
|
+
var createLayerCallback = useWebGL ? createVebGlTrafficLayer : createRasterTrafficLayer;
|
|
36
|
+
return /*#__PURE__*/React.createElement(_Layer["default"], (0, _extends2["default"])({}, remainingProps, {
|
|
37
|
+
createLayer: createLayerCallback
|
|
26
38
|
}));
|
|
27
39
|
};
|
|
28
40
|
var _default = TrafficLayer;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _useBaseLayer = require("./useBaseLayer");
|
|
8
|
+
// https://developer.here.com/documentation/map-tile/dev_guide/topics/resource-info.html
|
|
9
|
+
|
|
10
|
+
var DefaultRasterLayer = function DefaultRasterLayer(props) {
|
|
11
|
+
var api = props.api,
|
|
12
|
+
language = props.language,
|
|
13
|
+
darkMode = props.darkMode;
|
|
14
|
+
(0, _useBaseLayer.useBaseLayer)({
|
|
15
|
+
api: api,
|
|
16
|
+
language: language,
|
|
17
|
+
mapTileServiceType: 'base',
|
|
18
|
+
scheme: 'normal.day',
|
|
19
|
+
additionalParameters: !darkMode && {
|
|
20
|
+
style: 'alps'
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
return null;
|
|
24
|
+
};
|
|
25
|
+
var _default = DefaultRasterLayer;
|
|
26
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
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 DefaultVectorLayer = function DefaultVectorLayer(props) {
|
|
9
|
+
var api = props.api,
|
|
10
|
+
language = props.language;
|
|
11
|
+
(0, _useBaseLayer.useBaseLayer)({
|
|
12
|
+
api: api,
|
|
13
|
+
language: language,
|
|
14
|
+
mapTileServiceType: 'base',
|
|
15
|
+
scheme: 'normal.day',
|
|
16
|
+
additionalParameters: {}
|
|
17
|
+
});
|
|
18
|
+
return null;
|
|
19
|
+
};
|
|
20
|
+
var _default = DefaultVectorLayer;
|
|
21
|
+
exports["default"] = _default;
|
|
@@ -1,28 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports["default"] = void 0;
|
|
8
|
-
var
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _constants = require("../../../constants");
|
|
11
|
-
var _BaseLayer = _interopRequireDefault(require("./BaseLayer"));
|
|
12
|
-
var createFleetStyleLayer = function createFleetStyleLayer(api, language, showTraffic) {
|
|
13
|
-
var type = showTraffic ? 'traffic' : 'base';
|
|
14
|
-
var tileType = showTraffic ? 'traffictile' : 'maptile';
|
|
15
|
-
return api.platform.getMapTileService({
|
|
16
|
-
type: type
|
|
17
|
-
}).createTileLayer(tileType, 'normal.day', _constants.TILE_SIZE, _constants.FORMAT, {
|
|
18
|
-
style: 'fleet',
|
|
19
|
-
lg: language
|
|
20
|
-
});
|
|
21
|
-
};
|
|
7
|
+
var _useBaseLayer = require("./useBaseLayer");
|
|
22
8
|
var FleetStyleLayer = function FleetStyleLayer(props) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
var api = props.api,
|
|
10
|
+
language = props.language;
|
|
11
|
+
(0, _useBaseLayer.useBaseLayer)({
|
|
12
|
+
api: api,
|
|
13
|
+
language: language,
|
|
14
|
+
mapTileServiceType: 'base',
|
|
15
|
+
scheme: 'normal.day',
|
|
16
|
+
additionalParameters: {
|
|
17
|
+
style: 'fleet'
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
return null;
|
|
26
21
|
};
|
|
27
22
|
var _default = FleetStyleLayer;
|
|
28
23
|
exports["default"] = _default;
|
|
@@ -1,28 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports["default"] = void 0;
|
|
8
|
-
var
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _constants = require("../../../constants");
|
|
11
|
-
var _BaseLayer = _interopRequireDefault(require("./BaseLayer"));
|
|
12
|
-
var createSatelliteLayer = function createSatelliteLayer(api, language, showTraffic) {
|
|
13
|
-
var type = showTraffic ? 'traffic' : 'aerial';
|
|
14
|
-
var tileType = showTraffic ? 'traffictile' : 'maptile';
|
|
15
|
-
return api.platform.getMapTileService({
|
|
16
|
-
type: type
|
|
17
|
-
}).createTileLayer(tileType, 'hybrid.day', _constants.TILE_SIZE, _constants.FORMAT, {
|
|
18
|
-
style: 'default',
|
|
19
|
-
lg: language
|
|
20
|
-
});
|
|
21
|
-
};
|
|
7
|
+
var _useBaseLayer = require("./useBaseLayer");
|
|
22
8
|
var SatelliteLayer = function SatelliteLayer(props) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
var api = props.api,
|
|
10
|
+
language = props.language;
|
|
11
|
+
(0, _useBaseLayer.useBaseLayer)({
|
|
12
|
+
api: api,
|
|
13
|
+
language: language,
|
|
14
|
+
mapTileServiceType: 'aerial',
|
|
15
|
+
scheme: 'hybrid.day',
|
|
16
|
+
additionalParameters: {
|
|
17
|
+
style: 'default'
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
return null;
|
|
26
21
|
};
|
|
27
22
|
var _default = SatelliteLayer;
|
|
28
23
|
exports["default"] = _default;
|
|
@@ -1,28 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports["default"] = void 0;
|
|
8
|
-
var
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _constants = require("../../../constants");
|
|
11
|
-
var _BaseLayer = _interopRequireDefault(require("./BaseLayer"));
|
|
12
|
-
var createTerrainLayer = function createTerrainLayer(api, language, showTraffic) {
|
|
13
|
-
var type = showTraffic ? 'traffic' : 'aerial';
|
|
14
|
-
var tileType = showTraffic ? 'traffictile' : 'maptile';
|
|
15
|
-
return api.platform.getMapTileService({
|
|
16
|
-
type: type
|
|
17
|
-
}).createTileLayer(tileType, 'terrain.day', _constants.TILE_SIZE, _constants.FORMAT, {
|
|
18
|
-
style: 'default',
|
|
19
|
-
lg: language
|
|
20
|
-
});
|
|
21
|
-
};
|
|
7
|
+
var _useBaseLayer = require("./useBaseLayer");
|
|
22
8
|
var TerrainLayer = function TerrainLayer(props) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
var api = props.api,
|
|
10
|
+
language = props.language;
|
|
11
|
+
(0, _useBaseLayer.useBaseLayer)({
|
|
12
|
+
api: api,
|
|
13
|
+
language: language,
|
|
14
|
+
mapTileServiceType: 'aerial',
|
|
15
|
+
scheme: 'terrain.day',
|
|
16
|
+
additionalParameter: {
|
|
17
|
+
style: 'default'
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
return null;
|
|
26
21
|
};
|
|
27
22
|
var _default = TerrainLayer;
|
|
28
23
|
exports["default"] = _default;
|