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
|
@@ -1,10 +1,49 @@
|
|
|
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 _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
5
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
6
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
7
|
+
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; } }
|
|
8
|
+
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; }
|
|
9
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
10
|
+
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); } }
|
|
11
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
12
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
13
|
+
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); }
|
|
14
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
15
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
16
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
17
|
+
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); }
|
|
18
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
19
|
+
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; }
|
|
20
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
21
|
+
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); }
|
|
22
|
+
/**
|
|
2
23
|
* Copyright 2018-2024 Sourcepole AG
|
|
3
24
|
* All rights reserved.
|
|
4
25
|
*
|
|
5
26
|
* This source code is licensed under the BSD-style license found in the
|
|
6
27
|
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
import React from 'react';
|
|
31
|
+
import ReactDOM from 'react-dom';
|
|
32
|
+
import { connect } from 'react-redux';
|
|
33
|
+
import axios from 'axios';
|
|
34
|
+
import PropTypes from 'prop-types';
|
|
35
|
+
import { setCurrentTask } from '../actions/task';
|
|
36
|
+
import Icon from '../components/Icon';
|
|
37
|
+
import { MapContainerPortalContext } from '../components/PluginsContainer';
|
|
38
|
+
import CopyButton from '../components/widgets/CopyButton';
|
|
39
|
+
import ConfigUtils from '../utils/ConfigUtils';
|
|
40
|
+
import CoordinatesUtils from '../utils/CoordinatesUtils';
|
|
41
|
+
import { getElevationInterface } from '../utils/ElevationInterface';
|
|
42
|
+
import LocaleUtils from '../utils/LocaleUtils';
|
|
43
|
+
import MapUtils from '../utils/MapUtils';
|
|
44
|
+
import './style/MapInfoTooltip.css';
|
|
45
|
+
|
|
46
|
+
/**
|
|
8
47
|
* Provides map context information when right-clicking on the map.
|
|
9
48
|
*
|
|
10
49
|
* Displays the coordinates at the picked position by default.
|
|
@@ -31,4 +70,239 @@ function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof
|
|
|
31
70
|
* render() { return ...; }
|
|
32
71
|
* };
|
|
33
72
|
* ```
|
|
34
|
-
*/
|
|
73
|
+
*/
|
|
74
|
+
var MapInfoTooltip = /*#__PURE__*/function (_React$Component) {
|
|
75
|
+
function MapInfoTooltip() {
|
|
76
|
+
var _this;
|
|
77
|
+
_classCallCheck(this, MapInfoTooltip);
|
|
78
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
79
|
+
args[_key] = arguments[_key];
|
|
80
|
+
}
|
|
81
|
+
_this = _callSuper(this, MapInfoTooltip, [].concat(args));
|
|
82
|
+
_defineProperty(_this, "state", {
|
|
83
|
+
point: null,
|
|
84
|
+
elevation: null,
|
|
85
|
+
extraInfo: null
|
|
86
|
+
});
|
|
87
|
+
_defineProperty(_this, "clear", function () {
|
|
88
|
+
_this.setState({
|
|
89
|
+
point: null,
|
|
90
|
+
elevation: null,
|
|
91
|
+
extraInfo: null
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
return _this;
|
|
95
|
+
}
|
|
96
|
+
_inherits(MapInfoTooltip, _React$Component);
|
|
97
|
+
return _createClass(MapInfoTooltip, [{
|
|
98
|
+
key: "componentDidUpdate",
|
|
99
|
+
value: function componentDidUpdate(prevProps) {
|
|
100
|
+
var _this2 = this;
|
|
101
|
+
if (!this.props.enabled && this.state.point) {
|
|
102
|
+
this.clear();
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
var newPoint = this.props.map.click;
|
|
106
|
+
if (!newPoint || newPoint.button !== 2) {
|
|
107
|
+
if (this.state.point) {
|
|
108
|
+
this.clear();
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
var oldPoint = prevProps.map.click;
|
|
112
|
+
if (!oldPoint || oldPoint.pixel[0] !== newPoint.pixel[0] || oldPoint.pixel[1] !== newPoint.pixel[1]) {
|
|
113
|
+
this.setState({
|
|
114
|
+
point: newPoint,
|
|
115
|
+
elevation: null,
|
|
116
|
+
extraInfo: null
|
|
117
|
+
});
|
|
118
|
+
var pos = newPoint.coordinate;
|
|
119
|
+
var crs = this.props.map.projection;
|
|
120
|
+
getElevationInterface().getElevation(pos, crs).then(function (elevation) {
|
|
121
|
+
_this2.setState({
|
|
122
|
+
elevation: elevation
|
|
123
|
+
});
|
|
124
|
+
})["catch"](function () {});
|
|
125
|
+
var mapInfoService = ConfigUtils.getConfigProp("mapInfoService");
|
|
126
|
+
if (mapInfoService) {
|
|
127
|
+
axios.get(mapInfoService, {
|
|
128
|
+
params: {
|
|
129
|
+
pos: pos.join(","),
|
|
130
|
+
crs: crs
|
|
131
|
+
}
|
|
132
|
+
}).then(function (response) {
|
|
133
|
+
_this2.setState({
|
|
134
|
+
extraInfo: response.data.results
|
|
135
|
+
});
|
|
136
|
+
})["catch"](function () {});
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}, {
|
|
142
|
+
key: "render",
|
|
143
|
+
value: function render() {
|
|
144
|
+
var _this3 = this;
|
|
145
|
+
if (!this.state.point) {
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
var info = [];
|
|
149
|
+
var projections = [this.props.map.displayCrs];
|
|
150
|
+
if (!projections.includes(this.props.map.projection)) {
|
|
151
|
+
projections.push(this.props.map.projection);
|
|
152
|
+
}
|
|
153
|
+
if (this.props.includeWGS84 && !projections.includes("EPSG:4326")) {
|
|
154
|
+
projections.push("EPSG:4326");
|
|
155
|
+
}
|
|
156
|
+
projections.map(function (crs) {
|
|
157
|
+
var coo = CoordinatesUtils.getFormattedCoordinate(_this3.state.point.coordinate, _this3.props.map.projection, crs);
|
|
158
|
+
info.push([(CoordinatesUtils.getAvailableCRS()[crs] || {
|
|
159
|
+
label: crs
|
|
160
|
+
}).label, coo]);
|
|
161
|
+
});
|
|
162
|
+
if (this.state.elevation !== undefined && this.state.elevation !== null) {
|
|
163
|
+
var elevs = this.state.elevation.list;
|
|
164
|
+
if (!elevs) {
|
|
165
|
+
elevs = [{
|
|
166
|
+
elevation: this.state.elevation,
|
|
167
|
+
dataset: null
|
|
168
|
+
}];
|
|
169
|
+
}
|
|
170
|
+
var _iterator = _createForOfIteratorHelper(elevs),
|
|
171
|
+
_step;
|
|
172
|
+
try {
|
|
173
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
174
|
+
var data = _step.value;
|
|
175
|
+
info.push([LocaleUtils.tr("mapinfotooltip.elevation") + (data.dataset ? " (" + data.dataset + ")" : ""), data.elevation.toFixed(this.props.elevationPrecision) + " m"]);
|
|
176
|
+
}
|
|
177
|
+
} catch (err) {
|
|
178
|
+
_iterator.e(err);
|
|
179
|
+
} finally {
|
|
180
|
+
_iterator.f();
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (this.state.extraInfo) {
|
|
184
|
+
info.push.apply(info, _toConsumableArray(this.state.extraInfo));
|
|
185
|
+
}
|
|
186
|
+
var title = LocaleUtils.tr("mapinfotooltip.title");
|
|
187
|
+
var pixel = MapUtils.getHook(MapUtils.GET_PIXEL_FROM_COORDINATES_HOOK)(this.state.point.coordinate);
|
|
188
|
+
var style = {
|
|
189
|
+
left: pixel[0] + "px",
|
|
190
|
+
top: pixel[1] + "px"
|
|
191
|
+
};
|
|
192
|
+
var text = info.map(function (entry) {
|
|
193
|
+
return entry.join(": ");
|
|
194
|
+
}).join("\n");
|
|
195
|
+
var routingButtons = null;
|
|
196
|
+
if (ConfigUtils.havePlugin("Routing")) {
|
|
197
|
+
var prec = CoordinatesUtils.getPrecision(this.props.map.displayCrs);
|
|
198
|
+
var pos = CoordinatesUtils.reproject(this.state.point.coordinate, this.props.map.projection, this.props.map.displayCrs);
|
|
199
|
+
var point = {
|
|
200
|
+
text: pos.map(function (x) {
|
|
201
|
+
return x.toFixed(prec);
|
|
202
|
+
}).join(", ") + " (" + this.props.map.displayCrs + ")",
|
|
203
|
+
pos: _toConsumableArray(pos),
|
|
204
|
+
crs: this.props.map.displayCrs
|
|
205
|
+
};
|
|
206
|
+
routingButtons = /*#__PURE__*/React.createElement("table", {
|
|
207
|
+
className: "mapinfotooltip-body-routing"
|
|
208
|
+
}, /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("b", null, LocaleUtils.tr("routing.route"), ":")), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("div", {
|
|
209
|
+
className: "controlgroup"
|
|
210
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
211
|
+
className: "button",
|
|
212
|
+
onClick: function onClick() {
|
|
213
|
+
return _this3.props.setCurrentTask("Routing", null, null, {
|
|
214
|
+
from: point
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
}, LocaleUtils.tr("routing.fromhere")), /*#__PURE__*/React.createElement("button", {
|
|
218
|
+
className: "button",
|
|
219
|
+
onClick: function onClick() {
|
|
220
|
+
return _this3.props.setCurrentTask("Routing", null, null, {
|
|
221
|
+
to: point
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
}, LocaleUtils.tr("routing.tohere")), /*#__PURE__*/React.createElement("button", {
|
|
225
|
+
className: "button",
|
|
226
|
+
onClick: function onClick() {
|
|
227
|
+
return _this3.props.setCurrentTask("Routing", null, null, {
|
|
228
|
+
via: point
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
}, LocaleUtils.tr("routing.addviapoint"))))), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("b", null, LocaleUtils.tr("routing.reachability"), ":")), /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("div", {
|
|
232
|
+
className: "controlgroup"
|
|
233
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
234
|
+
className: "button",
|
|
235
|
+
onClick: function onClick() {
|
|
236
|
+
return _this3.props.setCurrentTask("Routing", null, null, {
|
|
237
|
+
isocenter: point
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
}, LocaleUtils.tr("routing.isocenter")), /*#__PURE__*/React.createElement("button", {
|
|
241
|
+
className: "button",
|
|
242
|
+
onClick: function onClick() {
|
|
243
|
+
return _this3.props.setCurrentTask("Routing", null, null, {
|
|
244
|
+
isoextracenter: point
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}, LocaleUtils.tr("routing.isoextracenter")))))));
|
|
248
|
+
}
|
|
249
|
+
return /*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/React.createElement("div", {
|
|
250
|
+
className: "mapinfotooltip",
|
|
251
|
+
style: style
|
|
252
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
253
|
+
className: "mapinfotooltip-window"
|
|
254
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
255
|
+
className: "mapinfotooltip-titlebar"
|
|
256
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
257
|
+
className: "mapinfotooltip-title"
|
|
258
|
+
}, title), /*#__PURE__*/React.createElement(CopyButton, {
|
|
259
|
+
buttonClass: "mapinfotooltip-button",
|
|
260
|
+
text: text
|
|
261
|
+
}), /*#__PURE__*/React.createElement(Icon, {
|
|
262
|
+
className: "mapinfotooltip-button",
|
|
263
|
+
icon: "remove",
|
|
264
|
+
onClick: this.clear
|
|
265
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
266
|
+
className: "mapinfotooltip-body"
|
|
267
|
+
}, /*#__PURE__*/React.createElement("table", null, /*#__PURE__*/React.createElement("tbody", null, info.map(function (entry, index) {
|
|
268
|
+
return /*#__PURE__*/React.createElement("tr", {
|
|
269
|
+
key: "row" + index
|
|
270
|
+
}, /*#__PURE__*/React.createElement("td", null, /*#__PURE__*/React.createElement("b", null, entry[0], ":")), /*#__PURE__*/React.createElement("td", null, entry[1]));
|
|
271
|
+
}))), routingButtons, this.props.plugins.map(function (Plugin, idx) {
|
|
272
|
+
return /*#__PURE__*/React.createElement(Plugin, {
|
|
273
|
+
closePopup: _this3.clear,
|
|
274
|
+
key: idx,
|
|
275
|
+
point: _this3.state.point,
|
|
276
|
+
projection: _this3.props.map.projection
|
|
277
|
+
});
|
|
278
|
+
})))), this.context);
|
|
279
|
+
}
|
|
280
|
+
}]);
|
|
281
|
+
}(React.Component);
|
|
282
|
+
_defineProperty(MapInfoTooltip, "contextType", MapContainerPortalContext);
|
|
283
|
+
_defineProperty(MapInfoTooltip, "propTypes", {
|
|
284
|
+
/** The number of decimal places to display for elevation values. */
|
|
285
|
+
elevationPrecision: PropTypes.number,
|
|
286
|
+
enabled: PropTypes.bool,
|
|
287
|
+
includeWGS84: PropTypes.bool,
|
|
288
|
+
map: PropTypes.object,
|
|
289
|
+
/** Additional plugin components for the map info tooltip. */
|
|
290
|
+
plugins: PropTypes.array,
|
|
291
|
+
setCurrentTask: PropTypes.func
|
|
292
|
+
});
|
|
293
|
+
_defineProperty(MapInfoTooltip, "defaultProps", {
|
|
294
|
+
elevationPrecision: 0,
|
|
295
|
+
includeWGS84: true,
|
|
296
|
+
plugins: []
|
|
297
|
+
});
|
|
298
|
+
export default (function (plugins) {
|
|
299
|
+
return connect(function (state) {
|
|
300
|
+
return {
|
|
301
|
+
enabled: state.task.identifyEnabled,
|
|
302
|
+
map: state.map,
|
|
303
|
+
plugins: plugins
|
|
304
|
+
};
|
|
305
|
+
}, {
|
|
306
|
+
setCurrentTask: setCurrentTask
|
|
307
|
+
})(MapInfoTooltip);
|
|
308
|
+
});
|
package/plugins/MapLegend.js
CHANGED
|
@@ -1,14 +1,263 @@
|
|
|
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 isEmpty from 'lodash.isempty';
|
|
26
|
+
import PropTypes from 'prop-types';
|
|
27
|
+
import { setCurrentTask } from '../actions/task';
|
|
28
|
+
import ResizeableWindow from '../components/ResizeableWindow';
|
|
29
|
+
import { Image } from '../components/widgets/Primitives';
|
|
30
|
+
import LayerUtils from '../utils/LayerUtils';
|
|
31
|
+
import LocaleUtils from '../utils/LocaleUtils';
|
|
32
|
+
import MapUtils from '../utils/MapUtils';
|
|
33
|
+
import './style/MapLegend.css';
|
|
34
|
+
|
|
35
|
+
/**
|
|
8
36
|
* Displays the map legend in a floating dialog.
|
|
9
37
|
*
|
|
10
38
|
* The user can toggle whether to display only layers which are enabled, visible in the current extent and/or visible at the current scale.
|
|
11
39
|
*
|
|
12
40
|
* See https://docs.qgis.org/3.28/en/docs/server_manual/services/wms.html#wms-getlegendgraphic for supported extra legend params.
|
|
13
|
-
*/
|
|
14
|
-
|
|
41
|
+
*/
|
|
42
|
+
var MapLegend = /*#__PURE__*/function (_React$Component) {
|
|
43
|
+
function MapLegend(props) {
|
|
44
|
+
var _this;
|
|
45
|
+
_classCallCheck(this, MapLegend);
|
|
46
|
+
_this = _callSuper(this, MapLegend, [props]);
|
|
47
|
+
_defineProperty(_this, "state", {
|
|
48
|
+
onlyVisibleLegend: false,
|
|
49
|
+
bboxDependentLegend: false,
|
|
50
|
+
scaleDependentLegend: false,
|
|
51
|
+
visible: false
|
|
52
|
+
});
|
|
53
|
+
_defineProperty(_this, "onClose", function () {
|
|
54
|
+
_this.setState({
|
|
55
|
+
visible: false
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
_defineProperty(_this, "printLayerLegend", function (layer, sublayer, mapScale) {
|
|
59
|
+
var isCategorized = (sublayer.sublayers || []).find(function (entry) {
|
|
60
|
+
return entry.category_sublayer === true;
|
|
61
|
+
});
|
|
62
|
+
if (_this.props.excludeLayers.includes(sublayer.name)) {
|
|
63
|
+
return null;
|
|
64
|
+
} else if (sublayer.sublayers && !isCategorized && (!_this.state.onlyVisibleLegend || sublayer.visibility)) {
|
|
65
|
+
if (_this.props.addGroupTitles) {
|
|
66
|
+
var children = sublayer.sublayers.map(function (subsublayer) {
|
|
67
|
+
return _this.printLayerLegend(layer, subsublayer, mapScale);
|
|
68
|
+
}).filter(function (x) {
|
|
69
|
+
return x;
|
|
70
|
+
});
|
|
71
|
+
if (isEmpty(children)) {
|
|
72
|
+
return null;
|
|
73
|
+
} else {
|
|
74
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
75
|
+
className: "map-legend-group",
|
|
76
|
+
key: sublayer.name
|
|
77
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
78
|
+
className: "map-legend-group-title"
|
|
79
|
+
}, sublayer.title || sublayer.name), /*#__PURE__*/React.createElement("div", {
|
|
80
|
+
className: "map-legend-group-entries"
|
|
81
|
+
}, sublayer.sublayers.map(function (subsublayer) {
|
|
82
|
+
return _this.printLayerLegend(layer, subsublayer, mapScale);
|
|
83
|
+
})));
|
|
84
|
+
}
|
|
85
|
+
} else {
|
|
86
|
+
return sublayer.sublayers.map(function (subsublayer) {
|
|
87
|
+
return _this.printLayerLegend(layer, subsublayer, mapScale);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
} else {
|
|
91
|
+
if (_this.state.onlyVisibleLegend && !sublayer.visibility) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
if ((_this.state.onlyVisibleLegend || _this.state.scaleDependentLegend) && !LayerUtils.layerScaleInRange(sublayer, mapScale)) {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
var request = LayerUtils.getLegendUrl(layer, sublayer, mapScale, _this.props.map, _this.state.bboxDependentLegend, _this.state.scaleDependentLegend, _this.props.extraLegendParameters);
|
|
98
|
+
return request ? /*#__PURE__*/React.createElement("div", {
|
|
99
|
+
className: "map-legend-legend-entry",
|
|
100
|
+
key: sublayer.name
|
|
101
|
+
}, /*#__PURE__*/React.createElement("div", null, _this.props.addLayerTitles && !sublayer.category_sublayer ? /*#__PURE__*/React.createElement("div", {
|
|
102
|
+
className: "map-legend-entry-title"
|
|
103
|
+
}, sublayer.title || sublayer.name) : null, /*#__PURE__*/React.createElement("div", {
|
|
104
|
+
className: "map-legend-entry-image"
|
|
105
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
106
|
+
src: request
|
|
107
|
+
})))) : null;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
_this.state.onlyVisibleLegend = props.onlyVisibleLegend;
|
|
111
|
+
_this.state.bboxDependentLegend = props.bboxDependentLegend;
|
|
112
|
+
_this.state.scaleDependentLegend = props.scaleDependentLegend;
|
|
113
|
+
return _this;
|
|
114
|
+
}
|
|
115
|
+
_inherits(MapLegend, _React$Component);
|
|
116
|
+
return _createClass(MapLegend, [{
|
|
117
|
+
key: "componentDidUpdate",
|
|
118
|
+
value: function componentDidUpdate(prevProps) {
|
|
119
|
+
if (this.props.active && !prevProps.active) {
|
|
120
|
+
this.setState({
|
|
121
|
+
visible: true
|
|
122
|
+
});
|
|
123
|
+
// Clear task immediately, visibility is stored as state
|
|
124
|
+
this.props.setCurrentTask(null);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}, {
|
|
128
|
+
key: "render",
|
|
129
|
+
value: function render() {
|
|
130
|
+
var _this2 = this;
|
|
131
|
+
if (!this.state.visible && !this.props.lockedWindow) {
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
var mapScale = MapUtils.computeForZoom(this.props.map.scales, this.props.map.zoom);
|
|
135
|
+
var extraControls = [{
|
|
136
|
+
icon: "eye",
|
|
137
|
+
callback: function callback() {
|
|
138
|
+
return _this2.setState(function (state) {
|
|
139
|
+
return {
|
|
140
|
+
onlyVisibleLegend: !state.onlyVisibleLegend
|
|
141
|
+
};
|
|
142
|
+
});
|
|
143
|
+
},
|
|
144
|
+
active: this.state.onlyVisibleLegend,
|
|
145
|
+
title: LocaleUtils.tr("maplegend.onlyvisible")
|
|
146
|
+
}, {
|
|
147
|
+
icon: "box",
|
|
148
|
+
callback: function callback() {
|
|
149
|
+
return _this2.setState(function (state) {
|
|
150
|
+
return {
|
|
151
|
+
bboxDependentLegend: !state.bboxDependentLegend
|
|
152
|
+
};
|
|
153
|
+
});
|
|
154
|
+
},
|
|
155
|
+
active: this.state.bboxDependentLegend,
|
|
156
|
+
title: LocaleUtils.tr("maplegend.bboxdependent")
|
|
157
|
+
}, {
|
|
158
|
+
icon: "scale",
|
|
159
|
+
callback: function callback() {
|
|
160
|
+
return _this2.setState(function (state) {
|
|
161
|
+
return {
|
|
162
|
+
scaleDependentLegend: !state.scaleDependentLegend
|
|
163
|
+
};
|
|
164
|
+
});
|
|
165
|
+
},
|
|
166
|
+
active: this.state.scaleDependentLegend,
|
|
167
|
+
title: LocaleUtils.tr("maplegend.scaledependent")
|
|
168
|
+
}];
|
|
169
|
+
return /*#__PURE__*/React.createElement(ResizeableWindow, {
|
|
170
|
+
dockable: this.props.lockedWindow ? false : this.props.geometry.side,
|
|
171
|
+
extraControls: extraControls,
|
|
172
|
+
icon: "list-alt",
|
|
173
|
+
initialHeight: this.props.geometry.initialHeight,
|
|
174
|
+
initialWidth: this.props.geometry.initialWidth,
|
|
175
|
+
initialX: this.props.geometry.initialX,
|
|
176
|
+
initialY: this.props.geometry.initialY,
|
|
177
|
+
initiallyDocked: this.props.geometry.initiallyDocked,
|
|
178
|
+
maximizeable: false,
|
|
179
|
+
onClose: this.props.lockedWindow ? null : this.onClose,
|
|
180
|
+
title: LocaleUtils.tr("maplegend.windowtitle")
|
|
181
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
182
|
+
className: "map-legend",
|
|
183
|
+
role: "body"
|
|
184
|
+
}, this.props.layers.map(function (layer) {
|
|
185
|
+
if (_this2.state.onlyVisibleLegend && !layer.visibility) {
|
|
186
|
+
return null;
|
|
187
|
+
} else if (layer.legendUrl) {
|
|
188
|
+
return _this2.printLayerLegend(layer, layer, mapScale);
|
|
189
|
+
} else if (layer.color) {
|
|
190
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
191
|
+
className: "map-legend-legend-entry",
|
|
192
|
+
key: layer.name
|
|
193
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
194
|
+
className: "map-legend-color-box",
|
|
195
|
+
style: {
|
|
196
|
+
backgroundColor: layer.color
|
|
197
|
+
}
|
|
198
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
199
|
+
className: "map-legend-entry-title"
|
|
200
|
+
}, layer.title || layer.name));
|
|
201
|
+
} else {
|
|
202
|
+
return null;
|
|
203
|
+
}
|
|
204
|
+
})));
|
|
205
|
+
}
|
|
206
|
+
}]);
|
|
207
|
+
}(React.Component);
|
|
208
|
+
_defineProperty(MapLegend, "propTypes", {
|
|
209
|
+
active: PropTypes.bool,
|
|
210
|
+
/** Whether to add group titles to the legend. */
|
|
211
|
+
addGroupTitles: PropTypes.bool,
|
|
212
|
+
/** Whether to add layer titles to the legend. Note that often the legend image itself already contains the layer title. */
|
|
213
|
+
addLayerTitles: PropTypes.bool,
|
|
214
|
+
/** Whether to display a BBOX-dependent legend by default. */
|
|
215
|
+
bboxDependentLegend: PropTypes.bool,
|
|
216
|
+
/** List of layernames to exclude from the legend. */
|
|
217
|
+
excludeLayers: PropTypes.array,
|
|
218
|
+
/** Extra parameters to add to the GetLegendGraphics request. */
|
|
219
|
+
extraLegendParameters: PropTypes.string,
|
|
220
|
+
/** Default window geometry with size, position and docking status. A locked window is not closeable and not resizeable. Positive position values (including '0') are related to top (InitialY) and left (InitialX), negative values (including '-0') to bottom (InitialY) and right (InitialX). */
|
|
221
|
+
geometry: PropTypes.shape({
|
|
222
|
+
initialWidth: PropTypes.number,
|
|
223
|
+
initialHeight: PropTypes.number,
|
|
224
|
+
initialX: PropTypes.number,
|
|
225
|
+
initialY: PropTypes.number,
|
|
226
|
+
initiallyDocked: PropTypes.bool,
|
|
227
|
+
side: PropTypes.string
|
|
228
|
+
}),
|
|
229
|
+
layers: PropTypes.array,
|
|
230
|
+
/** Whether the legend window is locked (always visible, not moveable or closeable). Set position and size via `geometry`. */
|
|
231
|
+
lockedWindow: PropTypes.bool,
|
|
232
|
+
map: PropTypes.object,
|
|
233
|
+
/** Whether to only include enabled layers in the legend by default. */
|
|
234
|
+
onlyVisibleLegend: PropTypes.bool,
|
|
235
|
+
/** Whether to display a scale-dependent legend by default. */
|
|
236
|
+
scaleDependentLegend: PropTypes.bool,
|
|
237
|
+
setCurrentTask: PropTypes.func
|
|
238
|
+
});
|
|
239
|
+
_defineProperty(MapLegend, "defaultProps", {
|
|
240
|
+
addGroupTitles: false,
|
|
241
|
+
addLayerTitles: false,
|
|
242
|
+
bboxDependentLegend: false,
|
|
243
|
+
excludeLayers: [],
|
|
244
|
+
onlyVisibleLegend: false,
|
|
245
|
+
scaleDependentLegend: false,
|
|
246
|
+
geometry: {
|
|
247
|
+
initialWidth: 320,
|
|
248
|
+
initialHeight: 320,
|
|
249
|
+
initialX: 0,
|
|
250
|
+
initialY: 0,
|
|
251
|
+
initiallyDocked: false,
|
|
252
|
+
side: 'left'
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
export default connect(function (state) {
|
|
256
|
+
return {
|
|
257
|
+
active: state.task.id === "MapLegend",
|
|
258
|
+
layers: state.layers.flat,
|
|
259
|
+
map: state.map
|
|
260
|
+
};
|
|
261
|
+
}, {
|
|
262
|
+
setCurrentTask: setCurrentTask
|
|
263
|
+
})(MapLegend);
|