@evergis/react 2.0.190 → 2.0.192

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.
@@ -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
 
@@ -728,6 +727,73 @@ const isParameterValueSymbol = parameterValue => !isParameterValueSimple(paramet
728
727
 
729
728
  const isStyle = value => 'symbol' in value;
730
729
 
730
+ let EvergisStyle = /*#__PURE__*/function () {
731
+ function EvergisStyle(style) {
732
+ _classCallCheck(this, EvergisStyle);
733
+
734
+ this.style = extractStyle(style);
735
+ this.classificationManager = new ClassificationManager(this.style);
736
+ }
737
+
738
+ _createClass(EvergisStyle, [{
739
+ key: "serialize",
740
+ value: function serialize() {
741
+ return packStyle(this.style);
742
+ }
743
+ }, {
744
+ key: "hasRasters",
745
+ value: function hasRasters() {
746
+ return !!(this.style.raster || (this.style.children || []).some(style => style.raster));
747
+ }
748
+ }, {
749
+ key: "symbol",
750
+ get: function get() {
751
+ return this.style.symbol;
752
+ }
753
+ }, {
754
+ key: "raster",
755
+ get: function get() {
756
+ return this.style.raster;
757
+ }
758
+ }, {
759
+ key: "label",
760
+ get: function get() {
761
+ return this.style.label;
762
+ }
763
+ }, {
764
+ key: "children",
765
+ get: function get() {
766
+ return this.style.children;
767
+ }
768
+ }, {
769
+ key: "title",
770
+ get: function get() {
771
+ return this.style.title;
772
+ }
773
+ }, {
774
+ key: "condition",
775
+ get: function get() {
776
+ return this.style.condition;
777
+ }
778
+ }, {
779
+ key: "ignoreLabel",
780
+ get: function get() {
781
+ return this.style.ignoreLabel;
782
+ }
783
+ }, {
784
+ key: "resolution",
785
+ get: function get() {
786
+ const {
787
+ minResolution,
788
+ maxResolution
789
+ } = this.style;
790
+ return minResolution === void 0 || maxResolution === void 0 ? null : [minResolution, maxResolution];
791
+ }
792
+ }]);
793
+
794
+ return EvergisStyle;
795
+ }();
796
+
731
797
  const toClassificationClass = (parameterValue, title, condition) => _extends({
732
798
  parameterValue,
733
799
  title
@@ -903,73 +969,6 @@ function getRangeValues(_ref, isDouble, isDate, index) {
903
969
  };
904
970
  }
905
971
 
906
- let EvergisStyle = /*#__PURE__*/function () {
907
- function EvergisStyle(style) {
908
- _classCallCheck(this, EvergisStyle);
909
-
910
- this.style = extractStyle(style);
911
- this.classificationManager = new ClassificationManager(this.style);
912
- }
913
-
914
- _createClass(EvergisStyle, [{
915
- key: "serialize",
916
- value: function serialize() {
917
- return packStyle(this.style);
918
- }
919
- }, {
920
- key: "hasRasters",
921
- value: function hasRasters() {
922
- return !!(this.style.raster || (this.style.children || []).some(style => style.raster));
923
- }
924
- }, {
925
- key: "symbol",
926
- get: function get() {
927
- return this.style.symbol;
928
- }
929
- }, {
930
- key: "raster",
931
- get: function get() {
932
- return this.style.raster;
933
- }
934
- }, {
935
- key: "label",
936
- get: function get() {
937
- return this.style.label;
938
- }
939
- }, {
940
- key: "children",
941
- get: function get() {
942
- return this.style.children;
943
- }
944
- }, {
945
- key: "title",
946
- get: function get() {
947
- return this.style.title;
948
- }
949
- }, {
950
- key: "condition",
951
- get: function get() {
952
- return this.style.condition;
953
- }
954
- }, {
955
- key: "ignoreLabel",
956
- get: function get() {
957
- return this.style.ignoreLabel;
958
- }
959
- }, {
960
- key: "resolution",
961
- get: function get() {
962
- const {
963
- minResolution,
964
- maxResolution
965
- } = this.style;
966
- return minResolution === void 0 || maxResolution === void 0 ? null : [minResolution, maxResolution];
967
- }
968
- }]);
969
-
970
- return EvergisStyle;
971
- }();
972
-
973
972
  const getHexColor = colorString => colorString ? new color.Color(colorString).toString('hex') : undefined;
974
973
 
975
974
  // TODO reduce
@@ -2501,10 +2500,10 @@ let FilterCondition = /*#__PURE__*/function () {
2501
2500
  return FilterCondition;
2502
2501
  }();
2503
2502
 
2504
- const isLayerService = value => isObject(value) && "name" in 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("(") ? parts[0].slice(1) : parts[0];
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(" && ").map(part => part.slice(1, -1));
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 == null ? void 0 : condition.includes('(')) || false;
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) === "Double";
2558
- const isDate = ((_value$attribute2 = value.attribute) == null ? void 0 : _value$attribute2.type) === "DateTime";
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 ? "более " : "") + formattedFrom;
2570
+ return "" + (!isDate ? 'более ' : '') + formattedFrom;
2572
2571
  }
2573
2572
 
2574
2573
  return from === to ? "" + formattedFrom : formattedFrom + " - " + formattedTo;
@@ -2580,69 +2579,68 @@ 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) === "byAttribute";
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(" == ");
2590
- return (_parts$ = parts[1]) == null ? void 0 : _parts$.slice(1, -1);
2588
+ const parts = condition == null ? void 0 : condition.split(' == ');
2589
+ return (parts == null ? void 0 : (_parts$ = parts[1]) == null ? void 0 : _parts$.slice(1, -1)) || '';
2591
2590
  };
2592
-
2593
- function createValueTitle$1(paramValue, attribute, formatValue, index) {
2591
+ function createValueTitleFromCondition(paramValue, attribute, formatValue, index) {
2592
+ if (!attribute) return '';
2594
2593
  if (paramValue.title) return paramValue.title;
2595
2594
  const value = {
2596
2595
  parameterValue: getParameterValue(paramValue.value),
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(" && ") && isFirstFrom ? getValueFromConditionPart(paramValue.condition, 2) : !isFirstFrom ? getValueFromConditionPart(paramValue.condition, 1) : null;
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
2609
2608
 
2610
-
2611
2609
  const DEFAULT_LEGEND_STYLES = {
2612
2610
  [0
2613
2611
  /* Point */
2614
2612
  ]: {
2615
- fillColor: "#00000047",
2613
+ fillColor: '#00000047',
2616
2614
  strokeWidth: 1,
2617
- strokeColor: "#0000001f"
2615
+ strokeColor: '#0000001f'
2618
2616
  },
2619
2617
  [1
2620
2618
  /* ImagePoint */
2621
2619
  ]: {
2622
- maskedColor: "#00000047"
2620
+ maskedColor: '#00000047'
2623
2621
  },
2624
2622
  [2
2625
2623
  /* Line */
2626
2624
  ]: {
2627
2625
  stroke: {
2628
2626
  width: 2,
2629
- color: "#00000047"
2627
+ color: '#00000047'
2630
2628
  }
2631
2629
  },
2632
2630
  [3
2633
2631
  /* Polygon */
2634
2632
  ]: {
2635
2633
  fill: {
2636
- color: "#00000000",
2637
- hatchColor: "#00000000"
2634
+ color: '#00000000',
2635
+ hatchColor: '#00000000'
2638
2636
  },
2639
2637
  stroke: {
2640
2638
  width: 1,
2641
- color: "#0000001f"
2639
+ color: '#0000001f'
2642
2640
  }
2643
2641
  }
2644
2642
  };
2645
- const SYMBOL_SIZE_PARAMETERS = ["size", "width", "height"]; // Основывается на http://cf.everpoint.ru/pages/viewpage.action?pageId=45024217 -> пункт "Библиотека символов"
2643
+ const SYMBOL_SIZE_PARAMETERS = ['size', 'width', 'height']; // Основывается на http://cf.everpoint.ru/pages/viewpage.action?pageId=45024217 -> пункт "Библиотека символов"
2646
2644
 
2647
2645
  const DEFAULT_LEGEND_SIZES = {
2648
2646
  circlePointSymbol: 8,
@@ -2672,16 +2670,16 @@ const updateSymbolParameter = (symbol, path, value) => symbolParameterWalker(()
2672
2670
 
2673
2671
  const createPointSymbol = (baseSymbol, parameter, classificationsParams, parameterValue) => {
2674
2672
  return updateSymbolParameter(_extends({}, baseSymbol, {
2675
- fillColor: getNonClassifiedParamValue(baseSymbol, "fillColor", classificationsParams, 0
2673
+ fillColor: getNonClassifiedParamValue(baseSymbol, 'fillColor', classificationsParams, 0
2676
2674
  /* Point */
2677
2675
  ),
2678
- strokeColor: getNonClassifiedParamValue(baseSymbol, "strokeColor", classificationsParams, 0
2676
+ strokeColor: getNonClassifiedParamValue(baseSymbol, 'strokeColor', classificationsParams, 0
2679
2677
  /* Point */
2680
2678
  ),
2681
- strokeWidth: getNonClassifiedParamValue(baseSymbol, "strokeWidth", classificationsParams, 0
2679
+ strokeWidth: getNonClassifiedParamValue(baseSymbol, 'strokeWidth', classificationsParams, 0
2682
2680
  /* Point */
2683
2681
  ),
2684
- size: getNonClassifiedParamValue(baseSymbol, "size", classificationsParams, 0
2682
+ size: getNonClassifiedParamValue(baseSymbol, 'size', classificationsParams, 0
2685
2683
  /* Point */
2686
2684
  ),
2687
2685
  offset: [0, 0]
@@ -2718,12 +2716,12 @@ const createImagePointSymbol = (baseSymbol, parameter, classificationsParams, pa
2718
2716
  let symbol = _extends({}, baseSymbol);
2719
2717
 
2720
2718
  if (isMaskedImageSymbol(symbol)) {
2721
- symbol.maskedColor = getNonClassifiedParamValue(baseSymbol, "maskedColor", classificationsParams, 1
2719
+ symbol.maskedColor = getNonClassifiedParamValue(baseSymbol, 'maskedColor', classificationsParams, 1
2722
2720
  /* ImagePoint */
2723
2721
  );
2724
2722
  }
2725
2723
 
2726
- if (parameter === "height" || parameter === "width") {
2724
+ if (parameter === 'height' || parameter === 'width') {
2727
2725
  const {
2728
2726
  height,
2729
2727
  width
@@ -2731,7 +2729,7 @@ const createImagePointSymbol = (baseSymbol, parameter, classificationsParams, pa
2731
2729
  symbol.height = height;
2732
2730
  symbol.width = width;
2733
2731
  } else {
2734
- symbol.width = getNonClassifiedParamValue(baseSymbol, "width", classificationsParams, 1
2732
+ symbol.width = getNonClassifiedParamValue(baseSymbol, 'width', classificationsParams, 1
2735
2733
  /* ImagePoint */
2736
2734
  );
2737
2735
  symbol.height = symbol.width;
@@ -2744,12 +2742,12 @@ const createImagePointSymbol = (baseSymbol, parameter, classificationsParams, pa
2744
2742
 
2745
2743
  const createLineSymbol = (baseSymbol, parameter, classificationsParams, parameterValue) => {
2746
2744
  return updateSymbolParameter(_extends({}, baseSymbol, {
2747
- type: "polylineSymbol",
2745
+ type: 'polylineSymbol',
2748
2746
  stroke: {
2749
- color: getNonClassifiedParamValue(baseSymbol, "stroke.color", classificationsParams, 2
2747
+ color: getNonClassifiedParamValue(baseSymbol, 'stroke.color', classificationsParams, 2
2750
2748
  /* Line */
2751
2749
  ),
2752
- width: getNonClassifiedParamValue(baseSymbol, "stroke.width", classificationsParams, 2
2750
+ width: getNonClassifiedParamValue(baseSymbol, 'stroke.width', classificationsParams, 2
2753
2751
  /* Line */
2754
2752
  )
2755
2753
  }
@@ -2759,18 +2757,18 @@ const createLineSymbol = (baseSymbol, parameter, classificationsParams, paramete
2759
2757
  const createPolygonSymbol = (baseSymbol, parameter, classificationsParams, parameterValue) => {
2760
2758
  return updateSymbolParameter(_extends({}, baseSymbol, {
2761
2759
  fill: {
2762
- color: getNonClassifiedParamValue(baseSymbol, "fill.color", classificationsParams, 3
2760
+ color: getNonClassifiedParamValue(baseSymbol, 'fill.color', classificationsParams, 3
2763
2761
  /* Polygon */
2764
2762
  ),
2765
- hatchColor: getNonClassifiedParamValue(baseSymbol, "fill.hatchColor", classificationsParams, 3
2763
+ hatchColor: getNonClassifiedParamValue(baseSymbol, 'fill.hatchColor', classificationsParams, 3
2766
2764
  /* Polygon */
2767
2765
  )
2768
2766
  },
2769
2767
  stroke: {
2770
- color: getNonClassifiedParamValue(baseSymbol, "stroke.color", classificationsParams, 3
2768
+ color: getNonClassifiedParamValue(baseSymbol, 'stroke.color', classificationsParams, 3
2771
2769
  /* Polygon */
2772
2770
  ),
2773
- width: getNonClassifiedParamValue(baseSymbol, "stroke.width", classificationsParams, 3
2771
+ width: getNonClassifiedParamValue(baseSymbol, 'stroke.width', classificationsParams, 3
2774
2772
  /* Polygon */
2775
2773
  )
2776
2774
  }
@@ -2780,29 +2778,37 @@ const createPolygonSymbol = (baseSymbol, parameter, classificationsParams, param
2780
2778
  const createH3Symbol = (baseSymbol, parameter, classificationsParams, parameterValue) => {
2781
2779
  return updateSymbolParameter(_extends({}, baseSymbol, {
2782
2780
  fill: {
2783
- color: getNonClassifiedParamValue(baseSymbol, "fill.color", classificationsParams, 3
2781
+ color: getNonClassifiedParamValue(baseSymbol, 'fill.color', classificationsParams, 3
2784
2782
  /* Polygon */
2785
2783
  )
2786
2784
  },
2787
2785
  stroke: {
2788
- color: getNonClassifiedParamValue(baseSymbol, "stroke.color", classificationsParams, 3
2786
+ color: getNonClassifiedParamValue(baseSymbol, 'stroke.color', classificationsParams, 3
2789
2787
  /* Polygon */
2790
2788
  ),
2791
- width: getNonClassifiedParamValue(baseSymbol, "stroke.width", classificationsParams, 3
2789
+ width: getNonClassifiedParamValue(baseSymbol, 'stroke.width', classificationsParams, 3
2792
2790
  /* Polygon */
2793
2791
  )
2794
2792
  }
2795
2793
  }), parameter, parameterValue);
2796
2794
  };
2797
2795
 
2796
+ const createClusterSymbol = (baseSymbol, parameter, classificationsParams, parameterValue) => {
2797
+ return updateSymbolParameter(_extends({}, baseSymbol, {
2798
+ fillColor: getNonClassifiedParamValue(baseSymbol, 'fillColor', classificationsParams, 0
2799
+ /* Point */
2800
+ )
2801
+ }), parameter, parameterValue);
2802
+ };
2803
+
2798
2804
  const createLegendSymbol = (parameterValue, parameter, classificationsParams, baseSymbol) => {
2799
2805
  if (isParameterValueSymbol(parameterValue)) {
2800
2806
  return parameterValue;
2801
2807
  }
2802
- /* if (isClusterSymbol(baseSymbol)) {
2803
- return createClusterSymbol(baseSymbol, parameter, classificationsParams, parameterValue);
2804
- }*/
2805
2808
 
2809
+ if (isClusterSymbol(baseSymbol)) {
2810
+ return createClusterSymbol(baseSymbol, parameter, classificationsParams, parameterValue);
2811
+ }
2806
2812
 
2807
2813
  if (isSizableSymbol(baseSymbol)) {
2808
2814
  return createPointSymbol(baseSymbol, parameter, classificationsParams, parameterValue);
@@ -2894,7 +2900,7 @@ const getMinimizedLegendValues = (attribute, classified, formatValue, index, oth
2894
2900
  const to = getValueFromConditionPart(paramValue.condition, 2);
2895
2901
  result.from = from ? isNumeric(from) ? +from : formatDate(from) : null;
2896
2902
  result.to = to ? isNumeric(to) ? +to : formatDate(to) : null;
2897
- result.title = createValueTitle$1(paramValue, attribute, formatValue, index);
2903
+ result.title = createValueTitleFromCondition(paramValue, attribute, formatValue, index);
2898
2904
  return result;
2899
2905
  }
2900
2906
 
@@ -2920,7 +2926,7 @@ const getMaximizedLegendValues = (attribute, param, params, classified, symbol,
2920
2926
  const result = {
2921
2927
  symbol: createLegendSymbol(paramValue.value, param, params, symbol)
2922
2928
  };
2923
- result.title = isRangeCondition(paramValue.condition) ? createValueTitle$1(paramValue, attribute, formatValue, sectionIndex) : getTitleFromCondition(paramValue.condition);
2929
+ result.title = isRangeCondition(paramValue.condition) ? createValueTitleFromCondition(paramValue, attribute, formatValue, sectionIndex) : getTitleFromCondition(paramValue.condition);
2924
2930
  result.hiddenCondition = createHiddenCondition(attribute.name, attribute.type, getClassificationValue(paramValue.value, result.title, new ClassificationCondition(classified.values[index].condition)));
2925
2931
  return result;
2926
2932
  });
@@ -2932,12 +2938,27 @@ const getMaximizedLegendValues = (attribute, param, params, classified, symbol,
2932
2938
  return [...items, other];
2933
2939
  };
2934
2940
  const getClassified = layerInfo => {
2941
+ var _layerInfo$style2, _layerInfo$style2$chi;
2942
+
2943
+ if ((_layerInfo$style2 = layerInfo.style) != null && (_layerInfo$style2$chi = _layerInfo$style2.children) != null && _layerInfo$style2$chi.length) {
2944
+ var _layerInfo$style3;
2945
+
2946
+ return {
2947
+ symbol: {
2948
+ type: 'byAttribute',
2949
+ defaultValue: layerInfo.style.symbol,
2950
+ title: null,
2951
+ values: (_layerInfo$style3 = layerInfo.style) == null ? void 0 : _layerInfo$style3.children
2952
+ }
2953
+ };
2954
+ }
2955
+
2935
2956
  const classifyParams = SYMBOL_CLASSIFICATION[layerInfo.geometryType];
2936
2957
  return classifyParams == null ? void 0 : classifyParams.reduce((result, classified) => {
2937
- var _layerInfo$style2;
2958
+ var _layerInfo$style4;
2938
2959
 
2939
- const param = get((_layerInfo$style2 = layerInfo.style) == null ? void 0 : _layerInfo$style2.symbol, classified);
2940
- return (param == null ? void 0 : param.type) === "byAttribute" ? _extends({}, result, {
2960
+ const param = get((_layerInfo$style4 = layerInfo.style) == null ? void 0 : _layerInfo$style4.symbol, classified);
2961
+ return (param == null ? void 0 : param.type) === 'byAttribute' ? _extends({}, result, {
2941
2962
  [classified]: param
2942
2963
  }) : result;
2943
2964
  }, {});
@@ -2975,7 +2996,7 @@ const getLegendSymbolSize = symbol => {
2975
2996
  }
2976
2997
 
2977
2998
  if (isPolylineSymbols(symbol)) {
2978
- size = getParameterValue(getParameterFromSymbol(symbol, "stroke.width"));
2999
+ size = getParameterValue(getParameterFromSymbol(symbol, 'stroke.width'));
2979
3000
  }
2980
3001
 
2981
3002
  return Math.max(DEFAULT_LEGEND_SYMBOL_SIZE, size);
@@ -2987,13 +3008,13 @@ const serializeSvgPointSymbol = symbol => {
2987
3008
  const figureFillColor = ((_symbol$figure = symbol.figure) == null ? void 0 : _symbol$figure.fillColor) || null;
2988
3009
  const bgFillColor = ((_symbol$background2 = symbol.background) == null ? void 0 : _symbol$background2.fillColor) || null;
2989
3010
  return _extends({
2990
- type: "svgPointSymbol",
3011
+ type: 'svgPointSymbol',
2991
3012
  size: symbol.size,
2992
3013
  offset: symbol.offset,
2993
3014
  angle: symbol.angle
2994
3015
  }, bgFillColor ? {
2995
3016
  background: {
2996
- id: "symbol-bg",
3017
+ id: 'symbol-bg',
2997
3018
  fillColor: bgFillColor,
2998
3019
  strokeColor: ((_symbol$background3 = symbol.background) == null ? void 0 : _symbol$background3.strokeColor) || null,
2999
3020
  strokeWidth: ((_symbol$background4 = symbol.background) == null ? void 0 : _symbol$background4.strokeWidth) || null,
@@ -3001,35 +3022,35 @@ const serializeSvgPointSymbol = symbol => {
3001
3022
  }
3002
3023
  } : {}, figureFillColor ? {
3003
3024
  figure: {
3004
- id: "symbol-figure",
3025
+ id: 'symbol-figure',
3005
3026
  fillColor: figureFillColor
3006
3027
  }
3007
3028
  } : {});
3008
3029
  };
3009
- const SIZE_PARAMETERS = ["size", "height", "strokeWidth", "stroke.width"];
3030
+ const SIZE_PARAMETERS = ['size', 'height', 'strokeWidth', 'stroke.width'];
3010
3031
  const isSizeClassification = parameter => SIZE_PARAMETERS.includes(parameter);
3011
3032
  const getServiceConfiguration = layer => {
3012
3033
  const emptyServiceConfiguration = {
3013
- name: ""
3034
+ name: ''
3014
3035
  };
3015
- if (!isLayerService(layer) || !("configuration" in layer)) return emptyServiceConfiguration;
3036
+ if (!isLayerService(layer) || !('configuration' in layer)) return emptyServiceConfiguration;
3016
3037
  return _extends({}, emptyServiceConfiguration, layer.configuration || {});
3017
3038
  };
3018
3039
  /** default attribute name which use for geometry info */
3019
3040
 
3020
- const GEOMETRY_ATTRIBUTE = "geometry";
3041
+ const GEOMETRY_ATTRIBUTE = 'geometry';
3021
3042
  /** default attribute name which contains unique id info */
3022
3043
 
3023
- const DEFAULT_ID_ATTRIBUTE_NAME = "gid";
3044
+ const DEFAULT_ID_ATTRIBUTE_NAME = 'gid';
3024
3045
  const getAttributesConfiguration = layer => {
3025
3046
  const serviceConfiguration = getServiceConfiguration(layer);
3026
3047
  const emptyAttributesConfiguration = {
3027
3048
  geometryAttribute: GEOMETRY_ATTRIBUTE,
3028
3049
  idAttribute: DEFAULT_ID_ATTRIBUTE_NAME,
3029
- tableName: ""
3050
+ tableName: ''
3030
3051
  };
3031
3052
 
3032
- if (!serviceConfiguration || !("attributesConfiguration" in serviceConfiguration)) {
3053
+ if (!serviceConfiguration || !('attributesConfiguration' in serviceConfiguration)) {
3033
3054
  return emptyAttributesConfiguration;
3034
3055
  }
3035
3056
 
@@ -3045,10 +3066,10 @@ const getLayerDefinition = layer => {
3045
3066
  geometryAttribute: geometryAttribute,
3046
3067
  idAttribute,
3047
3068
  geometryType: api.GeometryType.Unknown,
3048
- titleAttribute: ""
3069
+ titleAttribute: ''
3049
3070
  };
3050
3071
 
3051
- if (!isLayerService(layer) || !("layerDefinition" in layer)) {
3072
+ if (!isLayerService(layer) || !('layerDefinition' in layer)) {
3052
3073
  return emptyLayerDefinition;
3053
3074
  }
3054
3075
 
@@ -3063,7 +3084,6 @@ function getAttributeType(layer, attributeName) {
3063
3084
  const attribute = attributes[attributeName];
3064
3085
  return attribute ? attribute.type : api.AttributeType.Unknown;
3065
3086
  }
3066
-
3067
3087
  const getClassificationValue = (parameterValue, title, condition) => _extends({
3068
3088
  parameterValue,
3069
3089
  title
@@ -3108,13 +3128,14 @@ const DEFAULT_LEGEND_SYMBOL_SIZE = 26;
3108
3128
  const EXTRA_BORDER_SIZE = 4;
3109
3129
  const DEFAULT_SYMBOL_SIZE = 20;
3110
3130
  const DEFAULT_SYMBOL_WITH_BG_SIZE = 24;
3111
- const DEFAULT_SYMBOL_FILL_COLOR = "rgba(0, 163, 245, 1)";
3112
- const DEFAULT_SYMBOL_STROKE_COLOR = "rgb(255, 255, 255)";
3131
+ const DEFAULT_SYMBOL_FILL_COLOR = 'rgba(0, 163, 245, 1)';
3132
+ const DEFAULT_SYMBOL_STROKE_COLOR = 'rgb(255, 255, 255)';
3113
3133
  const DEFAULT_SYMBOL_OFFSET = [0, 0];
3134
+ 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
3135
  const SYMBOL_CLASSIFICATION = {
3115
- [api.GeometryType.Polygon]: ["fill.color", "stroke.color", "stroke.width"],
3116
- [api.GeometryType.Polyline]: ["stroke.color", "stroke.width"],
3117
- [api.GeometryType.Point]: ["angle", "background.fillColor", "background.strokeColor", "background.strokeWidth", "figure.fillColor", "size"]
3136
+ [api.GeometryType.Polygon]: ['fill.color', 'stroke.color', 'stroke.width'],
3137
+ [api.GeometryType.Polyline]: ['stroke.color', 'stroke.width'],
3138
+ [api.GeometryType.Point]: ['angle', 'size', 'fill.color', 'fillColor', 'background.fillColor', 'background.strokeColor', 'background.strokeWidth', 'figure.fillColor', 'singleObjectSymbol.figure.fillColor', 'singleObjectSymbol.background.fillColor']
3118
3139
  };
3119
3140
  const SYMBOL_LIMITS = {
3120
3141
  SIZE_MIN: 1,
@@ -3157,22 +3178,22 @@ const PARAMETER_INFOS = {
3157
3178
  })
3158
3179
  };
3159
3180
  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]: "between",
3175
- [exports.ComparisonOperator.Outside]: "!between"
3181
+ [exports.ComparisonOperator.Equals]: '==',
3182
+ [exports.ComparisonOperator.NotEquals]: '!=',
3183
+ [exports.ComparisonOperator.GreaterThan]: '>',
3184
+ [exports.ComparisonOperator.GreaterOrEquals]: '>=',
3185
+ [exports.ComparisonOperator.LessThan]: '<',
3186
+ [exports.ComparisonOperator.LessOrEquals]: '<=',
3187
+ [exports.ComparisonOperator.Filled]: '!=',
3188
+ [exports.ComparisonOperator.Empty]: '==',
3189
+ [exports.ComparisonOperator.Contains]: '==',
3190
+ [exports.ComparisonOperator.NotContains]: '!=',
3191
+ [exports.ComparisonOperator.StartsWith]: '==',
3192
+ [exports.ComparisonOperator.NotStartsWith]: '!=',
3193
+ [exports.ComparisonOperator.EndsWith]: '==',
3194
+ [exports.ComparisonOperator.NotEndsWith]: '!=',
3195
+ [exports.ComparisonOperator.Between]: 'between',
3196
+ [exports.ComparisonOperator.Outside]: '!between'
3176
3197
  };
3177
3198
  const BASE_OPERATORS = [exports.ComparisonOperator.Equals, exports.ComparisonOperator.NotEquals];
3178
3199
  const CONTAINS_OPERATORS = [exports.ComparisonOperator.Contains, exports.ComparisonOperator.NotContains];
@@ -5790,7 +5811,7 @@ const Fullscreen = () => {
5790
5811
  }));
5791
5812
  };
5792
5813
 
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;
5814
+ 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
5815
  const MapLegendDescription = /*#__PURE__*/styled__default.div(_templateObject$4 || (_templateObject$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 0.75rem;\n"])));
5795
5816
  const ItemText = /*#__PURE__*/styled__default.div(_templateObject2$4 || (_templateObject2$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n max-width: calc(100% - 2rem);\n font: ", ";\n"])), _ref => {
5796
5817
  let {
@@ -5800,18 +5821,18 @@ const ItemText = /*#__PURE__*/styled__default.div(_templateObject2$4 || (_templa
5800
5821
  } = _ref;
5801
5822
  return fonts.description;
5802
5823
  });
5803
- 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"])));
5804
- 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"])));
5824
+ 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"])));
5825
+ 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
5826
  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
5827
  let {
5807
5828
  isClusterFillColor
5808
5829
  } = _ref2;
5809
- return isClusterFillColor ? "default" : "pointer";
5830
+ return isClusterFillColor ? 'default' : 'pointer';
5810
5831
  }, _ref3 => {
5811
5832
  let {
5812
5833
  isClusterFillColor
5813
5834
  } = _ref3;
5814
- return isClusterFillColor ? "none" : "auto";
5835
+ return isClusterFillColor ? 'none' : 'auto';
5815
5836
  }, ItemText, SymbolContainer, ItemText, _ref4 => {
5816
5837
  let {
5817
5838
  isHidden
@@ -5845,7 +5866,7 @@ const MaximizedLegendContainer = /*#__PURE__*/styled__default.div(_templateObjec
5845
5866
  let {
5846
5867
  isShown
5847
5868
  } = _ref8;
5848
- return isShown ? "relative" : "absolute";
5869
+ return isShown ? 'relative' : 'absolute';
5849
5870
  }, _ref9 => {
5850
5871
  let {
5851
5872
  isShown
@@ -5855,7 +5876,7 @@ const MaximizedLegendContainer = /*#__PURE__*/styled__default.div(_templateObjec
5855
5876
  let {
5856
5877
  isShown
5857
5878
  } = _ref10;
5858
- return isShown ? "visible" : "hidden";
5879
+ return isShown ? 'visible' : 'hidden';
5859
5880
  });
5860
5881
  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
5882
  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 +5891,7 @@ const MapLegendSectionItems = /*#__PURE__*/styled__default.div(_templateObject15
5870
5891
  let {
5871
5892
  isExpanded
5872
5893
  } = _ref12;
5873
- return isExpanded ? "none" : "hidden";
5894
+ return isExpanded ? 'none' : 'hidden';
5874
5895
  });
5875
5896
  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
5897
 
@@ -5879,7 +5900,7 @@ const SizeLegendItemMixin = function SizeLegendItemMixin(value) {
5879
5900
  value = 0;
5880
5901
  }
5881
5902
 
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: \"\";\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);
5903
+ 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
5904
  };
5884
5905
 
5885
5906
  const StrokeWidthLegendItemMixin = function StrokeWidthLegendItemMixin(value) {
@@ -5887,7 +5908,7 @@ const StrokeWidthLegendItemMixin = function StrokeWidthLegendItemMixin(value) {
5887
5908
  value = 0;
5888
5909
  }
5889
5910
 
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 \n :first-child, :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));
5911
+ 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
5912
  };
5892
5913
 
5893
5914
  const StrokeColorLegendItemMixin = /*#__PURE__*/styled.css(_templateObject19 || (_templateObject19 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-right: 0.5rem;\n width: 1.5rem;\n"])));
@@ -5895,12 +5916,12 @@ const MapLegendItem = /*#__PURE__*/styled__default.div(_templateObject20 || (_te
5895
5916
  let {
5896
5917
  parameter
5897
5918
  } = _ref13;
5898
- return isParameterType(["strokeColor", "stroke.color"], parameter) ? 0.25 : 1;
5919
+ return isParameterType(['strokeColor', 'stroke.color'], parameter) ? 0.25 : 1;
5899
5920
  }, _ref14 => {
5900
5921
  let {
5901
5922
  value
5902
5923
  } = _ref14;
5903
- return typeof value === "number" ? "none" : value;
5924
+ return typeof value === 'number' ? 'none' : value;
5904
5925
  }, _ref15 => {
5905
5926
  let {
5906
5927
  isHidden
@@ -5911,13 +5932,13 @@ const MapLegendItem = /*#__PURE__*/styled__default.div(_templateObject20 || (_te
5911
5932
  value,
5912
5933
  parameter
5913
5934
  } = _ref16;
5914
- return isParameterType("size", parameter) && SizeLegendItemMixin(value);
5935
+ return isParameterType('size', parameter) && SizeLegendItemMixin(value);
5915
5936
  }, _ref17 => {
5916
5937
  let {
5917
5938
  value,
5918
5939
  parameter
5919
5940
  } = _ref17;
5920
- return isParameterType(["strokeWidth", "stroke.width"], parameter) && StrokeWidthLegendItemMixin(value);
5941
+ return isParameterType(['strokeWidth', 'stroke.width'], parameter) && StrokeWidthLegendItemMixin(value);
5921
5942
  });
5922
5943
  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
5944
  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 +5958,7 @@ const SingleLegendItemsMixin = /*#__PURE__*/styled.css(_templateObject30 || (_te
5937
5958
  let {
5938
5959
  parameter
5939
5960
  } = _ref19;
5940
- return isParameterType(["strokeColor", "stroke.color"], parameter) && StrokeColorLegendItemMixin;
5961
+ return isParameterType(['strokeColor', 'stroke.color'], parameter) && StrokeColorLegendItemMixin;
5941
5962
  });
5942
5963
  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
5964
  let {
@@ -5959,7 +5980,8 @@ const MapLegendItemsContainer = /*#__PURE__*/styled__default.div(_templateObject
5959
5980
  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
5981
  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
5982
  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: #1FB3AA;\n"])));
5983
+ 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"])));
5984
+ const ClusterLegendContainer = /*#__PURE__*/styled__default.div(_templateObject37 || (_templateObject37 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin: -0.9rem;\n transform: scale(0.5);\n"])));
5963
5985
 
5964
5986
  const getValueFromLegendTitle = (title, minOrMax) => {
5965
5987
  if (title.includes(" - ")) {
@@ -6112,7 +6134,7 @@ const useSvgSymbol = (symbol, skipOffset) => {
6112
6134
 
6113
6135
  var _templateObject$5, _templateObject2$5;
6114
6136
  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 => {
6137
+ 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
6138
  let {
6117
6139
  fontSettings
6118
6140
  } = _ref;
@@ -6136,7 +6158,7 @@ const SvgSymbolLabel = /*#__PURE__*/styled__default.div(_templateObject2$5 || (_
6136
6158
  let {
6137
6159
  fontSettings
6138
6160
  } = _ref5;
6139
- return !!(fontSettings != null && fontSettings.fontSize) && "font-size: " + (typeof fontSettings.fontSize === "string" ? fontSettings.fontSize : fontSettings.fontSize + "px");
6161
+ return !!(fontSettings != null && fontSettings.fontSize) && "font-size: " + (typeof fontSettings.fontSize === 'string' ? fontSettings.fontSize : fontSettings.fontSize + "px");
6140
6162
  }, _ref6 => {
6141
6163
  let {
6142
6164
  fontSettings
@@ -6219,24 +6241,48 @@ const SymbolByType = _ref => {
6219
6241
  }
6220
6242
  };
6221
6243
 
6244
+ const ClusterSymbolPreview = _ref => {
6245
+ var _symbol$labelSymbol;
6246
+
6247
+ let {
6248
+ symbol,
6249
+ size = 56,
6250
+ fontSize = '1.25rem'
6251
+ } = _ref;
6252
+ const svgSymbol = {
6253
+ type: 'svgPointSymbol',
6254
+ size,
6255
+ offset: [0, 0],
6256
+ angle: 0,
6257
+ background: {
6258
+ id: 'symbol-bg',
6259
+ fillColor: getParameterValue(symbol.fillColor),
6260
+ strokeColor: symbol.strokeColor,
6261
+ strokeWidth: 6,
6262
+ type: 'circle'
6263
+ }
6264
+ };
6265
+ return React__default.createElement(SvgSymbol, {
6266
+ svg: DEFAULT_CLUSTER_SVG,
6267
+ symbol: svgSymbol,
6268
+ text: '99',
6269
+ fontSettings: _extends({}, symbol.labelSymbol, {
6270
+ fontSize: fontSize || ((_symbol$labelSymbol = symbol.labelSymbol) == null ? void 0 : _symbol$labelSymbol.fontSize)
6271
+ })
6272
+ });
6273
+ };
6274
+
6222
6275
  const LegendSymbolRenderer = /*#__PURE__*/React.memo(_ref => {
6223
6276
  let {
6224
6277
  symbol
6225
6278
  } = _ref;
6226
6279
 
6227
- /* return isClusterSymbol(symbol) ? (
6228
- <ClusterLegendContainer>
6229
- <ClusterSymbolPreview symbol={symbol as ClusterSymbolDc} />
6230
- </ClusterLegendContainer>
6231
- ) : (
6232
- <SymbolByType
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
- );*/
6280
+ if (isClusterSymbol(symbol)) {
6281
+ return React__default.createElement(ClusterLegendContainer, null, React__default.createElement(ClusterSymbolPreview, {
6282
+ symbol: symbol
6283
+ }));
6284
+ }
6285
+
6240
6286
  return React__default.createElement(SymbolByType, {
6241
6287
  symbol: deserializeSymbol(symbol),
6242
6288
  size: getLegendSymbolSize(symbol) || DEFAULT_LEGEND_SYMBOL_SIZE,
@@ -6246,6 +6292,46 @@ const LegendSymbolRenderer = /*#__PURE__*/React.memo(_ref => {
6246
6292
  });
6247
6293
  });
6248
6294
 
6295
+ const isHiddenLegend = (hiddenCondition, hiddenLegends) => !!(hiddenLegends != null && hiddenLegends.includes(hiddenCondition));
6296
+
6297
+ const renderColumn = (column, index) => {
6298
+ const dateTime = column.split(' ');
6299
+ return React__default.createElement(React.Fragment, {
6300
+ key: index
6301
+ }, React__default.createElement(ItemText, {
6302
+ title: column
6303
+ }, dateTime[0], React__default.createElement(MapLegendDescription, null, dateTime[1])), index === 0 && React__default.createElement(ItemSeparator, null));
6304
+ };
6305
+
6306
+ const getLegendText = _ref => {
6307
+ let {
6308
+ title,
6309
+ index,
6310
+ isDate
6311
+ } = _ref;
6312
+
6313
+ if (!title) {
6314
+ return React__default.createElement(ItemText, null, "\u0414\u0440\u0443\u0433\u043E\u0435");
6315
+ }
6316
+
6317
+ const columns = title == null ? void 0 : title.split(' - ');
6318
+ const isSingleColumn = (columns == null ? void 0 : columns.length) === 1;
6319
+
6320
+ if (!isDate || index && isSingleColumn) {
6321
+ return React__default.createElement(ItemText, {
6322
+ title: title
6323
+ }, title);
6324
+ }
6325
+
6326
+ if (!index && isSingleColumn) {
6327
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement(ItemText, {
6328
+ title: "\u221E"
6329
+ }, "\u221E"), React__default.createElement(ItemSeparator, null), renderColumn(title));
6330
+ }
6331
+
6332
+ return React__default.createElement(React__default.Fragment, null, columns.map(renderColumn));
6333
+ };
6334
+
6249
6335
  const MaximizedLegend = _ref => {
6250
6336
  let {
6251
6337
  innerRef,
@@ -6259,45 +6345,11 @@ const MaximizedLegend = _ref => {
6259
6345
  hiddenLegends,
6260
6346
  toggleHiddenLegend
6261
6347
  } = _ref;
6262
- const {
6263
- t
6264
- } = reactI18next.useTranslation("common");
6265
- const isDate = attributeType === "DateTime";
6266
- const isSize = isParameterType("size", parameter);
6267
- const isStrokeWidth = isParameterType(["strokeWidth", "stroke.width"], parameter);
6268
- const isStrokeColor = isParameterType(["strokeColor", "stroke.color"], parameter);
6348
+ const isDate = attributeType === 'DateTime';
6349
+ const isSize = isParameterType('size', parameter);
6350
+ const isStrokeWidth = isParameterType(['strokeWidth', 'stroke.width'], parameter);
6351
+ const isStrokeColor = isParameterType(['strokeColor', 'stroke.color'], parameter);
6269
6352
  const parameterValue = React.useMemo(() => get(sectionSymbol, parameter), [sectionSymbol, parameter]);
6270
- const renderColumn = React.useCallback((column, index) => {
6271
- const dateTime = column.split(" ");
6272
- return React__default.createElement(React.Fragment, {
6273
- key: index
6274
- }, React__default.createElement(ItemText, {
6275
- title: column
6276
- }, dateTime[0], React__default.createElement(MapLegendDescription, null, dateTime[1])), index === 0 && React__default.createElement(ItemSeparator, null));
6277
- }, []);
6278
- const renderItemText = React.useCallback((title, index) => {
6279
- if (!title) {
6280
- return React__default.createElement(ItemText, null, t("classification.other"));
6281
- }
6282
-
6283
- const columns = title == null ? void 0 : title.split(" - ");
6284
- const isSingleColumn = (columns == null ? void 0 : columns.length) === 1;
6285
-
6286
- if (!isDate || index && isSingleColumn) {
6287
- return React__default.createElement(ItemText, {
6288
- title: title
6289
- }, title);
6290
- }
6291
-
6292
- if (!index && isSingleColumn) {
6293
- return React__default.createElement(React__default.Fragment, null, React__default.createElement(ItemText, {
6294
- title: "\u221E"
6295
- }, "\u221E"), React__default.createElement(ItemSeparator, null), renderColumn(title));
6296
- }
6297
-
6298
- return React__default.createElement(React__default.Fragment, null, columns.map(renderColumn));
6299
- }, [isDate, renderColumn, t]);
6300
- const isHidden = React.useCallback(hiddenCondition => !!(hiddenLegends != null && hiddenLegends.includes(hiddenCondition)), [hiddenLegends]);
6301
6353
  const renderLegend = React.useCallback((_ref2, index) => {
6302
6354
  var _parameterValue$value;
6303
6355
 
@@ -6310,7 +6362,7 @@ const MaximizedLegend = _ref => {
6310
6362
  const isClusterFillColor$1 = isClusterFillColor(symbol, parameter);
6311
6363
  return React__default.createElement(ClassifiedItem, {
6312
6364
  key: sectionIndex + title + index,
6313
- isHidden: isHidden(hiddenCondition),
6365
+ isHidden: isHiddenLegend(hiddenCondition, hiddenLegends),
6314
6366
  isClusterFillColor: isClusterFillColor$1,
6315
6367
  onClick: () => toggleHiddenLegend == null ? void 0 : toggleHiddenLegend(layerName, hiddenCondition)
6316
6368
  }, isSize || isStrokeWidth || isStrokeColor ? React__default.createElement(MapLegendItems, {
@@ -6326,8 +6378,12 @@ const MaximizedLegend = _ref => {
6326
6378
  parameter: parameter
6327
6379
  })) : React__default.createElement(SymbolContainer, null, React__default.createElement(LegendSymbolRenderer, {
6328
6380
  symbol: isClusterFillColor$1 ? symbol : getExtractedSymbol(symbol, true)
6329
- })), renderItemText(title, index));
6330
- }, [isSize, isStrokeColor, isStrokeWidth, parameter, parameterValue == null ? void 0 : parameterValue.defaultValue, parameterValue == null ? void 0 : parameterValue.values, renderItemText, sectionIndex, hiddenLegends, toggleHiddenLegend]);
6381
+ })), getLegendText({
6382
+ title,
6383
+ index,
6384
+ isDate
6385
+ }));
6386
+ }, [parameter, sectionIndex, hiddenLegends, isSize, isStrokeWidth, isStrokeColor, parameterValue, isDate, toggleHiddenLegend, layerName]);
6331
6387
  return React__default.createElement(MaximizedLegendContainer, {
6332
6388
  ref: innerRef,
6333
6389
  isShown: isShown
@@ -6357,12 +6413,10 @@ const LegendSection = _ref => {
6357
6413
  formatValue,
6358
6414
  index
6359
6415
  } = _ref;
6360
- const {
6361
- t
6362
- } = reactI18next.useTranslation("common");
6363
6416
  const [isExpanded, toggleExpanded] = useToggle();
6364
6417
  const [maxRef, maxNode] = useNode();
6365
6418
  const [minRef, minNode] = useNode();
6419
+ if (!attribute) return null;
6366
6420
  return React__default.createElement(MapLegendSectionContainer, null, React__default.createElement(MapLegendHeader, null, attribute.alias || attribute.name), React__default.createElement(LegendParameterDescription, {
6367
6421
  parameter: parameter
6368
6422
  }), React__default.createElement(MapLegendSectionItems, {
@@ -6379,47 +6433,115 @@ const LegendSection = _ref => {
6379
6433
  parameter: parameter,
6380
6434
  attributeType: attribute.type,
6381
6435
  index: index,
6382
- values: getMaximizedLegendValues(attribute, parameter, parameters, classified, symbol, formatValue, index, t("classification.other"))
6436
+ values: getMaximizedLegendValues(attribute, parameter, parameters, classified, symbol, formatValue, index, 'Другое')
6383
6437
  }), React__default.createElement(MinimizedLegend, {
6384
6438
  innerRef: minRef,
6385
6439
  isShown: !isExpanded,
6386
6440
  hiddenLegends: hiddenLegends == null ? void 0 : hiddenLegends[layerName],
6387
6441
  parameter: parameter,
6388
- values: getMinimizedLegendValues(attribute, classified, formatValue, index, t("classification.other"))
6442
+ values: getMinimizedLegendValues(attribute, classified, formatValue, index, 'Другое')
6389
6443
  })), React__default.createElement(MapLegendExpandButton, {
6390
6444
  onClick: toggleExpanded
6391
- }, t(isExpanded ? "toggleMenu" : "Развернуть")));
6445
+ }, isExpanded ? 'Свернуть' : 'Развернуть'));
6446
+ };
6447
+
6448
+ const getConditionAttribute = (attributes, condition) => {
6449
+ if (!condition) return null;
6450
+ const attributeName = getAttributeNameFromCondition(condition);
6451
+ let attribute = attributes.find(_ref => {
6452
+ let {
6453
+ name
6454
+ } = _ref;
6455
+ return name === attributeName;
6456
+ });
6457
+
6458
+ if (!attribute) {
6459
+ if (attributeName === 'count') {
6460
+ attribute = {
6461
+ name: 'count',
6462
+ alias: 'Количество',
6463
+ type: api.AttributeType.Int32
6464
+ };
6465
+ } else {
6466
+ return null;
6467
+ }
6468
+ }
6469
+
6470
+ return attribute;
6392
6471
  };
6393
6472
 
6394
- const _excluded$3 = ["layerInfo"];
6473
+ const LegendChildren = _ref => {
6474
+ var _layerInfo$style, _layerInfo$style$chil;
6475
+
6476
+ let {
6477
+ layerInfo,
6478
+ hiddenLegends,
6479
+ toggleHiddenLegend,
6480
+ formatValue
6481
+ } = _ref;
6482
+ if (!((_layerInfo$style = layerInfo.style) != null && (_layerInfo$style$chil = _layerInfo$style.children) != null && _layerInfo$style$chil.length)) return null;
6483
+ const attributes = getLayerAttributes(layerInfo.layerDefinition);
6484
+ return React__default.createElement(MapLegendContainer, null, layerInfo.style.children.map((paramValue, index) => {
6485
+ var _getConditionAttribut;
6486
+
6487
+ const attribute = getConditionAttribute(attributes, paramValue.condition);
6488
+ if (!attribute) return null;
6489
+ const hiddenCondition = createHiddenCondition(attribute.name, attribute.type, getClassificationValue(paramValue.symbol, paramValue.title, new ClassificationCondition(paramValue.condition)));
6490
+ const legendText = getLegendText({
6491
+ title: isRangeCondition(paramValue.condition) ? createValueTitleFromCondition(paramValue, attribute, formatValue, index) : getTitleFromCondition(paramValue.condition),
6492
+ index,
6493
+ isDate: ((_getConditionAttribut = getConditionAttribute(attributes, paramValue.condition)) == null ? void 0 : _getConditionAttribut.type) === 'DateTime'
6494
+ });
6495
+ return React__default.createElement(ClassifiedItem, {
6496
+ key: index,
6497
+ isHidden: isHiddenLegend(hiddenCondition, hiddenLegends == null ? void 0 : hiddenLegends[layerInfo.name]),
6498
+ onClick: () => toggleHiddenLegend == null ? void 0 : toggleHiddenLegend(layerInfo.name, hiddenCondition)
6499
+ }, React__default.createElement(SymbolContainer, null, React__default.createElement(LegendSymbolRenderer, {
6500
+ symbol: paramValue.symbol
6501
+ })), legendText);
6502
+ }));
6503
+ };
6504
+
6505
+ const _excluded$3 = ["layerInfo", "formatValue", "hiddenLegends", "toggleHiddenLegend"];
6395
6506
  const Legend = /*#__PURE__*/React.memo(_ref => {
6507
+ var _layerInfo$style, _layerInfo$style$chil;
6508
+
6396
6509
  let {
6397
- layerInfo
6510
+ layerInfo,
6511
+ formatValue,
6512
+ hiddenLegends,
6513
+ toggleHiddenLegend
6398
6514
  } = _ref,
6399
6515
  rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
6400
6516
 
6517
+ if ((_layerInfo$style = layerInfo.style) != null && (_layerInfo$style$chil = _layerInfo$style.children) != null && _layerInfo$style$chil.length) {
6518
+ return React__default.createElement(LegendChildren, {
6519
+ layerInfo: layerInfo,
6520
+ formatValue: formatValue,
6521
+ hiddenLegends: hiddenLegends,
6522
+ toggleHiddenLegend: toggleHiddenLegend
6523
+ });
6524
+ }
6525
+
6526
+ const attributes = getLayerAttributes(layerInfo.layerDefinition);
6401
6527
  const classified = getClassified(layerInfo);
6402
6528
  if (!classified) return null;
6403
6529
  const parameters = Object.keys(classified);
6404
- const attributes = getLayerAttributes(layerInfo.layerDefinition);
6405
6530
  return React__default.createElement(MapLegendContainer, null, Object.keys(classified).map((param, index) => {
6406
- var _classified$param$val, _layerInfo$style;
6531
+ var _layerInfo$style2, _classified$param, _classified$param$val;
6407
6532
 
6408
- const attributeName = getAttributeNameFromCondition((_classified$param$val = classified[param].values[0]) == null ? void 0 : _classified$param$val.condition);
6409
6533
  return React__default.createElement(LegendSection, Object.assign({
6410
6534
  key: index,
6411
6535
  layerName: layerInfo.name,
6412
- symbol: (_layerInfo$style = layerInfo.style) == null ? void 0 : _layerInfo$style.symbol,
6413
- attribute: attributes.find(_ref2 => {
6414
- let {
6415
- name
6416
- } = _ref2;
6417
- return name === attributeName;
6418
- }),
6536
+ symbol: (_layerInfo$style2 = layerInfo.style) == null ? void 0 : _layerInfo$style2.symbol,
6537
+ attribute: getConditionAttribute(attributes, (_classified$param = classified[param]) == null ? void 0 : (_classified$param$val = _classified$param.values[0]) == null ? void 0 : _classified$param$val.condition),
6419
6538
  classified: classified[param],
6420
6539
  parameter: param,
6421
6540
  parameters: parameters,
6422
- index: index
6541
+ index: index,
6542
+ formatValue: formatValue,
6543
+ hiddenLegends: hiddenLegends,
6544
+ toggleHiddenLegend: toggleHiddenLegend
6423
6545
  }, rest));
6424
6546
  }));
6425
6547
  });
@@ -6840,8 +6962,10 @@ exports.ClassificationCondition = ClassificationCondition;
6840
6962
  exports.ClassificationManager = ClassificationManager;
6841
6963
  exports.ClassifiedItem = ClassifiedItem;
6842
6964
  exports.ClusterLayer = ClusterLayer;
6965
+ exports.ClusterLegendContainer = ClusterLegendContainer;
6843
6966
  exports.ClusterSymbol = ClusterSymbol;
6844
6967
  exports.CompoundIcon = CompoundIcon;
6968
+ exports.DEFAULT_CLUSTER_SVG = DEFAULT_CLUSTER_SVG;
6845
6969
  exports.DEFAULT_CRS = DEFAULT_CRS;
6846
6970
  exports.DEFAULT_ID_ATTRIBUTE_NAME = DEFAULT_ID_ATTRIBUTE_NAME;
6847
6971
  exports.DEFAULT_LEGEND_SIZES = DEFAULT_LEGEND_SIZES;
@@ -6978,6 +7102,7 @@ exports.createLegendSymbol = createLegendSymbol;
6978
7102
  exports.createOtherHiddenCondition = createOtherHiddenCondition;
6979
7103
  exports.createSvgGradient = createSvgGradient;
6980
7104
  exports.createValueTitle = createValueTitle;
7105
+ exports.createValueTitleFromCondition = createValueTitleFromCondition;
6981
7106
  exports.dateComparisonOperators = dateComparisonOperators;
6982
7107
  exports.defaultOffset = defaultOffset;
6983
7108
  exports.defineStrokeStylePreset = defineStrokeStylePreset;
@@ -7000,6 +7125,7 @@ exports.getAttributeNameFromCondition = getAttributeNameFromCondition;
7000
7125
  exports.getAttributeType = getAttributeType;
7001
7126
  exports.getAttributesConfiguration = getAttributesConfiguration;
7002
7127
  exports.getChildSymbols = getChildSymbols;
7128
+ exports.getClassificationValue = getClassificationValue;
7003
7129
  exports.getClassified = getClassified;
7004
7130
  exports.getCrs = getCrs;
7005
7131
  exports.getDashStylePreset = getDashStylePreset;