qwc2 2025.10.9 → 2025.10.14
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 +763 -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
package/plugins/API.js
CHANGED
|
@@ -1,10 +1,123 @@
|
|
|
1
|
-
function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols)
|
|
1
|
+
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; }
|
|
2
|
+
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; }
|
|
3
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
4
|
+
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."); }
|
|
5
|
+
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; } }
|
|
6
|
+
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; }
|
|
7
|
+
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; } }
|
|
8
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
9
|
+
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); }
|
|
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 2020-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 ReactDOM from 'react-dom';
|
|
33
|
+
import { connect } from 'react-redux';
|
|
34
|
+
import axios from 'axios';
|
|
35
|
+
import ol from 'openlayers';
|
|
36
|
+
import PropTypes from 'prop-types';
|
|
37
|
+
import url from 'url';
|
|
38
|
+
import * as uuid from 'uuid';
|
|
39
|
+
import * as displayActions from '../actions/display';
|
|
40
|
+
import * as editingActions from '../actions/editing';
|
|
41
|
+
import { LayerRole } from '../actions/layers';
|
|
42
|
+
import * as layerActions from '../actions/layers';
|
|
43
|
+
import { registerCustomPlugin, unregisterCustomPlugin } from '../actions/localConfig';
|
|
44
|
+
import * as localeActions from '../actions/locale';
|
|
45
|
+
import * as locateActions from '../actions/locate';
|
|
46
|
+
import * as mapActions from '../actions/map';
|
|
47
|
+
import * as taskActions from '../actions/task';
|
|
48
|
+
import * as themeActions from '../actions/theme';
|
|
49
|
+
import * as windowsActions from '../actions/windows';
|
|
50
|
+
import AppMenu from '../components/AppMenu';
|
|
51
|
+
import AttributeForm from '../components/AttributeForm';
|
|
52
|
+
import AttributeTableWidget from '../components/AttributeTableWidget';
|
|
53
|
+
import AutoEditForm from '../components/AutoEditForm';
|
|
54
|
+
import CoordinateDisplayer from '../components/CoordinateDisplayer';
|
|
55
|
+
import EditComboField from '../components/EditComboField';
|
|
56
|
+
import EditUploadField from '../components/EditUploadField';
|
|
57
|
+
import FullscreenSwitcher from '../components/FullscreenSwitcher';
|
|
58
|
+
import Icon from '../components/Icon';
|
|
59
|
+
import IdentifyViewer from '../components/IdentifyViewer';
|
|
60
|
+
import ImportLayer from '../components/ImportLayer';
|
|
61
|
+
import LayerInfoWindow from '../components/LayerInfoWindow';
|
|
62
|
+
import LinkFeatureForm from '../components/LinkFeatureForm';
|
|
63
|
+
import MapSelection from '../components/MapSelection';
|
|
64
|
+
import NumericInputWindow from '../components/NumericInputWindow';
|
|
65
|
+
import PickFeature from '../components/PickFeature';
|
|
66
|
+
import PluginsContainer from '../components/PluginsContainer';
|
|
67
|
+
import PrintSelection from '../components/PrintSelection';
|
|
68
|
+
import QtDesignerForm from '../components/QtDesignerForm';
|
|
69
|
+
import ResizeableWindow from '../components/ResizeableWindow';
|
|
70
|
+
import SearchBox from '../components/SearchBox';
|
|
71
|
+
import ServiceInfoWindow from '../components/ServiceInfoWindow';
|
|
72
|
+
import SideBar from '../components/SideBar';
|
|
73
|
+
import { Swipeable } from '../components/Swipeable';
|
|
74
|
+
import TaskBar from '../components/TaskBar';
|
|
75
|
+
import ThemeLayersListWindow from '../components/ThemeLayersListWindow';
|
|
76
|
+
import ThemeList from '../components/ThemeList';
|
|
77
|
+
import Toolbar from '../components/Toolbar';
|
|
78
|
+
import ShareLink from '../components/share/ShareLink';
|
|
79
|
+
import ShareQRCode from '../components/share/ShareQRCode';
|
|
80
|
+
import ShareSocials from '../components/share/ShareSocials';
|
|
81
|
+
import FixedTimeline from '../components/timeline/FixedTimeline';
|
|
82
|
+
import InfiniteTimeline from '../components/timeline/InfiniteTimeline';
|
|
83
|
+
import TimelineFeaturesSlider from '../components/timeline/TimelineFeaturesSlider';
|
|
84
|
+
import AccordeonWidget from '../components/widgets/AccordeonWidget';
|
|
85
|
+
import ButtonBar from '../components/widgets/ButtonBar';
|
|
86
|
+
import ColorButton from '../components/widgets/ColorButton';
|
|
87
|
+
import ComboBox from '../components/widgets/ComboBox';
|
|
88
|
+
import CopyButton from '../components/widgets/CopyButton';
|
|
89
|
+
import DateTimeInput from '../components/widgets/DateTimeInput';
|
|
90
|
+
import EditableSelect from '../components/widgets/EditableSelect';
|
|
91
|
+
import FileSelector from '../components/widgets/FileSelector';
|
|
92
|
+
import Input from '../components/widgets/Input';
|
|
93
|
+
import InputContainer from '../components/widgets/InputContainer';
|
|
94
|
+
import LayerCatalogWidget from '../components/widgets/LayerCatalogWidget';
|
|
95
|
+
import MenuButton from '../components/widgets/MenuButton';
|
|
96
|
+
import ModalDialog from '../components/widgets/ModalDialog';
|
|
97
|
+
import NavBar from '../components/widgets/NavBar';
|
|
98
|
+
import NumberInput from '../components/widgets/NumberInput';
|
|
99
|
+
import PopupMenu from '../components/widgets/PopupMenu';
|
|
100
|
+
import { Image } from '../components/widgets/Primitives';
|
|
101
|
+
import SearchWidget from '../components/widgets/SearchWidget';
|
|
102
|
+
import Spinner from '../components/widgets/Spinner';
|
|
103
|
+
import SuggestionInput from '../components/widgets/SuggestionInput';
|
|
104
|
+
import TextInput from '../components/widgets/TextInput';
|
|
105
|
+
import ToggleSwitch from '../components/widgets/ToggleSwitch';
|
|
106
|
+
import VectorLayerPicker from '../components/widgets/VectorLayerPicker';
|
|
107
|
+
import ConfigUtils from '../utils/ConfigUtils';
|
|
108
|
+
import CoordinatesUtils from '../utils/CoordinatesUtils';
|
|
109
|
+
import EditingInterface from '../utils/EditingInterface';
|
|
110
|
+
import * as EditingUtils from '../utils/EditingUtils';
|
|
111
|
+
import LayerUtils from '../utils/LayerUtils';
|
|
112
|
+
import LocaleUtils from '../utils/LocaleUtils';
|
|
113
|
+
import MapUtils from '../utils/MapUtils';
|
|
114
|
+
import * as PermaLinkUtils from '../utils/PermaLinkUtils';
|
|
115
|
+
import PluginStore from '../utils/PluginStore';
|
|
116
|
+
import { SearchResultType } from '../utils/SearchProviders';
|
|
117
|
+
import ServiceLayerUtils from '../utils/ServiceLayerUtils';
|
|
118
|
+
import VectorLayerUtils from '../utils/VectorLayerUtils';
|
|
119
|
+
|
|
120
|
+
/**
|
|
8
121
|
* Exposes an API for interacting with QWC2 via `window.qwc2`.
|
|
9
122
|
*
|
|
10
123
|
* You can interact with the API as soon as the `QWC2ApiReady` event is dispatched.
|
|
@@ -79,17 +192,41 @@ function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var
|
|
|
79
192
|
* The QWC shared components are acessible via `window.qwc2.components`, i.e. `window.qwc2.components.SideBar`.
|
|
80
193
|
*
|
|
81
194
|
* In addition, the following methods are available on `window.qwc2`:
|
|
82
|
-
*/
|
|
195
|
+
*/
|
|
196
|
+
var API = /*#__PURE__*/function (_React$Component) {
|
|
197
|
+
function API() {
|
|
198
|
+
var _this;
|
|
199
|
+
_classCallCheck(this, API);
|
|
200
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
201
|
+
args[_key] = arguments[_key];
|
|
202
|
+
}
|
|
203
|
+
_this = _callSuper(this, API, [].concat(args));
|
|
204
|
+
/**
|
|
83
205
|
* Add custom plugin
|
|
84
206
|
*
|
|
85
207
|
* * `name`: An identifier
|
|
86
208
|
* * `plugin`: The plugin component class
|
|
87
209
|
* * `translations`: The plugin translation messages: `{"<lang>": {<messages>}, ...}`
|
|
88
|
-
*/
|
|
210
|
+
*/
|
|
211
|
+
_defineProperty(_this, "addPlugin", function (name, plugin) {
|
|
212
|
+
var _plugin$WrappedCompon, _component$availableI;
|
|
213
|
+
var translations = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
214
|
+
var component = (_plugin$WrappedCompon = plugin.WrappedComponent) !== null && _plugin$WrappedCompon !== void 0 ? _plugin$WrappedCompon : plugin;
|
|
215
|
+
var availableIn3D = (_component$availableI = component.availableIn3D) !== null && _component$availableI !== void 0 ? _component$availableI : false;
|
|
216
|
+
PluginStore.addCustomPlugin(name, plugin);
|
|
217
|
+
window.qwc2.addTranslations(translations);
|
|
218
|
+
_this.props.registerCustomPlugin(name, availableIn3D);
|
|
219
|
+
});
|
|
220
|
+
/**
|
|
89
221
|
* Remove custom plugin
|
|
90
222
|
*
|
|
91
223
|
* * `name`: The identifier
|
|
92
|
-
*/
|
|
224
|
+
*/
|
|
225
|
+
_defineProperty(_this, "removePlugin", function (name) {
|
|
226
|
+
PluginStore.removeCustomPlugin(name);
|
|
227
|
+
_this.props.unregisterCustomPlugin(name);
|
|
228
|
+
});
|
|
229
|
+
/**
|
|
93
230
|
* Add custom attribute calculator
|
|
94
231
|
* (i.e. computed attributes which are added to GetFeatureInfo responses).
|
|
95
232
|
*
|
|
@@ -97,11 +234,19 @@ function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var
|
|
|
97
234
|
* * `calcFunc`: The calculator function with signature `function(layer, feature)`
|
|
98
235
|
*
|
|
99
236
|
* The `calcFunc` should return either a two-enty `[name, value]` pair or a one-value `[value]` array.
|
|
100
|
-
*/
|
|
237
|
+
*/
|
|
238
|
+
_defineProperty(_this, "addIdentifyAttributeCalculator", function (name, calcFunc) {
|
|
239
|
+
window.qwc2.__attributeCalculators[name] = calcFunc;
|
|
240
|
+
});
|
|
241
|
+
/**
|
|
101
242
|
* Remove custom identify attribute calculator
|
|
102
243
|
*
|
|
103
244
|
* * `name`: The identifier
|
|
104
|
-
*/
|
|
245
|
+
*/
|
|
246
|
+
_defineProperty(_this, "removeIdentifyAttributeCalculator", function (name) {
|
|
247
|
+
delete window.qwc2.__attributeCalculators[name];
|
|
248
|
+
});
|
|
249
|
+
/**
|
|
105
250
|
* Add custom identify exporter
|
|
106
251
|
*
|
|
107
252
|
* * `name`: An identifier
|
|
@@ -121,11 +266,19 @@ function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var
|
|
|
121
266
|
* }
|
|
122
267
|
* }
|
|
123
268
|
* ```
|
|
124
|
-
*/
|
|
269
|
+
*/
|
|
270
|
+
_defineProperty(_this, "addIdentifyExporter", function (name, exporterConfig) {
|
|
271
|
+
window.qwc2.__identifyExportes[name] = exporterConfig;
|
|
272
|
+
});
|
|
273
|
+
/**
|
|
125
274
|
* Remove identify exporter
|
|
126
275
|
*
|
|
127
276
|
* * `name`: The identifier
|
|
128
|
-
*/
|
|
277
|
+
*/
|
|
278
|
+
_defineProperty(_this, "removeIdentifyExporter", function (name) {
|
|
279
|
+
delete window.qwc2.__identifyExportes[name];
|
|
280
|
+
});
|
|
281
|
+
/**
|
|
129
282
|
* Convenience method for adding an external layer.
|
|
130
283
|
*
|
|
131
284
|
* * `resource`: An external resource of the form `wms:<service_url>#<layername>` or `wmts:<capabilities_url>#<layername>`.
|
|
@@ -133,9 +286,43 @@ function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var
|
|
|
133
286
|
* * `beforeLayerName`: Insert the new layer before the layer with the specified name. If `null` or the layer does not exist, the layer is inserted on top.
|
|
134
287
|
* * `afterLayerName`: Insert the new layer after the layer with the specified name. If `null` or the layer does not exist, the layer is inserted on top.
|
|
135
288
|
* * `sublayers`: Whether to import the sublayer structure (`true`) or just a flat layer (`false`).
|
|
136
|
-
*/
|
|
289
|
+
*/
|
|
290
|
+
_defineProperty(_this, "addExternalLayer", function (resource) {
|
|
291
|
+
var optionsOrBeforeLayerName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
292
|
+
var sublayers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
293
|
+
var options = {};
|
|
294
|
+
if (_typeof(optionsOrBeforeLayerName) !== 'object') {
|
|
295
|
+
options.beforeLayerName = optionsOrBeforeLayerName;
|
|
296
|
+
options.sublayers = sublayers;
|
|
297
|
+
} else {
|
|
298
|
+
options = optionsOrBeforeLayerName;
|
|
299
|
+
}
|
|
300
|
+
var params = LayerUtils.splitLayerUrlParam(resource);
|
|
301
|
+
ServiceLayerUtils.findLayers(params.type, params.url, [params], _this.props.mapCrs, function (id, layer) {
|
|
302
|
+
if (layer) {
|
|
303
|
+
if (sublayers === false) {
|
|
304
|
+
layer.sublayers = null;
|
|
305
|
+
}
|
|
306
|
+
_this.props.addLayer(layer, null, options);
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
});
|
|
310
|
+
/**
|
|
137
311
|
* Deprecated, use `window.qwc2.drawGeometry` instead.
|
|
138
|
-
*/
|
|
312
|
+
*/
|
|
313
|
+
_defineProperty(_this, "drawScratch", function (geomType, message, drawMultiple, callback) {
|
|
314
|
+
var style = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
|
|
315
|
+
/* eslint-disable-next-line */
|
|
316
|
+
console.warn("window.qwc2.drawScratch is deprecated, use window.qwc2.drawGeometry instead");
|
|
317
|
+
_this.props.setCurrentTask("ScratchDrawing", null, null, {
|
|
318
|
+
geomType: geomType,
|
|
319
|
+
message: message,
|
|
320
|
+
drawMultiple: drawMultiple,
|
|
321
|
+
callback: callback,
|
|
322
|
+
style: style
|
|
323
|
+
});
|
|
324
|
+
});
|
|
325
|
+
/**
|
|
139
326
|
* Draw geometries, and return these as GeoJSON to the calling application.
|
|
140
327
|
*
|
|
141
328
|
* * `geomType`: `Point`, `LineString`, `Polygon`, `Circle` or `Box`.
|
|
@@ -147,8 +334,164 @@ function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var
|
|
|
147
334
|
* * `initialFeatures`: Array of initial geometries.
|
|
148
335
|
* * `snapping`: Whether snapping is available while drawing (default: `false`).
|
|
149
336
|
* * `snappingActive`: Whether snapping is initially active (default: `false`)
|
|
150
|
-
*/
|
|
337
|
+
*/
|
|
338
|
+
_defineProperty(_this, "drawGeometry", function (geomType, message, callback) {
|
|
339
|
+
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
340
|
+
_this.props.setCurrentTask("ScratchDrawing", null, null, {
|
|
341
|
+
callback: callback,
|
|
342
|
+
geomType: geomType,
|
|
343
|
+
message: message,
|
|
344
|
+
drawMultiple: options.drawMultiple || false,
|
|
345
|
+
style: options.style,
|
|
346
|
+
snapping: options.snapping || false,
|
|
347
|
+
snappingActive: options.snappingActive || false,
|
|
348
|
+
initialFeatures: options.initialFeatures
|
|
349
|
+
});
|
|
350
|
+
});
|
|
351
|
+
/**
|
|
151
352
|
* Return the current application state.
|
|
152
|
-
*/
|
|
153
|
-
|
|
154
|
-
|
|
353
|
+
*/
|
|
354
|
+
_defineProperty(_this, "getState", function () {
|
|
355
|
+
return _this.props.state;
|
|
356
|
+
});
|
|
357
|
+
return _this;
|
|
358
|
+
}
|
|
359
|
+
_inherits(API, _React$Component);
|
|
360
|
+
return _createClass(API, [{
|
|
361
|
+
key: "componentDidMount",
|
|
362
|
+
value: function componentDidMount() {
|
|
363
|
+
window.qwc2 = {
|
|
364
|
+
__customPlugins: {},
|
|
365
|
+
__attributeCalculators: {},
|
|
366
|
+
__identifyExportes: {}
|
|
367
|
+
};
|
|
368
|
+
// Auto-binded functions
|
|
369
|
+
for (var _i = 0, _Object$keys = Object.keys(this.props); _i < _Object$keys.length; _i++) {
|
|
370
|
+
var prop = _Object$keys[_i];
|
|
371
|
+
window.qwc2[prop] = this.props[prop];
|
|
372
|
+
}
|
|
373
|
+
// Additional exports
|
|
374
|
+
window.qwc2.LayerRole = LayerRole;
|
|
375
|
+
window.qwc2.addPlugin = this.addPlugin;
|
|
376
|
+
window.qwc2.removePlugin = this.removePlugin;
|
|
377
|
+
window.qwc2.addIdentifyAttributeCalculator = this.addIdentifyAttributeCalculator;
|
|
378
|
+
window.qwc2.removeIdentifyAttributeCalculator = this.removeIdentifyAttributeCalculator;
|
|
379
|
+
window.qwc2.addIdentifyExporter = this.addIdentifyExporter;
|
|
380
|
+
window.qwc2.removeIdentifyExporter = this.removeIdentifyExporter;
|
|
381
|
+
window.qwc2.addExternalLayer = this.addExternalLayer;
|
|
382
|
+
window.qwc2.drawScratch = this.drawScratch;
|
|
383
|
+
window.qwc2.drawGeometry = this.drawGeometry;
|
|
384
|
+
window.qwc2.getState = this.getState;
|
|
385
|
+
window.qwc2.ConfigUtils = ConfigUtils;
|
|
386
|
+
window.qwc2.CoordinatesUtils = CoordinatesUtils;
|
|
387
|
+
window.qwc2.EditingInterface = EditingInterface;
|
|
388
|
+
window.qwc2.EditingUtils = EditingUtils;
|
|
389
|
+
window.qwc2.LocaleUtils = LocaleUtils;
|
|
390
|
+
window.qwc2.MapUtils = MapUtils;
|
|
391
|
+
window.qwc2.PermaLinkUtils = PermaLinkUtils;
|
|
392
|
+
window.qwc2.SearchResultType = SearchResultType;
|
|
393
|
+
window.qwc2.VectorLayerUtils = VectorLayerUtils;
|
|
394
|
+
window.qwc2.libs = {};
|
|
395
|
+
window.qwc2.libs.axios = axios;
|
|
396
|
+
window.qwc2.libs.React = React;
|
|
397
|
+
window.qwc2.libs.ReactDOM = ReactDOM;
|
|
398
|
+
window.qwc2.libs.PropTypes = PropTypes;
|
|
399
|
+
window.qwc2.libs.connect = connect;
|
|
400
|
+
window.qwc2.libs.ol = ol;
|
|
401
|
+
window.qwc2.libs.url = url;
|
|
402
|
+
window.qwc2.libs.uuid = uuid;
|
|
403
|
+
window.qwc2.components = {};
|
|
404
|
+
window.qwc2.components.AppMenu = AppMenu;
|
|
405
|
+
window.qwc2.components.AttributeForm = AttributeForm;
|
|
406
|
+
window.qwc2.components.AttributeTableWidget = AttributeTableWidget;
|
|
407
|
+
window.qwc2.components.AutoEditForm = AutoEditForm;
|
|
408
|
+
window.qwc2.components.CoordinateDisplayer = CoordinateDisplayer;
|
|
409
|
+
window.qwc2.components.EditComboField = EditComboField;
|
|
410
|
+
window.qwc2.components.EditUploadField = EditUploadField;
|
|
411
|
+
window.qwc2.components.FullscreenSwitcher = FullscreenSwitcher;
|
|
412
|
+
window.qwc2.components.Icon = Icon;
|
|
413
|
+
window.qwc2.components.IdentifyViewer = IdentifyViewer;
|
|
414
|
+
window.qwc2.components.ImportLayer = ImportLayer;
|
|
415
|
+
window.qwc2.components.InputContainer = InputContainer;
|
|
416
|
+
window.qwc2.components.LayerInfoWindow = LayerInfoWindow;
|
|
417
|
+
window.qwc2.components.LinkFeatureForm = LinkFeatureForm;
|
|
418
|
+
window.qwc2.components.MapSelection = MapSelection;
|
|
419
|
+
window.qwc2.components.ModalDialog = ModalDialog;
|
|
420
|
+
window.qwc2.components.NumericInputWindow = NumericInputWindow;
|
|
421
|
+
window.qwc2.components.PickFeature = PickFeature;
|
|
422
|
+
window.qwc2.components.PluginsContainer = PluginsContainer;
|
|
423
|
+
window.qwc2.components.PopupMenu = PopupMenu;
|
|
424
|
+
window.qwc2.components.PrintSelection = PrintSelection;
|
|
425
|
+
window.qwc2.components.QtDesignerForm = QtDesignerForm;
|
|
426
|
+
window.qwc2.components.ResizeableWindow = ResizeableWindow;
|
|
427
|
+
window.qwc2.components.SearchBox = SearchBox;
|
|
428
|
+
window.qwc2.components.ServiceInfoWindow = ServiceInfoWindow;
|
|
429
|
+
window.qwc2.components.ShareLink = ShareLink;
|
|
430
|
+
window.qwc2.components.ShareQRCode = ShareQRCode;
|
|
431
|
+
window.qwc2.components.ShareSocials = ShareSocials;
|
|
432
|
+
window.qwc2.components.SideBar = SideBar;
|
|
433
|
+
window.qwc2.components.Spinner = Spinner;
|
|
434
|
+
window.qwc2.components.Swipeable = Swipeable;
|
|
435
|
+
window.qwc2.components.TaskBar = TaskBar;
|
|
436
|
+
window.qwc2.components.ThemeLayersListWindow = ThemeLayersListWindow;
|
|
437
|
+
window.qwc2.components.ThemeList = ThemeList;
|
|
438
|
+
window.qwc2.components.FixedTimeline = FixedTimeline;
|
|
439
|
+
window.qwc2.components.InfiniteTimeline = InfiniteTimeline;
|
|
440
|
+
window.qwc2.components.TimelineFeaturesSlider = TimelineFeaturesSlider;
|
|
441
|
+
window.qwc2.components.Toolbar = Toolbar;
|
|
442
|
+
window.qwc2.components.AccordeonWidget = AccordeonWidget;
|
|
443
|
+
window.qwc2.components.ButtonBar = ButtonBar;
|
|
444
|
+
window.qwc2.components.ColorButton = ColorButton;
|
|
445
|
+
window.qwc2.components.ComboBox = ComboBox;
|
|
446
|
+
window.qwc2.components.CopyButton = CopyButton;
|
|
447
|
+
window.qwc2.components.DateTimeInput = DateTimeInput;
|
|
448
|
+
window.qwc2.components.EditableSelect = EditableSelect;
|
|
449
|
+
window.qwc2.components.FileSelector = FileSelector;
|
|
450
|
+
window.qwc2.components.Input = Input;
|
|
451
|
+
window.qwc2.components.LayerCatalogWidget = LayerCatalogWidget;
|
|
452
|
+
window.qwc2.components.MenuButton = MenuButton;
|
|
453
|
+
window.qwc2.components.NavBar = NavBar;
|
|
454
|
+
window.qwc2.components.NumberInput = NumberInput;
|
|
455
|
+
window.qwc2.components.Image = Image;
|
|
456
|
+
window.qwc2.components.SearchWidget = SearchWidget;
|
|
457
|
+
window.qwc2.components.SuggestionInput = SuggestionInput;
|
|
458
|
+
window.qwc2.components.TextInput = TextInput;
|
|
459
|
+
window.qwc2.components.ToggleSwitch = ToggleSwitch;
|
|
460
|
+
window.qwc2.components.VectorLayerPicker = VectorLayerPicker;
|
|
461
|
+
window.dispatchEvent(new Event("QWC2ApiReady"));
|
|
462
|
+
}
|
|
463
|
+
}, {
|
|
464
|
+
key: "render",
|
|
465
|
+
value: function render() {
|
|
466
|
+
return null;
|
|
467
|
+
}
|
|
468
|
+
}]);
|
|
469
|
+
}(React.Component);
|
|
470
|
+
_defineProperty(API, "propTypes", {
|
|
471
|
+
addLayer: PropTypes.func,
|
|
472
|
+
mapCrs: PropTypes.string,
|
|
473
|
+
registerCustomPlugin: PropTypes.func,
|
|
474
|
+
setCurrentTask: PropTypes.func,
|
|
475
|
+
state: PropTypes.object,
|
|
476
|
+
unregisterCustomPlugin: PropTypes.func
|
|
477
|
+
});
|
|
478
|
+
function extractFunctions(obj) {
|
|
479
|
+
return Object.entries(obj).reduce(function (result, _ref) {
|
|
480
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
481
|
+
key = _ref2[0],
|
|
482
|
+
value = _ref2[1];
|
|
483
|
+
if (typeof value === "function") {
|
|
484
|
+
result[key] = value;
|
|
485
|
+
}
|
|
486
|
+
return result;
|
|
487
|
+
}, {});
|
|
488
|
+
}
|
|
489
|
+
export default connect(function (state) {
|
|
490
|
+
return {
|
|
491
|
+
mapCrs: state.map.projection,
|
|
492
|
+
state: state
|
|
493
|
+
};
|
|
494
|
+
}, _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
495
|
+
registerCustomPlugin: registerCustomPlugin,
|
|
496
|
+
unregisterCustomPlugin: unregisterCustomPlugin
|
|
497
|
+
}, extractFunctions(displayActions)), extractFunctions(editingActions)), extractFunctions(layerActions)), extractFunctions(localeActions)), extractFunctions(locateActions)), extractFunctions(mapActions)), extractFunctions(taskActions)), extractFunctions(themeActions)), extractFunctions(windowsActions)))(API);
|
|
@@ -1,10 +1,35 @@
|
|
|
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 _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
3
|
+
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); } }
|
|
4
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
5
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
6
|
+
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); }
|
|
7
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
10
|
+
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); }
|
|
11
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
12
|
+
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; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
|
+
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); }
|
|
15
|
+
/**
|
|
2
16
|
* Copyright 2024 Sourcepole AG
|
|
3
17
|
* All rights reserved.
|
|
4
18
|
*
|
|
5
19
|
* This source code is licensed under the BSD-style license found in the
|
|
6
20
|
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import { connect } from 'react-redux';
|
|
25
|
+
import PropTypes from 'prop-types';
|
|
26
|
+
import { setCurrentTask } from '../actions/task';
|
|
27
|
+
import AttributeTableWidget from '../components/AttributeTableWidget';
|
|
28
|
+
import ResizeableWindow from '../components/ResizeableWindow';
|
|
29
|
+
import EditingInterface from '../utils/EditingInterface';
|
|
30
|
+
import LocaleUtils from '../utils/LocaleUtils';
|
|
31
|
+
|
|
32
|
+
/**
|
|
8
33
|
* Display the attribute table of layers in a dialog.
|
|
9
34
|
*
|
|
10
35
|
* To make a layer available in the attribute table, create a a data resource and matching permissions for it in the `qwc-admin-gui`.
|
|
@@ -13,4 +38,85 @@ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof
|
|
|
13
38
|
*
|
|
14
39
|
* This plugin queries the dataset via the editing service specified by
|
|
15
40
|
* `editServiceUrl` in `config.json` (by default the `qwc-data-service`).
|
|
16
|
-
*/
|
|
41
|
+
*/
|
|
42
|
+
var AttributeTable = /*#__PURE__*/function (_React$Component) {
|
|
43
|
+
function AttributeTable() {
|
|
44
|
+
var _this;
|
|
45
|
+
_classCallCheck(this, AttributeTable);
|
|
46
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
47
|
+
args[_key] = arguments[_key];
|
|
48
|
+
}
|
|
49
|
+
_this = _callSuper(this, AttributeTable, [].concat(args));
|
|
50
|
+
_defineProperty(_this, "onClose", function () {
|
|
51
|
+
if (!_this.props.blocked) {
|
|
52
|
+
_this.props.setCurrentTask(null);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
return _this;
|
|
56
|
+
}
|
|
57
|
+
_inherits(AttributeTable, _React$Component);
|
|
58
|
+
return _createClass(AttributeTable, [{
|
|
59
|
+
key: "render",
|
|
60
|
+
value: function render() {
|
|
61
|
+
var _this$props$taskData;
|
|
62
|
+
if (!this.props.active) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
return /*#__PURE__*/React.createElement(ResizeableWindow, {
|
|
66
|
+
dockable: "bottom",
|
|
67
|
+
icon: "editing",
|
|
68
|
+
initialHeight: 480,
|
|
69
|
+
initialWidth: 800,
|
|
70
|
+
initiallyDocked: true,
|
|
71
|
+
onClose: this.onClose,
|
|
72
|
+
splitScreenWhenDocked: true,
|
|
73
|
+
title: LocaleUtils.tr("attribtable.title")
|
|
74
|
+
}, /*#__PURE__*/React.createElement(AttributeTableWidget, {
|
|
75
|
+
allowAddForGeometryLayers: this.props.allowAddForGeometryLayers,
|
|
76
|
+
iface: this.props.iface,
|
|
77
|
+
initialLayer: (_this$props$taskData = this.props.taskData) === null || _this$props$taskData === void 0 ? void 0 : _this$props$taskData.layer,
|
|
78
|
+
role: "body",
|
|
79
|
+
showEditFormButton: this.props.showEditFormButton,
|
|
80
|
+
showHiddenFields: this.props.showHiddenFields,
|
|
81
|
+
showLimitToExtent: this.props.showLimitToExtent,
|
|
82
|
+
zoomLevel: this.props.zoomLevel
|
|
83
|
+
}));
|
|
84
|
+
}
|
|
85
|
+
}]);
|
|
86
|
+
}(React.Component);
|
|
87
|
+
_defineProperty(AttributeTable, "propTypes", {
|
|
88
|
+
active: PropTypes.bool,
|
|
89
|
+
/** Whether to allow adding records for datasets which have a geometry column. */
|
|
90
|
+
allowAddForGeometryLayers: PropTypes.bool,
|
|
91
|
+
blocked: PropTypes.bool,
|
|
92
|
+
iface: PropTypes.object,
|
|
93
|
+
setCurrentTask: PropTypes.func,
|
|
94
|
+
/** Whether to show a button to open the edit form for selected layer. Requires the Editing plugin to be enabled. */
|
|
95
|
+
showEditFormButton: PropTypes.bool,
|
|
96
|
+
/** Whether to show hidden fields. */
|
|
97
|
+
showHiddenFields: PropTypes.bool,
|
|
98
|
+
/** Whether to show the "Limit to extent" checkbox */
|
|
99
|
+
showLimitToExtent: PropTypes.bool,
|
|
100
|
+
taskData: PropTypes.object,
|
|
101
|
+
/** The zoom level for zooming to point features. */
|
|
102
|
+
zoomLevel: PropTypes.number
|
|
103
|
+
});
|
|
104
|
+
_defineProperty(AttributeTable, "defaultProps", {
|
|
105
|
+
zoomLevel: 1000,
|
|
106
|
+
showEditFormButton: true,
|
|
107
|
+
showHiddenFields: true,
|
|
108
|
+
showLimitToExtent: true
|
|
109
|
+
});
|
|
110
|
+
export default (function () {
|
|
111
|
+
var iface = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : EditingInterface;
|
|
112
|
+
return connect(function (state) {
|
|
113
|
+
return {
|
|
114
|
+
active: state.task.id === "AttributeTable",
|
|
115
|
+
blocked: state.task.id === "AttributeTable" && state.task.blocked,
|
|
116
|
+
iface: iface,
|
|
117
|
+
taskData: state.task.id === "AttributeTable" ? state.task.data : null
|
|
118
|
+
};
|
|
119
|
+
}, {
|
|
120
|
+
setCurrentTask: setCurrentTask
|
|
121
|
+
})(AttributeTable);
|
|
122
|
+
});
|