@evergis/react 2.0.190 → 2.0.191
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/dist/components/Legend/Legend.d.ts +2 -2
- package/dist/components/Legend/components/ClusterSymbolPreview.d.ts +7 -0
- package/dist/components/Legend/components/LegendSection.d.ts +2 -2
- package/dist/components/Legend/components/LegendSymbolRenderer.d.ts +2 -2
- package/dist/components/Legend/components/MaximizedLegend.d.ts +2 -2
- package/dist/components/Legend/components/SvgSymbol.d.ts +2 -2
- package/dist/components/Legend/constants.d.ts +4 -3
- package/dist/components/Legend/styled.d.ts +3 -2
- package/dist/components/Legend/types.d.ts +18 -18
- package/dist/react.cjs.development.js +177 -134
- package/dist/react.cjs.development.js.map +1 -1
- package/dist/react.cjs.production.min.js +1 -1
- package/dist/react.cjs.production.min.js.map +1 -1
- package/dist/react.esm.js +176 -135
- package/dist/react.esm.js.map +1 -1
- package/dist/utils/legend.d.ts +10 -10
- package/package.json +2 -2
|
@@ -58,7 +58,6 @@ var styled = require('styled-components');
|
|
|
58
58
|
var styled__default = _interopDefault(styled);
|
|
59
59
|
var punycode = _interopDefault(require('punycode'));
|
|
60
60
|
var TileLayer$1 = require('@evergis/sgis/es/layers/TileLayer');
|
|
61
|
-
var reactI18next = require('react-i18next');
|
|
62
61
|
var svg_js = require('@svgdotjs/svg.js');
|
|
63
62
|
var Color = require('@evergis/color/es/Color');
|
|
64
63
|
|
|
@@ -2501,10 +2500,10 @@ let FilterCondition = /*#__PURE__*/function () {
|
|
|
2501
2500
|
return FilterCondition;
|
|
2502
2501
|
}();
|
|
2503
2502
|
|
|
2504
|
-
const isLayerService = value => isObject(value) &&
|
|
2503
|
+
const isLayerService = value => isObject(value) && 'name' in value;
|
|
2505
2504
|
const getAttributeFromCondition = condition => {
|
|
2506
|
-
const parts = condition.split(
|
|
2507
|
-
return parts[0].startsWith(
|
|
2505
|
+
const parts = condition.split(' ');
|
|
2506
|
+
return parts[0].startsWith('(') ? parts[0].slice(1) : parts[0];
|
|
2508
2507
|
};
|
|
2509
2508
|
const getExprFromCondition = (condition, partIndex) => {
|
|
2510
2509
|
var _expr;
|
|
@@ -2512,13 +2511,13 @@ const getExprFromCondition = (condition, partIndex) => {
|
|
|
2512
2511
|
let expr;
|
|
2513
2512
|
|
|
2514
2513
|
if (partIndex) {
|
|
2515
|
-
const parts = condition.split(
|
|
2514
|
+
const parts = condition.split(' && ').map(part => part.slice(1, -1));
|
|
2516
2515
|
expr = parts[partIndex - 1];
|
|
2517
2516
|
} else {
|
|
2518
2517
|
expr = condition;
|
|
2519
2518
|
}
|
|
2520
2519
|
|
|
2521
|
-
return (_expr = expr) == null ? void 0 : _expr.split(
|
|
2520
|
+
return (_expr = expr) == null ? void 0 : _expr.split(' ');
|
|
2522
2521
|
};
|
|
2523
2522
|
const getSignFromConditionPart = (condition, partIndex) => {
|
|
2524
2523
|
var _getExprFromCondition;
|
|
@@ -2530,7 +2529,7 @@ const getValueFromConditionPart = (condition, partIndex) => {
|
|
|
2530
2529
|
|
|
2531
2530
|
return (_getExprFromCondition2 = getExprFromCondition(condition, partIndex)) == null ? void 0 : _getExprFromCondition2[2];
|
|
2532
2531
|
};
|
|
2533
|
-
const isRangeCondition = condition => condition.includes(
|
|
2532
|
+
const isRangeCondition = condition => condition.includes('(');
|
|
2534
2533
|
const getSymbolParameterInfo = parameter => {
|
|
2535
2534
|
return PARAMETER_INFOS[parameter] || DEFAULT_PARAMETER_INFO;
|
|
2536
2535
|
};
|
|
@@ -2554,8 +2553,8 @@ const getRangeValues$1 = (_ref, isDouble, isDate, index) => {
|
|
|
2554
2553
|
const formatRangeClassValue = (value, formatValue, index) => {
|
|
2555
2554
|
var _value$attribute, _value$attribute2, _value$attribute3, _value$attribute4, _value$attribute5, _value$attribute6;
|
|
2556
2555
|
|
|
2557
|
-
const isDouble = ((_value$attribute = value.attribute) == null ? void 0 : _value$attribute.type) ===
|
|
2558
|
-
const isDate = ((_value$attribute2 = value.attribute) == null ? void 0 : _value$attribute2.type) ===
|
|
2556
|
+
const isDouble = ((_value$attribute = value.attribute) == null ? void 0 : _value$attribute.type) === 'Double';
|
|
2557
|
+
const isDate = ((_value$attribute2 = value.attribute) == null ? void 0 : _value$attribute2.type) === 'DateTime';
|
|
2559
2558
|
const {
|
|
2560
2559
|
from,
|
|
2561
2560
|
to
|
|
@@ -2564,11 +2563,11 @@ const formatRangeClassValue = (value, formatValue, index) => {
|
|
|
2564
2563
|
const formattedTo = formatValue ? formatValue((_value$attribute5 = value.attribute) == null ? void 0 : _value$attribute5.type, to, (_value$attribute6 = value.attribute) == null ? void 0 : _value$attribute6.stringFormat) : to;
|
|
2565
2564
|
|
|
2566
2565
|
if (from === null) {
|
|
2567
|
-
return "" + formattedTo + (!isDate ?
|
|
2566
|
+
return "" + formattedTo + (!isDate ? ' и менее' : '');
|
|
2568
2567
|
}
|
|
2569
2568
|
|
|
2570
2569
|
if (to === null) {
|
|
2571
|
-
return "" + (!isDate ?
|
|
2570
|
+
return "" + (!isDate ? 'более ' : '') + formattedFrom;
|
|
2572
2571
|
}
|
|
2573
2572
|
|
|
2574
2573
|
return from === to ? "" + formattedFrom : formattedFrom + " - " + formattedTo;
|
|
@@ -2580,13 +2579,13 @@ const checkLayerHasLegend = layerInfo => {
|
|
|
2580
2579
|
var _layerInfo$style;
|
|
2581
2580
|
|
|
2582
2581
|
const paramValue = get((_layerInfo$style = layerInfo.style) == null ? void 0 : _layerInfo$style.symbol, param);
|
|
2583
|
-
return (paramValue == null ? void 0 : paramValue.type) ===
|
|
2582
|
+
return (paramValue == null ? void 0 : paramValue.type) === 'byAttribute';
|
|
2584
2583
|
})) || false;
|
|
2585
2584
|
};
|
|
2586
2585
|
const getTitleFromCondition = condition => {
|
|
2587
2586
|
var _parts$;
|
|
2588
2587
|
|
|
2589
|
-
const parts = condition.split(
|
|
2588
|
+
const parts = condition.split(' == ');
|
|
2590
2589
|
return (_parts$ = parts[1]) == null ? void 0 : _parts$.slice(1, -1);
|
|
2591
2590
|
};
|
|
2592
2591
|
|
|
@@ -2597,12 +2596,12 @@ function createValueTitle$1(paramValue, attribute, formatValue, index) {
|
|
|
2597
2596
|
attribute
|
|
2598
2597
|
};
|
|
2599
2598
|
const sign = getSignFromConditionPart(paramValue.condition, 1);
|
|
2600
|
-
const isFirstFrom = sign.includes(
|
|
2599
|
+
const isFirstFrom = sign.includes('>');
|
|
2601
2600
|
value.from = isFirstFrom ? getValueFromConditionPart(paramValue.condition, 1) : null;
|
|
2602
|
-
value.to = paramValue.condition.includes(
|
|
2601
|
+
value.to = paramValue.condition.includes(' && ') && isFirstFrom ? getValueFromConditionPart(paramValue.condition, 2) : !isFirstFrom ? getValueFromConditionPart(paramValue.condition, 1) : null;
|
|
2603
2602
|
if (isRangeClass(value)) return formatRangeClassValue(value, formatValue, index);
|
|
2604
2603
|
if (isUniqueClass(value)) return formatUniqueClassValue(value, formatValue);
|
|
2605
|
-
return
|
|
2604
|
+
return '';
|
|
2606
2605
|
} // Основывается на http://cf.everpoint.ru/pages/viewpage.action?pageId=45024217 ->
|
|
2607
2606
|
// пункт "Настраиваемые значения параметров символики в системе"
|
|
2608
2607
|
// Для добавления подготовленных значений размеров символов нужно использовать константу PREPARED_SYMBOL_SIZES
|
|
@@ -2612,37 +2611,37 @@ const DEFAULT_LEGEND_STYLES = {
|
|
|
2612
2611
|
[0
|
|
2613
2612
|
/* Point */
|
|
2614
2613
|
]: {
|
|
2615
|
-
fillColor:
|
|
2614
|
+
fillColor: '#00000047',
|
|
2616
2615
|
strokeWidth: 1,
|
|
2617
|
-
strokeColor:
|
|
2616
|
+
strokeColor: '#0000001f'
|
|
2618
2617
|
},
|
|
2619
2618
|
[1
|
|
2620
2619
|
/* ImagePoint */
|
|
2621
2620
|
]: {
|
|
2622
|
-
maskedColor:
|
|
2621
|
+
maskedColor: '#00000047'
|
|
2623
2622
|
},
|
|
2624
2623
|
[2
|
|
2625
2624
|
/* Line */
|
|
2626
2625
|
]: {
|
|
2627
2626
|
stroke: {
|
|
2628
2627
|
width: 2,
|
|
2629
|
-
color:
|
|
2628
|
+
color: '#00000047'
|
|
2630
2629
|
}
|
|
2631
2630
|
},
|
|
2632
2631
|
[3
|
|
2633
2632
|
/* Polygon */
|
|
2634
2633
|
]: {
|
|
2635
2634
|
fill: {
|
|
2636
|
-
color:
|
|
2637
|
-
hatchColor:
|
|
2635
|
+
color: '#00000000',
|
|
2636
|
+
hatchColor: '#00000000'
|
|
2638
2637
|
},
|
|
2639
2638
|
stroke: {
|
|
2640
2639
|
width: 1,
|
|
2641
|
-
color:
|
|
2640
|
+
color: '#0000001f'
|
|
2642
2641
|
}
|
|
2643
2642
|
}
|
|
2644
2643
|
};
|
|
2645
|
-
const SYMBOL_SIZE_PARAMETERS = [
|
|
2644
|
+
const SYMBOL_SIZE_PARAMETERS = ['size', 'width', 'height']; // Основывается на http://cf.everpoint.ru/pages/viewpage.action?pageId=45024217 -> пункт "Библиотека символов"
|
|
2646
2645
|
|
|
2647
2646
|
const DEFAULT_LEGEND_SIZES = {
|
|
2648
2647
|
circlePointSymbol: 8,
|
|
@@ -2672,16 +2671,16 @@ const updateSymbolParameter = (symbol, path, value) => symbolParameterWalker(()
|
|
|
2672
2671
|
|
|
2673
2672
|
const createPointSymbol = (baseSymbol, parameter, classificationsParams, parameterValue) => {
|
|
2674
2673
|
return updateSymbolParameter(_extends({}, baseSymbol, {
|
|
2675
|
-
fillColor: getNonClassifiedParamValue(baseSymbol,
|
|
2674
|
+
fillColor: getNonClassifiedParamValue(baseSymbol, 'fillColor', classificationsParams, 0
|
|
2676
2675
|
/* Point */
|
|
2677
2676
|
),
|
|
2678
|
-
strokeColor: getNonClassifiedParamValue(baseSymbol,
|
|
2677
|
+
strokeColor: getNonClassifiedParamValue(baseSymbol, 'strokeColor', classificationsParams, 0
|
|
2679
2678
|
/* Point */
|
|
2680
2679
|
),
|
|
2681
|
-
strokeWidth: getNonClassifiedParamValue(baseSymbol,
|
|
2680
|
+
strokeWidth: getNonClassifiedParamValue(baseSymbol, 'strokeWidth', classificationsParams, 0
|
|
2682
2681
|
/* Point */
|
|
2683
2682
|
),
|
|
2684
|
-
size: getNonClassifiedParamValue(baseSymbol,
|
|
2683
|
+
size: getNonClassifiedParamValue(baseSymbol, 'size', classificationsParams, 0
|
|
2685
2684
|
/* Point */
|
|
2686
2685
|
),
|
|
2687
2686
|
offset: [0, 0]
|
|
@@ -2718,12 +2717,12 @@ const createImagePointSymbol = (baseSymbol, parameter, classificationsParams, pa
|
|
|
2718
2717
|
let symbol = _extends({}, baseSymbol);
|
|
2719
2718
|
|
|
2720
2719
|
if (isMaskedImageSymbol(symbol)) {
|
|
2721
|
-
symbol.maskedColor = getNonClassifiedParamValue(baseSymbol,
|
|
2720
|
+
symbol.maskedColor = getNonClassifiedParamValue(baseSymbol, 'maskedColor', classificationsParams, 1
|
|
2722
2721
|
/* ImagePoint */
|
|
2723
2722
|
);
|
|
2724
2723
|
}
|
|
2725
2724
|
|
|
2726
|
-
if (parameter ===
|
|
2725
|
+
if (parameter === 'height' || parameter === 'width') {
|
|
2727
2726
|
const {
|
|
2728
2727
|
height,
|
|
2729
2728
|
width
|
|
@@ -2731,7 +2730,7 @@ const createImagePointSymbol = (baseSymbol, parameter, classificationsParams, pa
|
|
|
2731
2730
|
symbol.height = height;
|
|
2732
2731
|
symbol.width = width;
|
|
2733
2732
|
} else {
|
|
2734
|
-
symbol.width = getNonClassifiedParamValue(baseSymbol,
|
|
2733
|
+
symbol.width = getNonClassifiedParamValue(baseSymbol, 'width', classificationsParams, 1
|
|
2735
2734
|
/* ImagePoint */
|
|
2736
2735
|
);
|
|
2737
2736
|
symbol.height = symbol.width;
|
|
@@ -2744,12 +2743,12 @@ const createImagePointSymbol = (baseSymbol, parameter, classificationsParams, pa
|
|
|
2744
2743
|
|
|
2745
2744
|
const createLineSymbol = (baseSymbol, parameter, classificationsParams, parameterValue) => {
|
|
2746
2745
|
return updateSymbolParameter(_extends({}, baseSymbol, {
|
|
2747
|
-
type:
|
|
2746
|
+
type: 'polylineSymbol',
|
|
2748
2747
|
stroke: {
|
|
2749
|
-
color: getNonClassifiedParamValue(baseSymbol,
|
|
2748
|
+
color: getNonClassifiedParamValue(baseSymbol, 'stroke.color', classificationsParams, 2
|
|
2750
2749
|
/* Line */
|
|
2751
2750
|
),
|
|
2752
|
-
width: getNonClassifiedParamValue(baseSymbol,
|
|
2751
|
+
width: getNonClassifiedParamValue(baseSymbol, 'stroke.width', classificationsParams, 2
|
|
2753
2752
|
/* Line */
|
|
2754
2753
|
)
|
|
2755
2754
|
}
|
|
@@ -2759,18 +2758,18 @@ const createLineSymbol = (baseSymbol, parameter, classificationsParams, paramete
|
|
|
2759
2758
|
const createPolygonSymbol = (baseSymbol, parameter, classificationsParams, parameterValue) => {
|
|
2760
2759
|
return updateSymbolParameter(_extends({}, baseSymbol, {
|
|
2761
2760
|
fill: {
|
|
2762
|
-
color: getNonClassifiedParamValue(baseSymbol,
|
|
2761
|
+
color: getNonClassifiedParamValue(baseSymbol, 'fill.color', classificationsParams, 3
|
|
2763
2762
|
/* Polygon */
|
|
2764
2763
|
),
|
|
2765
|
-
hatchColor: getNonClassifiedParamValue(baseSymbol,
|
|
2764
|
+
hatchColor: getNonClassifiedParamValue(baseSymbol, 'fill.hatchColor', classificationsParams, 3
|
|
2766
2765
|
/* Polygon */
|
|
2767
2766
|
)
|
|
2768
2767
|
},
|
|
2769
2768
|
stroke: {
|
|
2770
|
-
color: getNonClassifiedParamValue(baseSymbol,
|
|
2769
|
+
color: getNonClassifiedParamValue(baseSymbol, 'stroke.color', classificationsParams, 3
|
|
2771
2770
|
/* Polygon */
|
|
2772
2771
|
),
|
|
2773
|
-
width: getNonClassifiedParamValue(baseSymbol,
|
|
2772
|
+
width: getNonClassifiedParamValue(baseSymbol, 'stroke.width', classificationsParams, 3
|
|
2774
2773
|
/* Polygon */
|
|
2775
2774
|
)
|
|
2776
2775
|
}
|
|
@@ -2780,29 +2779,37 @@ const createPolygonSymbol = (baseSymbol, parameter, classificationsParams, param
|
|
|
2780
2779
|
const createH3Symbol = (baseSymbol, parameter, classificationsParams, parameterValue) => {
|
|
2781
2780
|
return updateSymbolParameter(_extends({}, baseSymbol, {
|
|
2782
2781
|
fill: {
|
|
2783
|
-
color: getNonClassifiedParamValue(baseSymbol,
|
|
2782
|
+
color: getNonClassifiedParamValue(baseSymbol, 'fill.color', classificationsParams, 3
|
|
2784
2783
|
/* Polygon */
|
|
2785
2784
|
)
|
|
2786
2785
|
},
|
|
2787
2786
|
stroke: {
|
|
2788
|
-
color: getNonClassifiedParamValue(baseSymbol,
|
|
2787
|
+
color: getNonClassifiedParamValue(baseSymbol, 'stroke.color', classificationsParams, 3
|
|
2789
2788
|
/* Polygon */
|
|
2790
2789
|
),
|
|
2791
|
-
width: getNonClassifiedParamValue(baseSymbol,
|
|
2790
|
+
width: getNonClassifiedParamValue(baseSymbol, 'stroke.width', classificationsParams, 3
|
|
2792
2791
|
/* Polygon */
|
|
2793
2792
|
)
|
|
2794
2793
|
}
|
|
2795
2794
|
}), parameter, parameterValue);
|
|
2796
2795
|
};
|
|
2797
2796
|
|
|
2797
|
+
const createClusterSymbol = (baseSymbol, parameter, classificationsParams, parameterValue) => {
|
|
2798
|
+
return updateSymbolParameter(_extends({}, baseSymbol, {
|
|
2799
|
+
fillColor: getNonClassifiedParamValue(baseSymbol, 'fillColor', classificationsParams, 0
|
|
2800
|
+
/* Point */
|
|
2801
|
+
)
|
|
2802
|
+
}), parameter, parameterValue);
|
|
2803
|
+
};
|
|
2804
|
+
|
|
2798
2805
|
const createLegendSymbol = (parameterValue, parameter, classificationsParams, baseSymbol) => {
|
|
2799
2806
|
if (isParameterValueSymbol(parameterValue)) {
|
|
2800
2807
|
return parameterValue;
|
|
2801
2808
|
}
|
|
2802
|
-
/* if (isClusterSymbol(baseSymbol)) {
|
|
2803
|
-
return createClusterSymbol(baseSymbol, parameter, classificationsParams, parameterValue);
|
|
2804
|
-
}*/
|
|
2805
2809
|
|
|
2810
|
+
if (isClusterSymbol(baseSymbol)) {
|
|
2811
|
+
return createClusterSymbol(baseSymbol, parameter, classificationsParams, parameterValue);
|
|
2812
|
+
}
|
|
2806
2813
|
|
|
2807
2814
|
if (isSizableSymbol(baseSymbol)) {
|
|
2808
2815
|
return createPointSymbol(baseSymbol, parameter, classificationsParams, parameterValue);
|
|
@@ -2937,7 +2944,7 @@ const getClassified = layerInfo => {
|
|
|
2937
2944
|
var _layerInfo$style2;
|
|
2938
2945
|
|
|
2939
2946
|
const param = get((_layerInfo$style2 = layerInfo.style) == null ? void 0 : _layerInfo$style2.symbol, classified);
|
|
2940
|
-
return (param == null ? void 0 : param.type) ===
|
|
2947
|
+
return (param == null ? void 0 : param.type) === 'byAttribute' ? _extends({}, result, {
|
|
2941
2948
|
[classified]: param
|
|
2942
2949
|
}) : result;
|
|
2943
2950
|
}, {});
|
|
@@ -2975,7 +2982,7 @@ const getLegendSymbolSize = symbol => {
|
|
|
2975
2982
|
}
|
|
2976
2983
|
|
|
2977
2984
|
if (isPolylineSymbols(symbol)) {
|
|
2978
|
-
size = getParameterValue(getParameterFromSymbol(symbol,
|
|
2985
|
+
size = getParameterValue(getParameterFromSymbol(symbol, 'stroke.width'));
|
|
2979
2986
|
}
|
|
2980
2987
|
|
|
2981
2988
|
return Math.max(DEFAULT_LEGEND_SYMBOL_SIZE, size);
|
|
@@ -2987,13 +2994,13 @@ const serializeSvgPointSymbol = symbol => {
|
|
|
2987
2994
|
const figureFillColor = ((_symbol$figure = symbol.figure) == null ? void 0 : _symbol$figure.fillColor) || null;
|
|
2988
2995
|
const bgFillColor = ((_symbol$background2 = symbol.background) == null ? void 0 : _symbol$background2.fillColor) || null;
|
|
2989
2996
|
return _extends({
|
|
2990
|
-
type:
|
|
2997
|
+
type: 'svgPointSymbol',
|
|
2991
2998
|
size: symbol.size,
|
|
2992
2999
|
offset: symbol.offset,
|
|
2993
3000
|
angle: symbol.angle
|
|
2994
3001
|
}, bgFillColor ? {
|
|
2995
3002
|
background: {
|
|
2996
|
-
id:
|
|
3003
|
+
id: 'symbol-bg',
|
|
2997
3004
|
fillColor: bgFillColor,
|
|
2998
3005
|
strokeColor: ((_symbol$background3 = symbol.background) == null ? void 0 : _symbol$background3.strokeColor) || null,
|
|
2999
3006
|
strokeWidth: ((_symbol$background4 = symbol.background) == null ? void 0 : _symbol$background4.strokeWidth) || null,
|
|
@@ -3001,35 +3008,35 @@ const serializeSvgPointSymbol = symbol => {
|
|
|
3001
3008
|
}
|
|
3002
3009
|
} : {}, figureFillColor ? {
|
|
3003
3010
|
figure: {
|
|
3004
|
-
id:
|
|
3011
|
+
id: 'symbol-figure',
|
|
3005
3012
|
fillColor: figureFillColor
|
|
3006
3013
|
}
|
|
3007
3014
|
} : {});
|
|
3008
3015
|
};
|
|
3009
|
-
const SIZE_PARAMETERS = [
|
|
3016
|
+
const SIZE_PARAMETERS = ['size', 'height', 'strokeWidth', 'stroke.width'];
|
|
3010
3017
|
const isSizeClassification = parameter => SIZE_PARAMETERS.includes(parameter);
|
|
3011
3018
|
const getServiceConfiguration = layer => {
|
|
3012
3019
|
const emptyServiceConfiguration = {
|
|
3013
|
-
name:
|
|
3020
|
+
name: ''
|
|
3014
3021
|
};
|
|
3015
|
-
if (!isLayerService(layer) || !(
|
|
3022
|
+
if (!isLayerService(layer) || !('configuration' in layer)) return emptyServiceConfiguration;
|
|
3016
3023
|
return _extends({}, emptyServiceConfiguration, layer.configuration || {});
|
|
3017
3024
|
};
|
|
3018
3025
|
/** default attribute name which use for geometry info */
|
|
3019
3026
|
|
|
3020
|
-
const GEOMETRY_ATTRIBUTE =
|
|
3027
|
+
const GEOMETRY_ATTRIBUTE = 'geometry';
|
|
3021
3028
|
/** default attribute name which contains unique id info */
|
|
3022
3029
|
|
|
3023
|
-
const DEFAULT_ID_ATTRIBUTE_NAME =
|
|
3030
|
+
const DEFAULT_ID_ATTRIBUTE_NAME = 'gid';
|
|
3024
3031
|
const getAttributesConfiguration = layer => {
|
|
3025
3032
|
const serviceConfiguration = getServiceConfiguration(layer);
|
|
3026
3033
|
const emptyAttributesConfiguration = {
|
|
3027
3034
|
geometryAttribute: GEOMETRY_ATTRIBUTE,
|
|
3028
3035
|
idAttribute: DEFAULT_ID_ATTRIBUTE_NAME,
|
|
3029
|
-
tableName:
|
|
3036
|
+
tableName: ''
|
|
3030
3037
|
};
|
|
3031
3038
|
|
|
3032
|
-
if (!serviceConfiguration || !(
|
|
3039
|
+
if (!serviceConfiguration || !('attributesConfiguration' in serviceConfiguration)) {
|
|
3033
3040
|
return emptyAttributesConfiguration;
|
|
3034
3041
|
}
|
|
3035
3042
|
|
|
@@ -3045,10 +3052,10 @@ const getLayerDefinition = layer => {
|
|
|
3045
3052
|
geometryAttribute: geometryAttribute,
|
|
3046
3053
|
idAttribute,
|
|
3047
3054
|
geometryType: api.GeometryType.Unknown,
|
|
3048
|
-
titleAttribute:
|
|
3055
|
+
titleAttribute: ''
|
|
3049
3056
|
};
|
|
3050
3057
|
|
|
3051
|
-
if (!isLayerService(layer) || !(
|
|
3058
|
+
if (!isLayerService(layer) || !('layerDefinition' in layer)) {
|
|
3052
3059
|
return emptyLayerDefinition;
|
|
3053
3060
|
}
|
|
3054
3061
|
|
|
@@ -3108,13 +3115,14 @@ const DEFAULT_LEGEND_SYMBOL_SIZE = 26;
|
|
|
3108
3115
|
const EXTRA_BORDER_SIZE = 4;
|
|
3109
3116
|
const DEFAULT_SYMBOL_SIZE = 20;
|
|
3110
3117
|
const DEFAULT_SYMBOL_WITH_BG_SIZE = 24;
|
|
3111
|
-
const DEFAULT_SYMBOL_FILL_COLOR =
|
|
3112
|
-
const DEFAULT_SYMBOL_STROKE_COLOR =
|
|
3118
|
+
const DEFAULT_SYMBOL_FILL_COLOR = 'rgba(0, 163, 245, 1)';
|
|
3119
|
+
const DEFAULT_SYMBOL_STROKE_COLOR = 'rgb(255, 255, 255)';
|
|
3113
3120
|
const DEFAULT_SYMBOL_OFFSET = [0, 0];
|
|
3121
|
+
const DEFAULT_CLUSTER_SVG = "\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 56 56\" width=\"56px\" height=\"56px\">\n <circle cx=\"28\" cy=\"28\" r=\"22\" fill=\"#00AAFF\" stroke=\"#00AAFF\" stroke-opacity=\"0.28\" stroke-width=\"12\" id=\"symbol-bg\" />\n</svg>\n";
|
|
3114
3122
|
const SYMBOL_CLASSIFICATION = {
|
|
3115
|
-
[api.GeometryType.Polygon]: [
|
|
3116
|
-
[api.GeometryType.Polyline]: [
|
|
3117
|
-
[api.GeometryType.Point]: [
|
|
3123
|
+
[api.GeometryType.Polygon]: ['fill.color', 'stroke.color', 'stroke.width'],
|
|
3124
|
+
[api.GeometryType.Polyline]: ['stroke.color', 'stroke.width'],
|
|
3125
|
+
[api.GeometryType.Point]: ['angle', 'size', 'fill.color', 'fillColor', 'background.fillColor', 'background.strokeColor', 'background.strokeWidth', 'figure.fillColor', 'singleObjectSymbol.figure.fillColor', 'singleObjectSymbol.background.fillColor']
|
|
3118
3126
|
};
|
|
3119
3127
|
const SYMBOL_LIMITS = {
|
|
3120
3128
|
SIZE_MIN: 1,
|
|
@@ -3157,22 +3165,22 @@ const PARAMETER_INFOS = {
|
|
|
3157
3165
|
})
|
|
3158
3166
|
};
|
|
3159
3167
|
const OPERATOR_CONDITION_REMAP = {
|
|
3160
|
-
[exports.ComparisonOperator.Equals]:
|
|
3161
|
-
[exports.ComparisonOperator.NotEquals]:
|
|
3162
|
-
[exports.ComparisonOperator.GreaterThan]:
|
|
3163
|
-
[exports.ComparisonOperator.GreaterOrEquals]:
|
|
3164
|
-
[exports.ComparisonOperator.LessThan]:
|
|
3165
|
-
[exports.ComparisonOperator.LessOrEquals]:
|
|
3166
|
-
[exports.ComparisonOperator.Filled]:
|
|
3167
|
-
[exports.ComparisonOperator.Empty]:
|
|
3168
|
-
[exports.ComparisonOperator.Contains]:
|
|
3169
|
-
[exports.ComparisonOperator.NotContains]:
|
|
3170
|
-
[exports.ComparisonOperator.StartsWith]:
|
|
3171
|
-
[exports.ComparisonOperator.NotStartsWith]:
|
|
3172
|
-
[exports.ComparisonOperator.EndsWith]:
|
|
3173
|
-
[exports.ComparisonOperator.NotEndsWith]:
|
|
3174
|
-
[exports.ComparisonOperator.Between]:
|
|
3175
|
-
[exports.ComparisonOperator.Outside]:
|
|
3168
|
+
[exports.ComparisonOperator.Equals]: '==',
|
|
3169
|
+
[exports.ComparisonOperator.NotEquals]: '!=',
|
|
3170
|
+
[exports.ComparisonOperator.GreaterThan]: '>',
|
|
3171
|
+
[exports.ComparisonOperator.GreaterOrEquals]: '>=',
|
|
3172
|
+
[exports.ComparisonOperator.LessThan]: '<',
|
|
3173
|
+
[exports.ComparisonOperator.LessOrEquals]: '<=',
|
|
3174
|
+
[exports.ComparisonOperator.Filled]: '!=',
|
|
3175
|
+
[exports.ComparisonOperator.Empty]: '==',
|
|
3176
|
+
[exports.ComparisonOperator.Contains]: '==',
|
|
3177
|
+
[exports.ComparisonOperator.NotContains]: '!=',
|
|
3178
|
+
[exports.ComparisonOperator.StartsWith]: '==',
|
|
3179
|
+
[exports.ComparisonOperator.NotStartsWith]: '!=',
|
|
3180
|
+
[exports.ComparisonOperator.EndsWith]: '==',
|
|
3181
|
+
[exports.ComparisonOperator.NotEndsWith]: '!=',
|
|
3182
|
+
[exports.ComparisonOperator.Between]: 'between',
|
|
3183
|
+
[exports.ComparisonOperator.Outside]: '!between'
|
|
3176
3184
|
};
|
|
3177
3185
|
const BASE_OPERATORS = [exports.ComparisonOperator.Equals, exports.ComparisonOperator.NotEquals];
|
|
3178
3186
|
const CONTAINS_OPERATORS = [exports.ComparisonOperator.Contains, exports.ComparisonOperator.NotContains];
|
|
@@ -5790,7 +5798,7 @@ const Fullscreen = () => {
|
|
|
5790
5798
|
}));
|
|
5791
5799
|
};
|
|
5792
5800
|
|
|
5793
|
-
var _templateObject$4, _templateObject2$4, _templateObject3$3, _templateObject4$3, _templateObject5$3, _templateObject6$2, _templateObject7$2, _templateObject8$2, _templateObject9$1, _templateObject10$1, _templateObject11$1, _templateObject12$1, _templateObject13$1, _templateObject14$1, _templateObject15$1, _templateObject16$1, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33, _templateObject34, _templateObject35, _templateObject36;
|
|
5801
|
+
var _templateObject$4, _templateObject2$4, _templateObject3$3, _templateObject4$3, _templateObject5$3, _templateObject6$2, _templateObject7$2, _templateObject8$2, _templateObject9$1, _templateObject10$1, _templateObject11$1, _templateObject12$1, _templateObject13$1, _templateObject14$1, _templateObject15$1, _templateObject16$1, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33, _templateObject34, _templateObject35, _templateObject36, _templateObject37;
|
|
5794
5802
|
const MapLegendDescription = /*#__PURE__*/styled__default.div(_templateObject$4 || (_templateObject$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 0.75rem;\n"])));
|
|
5795
5803
|
const ItemText = /*#__PURE__*/styled__default.div(_templateObject2$4 || (_templateObject2$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n max-width: calc(100% - 2rem);\n font: ", ";\n"])), _ref => {
|
|
5796
5804
|
let {
|
|
@@ -5800,18 +5808,18 @@ const ItemText = /*#__PURE__*/styled__default.div(_templateObject2$4 || (_templa
|
|
|
5800
5808
|
} = _ref;
|
|
5801
5809
|
return fonts.description;
|
|
5802
5810
|
});
|
|
5803
|
-
const ItemSeparator = /*#__PURE__*/styled__default.div(_templateObject3$3 || (_templateObject3$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n :after {\n content:
|
|
5804
|
-
const SymbolContainer = /*#__PURE__*/styled__default(
|
|
5811
|
+
const ItemSeparator = /*#__PURE__*/styled__default.div(_templateObject3$3 || (_templateObject3$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n :after {\n content: '-';\n margin: 0 0.5rem;\n font-size: 0.75rem;\n }\n"])));
|
|
5812
|
+
const SymbolContainer = /*#__PURE__*/styled__default('span')(_templateObject4$3 || (_templateObject4$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: center;\n min-width: 16px;\n margin-right: 0.5rem;\n"])));
|
|
5805
5813
|
const ClassifiedItem = /*#__PURE__*/styled__default.div(_templateObject5$3 || (_templateObject5$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n align-items: center;\n cursor: ", ";\n pointer-events: ", ";\n\n :not(:last-of-type) {\n margin-bottom: 0.25rem;\n }\n\n ", ", ", " {\n transition: opacity 150ms;\n }\n\n ", " {\n opacity: ", ";\n }\n\n ", " {\n opacity: ", ";\n }\n\n :hover {\n ", ", ", " {\n opacity: 1;\n }\n }\n"])), _ref2 => {
|
|
5806
5814
|
let {
|
|
5807
5815
|
isClusterFillColor
|
|
5808
5816
|
} = _ref2;
|
|
5809
|
-
return isClusterFillColor ?
|
|
5817
|
+
return isClusterFillColor ? 'default' : 'pointer';
|
|
5810
5818
|
}, _ref3 => {
|
|
5811
5819
|
let {
|
|
5812
5820
|
isClusterFillColor
|
|
5813
5821
|
} = _ref3;
|
|
5814
|
-
return isClusterFillColor ?
|
|
5822
|
+
return isClusterFillColor ? 'none' : 'auto';
|
|
5815
5823
|
}, ItemText, SymbolContainer, ItemText, _ref4 => {
|
|
5816
5824
|
let {
|
|
5817
5825
|
isHidden
|
|
@@ -5845,7 +5853,7 @@ const MaximizedLegendContainer = /*#__PURE__*/styled__default.div(_templateObjec
|
|
|
5845
5853
|
let {
|
|
5846
5854
|
isShown
|
|
5847
5855
|
} = _ref8;
|
|
5848
|
-
return isShown ?
|
|
5856
|
+
return isShown ? 'relative' : 'absolute';
|
|
5849
5857
|
}, _ref9 => {
|
|
5850
5858
|
let {
|
|
5851
5859
|
isShown
|
|
@@ -5855,7 +5863,7 @@ const MaximizedLegendContainer = /*#__PURE__*/styled__default.div(_templateObjec
|
|
|
5855
5863
|
let {
|
|
5856
5864
|
isShown
|
|
5857
5865
|
} = _ref10;
|
|
5858
|
-
return isShown ?
|
|
5866
|
+
return isShown ? 'visible' : 'hidden';
|
|
5859
5867
|
});
|
|
5860
5868
|
const MinimizedLegendContainer = /*#__PURE__*/styled__default(MaximizedLegendContainer)(_templateObject13$1 || (_templateObject13$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: calc(100% - 1.5rem);\n padding-right: 1.5rem;\n"])));
|
|
5861
5869
|
const MapLegendSectionContainer = /*#__PURE__*/styled__default.div(_templateObject14$1 || (_templateObject14$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 100%;\n\n :not(:last-child) {\n margin-bottom: 1rem;\n }\n"])));
|
|
@@ -5870,7 +5878,7 @@ const MapLegendSectionItems = /*#__PURE__*/styled__default.div(_templateObject15
|
|
|
5870
5878
|
let {
|
|
5871
5879
|
isExpanded
|
|
5872
5880
|
} = _ref12;
|
|
5873
|
-
return isExpanded ?
|
|
5881
|
+
return isExpanded ? 'none' : 'hidden';
|
|
5874
5882
|
});
|
|
5875
5883
|
const MapLegendValueDescr = /*#__PURE__*/styled__default.div(_templateObject16$1 || (_templateObject16$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n min-height: 1rem;\n margin-bottom: 0.25rem;\n font-size: 0.75rem;\n font-weight: 600;\n line-height: 1rem;\n"])));
|
|
5876
5884
|
|
|
@@ -5879,7 +5887,7 @@ const SizeLegendItemMixin = function SizeLegendItemMixin(value) {
|
|
|
5879
5887
|
value = 0;
|
|
5880
5888
|
}
|
|
5881
5889
|
|
|
5882
|
-
return styled.css(_templateObject17 || (_templateObject17 = _taggedTemplateLiteralLoose(["\n position: absolute;\n bottom: 0;\n left: 50%;\n display: flex;\n align-items: flex-end;\n flex: none;\n height: inherit;\n width: inherit;\n margin: 0 auto;\n background: none;\n border: none;\n\n :after {\n content:
|
|
5890
|
+
return styled.css(_templateObject17 || (_templateObject17 = _taggedTemplateLiteralLoose(["\n position: absolute;\n bottom: 0;\n left: 50%;\n display: flex;\n align-items: flex-end;\n flex: none;\n height: inherit;\n width: inherit;\n margin: 0 auto;\n background: none;\n border: none;\n\n :after {\n content: '';\n display: flex;\n border: 1px rgba(48, 69, 79, 0.28) solid;\n border-radius: 50%;\n margin: 0 0 0 -", "px;\n width: ", "px;\n height: ", "px;\n }\n"])), value / 2, value, value);
|
|
5883
5891
|
};
|
|
5884
5892
|
|
|
5885
5893
|
const StrokeWidthLegendItemMixin = function StrokeWidthLegendItemMixin(value) {
|
|
@@ -5887,7 +5895,7 @@ const StrokeWidthLegendItemMixin = function StrokeWidthLegendItemMixin(value) {
|
|
|
5887
5895
|
value = 0;
|
|
5888
5896
|
}
|
|
5889
5897
|
|
|
5890
|
-
return styled.css(_templateObject18 || (_templateObject18 = _taggedTemplateLiteralLoose(["\n position: relative;\n background: none;\n border: none;\n display: flex;\n align-items: center;\n flex: none;\n width: calc(100% - 2rem);\n height: ", "px;\n margin: 0 0 0.25rem 0;\n padding-left: 2rem;\n font-size: 0.75rem;\n
|
|
5898
|
+
return styled.css(_templateObject18 || (_templateObject18 = _taggedTemplateLiteralLoose(["\n position: relative;\n background: none;\n border: none;\n display: flex;\n align-items: center;\n flex: none;\n width: calc(100% - 2rem);\n height: ", "px;\n margin: 0 0 0.25rem 0;\n padding-left: 2rem;\n font-size: 0.75rem;\n\n :first-child,\n :last-child {\n height: auto;\n }\n\n :after {\n content: '';\n position: absolute;\n top: 50%;\n left: 0;\n width: 1.5rem;\n height: ", "px;\n margin-top: -", "px;\n background: rgb(224, 224, 224);\n }\n"])), value, value, Math.round(value / 2));
|
|
5891
5899
|
};
|
|
5892
5900
|
|
|
5893
5901
|
const StrokeColorLegendItemMixin = /*#__PURE__*/styled.css(_templateObject19 || (_templateObject19 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-right: 0.5rem;\n width: 1.5rem;\n"])));
|
|
@@ -5895,12 +5903,12 @@ const MapLegendItem = /*#__PURE__*/styled__default.div(_templateObject20 || (_te
|
|
|
5895
5903
|
let {
|
|
5896
5904
|
parameter
|
|
5897
5905
|
} = _ref13;
|
|
5898
|
-
return isParameterType([
|
|
5906
|
+
return isParameterType(['strokeColor', 'stroke.color'], parameter) ? 0.25 : 1;
|
|
5899
5907
|
}, _ref14 => {
|
|
5900
5908
|
let {
|
|
5901
5909
|
value
|
|
5902
5910
|
} = _ref14;
|
|
5903
|
-
return typeof value ===
|
|
5911
|
+
return typeof value === 'number' ? 'none' : value;
|
|
5904
5912
|
}, _ref15 => {
|
|
5905
5913
|
let {
|
|
5906
5914
|
isHidden
|
|
@@ -5911,13 +5919,13 @@ const MapLegendItem = /*#__PURE__*/styled__default.div(_templateObject20 || (_te
|
|
|
5911
5919
|
value,
|
|
5912
5920
|
parameter
|
|
5913
5921
|
} = _ref16;
|
|
5914
|
-
return isParameterType(
|
|
5922
|
+
return isParameterType('size', parameter) && SizeLegendItemMixin(value);
|
|
5915
5923
|
}, _ref17 => {
|
|
5916
5924
|
let {
|
|
5917
5925
|
value,
|
|
5918
5926
|
parameter
|
|
5919
5927
|
} = _ref17;
|
|
5920
|
-
return isParameterType([
|
|
5928
|
+
return isParameterType(['strokeWidth', 'stroke.width'], parameter) && StrokeWidthLegendItemMixin(value);
|
|
5921
5929
|
});
|
|
5922
5930
|
const MapLegendOther = /*#__PURE__*/styled__default(MapLegendItem)(_templateObject21 || (_templateObject21 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n flex: none;\n position: relative;\n width: 1rem;\n margin-left: 0.25rem;\n border-radius: 0.125rem;\n"])));
|
|
5923
5931
|
const SizeLegendItemsMixin = /*#__PURE__*/styled.css(_templateObject22 || (_templateObject22 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n width: 2rem;\n height: 2rem;\n margin: 0 auto;\n\n ", " {\n width: auto;\n margin-left: 0;\n }\n"])), MapLegendOther);
|
|
@@ -5937,7 +5945,7 @@ const SingleLegendItemsMixin = /*#__PURE__*/styled.css(_templateObject30 || (_te
|
|
|
5937
5945
|
let {
|
|
5938
5946
|
parameter
|
|
5939
5947
|
} = _ref19;
|
|
5940
|
-
return isParameterType([
|
|
5948
|
+
return isParameterType(['strokeColor', 'stroke.color'], parameter) && StrokeColorLegendItemMixin;
|
|
5941
5949
|
});
|
|
5942
5950
|
const MapLegendItems = /*#__PURE__*/styled__default.div(_templateObject31 || (_templateObject31 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n width: 100%;\n border-radius: 0.125rem;\n\n ", ";\n ", ";\n ", ";\n"])), _ref20 => {
|
|
5943
5951
|
let {
|
|
@@ -5959,7 +5967,8 @@ const MapLegendItemsContainer = /*#__PURE__*/styled__default.div(_templateObject
|
|
|
5959
5967
|
const MapLegendValues = /*#__PURE__*/styled__default.div(_templateObject33 || (_templateObject33 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n width: 100%;\n margin-top: 0.5rem;\n font-size: 0.75rem;\n color: rgba(48, 69, 79, 0.65);\n"])));
|
|
5960
5968
|
const MapLegendValuesRange = /*#__PURE__*/styled__default.div(_templateObject34 || (_templateObject34 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n width: calc(100% - 1.25rem);\n\n div {\n flex: 1;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n\n :first-child {\n margin-right: 0.5rem;\n }\n\n :last-child {\n margin-left: 0.5rem;\n text-align: right;\n }\n }\n"])));
|
|
5961
5969
|
const MapLegendValuesOther = /*#__PURE__*/styled__default(MapLegendOther)(_templateObject35 || (_templateObject35 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n justify-content: center;\n border: 0;\n overflow: visible;\n"])));
|
|
5962
|
-
const MapLegendExpandButton = /*#__PURE__*/styled__default.div(_templateObject36 || (_templateObject36 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n cursor: pointer;\n margin-top: 0.1rem;\n font-size: 0.625rem;\n color: #
|
|
5970
|
+
const MapLegendExpandButton = /*#__PURE__*/styled__default.div(_templateObject36 || (_templateObject36 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n cursor: pointer;\n margin-top: 0.1rem;\n font-size: 0.625rem;\n color: #1fb3aa;\n"])));
|
|
5971
|
+
const ClusterLegendContainer = /*#__PURE__*/styled__default.div(_templateObject37 || (_templateObject37 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin: -0.9rem;\n transform: scale(0.5);\n"])));
|
|
5963
5972
|
|
|
5964
5973
|
const getValueFromLegendTitle = (title, minOrMax) => {
|
|
5965
5974
|
if (title.includes(" - ")) {
|
|
@@ -6112,7 +6121,7 @@ const useSvgSymbol = (symbol, skipOffset) => {
|
|
|
6112
6121
|
|
|
6113
6122
|
var _templateObject$5, _templateObject2$5;
|
|
6114
6123
|
const SvgSymbolContainer = /*#__PURE__*/styled__default.div(_templateObject$5 || (_templateObject$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n"])));
|
|
6115
|
-
const SvgSymbolLabel = /*#__PURE__*/styled__default.div(_templateObject2$5 || (_templateObject2$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #fff;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n"])), _ref => {
|
|
6124
|
+
const SvgSymbolLabel = /*#__PURE__*/styled__default.div(_templateObject2$5 || (_templateObject2$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: #fff;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n line-height: 0;\n"])), _ref => {
|
|
6116
6125
|
let {
|
|
6117
6126
|
fontSettings
|
|
6118
6127
|
} = _ref;
|
|
@@ -6136,7 +6145,7 @@ const SvgSymbolLabel = /*#__PURE__*/styled__default.div(_templateObject2$5 || (_
|
|
|
6136
6145
|
let {
|
|
6137
6146
|
fontSettings
|
|
6138
6147
|
} = _ref5;
|
|
6139
|
-
return !!(fontSettings != null && fontSettings.fontSize) && "font-size: " + (typeof fontSettings.fontSize ===
|
|
6148
|
+
return !!(fontSettings != null && fontSettings.fontSize) && "font-size: " + (typeof fontSettings.fontSize === 'string' ? fontSettings.fontSize : fontSettings.fontSize + "px");
|
|
6140
6149
|
}, _ref6 => {
|
|
6141
6150
|
let {
|
|
6142
6151
|
fontSettings
|
|
@@ -6219,24 +6228,48 @@ const SymbolByType = _ref => {
|
|
|
6219
6228
|
}
|
|
6220
6229
|
};
|
|
6221
6230
|
|
|
6231
|
+
const ClusterSymbolPreview = _ref => {
|
|
6232
|
+
var _symbol$labelSymbol;
|
|
6233
|
+
|
|
6234
|
+
let {
|
|
6235
|
+
symbol,
|
|
6236
|
+
size = 56,
|
|
6237
|
+
fontSize = '1.25rem'
|
|
6238
|
+
} = _ref;
|
|
6239
|
+
const svgSymbol = {
|
|
6240
|
+
type: 'svgPointSymbol',
|
|
6241
|
+
size,
|
|
6242
|
+
offset: [0, 0],
|
|
6243
|
+
angle: 0,
|
|
6244
|
+
background: {
|
|
6245
|
+
id: 'symbol-bg',
|
|
6246
|
+
fillColor: getParameterValue(symbol.fillColor),
|
|
6247
|
+
strokeColor: symbol.strokeColor,
|
|
6248
|
+
strokeWidth: 6,
|
|
6249
|
+
type: 'circle'
|
|
6250
|
+
}
|
|
6251
|
+
};
|
|
6252
|
+
return React__default.createElement(SvgSymbol, {
|
|
6253
|
+
svg: DEFAULT_CLUSTER_SVG,
|
|
6254
|
+
symbol: svgSymbol,
|
|
6255
|
+
text: '99',
|
|
6256
|
+
fontSettings: _extends({}, symbol.labelSymbol, {
|
|
6257
|
+
fontSize: fontSize || ((_symbol$labelSymbol = symbol.labelSymbol) == null ? void 0 : _symbol$labelSymbol.fontSize)
|
|
6258
|
+
})
|
|
6259
|
+
});
|
|
6260
|
+
};
|
|
6261
|
+
|
|
6222
6262
|
const LegendSymbolRenderer = /*#__PURE__*/React.memo(_ref => {
|
|
6223
6263
|
let {
|
|
6224
6264
|
symbol
|
|
6225
6265
|
} = _ref;
|
|
6226
6266
|
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
symbol={deserializeSymbol(symbol)}
|
|
6234
|
-
size={getLegendSymbolSize(symbol) || DEFAULT_LEGEND_SYMBOL_SIZE}
|
|
6235
|
-
type={symbol.type}
|
|
6236
|
-
svg={(symbol as SvgPointSymbol).data}
|
|
6237
|
-
skipOffset
|
|
6238
|
-
/>
|
|
6239
|
-
);*/
|
|
6267
|
+
if (isClusterSymbol(symbol)) {
|
|
6268
|
+
return React__default.createElement(ClusterLegendContainer, null, React__default.createElement(ClusterSymbolPreview, {
|
|
6269
|
+
symbol: symbol
|
|
6270
|
+
}));
|
|
6271
|
+
}
|
|
6272
|
+
|
|
6240
6273
|
return React__default.createElement(SymbolByType, {
|
|
6241
6274
|
symbol: deserializeSymbol(symbol),
|
|
6242
6275
|
size: getLegendSymbolSize(symbol) || DEFAULT_LEGEND_SYMBOL_SIZE,
|
|
@@ -6259,16 +6292,13 @@ const MaximizedLegend = _ref => {
|
|
|
6259
6292
|
hiddenLegends,
|
|
6260
6293
|
toggleHiddenLegend
|
|
6261
6294
|
} = _ref;
|
|
6262
|
-
const
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
const
|
|
6266
|
-
const isSize = isParameterType("size", parameter);
|
|
6267
|
-
const isStrokeWidth = isParameterType(["strokeWidth", "stroke.width"], parameter);
|
|
6268
|
-
const isStrokeColor = isParameterType(["strokeColor", "stroke.color"], parameter);
|
|
6295
|
+
const isDate = attributeType === 'DateTime';
|
|
6296
|
+
const isSize = isParameterType('size', parameter);
|
|
6297
|
+
const isStrokeWidth = isParameterType(['strokeWidth', 'stroke.width'], parameter);
|
|
6298
|
+
const isStrokeColor = isParameterType(['strokeColor', 'stroke.color'], parameter);
|
|
6269
6299
|
const parameterValue = React.useMemo(() => get(sectionSymbol, parameter), [sectionSymbol, parameter]);
|
|
6270
6300
|
const renderColumn = React.useCallback((column, index) => {
|
|
6271
|
-
const dateTime = column.split(
|
|
6301
|
+
const dateTime = column.split(' ');
|
|
6272
6302
|
return React__default.createElement(React.Fragment, {
|
|
6273
6303
|
key: index
|
|
6274
6304
|
}, React__default.createElement(ItemText, {
|
|
@@ -6277,10 +6307,10 @@ const MaximizedLegend = _ref => {
|
|
|
6277
6307
|
}, []);
|
|
6278
6308
|
const renderItemText = React.useCallback((title, index) => {
|
|
6279
6309
|
if (!title) {
|
|
6280
|
-
return React__default.createElement(ItemText, null,
|
|
6310
|
+
return React__default.createElement(ItemText, null, "\u0414\u0440\u0443\u0433\u043E\u0435");
|
|
6281
6311
|
}
|
|
6282
6312
|
|
|
6283
|
-
const columns = title == null ? void 0 : title.split(
|
|
6313
|
+
const columns = title == null ? void 0 : title.split(' - ');
|
|
6284
6314
|
const isSingleColumn = (columns == null ? void 0 : columns.length) === 1;
|
|
6285
6315
|
|
|
6286
6316
|
if (!isDate || index && isSingleColumn) {
|
|
@@ -6296,7 +6326,7 @@ const MaximizedLegend = _ref => {
|
|
|
6296
6326
|
}
|
|
6297
6327
|
|
|
6298
6328
|
return React__default.createElement(React__default.Fragment, null, columns.map(renderColumn));
|
|
6299
|
-
}, [isDate, renderColumn
|
|
6329
|
+
}, [isDate, renderColumn]);
|
|
6300
6330
|
const isHidden = React.useCallback(hiddenCondition => !!(hiddenLegends != null && hiddenLegends.includes(hiddenCondition)), [hiddenLegends]);
|
|
6301
6331
|
const renderLegend = React.useCallback((_ref2, index) => {
|
|
6302
6332
|
var _parameterValue$value;
|
|
@@ -6327,7 +6357,7 @@ const MaximizedLegend = _ref => {
|
|
|
6327
6357
|
})) : React__default.createElement(SymbolContainer, null, React__default.createElement(LegendSymbolRenderer, {
|
|
6328
6358
|
symbol: isClusterFillColor$1 ? symbol : getExtractedSymbol(symbol, true)
|
|
6329
6359
|
})), renderItemText(title, index));
|
|
6330
|
-
}, [
|
|
6360
|
+
}, [parameter, sectionIndex, isHidden, isSize, isStrokeWidth, isStrokeColor, parameterValue, renderItemText, toggleHiddenLegend, layerName]);
|
|
6331
6361
|
return React__default.createElement(MaximizedLegendContainer, {
|
|
6332
6362
|
ref: innerRef,
|
|
6333
6363
|
isShown: isShown
|
|
@@ -6357,9 +6387,6 @@ const LegendSection = _ref => {
|
|
|
6357
6387
|
formatValue,
|
|
6358
6388
|
index
|
|
6359
6389
|
} = _ref;
|
|
6360
|
-
const {
|
|
6361
|
-
t
|
|
6362
|
-
} = reactI18next.useTranslation("common");
|
|
6363
6390
|
const [isExpanded, toggleExpanded] = useToggle();
|
|
6364
6391
|
const [maxRef, maxNode] = useNode();
|
|
6365
6392
|
const [minRef, minNode] = useNode();
|
|
@@ -6379,16 +6406,16 @@ const LegendSection = _ref => {
|
|
|
6379
6406
|
parameter: parameter,
|
|
6380
6407
|
attributeType: attribute.type,
|
|
6381
6408
|
index: index,
|
|
6382
|
-
values: getMaximizedLegendValues(attribute, parameter, parameters, classified, symbol, formatValue, index,
|
|
6409
|
+
values: getMaximizedLegendValues(attribute, parameter, parameters, classified, symbol, formatValue, index, 'Другое')
|
|
6383
6410
|
}), React__default.createElement(MinimizedLegend, {
|
|
6384
6411
|
innerRef: minRef,
|
|
6385
6412
|
isShown: !isExpanded,
|
|
6386
6413
|
hiddenLegends: hiddenLegends == null ? void 0 : hiddenLegends[layerName],
|
|
6387
6414
|
parameter: parameter,
|
|
6388
|
-
values: getMinimizedLegendValues(attribute, classified, formatValue, index,
|
|
6415
|
+
values: getMinimizedLegendValues(attribute, classified, formatValue, index, 'Другое')
|
|
6389
6416
|
})), React__default.createElement(MapLegendExpandButton, {
|
|
6390
6417
|
onClick: toggleExpanded
|
|
6391
|
-
},
|
|
6418
|
+
}, isExpanded ? 'Свернуть' : 'Развернуть'));
|
|
6392
6419
|
};
|
|
6393
6420
|
|
|
6394
6421
|
const _excluded$3 = ["layerInfo"];
|
|
@@ -6406,16 +6433,30 @@ const Legend = /*#__PURE__*/React.memo(_ref => {
|
|
|
6406
6433
|
var _classified$param$val, _layerInfo$style;
|
|
6407
6434
|
|
|
6408
6435
|
const attributeName = getAttributeNameFromCondition((_classified$param$val = classified[param].values[0]) == null ? void 0 : _classified$param$val.condition);
|
|
6436
|
+
let attribute = attributes.find(_ref2 => {
|
|
6437
|
+
let {
|
|
6438
|
+
name
|
|
6439
|
+
} = _ref2;
|
|
6440
|
+
return name === attributeName;
|
|
6441
|
+
});
|
|
6442
|
+
|
|
6443
|
+
if (!attribute) {
|
|
6444
|
+
if (attributeName === 'count') {
|
|
6445
|
+
attribute = {
|
|
6446
|
+
name: 'count',
|
|
6447
|
+
alias: 'Количество',
|
|
6448
|
+
type: api.AttributeType.Int32
|
|
6449
|
+
};
|
|
6450
|
+
} else {
|
|
6451
|
+
return null;
|
|
6452
|
+
}
|
|
6453
|
+
}
|
|
6454
|
+
|
|
6409
6455
|
return React__default.createElement(LegendSection, Object.assign({
|
|
6410
6456
|
key: index,
|
|
6411
6457
|
layerName: layerInfo.name,
|
|
6412
6458
|
symbol: (_layerInfo$style = layerInfo.style) == null ? void 0 : _layerInfo$style.symbol,
|
|
6413
|
-
attribute:
|
|
6414
|
-
let {
|
|
6415
|
-
name
|
|
6416
|
-
} = _ref2;
|
|
6417
|
-
return name === attributeName;
|
|
6418
|
-
}),
|
|
6459
|
+
attribute: attribute,
|
|
6419
6460
|
classified: classified[param],
|
|
6420
6461
|
parameter: param,
|
|
6421
6462
|
parameters: parameters,
|
|
@@ -6840,8 +6881,10 @@ exports.ClassificationCondition = ClassificationCondition;
|
|
|
6840
6881
|
exports.ClassificationManager = ClassificationManager;
|
|
6841
6882
|
exports.ClassifiedItem = ClassifiedItem;
|
|
6842
6883
|
exports.ClusterLayer = ClusterLayer;
|
|
6884
|
+
exports.ClusterLegendContainer = ClusterLegendContainer;
|
|
6843
6885
|
exports.ClusterSymbol = ClusterSymbol;
|
|
6844
6886
|
exports.CompoundIcon = CompoundIcon;
|
|
6887
|
+
exports.DEFAULT_CLUSTER_SVG = DEFAULT_CLUSTER_SVG;
|
|
6845
6888
|
exports.DEFAULT_CRS = DEFAULT_CRS;
|
|
6846
6889
|
exports.DEFAULT_ID_ATTRIBUTE_NAME = DEFAULT_ID_ATTRIBUTE_NAME;
|
|
6847
6890
|
exports.DEFAULT_LEGEND_SIZES = DEFAULT_LEGEND_SIZES;
|