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
package/utils/FeatureStyles.js
CHANGED
|
@@ -1,10 +1,434 @@
|
|
|
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
|
|
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 _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; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
+
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); }
|
|
7
|
+
/**
|
|
2
8
|
* Copyright 2017-2024 Sourcepole AG
|
|
3
9
|
* All rights reserved.
|
|
4
10
|
*
|
|
5
11
|
* This source code is licensed under the BSD-style license found in the
|
|
6
12
|
* LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import ol from 'openlayers';
|
|
16
|
+
import minus from '../icons/minus.svg';
|
|
17
|
+
import plus from '../icons/plus.svg';
|
|
18
|
+
import ConfigUtils from './ConfigUtils';
|
|
19
|
+
import ResourceRegistry from './ResourceRegistry';
|
|
20
|
+
import arrowhead from './img/arrowhead.svg';
|
|
21
|
+
import markerIcon from './img/marker-icon.png';
|
|
22
|
+
import measurehead from './img/measurehead.svg';
|
|
23
|
+
ResourceRegistry.addResource('arrowhead', arrowhead);
|
|
24
|
+
ResourceRegistry.addResource('measurehead', measurehead);
|
|
25
|
+
ResourceRegistry.addResource('marker', markerIcon);
|
|
26
|
+
ResourceRegistry.addResource('minus', minus);
|
|
27
|
+
ResourceRegistry.addResource('plus', plus);
|
|
28
|
+
var DEFAULT_FEATURE_STYLE = {
|
|
29
|
+
strokeColor: [0, 0, 255, 1],
|
|
30
|
+
strokeWidth: 1,
|
|
31
|
+
strokeDash: [4],
|
|
32
|
+
fillColor: [255, 0, 255, 0.33],
|
|
33
|
+
circleRadius: 10,
|
|
34
|
+
textFill: "black",
|
|
35
|
+
textStroke: "white",
|
|
36
|
+
textFont: "11pt sans-serif"
|
|
37
|
+
};
|
|
38
|
+
var DEFAULT_MARKER_STYLE = {
|
|
39
|
+
iconAnchor: [0.5, 1],
|
|
40
|
+
opacity: 1,
|
|
41
|
+
iconSrc: markerIcon,
|
|
42
|
+
color: undefined,
|
|
43
|
+
scale: undefined,
|
|
44
|
+
crossOrigin: undefined,
|
|
45
|
+
textColor: '#000000',
|
|
46
|
+
textStroke: '#FFFFFF'
|
|
47
|
+
};
|
|
48
|
+
var DEFAULT_INTERACTION_STYLE = {
|
|
49
|
+
fillColor: [255, 0, 0, 0.5],
|
|
50
|
+
strokeColor: "red",
|
|
51
|
+
strokeWidth: 1.5,
|
|
52
|
+
vertexFillColor: "white",
|
|
53
|
+
vertexStrokeColor: "red",
|
|
54
|
+
snapFillColor: [255, 255, 255, 0.05],
|
|
55
|
+
snapStrokeColor: '#3399CC',
|
|
56
|
+
snapStrokeWidth: 1,
|
|
57
|
+
snapVertexFillColor: [255, 255, 255, 0.05],
|
|
58
|
+
snapVertexStrokeColor: '#3399CC',
|
|
59
|
+
measureFillColor: [255, 0, 0, 0.25],
|
|
60
|
+
measureStrokeColor: "red",
|
|
61
|
+
measureStrokeWidth: 4,
|
|
62
|
+
measureVertexFillColor: "white",
|
|
63
|
+
measureVertexStrokeColor: "red",
|
|
64
|
+
measureVertexStrokeWidth: 2,
|
|
65
|
+
measurePointRadius: 6,
|
|
66
|
+
sketchPointFillColor: "#0099FF",
|
|
67
|
+
sketchPointStrokeColor: "white",
|
|
68
|
+
sketchPointRadius: 6,
|
|
69
|
+
printStrokeColor: '#3399CC',
|
|
70
|
+
printStrokeWidth: 3,
|
|
71
|
+
printVertexColor: '#FFFFFF',
|
|
72
|
+
printVertexRadius: 6,
|
|
73
|
+
printBackgroundColor: [0, 0, 0, 0.5]
|
|
74
|
+
};
|
|
75
|
+
export var END_MARKERS = {
|
|
76
|
+
OUTARROW: {
|
|
77
|
+
src: arrowhead,
|
|
78
|
+
anchor: [0.05, 0.5],
|
|
79
|
+
baserotation: 0
|
|
80
|
+
},
|
|
81
|
+
INARROW: {
|
|
82
|
+
src: arrowhead,
|
|
83
|
+
anchor: [0.05, 0.5],
|
|
84
|
+
baserotation: 180
|
|
85
|
+
},
|
|
86
|
+
LINE: {
|
|
87
|
+
src: measurehead,
|
|
88
|
+
anchor: [0.05, 0.5],
|
|
89
|
+
baserotation: 0
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
export function computeFeatureStyle(layer, feature) {
|
|
93
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, DEFAULT_FEATURE_STYLE), ConfigUtils.getConfigProp("defaultFeatureStyle")), layer.styleOptions), feature.styleOptions);
|
|
94
|
+
}
|
|
95
|
+
var defaultStyle = function defaultStyle(feature, options) {
|
|
96
|
+
var opts = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_FEATURE_STYLE), ConfigUtils.getConfigProp("defaultFeatureStyle")), options);
|
|
97
|
+
var styles = [];
|
|
98
|
+
styles.push(new ol.style.Style({
|
|
99
|
+
fill: new ol.style.Fill({
|
|
100
|
+
color: opts.fillColor
|
|
101
|
+
}),
|
|
102
|
+
stroke: new ol.style.Stroke({
|
|
103
|
+
color: opts.strokeColor,
|
|
104
|
+
width: opts.strokeWidth,
|
|
105
|
+
lineDash: opts.strokeDash
|
|
106
|
+
}),
|
|
107
|
+
image: opts.circleRadius > 0 ? new ol.style.Circle({
|
|
108
|
+
radius: opts.circleRadius,
|
|
109
|
+
fill: new ol.style.Fill({
|
|
110
|
+
color: opts.fillColor
|
|
111
|
+
}),
|
|
112
|
+
stroke: new ol.style.Stroke({
|
|
113
|
+
color: opts.strokeColor,
|
|
114
|
+
width: opts.strokeWidth
|
|
115
|
+
})
|
|
116
|
+
}) : null
|
|
117
|
+
}));
|
|
118
|
+
if (feature.getProperties().label) {
|
|
119
|
+
styles.push(new ol.style.Style({
|
|
120
|
+
geometry: function geometry(f) {
|
|
121
|
+
if (f.getGeometry().getType().startsWith("Multi")) {
|
|
122
|
+
// Only label middle point
|
|
123
|
+
var extent = f.getGeometry().getExtent();
|
|
124
|
+
return new ol.geom.Point(f.getGeometry().getClosestPoint(ol.extent.getCenter(extent)));
|
|
125
|
+
}
|
|
126
|
+
return f.getGeometry();
|
|
127
|
+
},
|
|
128
|
+
text: new ol.style.Text({
|
|
129
|
+
font: opts.textFont || '11pt sans-serif',
|
|
130
|
+
text: feature.getProperties().label || "",
|
|
131
|
+
overflow: true,
|
|
132
|
+
fill: new ol.style.Fill({
|
|
133
|
+
color: opts.textFill
|
|
134
|
+
}),
|
|
135
|
+
stroke: new ol.style.Stroke({
|
|
136
|
+
color: opts.textStroke,
|
|
137
|
+
width: 3
|
|
138
|
+
}),
|
|
139
|
+
textAlign: feature.getGeometry().getType() === "Point" ? 'left' : 'center',
|
|
140
|
+
textBaseline: feature.getGeometry().getType() === "Point" ? 'bottom' : 'middle',
|
|
141
|
+
offsetX: feature.getGeometry().getType() === "Point" ? 5 + opts.circleRadius : 0
|
|
142
|
+
})
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
if (feature.getProperties().segment_labels) {
|
|
146
|
+
var segmentLabels = feature.getProperties().segment_labels;
|
|
147
|
+
var coo = feature.getGeometry().getCoordinates();
|
|
148
|
+
for (var i = 0; i < coo.length - 1; ++i) {
|
|
149
|
+
var p1 = coo[i];
|
|
150
|
+
var p2 = coo[i + 1];
|
|
151
|
+
var angle = -Math.atan2(p2[1] - p1[1], p2[0] - p1[0]);
|
|
152
|
+
while (angle < -0.5 * Math.PI) {
|
|
153
|
+
angle += Math.PI;
|
|
154
|
+
}
|
|
155
|
+
while (angle > 0.5 * Math.PI) {
|
|
156
|
+
angle -= Math.PI;
|
|
157
|
+
}
|
|
158
|
+
styles.push(new ol.style.Style({
|
|
159
|
+
geometry: new ol.geom.Point([0.5 * (p1[0] + p2[0]), 0.5 * (p1[1] + p2[1])]),
|
|
160
|
+
text: new ol.style.Text({
|
|
161
|
+
font: opts.textFont || '11pt sans-serif',
|
|
162
|
+
text: segmentLabels[i],
|
|
163
|
+
fill: new ol.style.Fill({
|
|
164
|
+
color: opts.textFill
|
|
165
|
+
}),
|
|
166
|
+
stroke: new ol.style.Stroke({
|
|
167
|
+
color: opts.textStroke,
|
|
168
|
+
width: 3
|
|
169
|
+
}),
|
|
170
|
+
rotation: angle,
|
|
171
|
+
offsetY: 10
|
|
172
|
+
})
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (feature.getGeometry().getType() === "LineString" && opts.headmarker in END_MARKERS) {
|
|
177
|
+
var _p = feature.getGeometry().getCoordinates()[0];
|
|
178
|
+
var _p2 = feature.getGeometry().getCoordinates()[1];
|
|
179
|
+
var rotation = 0.5 * Math.PI + Math.atan2(_p[0] - _p2[0], _p[1] - _p2[1]);
|
|
180
|
+
styles.push(new ol.style.Style({
|
|
181
|
+
geometry: new ol.geom.Point(_p),
|
|
182
|
+
image: new ol.style.Icon(_objectSpread(_objectSpread({}, END_MARKERS[opts.headmarker]), {}, {
|
|
183
|
+
anchorXUnits: 'fraction',
|
|
184
|
+
anchorYUnits: 'fraction',
|
|
185
|
+
color: opts.strokeColor,
|
|
186
|
+
rotation: END_MARKERS[opts.headmarker].baserotation / 180 * Math.PI + rotation,
|
|
187
|
+
scale: 0.125 * (1 + opts.strokeWidth) // Also update in VectorLayerUtils.generateMarkerGeometry
|
|
188
|
+
}))
|
|
189
|
+
}));
|
|
190
|
+
}
|
|
191
|
+
if (feature.getGeometry().getType() === "LineString" && opts.tailmarker in END_MARKERS) {
|
|
192
|
+
var l = feature.getGeometry().getCoordinates().length;
|
|
193
|
+
var _p3 = feature.getGeometry().getCoordinates()[l - 1];
|
|
194
|
+
var _p4 = feature.getGeometry().getCoordinates()[l - 2];
|
|
195
|
+
var _rotation = 0.5 * Math.PI + Math.atan2(_p3[0] - _p4[0], _p3[1] - _p4[1]);
|
|
196
|
+
styles.push(new ol.style.Style({
|
|
197
|
+
geometry: new ol.geom.Point(_p3),
|
|
198
|
+
image: new ol.style.Icon(_objectSpread(_objectSpread({}, END_MARKERS[opts.tailmarker]), {}, {
|
|
199
|
+
anchorXUnits: 'fraction',
|
|
200
|
+
anchorYUnits: 'fraction',
|
|
201
|
+
color: opts.strokeColor,
|
|
202
|
+
rotation: END_MARKERS[opts.tailmarker].baserotation / 180 * Math.PI + _rotation,
|
|
203
|
+
scale: 0.125 * (1 + opts.strokeWidth) // Also update in VectorLayerUtils.generateMarkerGeometry
|
|
204
|
+
}))
|
|
205
|
+
}));
|
|
206
|
+
}
|
|
207
|
+
return styles;
|
|
208
|
+
};
|
|
209
|
+
export default {
|
|
210
|
+
"default": defaultStyle,
|
|
211
|
+
marker: function marker(feature, options) {
|
|
212
|
+
var opts = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_MARKER_STYLE), ConfigUtils.getConfigProp("defaultMarkerStyle")), options);
|
|
213
|
+
return [new ol.style.Style({
|
|
214
|
+
image: new ol.style.Icon({
|
|
215
|
+
anchor: opts.iconAnchor,
|
|
216
|
+
anchorXUnits: 'fraction',
|
|
217
|
+
anchorYUnits: 'fraction',
|
|
218
|
+
opacity: opts.opacity,
|
|
219
|
+
crossOrigin: opts.crossOrigin,
|
|
220
|
+
src: opts.iconSrc,
|
|
221
|
+
scale: opts.scale,
|
|
222
|
+
color: opts.color
|
|
223
|
+
}),
|
|
224
|
+
text: new ol.style.Text({
|
|
225
|
+
font: opts.textFont || '11pt sans-serif',
|
|
226
|
+
text: feature.getProperties().label || "",
|
|
227
|
+
offsetY: 8,
|
|
228
|
+
fill: new ol.style.Fill({
|
|
229
|
+
color: opts.textColor
|
|
230
|
+
}),
|
|
231
|
+
stroke: new ol.style.Stroke({
|
|
232
|
+
color: opts.textStroke,
|
|
233
|
+
width: 3
|
|
234
|
+
})
|
|
235
|
+
})
|
|
236
|
+
})];
|
|
237
|
+
},
|
|
238
|
+
interaction: function interaction(options, isSnap) {
|
|
239
|
+
var opts = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_INTERACTION_STYLE), ConfigUtils.getConfigProp("defaultInteractionStyle")), options);
|
|
240
|
+
var fillColor = opts.fillColor;
|
|
241
|
+
var strokeColor = opts.strokeColor;
|
|
242
|
+
var strokeWidth = opts.strokeWidth;
|
|
243
|
+
if (isSnap) {
|
|
244
|
+
fillColor = opts.snapFillColor;
|
|
245
|
+
strokeColor = opts.snapStrokeColor;
|
|
246
|
+
strokeWidth = opts.snapStrokeWidth;
|
|
247
|
+
}
|
|
248
|
+
return new ol.style.Style({
|
|
249
|
+
fill: new ol.style.Fill({
|
|
250
|
+
color: fillColor
|
|
251
|
+
}),
|
|
252
|
+
stroke: new ol.style.Stroke({
|
|
253
|
+
color: strokeColor,
|
|
254
|
+
width: strokeWidth
|
|
255
|
+
})
|
|
256
|
+
});
|
|
257
|
+
},
|
|
258
|
+
interactionVertex: function interactionVertex(options, isSnap) {
|
|
259
|
+
var opts = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_INTERACTION_STYLE), ConfigUtils.getConfigProp("defaultInteractionStyle")), options);
|
|
260
|
+
var strokeWidth = opts.strokeWidth;
|
|
261
|
+
var vertexFill = opts.vertexFillColor;
|
|
262
|
+
var vertexStroke = opts.vertexStrokeColor;
|
|
263
|
+
if (isSnap) {
|
|
264
|
+
strokeWidth = opts.snapStrokeWidth;
|
|
265
|
+
vertexFill = opts.snapVertexFillColor;
|
|
266
|
+
vertexStroke = opts.snapVertexStrokeColor;
|
|
267
|
+
}
|
|
268
|
+
return new ol.style.Style({
|
|
269
|
+
image: options.img ? new ol.style.Icon({
|
|
270
|
+
src: ResourceRegistry.getResource(options.img),
|
|
271
|
+
rotation: options.rotation,
|
|
272
|
+
anchor: [0.5, 1],
|
|
273
|
+
imgSize: options.size,
|
|
274
|
+
rotateWithView: true
|
|
275
|
+
}) : new ol.style.RegularShape({
|
|
276
|
+
fill: new ol.style.Fill({
|
|
277
|
+
color: vertexFill
|
|
278
|
+
}),
|
|
279
|
+
stroke: new ol.style.Stroke({
|
|
280
|
+
color: vertexStroke,
|
|
281
|
+
width: strokeWidth
|
|
282
|
+
}),
|
|
283
|
+
points: 4,
|
|
284
|
+
radius: 5,
|
|
285
|
+
angle: Math.PI / 4
|
|
286
|
+
}),
|
|
287
|
+
geometry: opts.geometryFunction
|
|
288
|
+
});
|
|
289
|
+
},
|
|
290
|
+
measureInteraction: function measureInteraction(feature, options) {
|
|
291
|
+
var opts = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_INTERACTION_STYLE), ConfigUtils.getConfigProp("defaultInteractionStyle")), options);
|
|
292
|
+
var styleOptions = {
|
|
293
|
+
strokeColor: opts.measureStrokeColor,
|
|
294
|
+
strokeWidth: opts.measureStrokeWidth,
|
|
295
|
+
fillColor: opts.measureFillColor,
|
|
296
|
+
headmarker: opts.headmarker,
|
|
297
|
+
tailmarker: opts.tailmarker,
|
|
298
|
+
strokeDash: []
|
|
299
|
+
};
|
|
300
|
+
return defaultStyle(feature, styleOptions);
|
|
301
|
+
},
|
|
302
|
+
measureInteractionVertex: function measureInteractionVertex(options) {
|
|
303
|
+
var opts = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_INTERACTION_STYLE), ConfigUtils.getConfigProp("defaultInteractionStyle")), options);
|
|
304
|
+
return new ol.style.Style({
|
|
305
|
+
image: new ol.style.Circle({
|
|
306
|
+
radius: opts.measurePointRadius,
|
|
307
|
+
fill: new ol.style.Fill({
|
|
308
|
+
color: opts.measureVertexFillColor
|
|
309
|
+
}),
|
|
310
|
+
stroke: new ol.style.Stroke({
|
|
311
|
+
color: opts.measureVertexStrokeColor,
|
|
312
|
+
width: opts.measureVertexStrokeWidth
|
|
313
|
+
})
|
|
314
|
+
}),
|
|
315
|
+
geometry: opts.geometryFunction
|
|
316
|
+
});
|
|
317
|
+
},
|
|
318
|
+
sketchInteraction: function sketchInteraction(options) {
|
|
319
|
+
var opts = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_INTERACTION_STYLE), ConfigUtils.getConfigProp("defaultInteractionStyle")), options);
|
|
320
|
+
return new ol.style.Style({
|
|
321
|
+
image: new ol.style.Circle({
|
|
322
|
+
fill: new ol.style.Fill({
|
|
323
|
+
color: opts.sketchPointFillColor
|
|
324
|
+
}),
|
|
325
|
+
stroke: new ol.style.Stroke({
|
|
326
|
+
color: opts.sketchPointStrokeColor,
|
|
327
|
+
width: opts.strokeWidth
|
|
328
|
+
}),
|
|
329
|
+
radius: opts.sketchPointRadius
|
|
330
|
+
})
|
|
331
|
+
});
|
|
332
|
+
},
|
|
333
|
+
printInteraction: function printInteraction(options) {
|
|
334
|
+
var opts = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_INTERACTION_STYLE), ConfigUtils.getConfigProp("defaultInteractionStyle")), options);
|
|
335
|
+
return new ol.style.Style({
|
|
336
|
+
geometry: opts.geometryFunction,
|
|
337
|
+
fill: new ol.style.Fill({
|
|
338
|
+
color: [0, 0, 0, 0]
|
|
339
|
+
}),
|
|
340
|
+
stroke: new ol.style.Stroke({
|
|
341
|
+
color: opts.printStrokeColor,
|
|
342
|
+
width: opts.printStrokeWidth
|
|
343
|
+
})
|
|
344
|
+
});
|
|
345
|
+
},
|
|
346
|
+
printInteractionVertex: function printInteractionVertex(options) {
|
|
347
|
+
var opts = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_INTERACTION_STYLE), ConfigUtils.getConfigProp("defaultInteractionStyle")), options);
|
|
348
|
+
return new ol.style.Style({
|
|
349
|
+
geometry: opts.geometryFunction,
|
|
350
|
+
image: new ol.style.Circle({
|
|
351
|
+
radius: opts.printVertexRadius,
|
|
352
|
+
fill: new ol.style.Fill({
|
|
353
|
+
color: opts.fill ? opts.printStrokeColor : opts.printVertexColor
|
|
354
|
+
}),
|
|
355
|
+
stroke: new ol.style.Stroke({
|
|
356
|
+
color: opts.printStrokeColor,
|
|
357
|
+
width: opts.printStrokeWidth
|
|
358
|
+
})
|
|
359
|
+
})
|
|
360
|
+
});
|
|
361
|
+
},
|
|
362
|
+
printInteractionBackground: function printInteractionBackground(options) {
|
|
363
|
+
var opts = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_INTERACTION_STYLE), ConfigUtils.getConfigProp("defaultInteractionStyle")), options);
|
|
364
|
+
return new ol.style.Style({
|
|
365
|
+
geometry: opts.geometryFunction,
|
|
366
|
+
fill: new ol.style.Fill({
|
|
367
|
+
color: opts.printBackgroundColor
|
|
368
|
+
})
|
|
369
|
+
});
|
|
370
|
+
},
|
|
371
|
+
printInteractionSeries: function printInteractionSeries(options) {
|
|
372
|
+
var opts = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_INTERACTION_STYLE), ConfigUtils.getConfigProp("defaultInteractionStyle")), options);
|
|
373
|
+
return new ol.style.Style({
|
|
374
|
+
geometry: opts.geometryFunction,
|
|
375
|
+
stroke: new ol.style.Stroke({
|
|
376
|
+
color: opts.printStrokeColor,
|
|
377
|
+
width: opts.printStrokeWidth
|
|
378
|
+
})
|
|
379
|
+
});
|
|
380
|
+
},
|
|
381
|
+
printInteractionSeriesIcon: function printInteractionSeriesIcon(options) {
|
|
382
|
+
var opts = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_INTERACTION_STYLE), ConfigUtils.getConfigProp("defaultInteractionStyle")), options);
|
|
383
|
+
return [new ol.style.Style({
|
|
384
|
+
geometry: opts.geometryFunction,
|
|
385
|
+
image: new ol.style.Circle({
|
|
386
|
+
radius: 20 * opts.radius,
|
|
387
|
+
fill: new ol.style.Fill({
|
|
388
|
+
color: opts.printVertexColor
|
|
389
|
+
}),
|
|
390
|
+
stroke: new ol.style.Stroke({
|
|
391
|
+
color: opts.printStrokeColor,
|
|
392
|
+
width: opts.printStrokeWidth
|
|
393
|
+
})
|
|
394
|
+
})
|
|
395
|
+
}), new ol.style.Style({
|
|
396
|
+
geometry: opts.geometryFunction,
|
|
397
|
+
image: new ol.style.Icon({
|
|
398
|
+
src: ResourceRegistry.getResource(opts.img),
|
|
399
|
+
opacity: 0.5,
|
|
400
|
+
rotation: opts.rotation,
|
|
401
|
+
scale: opts.radius,
|
|
402
|
+
rotateWithView: true
|
|
403
|
+
})
|
|
404
|
+
})];
|
|
405
|
+
},
|
|
406
|
+
image: function image(feature, options) {
|
|
407
|
+
return new ol.style.Style({
|
|
408
|
+
image: new ol.style.Icon({
|
|
409
|
+
src: ResourceRegistry.getResource(options.img),
|
|
410
|
+
rotation: options.rotation,
|
|
411
|
+
anchor: options.anchor,
|
|
412
|
+
imgSize: options.size,
|
|
413
|
+
rotateWithView: true
|
|
414
|
+
})
|
|
415
|
+
});
|
|
416
|
+
},
|
|
417
|
+
text: function text(feature, options) {
|
|
418
|
+
return [new ol.style.Style({
|
|
419
|
+
text: new ol.style.Text({
|
|
420
|
+
font: '10pt sans-serif',
|
|
421
|
+
text: feature.getProperties().label || "",
|
|
422
|
+
rotation: feature.getProperties().rotation || 0,
|
|
423
|
+
scale: options.strokeWidth,
|
|
424
|
+
fill: new ol.style.Fill({
|
|
425
|
+
color: options.fillColor
|
|
426
|
+
}),
|
|
427
|
+
stroke: new ol.style.Stroke({
|
|
428
|
+
color: options.strokeColor,
|
|
429
|
+
width: 2
|
|
430
|
+
})
|
|
431
|
+
})
|
|
432
|
+
})];
|
|
433
|
+
}
|
|
434
|
+
};
|