qwc2 2025.10.13 → 2025.10.15
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/actions/display.js +30 -1
- package/actions/editing.js +22 -1
- package/actions/layerinfo.js +13 -1
- package/actions/layers.js +213 -3
- package/actions/localConfig.js +58 -1
- package/actions/locale.js +21 -1
- package/actions/locate.js +26 -1
- package/actions/logging.js +10 -1
- package/actions/map.js +105 -2
- package/actions/measurement.js +12 -1
- package/actions/processNotifications.js +37 -1
- package/actions/redlining.js +18 -1
- package/actions/redliningPick.js +12 -1
- package/actions/search.js +12 -1
- package/actions/serviceinfo.js +12 -1
- package/actions/task.js +55 -3
- package/actions/theme.js +339 -19
- package/actions/windows.js +164 -5
- package/components/AppMenu.js +435 -3
- package/components/AttributeForm.js +928 -32
- package/components/AttributeTableWidget.js +1105 -13
- package/components/AutoEditForm.js +189 -3
- package/components/CoordinateDisplayer.js +78 -2
- package/components/EditComboField.js +190 -6
- package/components/EditUploadField.js +315 -3
- package/components/ExportSelection.js +203 -2
- package/components/FullscreenSwitcher.js +90 -3
- package/components/Icon.js +81 -2
- package/components/IdentifyViewer.js +1161 -6
- package/components/ImportLayer.js +718 -20
- package/components/LayerInfoWindow.js +145 -2
- package/components/LinkFeatureForm.js +246 -5
- package/components/MapButton.js +88 -2
- package/components/MapSelection.js +287 -8
- package/components/MessageBar.js +68 -2
- package/components/NumericInputWindow.js +359 -2
- package/components/PickFeature.js +266 -2
- package/components/PluginsContainer.js +227 -8
- package/components/PrintSelection.js +620 -49
- package/components/ProcessNotifications.js +104 -2
- package/components/QtDesignerForm.js +1137 -18
- package/components/ResizeableWindow.js +591 -8
- package/components/SearchBox.js +1307 -20
- package/components/ServiceInfoWindow.js +107 -2
- package/components/SideBar.js +204 -4
- package/components/StandardApp.js +381 -20
- package/components/Swipeable.js +15 -1
- package/components/TaskBar.js +85 -2
- package/components/ThemeLayersListWindow.js +216 -4
- package/components/ThemeList.js +381 -7
- package/components/Toolbar.js +106 -2
- package/components/WindowManager.js +178 -2
- package/components/map/OlLayer.js +257 -6
- package/components/map/OlMap.js +405 -5
- package/components/map/layers/BingLayer.js +31 -2
- package/components/map/layers/GoogleLayer.js +222 -19
- package/components/map/layers/GraticuleLayer.js +21 -1
- package/components/map/layers/ImageLayer.js +15 -1
- package/components/map/layers/MVTLayer.js +52 -2
- package/components/map/layers/OSMLayer.js +24 -2
- package/components/map/layers/OverlayLayer.js +55 -3
- package/components/map/layers/VectorLayer.js +173 -8
- package/components/map/layers/WFSLayer.js +220 -6
- package/components/map/layers/WMSLayer.js +180 -6
- package/components/map/layers/WMTSLayer.js +67 -3
- package/components/map/layers/XYZLayer.js +24 -2
- package/components/map/layers/index.js +28 -1
- package/components/map3d/EditDataset3D.js +190 -3
- package/components/map3d/HeightProfile3D.js +402 -3
- package/components/map3d/ImportObjects3D.js +162 -2
- package/components/map3d/Map3D.js +1304 -38
- package/components/map3d/MapControls3D.js +392 -7
- package/components/map3d/SearchField3D.js +183 -11
- package/components/map3d/View3DSwitcher.js +98 -2
- package/components/map3d/drawtool/CreateTool3D.js +174 -4
- package/components/map3d/drawtool/EditTool3D.js +590 -6
- package/components/map3d/drawtool/NumericInput3D.js +336 -4
- package/components/map3d/layers/GeoTIFFLayer3D.js +15 -1
- package/components/map3d/layers/VectorLayer3D.js +53 -2
- package/components/map3d/layers/WFSLayer3D.js +109 -3
- package/components/map3d/layers/WMSLayer3D.js +70 -2
- package/components/map3d/layers/WMTSLayer3D.js +27 -3
- package/components/map3d/layers/index.js +14 -1
- package/components/map3d/utils/FirstPersonControls3D.js +423 -16
- package/components/map3d/utils/MiscUtils3D.js +221 -13
- package/components/map3d/utils/OrbitControls3D.js +176 -5
- package/components/map3d/utils/Tiles3DStyle.js +238 -9
- package/components/share/ShareLink.js +54 -2
- package/components/share/ShareQRCode.js +62 -2
- package/components/share/ShareSocials.js +125 -3
- package/components/timeline/FixedTimeline.js +236 -5
- package/components/timeline/InfiniteTimeline.js +347 -8
- package/components/timeline/TimelineFeaturesSlider.js +439 -5
- package/components/widgets/AccordeonWidget.js +96 -2
- package/components/widgets/ButtonBar.js +124 -2
- package/components/widgets/ColorButton.js +201 -3
- package/components/widgets/ComboBox.js +166 -2
- package/components/widgets/CopyButton.js +110 -2
- package/components/widgets/DateTimeInput.js +100 -3
- package/components/widgets/EditableSelect.js +230 -3
- package/components/widgets/FileSelector.js +128 -4
- package/components/widgets/Input.js +124 -2
- package/components/widgets/InputContainer.js +96 -2
- package/components/widgets/LayerCatalogWidget.js +219 -3
- package/components/widgets/MenuButton.js +157 -1
- package/components/widgets/ModalDialog.js +64 -2
- package/components/widgets/NavBar.js +119 -2
- package/components/widgets/NumberInput.js +226 -4
- package/components/widgets/PopupMenu.js +72 -1
- package/components/widgets/Primitives.js +6 -1
- package/components/widgets/ReCaptchaWidget.js +55 -1
- package/components/widgets/SearchWidget.js +255 -2
- package/components/widgets/Spinner.js +44 -2
- package/components/widgets/SuggestionInput.js +77 -2
- package/components/widgets/TextInput.js +308 -2
- package/components/widgets/ToggleSwitch.js +85 -2
- package/components/widgets/VectorLayerPicker.js +85 -3
- package/libs/openlayers.js +225 -5
- package/package.json +1 -1
- package/plugins/API.js +358 -15
- package/plugins/AttributeTable.js +109 -3
- package/plugins/Authentication.js +130 -5
- package/plugins/BackgroundSwitcher.js +218 -4
- package/plugins/Bookmark.js +289 -3
- package/plugins/BottomBar.js +298 -4
- package/plugins/CookiePopup.js +67 -3
- package/plugins/Cyclomedia.js +442 -5
- package/plugins/Editing.js +497 -9
- package/plugins/FeatureForm.js +366 -4
- package/plugins/FeatureSearch.js +458 -3
- package/plugins/GeometryDigitizer.js +664 -7
- package/plugins/HeightProfile.js +768 -15
- package/plugins/Help.js +102 -3
- package/plugins/HomeButton.js +80 -3
- package/plugins/Identify.js +543 -5
- package/plugins/LayerCatalog.js +215 -4
- package/plugins/LayerTree.js +1194 -6
- package/plugins/LocateButton.js +94 -3
- package/plugins/Map.js +320 -16
- package/plugins/MapCompare.js +94 -3
- package/plugins/MapCopyright.js +127 -5
- package/plugins/MapExport.js +613 -20
- package/plugins/MapFilter.js +868 -12
- package/plugins/MapInfoTooltip.js +277 -3
- package/plugins/MapLegend.js +253 -4
- package/plugins/MapTip.js +290 -4
- package/plugins/Measure.js +220 -4
- package/plugins/NewsPopup.js +137 -3
- package/plugins/OverviewMap.js +167 -7
- package/plugins/Panoramax.js +340 -2
- package/plugins/Portal.js +199 -4
- package/plugins/Print.js +1231 -15
- package/plugins/Redlining.js +750 -6
- package/plugins/Reports.js +332 -3
- package/plugins/Routing.js +1278 -15
- package/plugins/ScratchDrawing.js +173 -5
- package/plugins/Settings.js +241 -4
- package/plugins/Share.js +198 -3
- package/plugins/StartupMarker.js +84 -4
- package/plugins/TaskButton.js +88 -3
- package/plugins/ThemeSwitcher.js +164 -4
- package/plugins/TimeManager.js +971 -10
- package/plugins/TopBar.js +300 -7
- package/plugins/TourGuide.js +213 -2
- package/plugins/ValueTool.js +419 -4
- package/plugins/View3D.js +519 -14
- package/plugins/ZoomButtons.js +165 -3
- package/plugins/map/EditingSupport.js +199 -7
- package/plugins/map/LocateSupport.js +260 -4
- package/plugins/map/MeasurementSupport.js +216 -8
- package/plugins/map/RedliningPickSupport.js +201 -7
- package/plugins/map/RedliningSupport.js +726 -17
- package/plugins/map/SnapInteraction.js +101 -1
- package/plugins/map/SnapSupport.js +210 -2
- package/plugins/map/SnappingSupport.js +356 -17
- package/plugins/map3d/BackgroundSwitcher3D.js +44 -3
- package/plugins/map3d/BottomBar3D.js +118 -3
- package/plugins/map3d/Compare3D.js +422 -8
- package/plugins/map3d/Draw3D.js +353 -6
- package/plugins/map3d/ExportObjects3D.js +393 -18
- package/plugins/map3d/HideObjects3D.js +313 -12
- package/plugins/map3d/Identify3D.js +283 -12
- package/plugins/map3d/LayerTree3D.js +323 -3
- package/plugins/map3d/MapCopyright3D.js +128 -5
- package/plugins/map3d/MapExport3D.js +590 -10
- package/plugins/map3d/MapLight3D.js +553 -6
- package/plugins/map3d/Measure3D.js +571 -20
- package/plugins/map3d/OverviewMap3D.js +169 -3
- package/plugins/map3d/Settings3D.js +73 -3
- package/plugins/map3d/TopBar3D.js +207 -9
- package/plugins/redlining/RedliningBufferSupport.js +206 -3
- package/reducers/display.js +34 -2
- package/reducers/editing.js +68 -3
- package/reducers/index.js +9 -1
- package/reducers/layerinfo.js +26 -2
- package/reducers/layers.js +456 -9
- package/reducers/localConfig.js +122 -2
- package/reducers/locale.js +38 -2
- package/reducers/locate.js +40 -2
- package/reducers/map.js +176 -5
- package/reducers/measurement.js +42 -2
- package/reducers/processNotifications.js +49 -2
- package/reducers/redlining.js +50 -2
- package/reducers/redliningPick.js +27 -2
- package/reducers/search.js +20 -1
- package/reducers/serviceinfo.js +25 -2
- package/reducers/task.js +45 -2
- package/reducers/theme.js +51 -2
- package/reducers/windows.js +203 -2
- package/scripts/dist.sh +1 -1
- package/scripts/gen-plugin-docs.js +152 -2
- package/scripts/makeIconkit.js +85 -6
- package/scripts/themesConfig.js +742 -40
- package/scripts/updateTranslations.js +251 -10
- package/selectors/searchproviders.js +44 -2
- package/stores/StandardStore.js +42 -2
- package/utils/ConfigUtils.js +84 -3
- package/utils/CoordinatesUtils.js +234 -23
- package/utils/DxfUtils.js +237 -11
- package/utils/EditingInterface.js +421 -87
- package/utils/EditingUtils.js +357 -13
- package/utils/ElevationInterface.js +83 -22
- package/utils/FeatureStyles.js +429 -5
- package/utils/IdentifyUtils.js +443 -7
- package/utils/ImageEditor.js +79 -9
- package/utils/LayerUtils.js +1516 -50
- package/utils/LocaleUtils.js +117 -7
- package/utils/MapUtils.js +241 -59
- package/utils/MeasureUtils.js +323 -2
- package/utils/MiscUtils.js +189 -11
- package/utils/PermaLinkUtils.js +429 -6
- package/utils/PluginStore.js +27 -1
- package/utils/ResourceRegistry.js +15 -1
- package/utils/RoutingInterface.js +307 -7
- package/utils/SearchProviders.js +722 -19
- package/utils/ServiceLayerUtils.js +669 -14
- package/utils/Signal.js +32 -2
- package/utils/ThemeUtils.js +341 -7
- package/utils/VectorLayerUtils.js +589 -15
- package/utils/expr_grammar/grammar.js +2239 -2
- package/utils/expr_grammar/test.js +65 -3
|
@@ -1,7 +1,271 @@
|
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
5
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
7
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
8
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
9
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
10
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
11
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
12
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
13
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
14
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
15
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
16
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
17
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
18
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
19
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
20
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
21
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
22
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
23
|
+
/**
|
|
2
24
|
* Copyright 2024 Sourcepole AG
|
|
3
25
|
* All rights reserved.
|
|
4
26
|
*
|
|
5
27
|
* This source code is licensed under the BSD-style license found in the
|
|
6
28
|
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
import React from 'react';
|
|
32
|
+
import { connect } from 'react-redux';
|
|
33
|
+
import isEmpty from 'lodash.isempty';
|
|
34
|
+
import PropTypes from 'prop-types';
|
|
35
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
36
|
+
import { LayerRole, addLayerFeatures, clearLayer } from '../actions/layers';
|
|
37
|
+
import IdentifyUtils from '../utils/IdentifyUtils';
|
|
38
|
+
import LocaleUtils from '../utils/LocaleUtils';
|
|
39
|
+
import MapUtils from '../utils/MapUtils';
|
|
40
|
+
import VectorLayerUtils from '../utils/VectorLayerUtils';
|
|
41
|
+
import MapSelection from './MapSelection';
|
|
42
|
+
import PopupMenu from './widgets/PopupMenu';
|
|
43
|
+
import Spinner from './widgets/Spinner';
|
|
44
|
+
import './style/PickFeature.css';
|
|
45
|
+
var PickFeature = /*#__PURE__*/function (_React$Component) {
|
|
46
|
+
function PickFeature(props) {
|
|
47
|
+
var _this;
|
|
48
|
+
_classCallCheck(this, PickFeature);
|
|
49
|
+
_this = _callSuper(this, PickFeature, [props]);
|
|
50
|
+
_defineProperty(_this, "handleIdentifyResponse", function (response, reqId, layer, infoFormat) {
|
|
51
|
+
if (_this.state.reqId !== reqId) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
var result = IdentifyUtils.parseResponse(response, layer, infoFormat, _this.state.clickPos, _this.props.map.projection, false);
|
|
55
|
+
if (_this.props.featureFilter) {
|
|
56
|
+
Object.entries(result).forEach(function (_ref) {
|
|
57
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
58
|
+
layername = _ref2[0],
|
|
59
|
+
features = _ref2[1];
|
|
60
|
+
result[layername] = features.filter(_this.props.featureFilter);
|
|
61
|
+
});
|
|
62
|
+
} else {
|
|
63
|
+
Object.entries(result).forEach(function (_ref3) {
|
|
64
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
65
|
+
layername = _ref4[0],
|
|
66
|
+
features = _ref4[1];
|
|
67
|
+
result[layername] = features.filter(function (feature) {
|
|
68
|
+
return !!feature.geometry;
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
_this.setState(function (state) {
|
|
73
|
+
var newState = {
|
|
74
|
+
pickResults: _objectSpread(_objectSpread({}, state.pickResults), result),
|
|
75
|
+
pendingQueries: state.pendingQueries - 1
|
|
76
|
+
};
|
|
77
|
+
if (newState.pendingQueries === 0) {
|
|
78
|
+
var entries = Object.entries(newState.pickResults);
|
|
79
|
+
if (entries.length === 1 && entries[0][1].length === 1) {
|
|
80
|
+
_this.props.featurePicked(entries[0][0], entries[0][1][0]);
|
|
81
|
+
newState.pickResults = null;
|
|
82
|
+
newState.pickGeom = null;
|
|
83
|
+
} else if (entries.reduce(function (sum, entry) {
|
|
84
|
+
return sum + entry[1].length;
|
|
85
|
+
}, 0) === 0) {
|
|
86
|
+
newState.pickResults = null;
|
|
87
|
+
newState.pickGeom = null;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return newState;
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
_defineProperty(_this, "highlightFeature", function (key, feature) {
|
|
94
|
+
var layer = {
|
|
95
|
+
id: "pick-feature-selection",
|
|
96
|
+
role: LayerRole.SELECTION
|
|
97
|
+
};
|
|
98
|
+
_this.props.addLayerFeatures(layer, [feature], true);
|
|
99
|
+
_this.setState({
|
|
100
|
+
highlightedFeature: key + ":" + feature.id
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
_defineProperty(_this, "clearHighlight", function (key, feature) {
|
|
104
|
+
if (_this.state.highlightedFeature === key + ":" + feature.id) {
|
|
105
|
+
_this.setState({
|
|
106
|
+
highlightFeature: null
|
|
107
|
+
});
|
|
108
|
+
_this.props.clearLayer("pick-feature-selection");
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
_defineProperty(_this, "onClose", function () {
|
|
112
|
+
_this.setState(PickFeature.defaultState);
|
|
113
|
+
_this.props.clearLayer("pick-feature-selection");
|
|
114
|
+
});
|
|
115
|
+
_this.state = PickFeature.defaultState;
|
|
116
|
+
return _this;
|
|
117
|
+
}
|
|
118
|
+
_inherits(PickFeature, _React$Component);
|
|
119
|
+
return _createClass(PickFeature, [{
|
|
120
|
+
key: "componentDidUpdate",
|
|
121
|
+
value: function componentDidUpdate(prevProps, prevState) {
|
|
122
|
+
var _this2 = this;
|
|
123
|
+
if (this.state.pickGeom && this.state.pickGeom !== prevState.pickGeom) {
|
|
124
|
+
var queryLayers = [];
|
|
125
|
+
if (this.props.layerFilter) {
|
|
126
|
+
queryLayers = [this.props.layers.find(function (l) {
|
|
127
|
+
return l.url === _this2.props.layerFilter.url;
|
|
128
|
+
})].filter(Boolean);
|
|
129
|
+
} else {
|
|
130
|
+
queryLayers = IdentifyUtils.getQueryLayers(this.props.layers, this.props.map);
|
|
131
|
+
}
|
|
132
|
+
if (!isEmpty(queryLayers)) {
|
|
133
|
+
this.setState(function (state) {
|
|
134
|
+
var getPixelFromCoordinate = MapUtils.getHook(MapUtils.GET_PIXEL_FROM_COORDINATES_HOOK);
|
|
135
|
+
var coordinates = _this2.props.pickGeomType === "Point" ? [[state.pickGeom.coordinates]] : state.pickGeom.coordinates;
|
|
136
|
+
var maxX = coordinates[0][0][0];
|
|
137
|
+
var maxY = coordinates[0][0][1];
|
|
138
|
+
for (var i = 1; i < coordinates[0].length; ++i) {
|
|
139
|
+
if (coordinates[0][i][0] > maxX) {
|
|
140
|
+
maxX = coordinates[0][i][0];
|
|
141
|
+
maxY = coordinates[0][i][1];
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
var clickPos = getPixelFromCoordinate([maxX, maxY], false);
|
|
145
|
+
var reqId = uuidv4();
|
|
146
|
+
queryLayers.forEach(function (layer) {
|
|
147
|
+
var request = null;
|
|
148
|
+
if (_this2.props.pickGeomType === 'Point') {
|
|
149
|
+
var _this2$props$layerFil;
|
|
150
|
+
request = IdentifyUtils.buildRequest(layer, ((_this2$props$layerFil = _this2.props.layerFilter) === null || _this2$props$layerFil === void 0 ? void 0 : _this2$props$layerFil.name) || layer.queryLayers.join(","), state.pickGeom.coordinates, _this2.props.map);
|
|
151
|
+
} else if (_this2.props.pickGeomType === 'Polygon') {
|
|
152
|
+
var _this2$props$layerFil2;
|
|
153
|
+
var filter = VectorLayerUtils.geoJSONGeomToWkt(_this2.state.pickGeom);
|
|
154
|
+
request = IdentifyUtils.buildFilterRequest(layer, ((_this2$props$layerFil2 = _this2.props.layerFilter) === null || _this2$props$layerFil2 === void 0 ? void 0 : _this2$props$layerFil2.name) || layer.queryLayers.join(","), filter, _this2.props.map);
|
|
155
|
+
} else {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
IdentifyUtils.sendRequest(request, function (response) {
|
|
159
|
+
return _this2.handleIdentifyResponse(response, reqId, layer, request.params.info_format);
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
return {
|
|
163
|
+
pickResults: {},
|
|
164
|
+
clickPos: clickPos,
|
|
165
|
+
pendingQueries: queryLayers.length,
|
|
166
|
+
reqId: reqId
|
|
167
|
+
};
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}, {
|
|
173
|
+
key: "render",
|
|
174
|
+
value: function render() {
|
|
175
|
+
var _this3 = this;
|
|
176
|
+
var resultsMenu = null;
|
|
177
|
+
if (this.state.pickResults) {
|
|
178
|
+
resultsMenu = /*#__PURE__*/React.createElement(PopupMenu, {
|
|
179
|
+
className: "PickFeatureMenu",
|
|
180
|
+
key: "PickResultMenu",
|
|
181
|
+
onClose: this.onClose,
|
|
182
|
+
x: this.state.clickPos[0],
|
|
183
|
+
y: this.state.clickPos[1]
|
|
184
|
+
}, this.state.pendingQueries === 0 ? Object.entries(this.state.pickResults).map(function (_ref5) {
|
|
185
|
+
var _ref6 = _slicedToArray(_ref5, 2),
|
|
186
|
+
layername = _ref6[0],
|
|
187
|
+
features = _ref6[1];
|
|
188
|
+
return features.map(function (feature) {
|
|
189
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
190
|
+
key: layername + ":" + feature.id,
|
|
191
|
+
onClickCapture: function onClickCapture() {
|
|
192
|
+
return _this3.props.featurePicked(layername, feature);
|
|
193
|
+
},
|
|
194
|
+
onMouseOut: function onMouseOut() {
|
|
195
|
+
return _this3.clearHighlight(layername, feature);
|
|
196
|
+
},
|
|
197
|
+
onMouseOver: function onMouseOver() {
|
|
198
|
+
return _this3.highlightFeature(layername, feature);
|
|
199
|
+
}
|
|
200
|
+
}, layername + ": " + feature.displayname);
|
|
201
|
+
});
|
|
202
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
203
|
+
className: "pick-feature-menu-querying"
|
|
204
|
+
}, /*#__PURE__*/React.createElement(Spinner, null), LocaleUtils.tr("pickfeature.querying")));
|
|
205
|
+
}
|
|
206
|
+
return [resultsMenu, /*#__PURE__*/React.createElement(MapSelection, {
|
|
207
|
+
active: true,
|
|
208
|
+
geomType: this.props.pickGeomType,
|
|
209
|
+
geometry: this.state.pickGeom,
|
|
210
|
+
geometryChanged: function geometryChanged(geom) {
|
|
211
|
+
return _this3.setState({
|
|
212
|
+
pickGeom: geom
|
|
213
|
+
});
|
|
214
|
+
},
|
|
215
|
+
key: "MapSelection",
|
|
216
|
+
styleOptions: this.props.highlightStyle
|
|
217
|
+
})];
|
|
218
|
+
}
|
|
219
|
+
}]);
|
|
220
|
+
}(React.Component);
|
|
221
|
+
_defineProperty(PickFeature, "propTypes", {
|
|
222
|
+
addLayerFeatures: PropTypes.func,
|
|
223
|
+
clearLayer: PropTypes.func,
|
|
224
|
+
/** Optional: Function which accepts a GeoJSON feature and returns whether it should be accepted (true) or discarded (false) */
|
|
225
|
+
featureFilter: PropTypes.func,
|
|
226
|
+
featurePicked: PropTypes.func,
|
|
227
|
+
/** The style used for highlighting filter geometries. */
|
|
228
|
+
highlightStyle: PropTypes.shape({
|
|
229
|
+
/* Stroke color rgba array, i.e. [255, 0, 0, 0.5] */
|
|
230
|
+
strokeColor: PropTypes.array,
|
|
231
|
+
/* Stroke width */
|
|
232
|
+
strokeWidth: PropTypes.number,
|
|
233
|
+
/* Stroke dash/gap pattern array. Empty for solid line. */
|
|
234
|
+
strokeDash: PropTypes.array,
|
|
235
|
+
/* Fill color rgba array, i.e. [255, 0, 0, 0.33] */
|
|
236
|
+
fillColor: PropTypes.array
|
|
237
|
+
}),
|
|
238
|
+
/** Optional: Restrict pick to specified layer name */
|
|
239
|
+
layerFilter: PropTypes.shape({
|
|
240
|
+
url: PropTypes.string,
|
|
241
|
+
name: PropTypes.string
|
|
242
|
+
}),
|
|
243
|
+
layers: PropTypes.array,
|
|
244
|
+
map: PropTypes.object,
|
|
245
|
+
/** Pick geometry type: Point, Polygon, ... (default: Point) */
|
|
246
|
+
pickGeomType: PropTypes.string
|
|
247
|
+
});
|
|
248
|
+
_defineProperty(PickFeature, "defaultProps", {
|
|
249
|
+
pickGeomType: 'Point',
|
|
250
|
+
highlightStyle: {
|
|
251
|
+
strokeColor: [0, 0, 0],
|
|
252
|
+
fillColor: [255, 255, 0, 0.25]
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
_defineProperty(PickFeature, "defaultState", {
|
|
256
|
+
pickGeom: null,
|
|
257
|
+
pickResults: null,
|
|
258
|
+
clickPos: null,
|
|
259
|
+
highlightedFeature: null,
|
|
260
|
+
pendingQueries: 0,
|
|
261
|
+
reqId: null
|
|
262
|
+
});
|
|
263
|
+
export default connect(function (state) {
|
|
264
|
+
return {
|
|
265
|
+
layers: state.layers.flat,
|
|
266
|
+
map: state.map
|
|
267
|
+
};
|
|
268
|
+
}, {
|
|
269
|
+
addLayerFeatures: addLayerFeatures,
|
|
270
|
+
clearLayer: clearLayer
|
|
271
|
+
})(PickFeature);
|
|
@@ -1,14 +1,233 @@
|
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
3
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
6
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
7
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
8
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
9
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
11
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
12
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
13
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
14
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
15
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
16
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
17
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
18
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
19
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
20
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
23
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
24
|
+
/**
|
|
2
25
|
* Copyright 2016 GeoSolutions Sas
|
|
3
26
|
* Copyright 2016-2024 Sourcepole AG
|
|
4
27
|
* All rights reserved.
|
|
5
28
|
*
|
|
6
29
|
* This source code is licensed under the BSD-style license found in the
|
|
7
30
|
* LICENSE file in the root directory of this source tree.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
31
|
+
*/
|
|
32
|
+
import React from 'react';
|
|
33
|
+
import { connect } from 'react-redux';
|
|
34
|
+
import PropTypes from 'prop-types';
|
|
35
|
+
import ConfigUtils from '../utils/ConfigUtils';
|
|
36
|
+
import PluginStore from '../utils/PluginStore';
|
|
37
|
+
import ProcessNotifications from './ProcessNotifications';
|
|
38
|
+
import WindowManager from './WindowManager';
|
|
39
|
+
import './style/PluginsContainer.css';
|
|
40
|
+
export var MapButtonPortalContext = /*#__PURE__*/React.createContext(null);
|
|
41
|
+
export var MapContainerPortalContext = /*#__PURE__*/React.createContext(null);
|
|
42
|
+
export var AppInfosPortalContext = /*#__PURE__*/React.createContext(null);
|
|
43
|
+
var PluginsContainer = /*#__PURE__*/function (_React$Component) {
|
|
44
|
+
function PluginsContainer() {
|
|
45
|
+
var _this;
|
|
46
|
+
_classCallCheck(this, PluginsContainer);
|
|
47
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
48
|
+
args[_key] = arguments[_key];
|
|
49
|
+
}
|
|
50
|
+
_this = _callSuper(this, PluginsContainer, [].concat(args));
|
|
51
|
+
_defineProperty(_this, "state", {
|
|
52
|
+
mapButtonsContainerRef: null,
|
|
53
|
+
mapContainerRef: null,
|
|
54
|
+
appInfosContainerRef: null
|
|
55
|
+
});
|
|
56
|
+
_defineProperty(_this, "renderPlugins", function () {
|
|
57
|
+
var device = ConfigUtils.isMobile() ? 'mobile' : 'desktop';
|
|
58
|
+
var plugins = PluginStore.getPlugins();
|
|
59
|
+
return _this.props.pluginsConfig.map(function (pluginConf) {
|
|
60
|
+
var _this$props$theme, _this$props$theme2, _pluginConf$key;
|
|
61
|
+
var Plugin = plugins[pluginConf.name + "Plugin"];
|
|
62
|
+
if (!Plugin) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
var themeDevicePluginConfig = ((_this$props$theme = _this.props.theme) === null || _this$props$theme === void 0 || (_this$props$theme = _this$props$theme.config) === null || _this$props$theme === void 0 || (_this$props$theme = _this$props$theme[device]) === null || _this$props$theme === void 0 || (_this$props$theme = _this$props$theme.plugins) === null || _this$props$theme === void 0 ? void 0 : _this$props$theme[pluginConf.name]) || {};
|
|
66
|
+
var themePluginConfig = ((_this$props$theme2 = _this.props.theme) === null || _this$props$theme2 === void 0 || (_this$props$theme2 = _this$props$theme2.config) === null || _this$props$theme2 === void 0 || (_this$props$theme2 = _this$props$theme2.plugins) === null || _this$props$theme2 === void 0 ? void 0 : _this$props$theme2[pluginConf.name]) || {};
|
|
67
|
+
var cfg = _objectSpread(_objectSpread(_objectSpread({}, pluginConf.cfg || {}), themePluginConfig), themeDevicePluginConfig);
|
|
68
|
+
return /*#__PURE__*/React.createElement(Plugin, _extends({
|
|
69
|
+
key: (_pluginConf$key = pluginConf.key) !== null && _pluginConf$key !== void 0 ? _pluginConf$key : pluginConf.name
|
|
70
|
+
}, cfg));
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
_defineProperty(_this, "setupTouchEvents", function (el) {
|
|
74
|
+
if (el) {
|
|
75
|
+
el.addEventListener('touchstart', function (ev) {
|
|
76
|
+
_this.touchY = ev.targetTouches[0].clientY;
|
|
77
|
+
}, {
|
|
78
|
+
passive: false
|
|
79
|
+
});
|
|
80
|
+
el.addEventListener('touchmove', _this.preventOverscroll, {
|
|
81
|
+
passive: false
|
|
82
|
+
});
|
|
83
|
+
var resizeObserver = new ResizeObserver(function (entries) {
|
|
84
|
+
var contentRectEntry = entries.find(function (entry) {
|
|
85
|
+
return entry.contentRect;
|
|
86
|
+
});
|
|
87
|
+
if (contentRectEntry) {
|
|
88
|
+
var height = contentRectEntry.contentRect.height;
|
|
89
|
+
el.style.setProperty('--plugins-container-height', "".concat(height, "px"));
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
resizeObserver.observe(el);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
_defineProperty(_this, "preventOverscroll", function (ev) {
|
|
96
|
+
if (ev.touches[0].touchType !== "direct") {
|
|
97
|
+
// Don't do anything for stylus inputs
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
var scrollEvent = false;
|
|
101
|
+
var element = ev.target;
|
|
102
|
+
var direction = ev.targetTouches[0].clientY - _this.touchY;
|
|
103
|
+
_this.touchY = ev.targetTouches[0].clientY;
|
|
104
|
+
while (!scrollEvent && element) {
|
|
105
|
+
var scrollable = element.scrollHeight > element.clientHeight;
|
|
106
|
+
// Workaround for resizeable-window having scrollHeight > clientHeight even though it has no scrollbar
|
|
107
|
+
if (element.classList.contains('resizeable-window')) {
|
|
108
|
+
scrollable = false;
|
|
109
|
+
}
|
|
110
|
+
if (element.type === "range") {
|
|
111
|
+
// If it is a range element, treat it as a scroll event
|
|
112
|
+
scrollEvent = true;
|
|
113
|
+
} else if (scrollable && element.scrollTop + element.clientHeight < element.scrollHeight && direction < 0) {
|
|
114
|
+
// User scrolls down and element is not at end of scroll
|
|
115
|
+
scrollEvent = true;
|
|
116
|
+
} else if (scrollable && element.scrollTop > 0 && direction > 0) {
|
|
117
|
+
// User scrolls up and element is not at start of scroll
|
|
118
|
+
scrollEvent = true;
|
|
119
|
+
} else {
|
|
120
|
+
element = element.parentElement;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (!scrollEvent) {
|
|
124
|
+
ev.preventDefault();
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
_defineProperty(_this, "setMapContainerRef", function (el) {
|
|
128
|
+
_this.setState({
|
|
129
|
+
mapContainerRef: el
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
_defineProperty(_this, "setAppInfosContainerRef", function (el) {
|
|
133
|
+
_this.setState({
|
|
134
|
+
appInfosContainerRef: el
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
_defineProperty(_this, "setButtonContainerRef", function (el) {
|
|
138
|
+
_this.setState({
|
|
139
|
+
mapButtonsContainerRef: el
|
|
140
|
+
});
|
|
141
|
+
if (el) {
|
|
142
|
+
var resizeObserver = new ResizeObserver(function (entries) {
|
|
143
|
+
var contentRectEntry = entries.find(function (entry) {
|
|
144
|
+
return entry.contentRect;
|
|
145
|
+
});
|
|
146
|
+
if (contentRectEntry) {
|
|
147
|
+
var width = contentRectEntry.contentRect.width;
|
|
148
|
+
var height = contentRectEntry.contentRect.height;
|
|
149
|
+
el.style.setProperty('--buttons-container-width', "".concat(width, "px"));
|
|
150
|
+
el.style.setProperty('--buttons-container-height', "".concat(height, "px"));
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
resizeObserver.observe(el);
|
|
154
|
+
el.recomputeSpacers = function () {
|
|
155
|
+
var slots = new Set();
|
|
156
|
+
Array.from(el.childNodes).forEach(function (child) {
|
|
157
|
+
if (child.dataset.spacer) {
|
|
158
|
+
el.removeChild(child);
|
|
159
|
+
} else {
|
|
160
|
+
slots.add(child.dataset.slot);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
var maxSlot = Math.max.apply(Math, _toConsumableArray(slots));
|
|
164
|
+
for (var i = 0; i < maxSlot; ++i) {
|
|
165
|
+
if (!slots.has(String(i))) {
|
|
166
|
+
var child = document.createElement("div");
|
|
167
|
+
child.className = "map-buttons-spacer";
|
|
168
|
+
child.dataset.spacer = 1;
|
|
169
|
+
child.style.order = i;
|
|
170
|
+
el.appendChild(child);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
return _this;
|
|
177
|
+
}
|
|
178
|
+
_inherits(PluginsContainer, _React$Component);
|
|
179
|
+
return _createClass(PluginsContainer, [{
|
|
180
|
+
key: "render",
|
|
181
|
+
value: function render() {
|
|
182
|
+
var _this$props$className;
|
|
183
|
+
var left = this.props.mapMargins.left + this.props.mapMargins.outerLeft;
|
|
184
|
+
var top = this.props.mapMargins.top;
|
|
185
|
+
var right = this.props.mapMargins.right + this.props.mapMargins.outerRight;
|
|
186
|
+
var bottom = this.props.mapMargins.bottom;
|
|
187
|
+
var mapContainerStyle = {
|
|
188
|
+
left: 'calc(' + left + 'px)',
|
|
189
|
+
top: 'calc(var(--topbar-height) + ' + top + 'px)',
|
|
190
|
+
right: 'calc(' + right + 'px)',
|
|
191
|
+
bottom: 'calc(var(--bottombar-height) + ' + bottom + 'px)'
|
|
192
|
+
};
|
|
193
|
+
var haveRefs = this.state.mapButtonsContainerRef && this.state.mapContainerRef && this.state.appInfosContainerRef;
|
|
194
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
195
|
+
className: "plugins-container " + ((_this$props$className = this.props.className) !== null && _this$props$className !== void 0 ? _this$props$className : ""),
|
|
196
|
+
ref: this.setupTouchEvents
|
|
197
|
+
}, /*#__PURE__*/React.createElement(AppInfosPortalContext.Provider, {
|
|
198
|
+
value: this.state.appInfosContainerRef
|
|
199
|
+
}, /*#__PURE__*/React.createElement(MapButtonPortalContext.Provider, {
|
|
200
|
+
value: this.state.mapButtonsContainerRef
|
|
201
|
+
}, /*#__PURE__*/React.createElement(MapContainerPortalContext.Provider, {
|
|
202
|
+
value: this.state.mapContainerRef
|
|
203
|
+
}, haveRefs ? this.renderPlugins() : null, haveRefs ? this.props.children : null))), /*#__PURE__*/React.createElement(WindowManager, null), /*#__PURE__*/React.createElement("div", {
|
|
204
|
+
className: "map-container",
|
|
205
|
+
ref: this.setMapContainerRef,
|
|
206
|
+
style: mapContainerStyle
|
|
207
|
+
}, /*#__PURE__*/React.createElement(ProcessNotifications, null)), /*#__PURE__*/React.createElement("div", {
|
|
208
|
+
className: "map-buttons-container",
|
|
209
|
+
ref: this.setButtonContainerRef,
|
|
210
|
+
style: mapContainerStyle
|
|
211
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
212
|
+
className: "app-infos-container",
|
|
213
|
+
ref: this.setAppInfosContainerRef,
|
|
214
|
+
style: mapContainerStyle
|
|
215
|
+
}));
|
|
216
|
+
}
|
|
217
|
+
}]);
|
|
218
|
+
}(React.Component);
|
|
219
|
+
_defineProperty(PluginsContainer, "propTypes", {
|
|
220
|
+
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
221
|
+
className: PropTypes.string,
|
|
222
|
+
mapMargins: PropTypes.object,
|
|
223
|
+
pluginsConfig: PropTypes.array,
|
|
224
|
+
theme: PropTypes.object
|
|
225
|
+
});
|
|
226
|
+
export default connect(function (state) {
|
|
227
|
+
return {
|
|
228
|
+
// Just to trigger re-render when custom plugins change
|
|
229
|
+
customPlugins: state.localConfig.customPlugins,
|
|
230
|
+
mapMargins: state.windows.mapMargins,
|
|
231
|
+
theme: state.theme.current
|
|
232
|
+
};
|
|
233
|
+
})(PluginsContainer);
|