@evergis/react 2.0.198 → 2.0.201
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/hooks/useSvgSymbol.d.ts +3 -3
- package/dist/components/Legend/types.d.ts +2 -2
- package/dist/react.cjs.development.js +38 -21
- 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 +38 -21
- package/dist/react.esm.js.map +1 -1
- package/dist/utils/svg.d.ts +2 -2
- package/package.json +2 -2
package/dist/react.esm.js
CHANGED
|
@@ -3148,7 +3148,7 @@ const DEFAULT_CLUSTER_SVG = "\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox
|
|
|
3148
3148
|
const SYMBOL_CLASSIFICATION = {
|
|
3149
3149
|
[GeometryType.Polygon]: ['fill.color', 'stroke.color', 'stroke.width'],
|
|
3150
3150
|
[GeometryType.Polyline]: ['stroke.color', 'stroke.width'],
|
|
3151
|
-
[GeometryType.Point]: ['angle', 'size', 'fill.color', 'fillColor', 'background.fillColor', 'background.strokeColor', 'background.strokeWidth', 'figure.fillColor', 'figure.strokeColor', 'figure.strokeWidth', 'singleObjectSymbol.figure.fillColor', 'singleObjectSymbol.background.fillColor']
|
|
3151
|
+
[GeometryType.Point]: ['angle', 'size', 'fill.color', 'fillColor', 'background.fillColor', 'background.strokeColor', 'background.strokeWidth', 'figure.fillColor', 'figure.strokeColor', 'figure.strokeWidth', 'singleObjectSymbol.figure.fillColor', 'singleObjectSymbol.figure.strokeColor', 'singleObjectSymbol.figure.strokeWidth', 'singleObjectSymbol.background.fillColor', 'singleObjectSymbol.background.strokeColor', 'singleObjectSymbol.background.strokeWidth']
|
|
3152
3152
|
};
|
|
3153
3153
|
const SYMBOL_LIMITS = {
|
|
3154
3154
|
SIZE_MIN: 1,
|
|
@@ -3226,6 +3226,7 @@ var SvgSymbolBg;
|
|
|
3226
3226
|
SvgSymbolBg["Circle"] = "circle";
|
|
3227
3227
|
})(SvgSymbolBg || (SvgSymbolBg = {}));
|
|
3228
3228
|
|
|
3229
|
+
const DEFAULT_STROKE_OPACITY = 0.28;
|
|
3229
3230
|
const convertSvgToBase64 = svg => "data:image/svg+xml;base64," + window.btoa(svg);
|
|
3230
3231
|
const createSvgGradient = (svg, values) => svg.gradient('linear', add => {
|
|
3231
3232
|
values == null ? void 0 : values.forEach((_ref, index) => {
|
|
@@ -3244,7 +3245,7 @@ const manipulateSvgSymbol = _ref2 => {
|
|
|
3244
3245
|
symbol,
|
|
3245
3246
|
svg,
|
|
3246
3247
|
bg,
|
|
3247
|
-
|
|
3248
|
+
isClassified
|
|
3248
3249
|
} = _ref2;
|
|
3249
3250
|
if (!symbol) return SVGContainer;
|
|
3250
3251
|
const symbolData = getParameterValue(svg || symbol.data);
|
|
@@ -3295,9 +3296,9 @@ const manipulateSvgSymbol = _ref2 => {
|
|
|
3295
3296
|
SVGContainer.find(':not(#symbol-bg)').each(item => item.center(DEFAULT_SYMBOL_WITH_BG_SIZE / 2, DEFAULT_SYMBOL_WITH_BG_SIZE / 2).fill('white'));
|
|
3296
3297
|
const symbolBg = SVGContainer.find('#symbol-bg')[0];
|
|
3297
3298
|
|
|
3298
|
-
if (
|
|
3299
|
+
if (isClassified) {
|
|
3299
3300
|
symbolBg == null ? void 0 : symbolBg.stroke({
|
|
3300
|
-
opacity:
|
|
3301
|
+
opacity: DEFAULT_STROKE_OPACITY
|
|
3301
3302
|
});
|
|
3302
3303
|
} // eslint-disable-next-line max-depth
|
|
3303
3304
|
|
|
@@ -3305,15 +3306,15 @@ const manipulateSvgSymbol = _ref2 => {
|
|
|
3305
3306
|
if (isParameterByAttribute(background == null ? void 0 : background.fillColor)) {
|
|
3306
3307
|
var _background$fillColor;
|
|
3307
3308
|
|
|
3308
|
-
|
|
3309
|
-
|
|
3309
|
+
symbolBg == null ? void 0 : symbolBg.fill(createSvgGradient(SVGContainer, background == null ? void 0 : (_background$fillColor = background.fillColor) == null ? void 0 : _background$fillColor.values));
|
|
3310
|
+
}
|
|
3310
3311
|
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
}
|
|
3312
|
+
if (isParameterByAttribute(background == null ? void 0 : background.strokeColor)) {
|
|
3313
|
+
var _background$strokeCol;
|
|
3314
|
+
|
|
3315
|
+
symbolBg == null ? void 0 : symbolBg.stroke({
|
|
3316
|
+
color: createSvgGradient(SVGContainer, background == null ? void 0 : (_background$strokeCol = background.strokeColor) == null ? void 0 : _background$strokeCol.values)
|
|
3317
|
+
});
|
|
3317
3318
|
}
|
|
3318
3319
|
} else {
|
|
3319
3320
|
SVGContainer.svg(innerSvg);
|
|
@@ -3329,6 +3330,20 @@ const manipulateSvgSymbol = _ref2 => {
|
|
|
3329
3330
|
color: strokeColor,
|
|
3330
3331
|
width: strokeWidth
|
|
3331
3332
|
});
|
|
3333
|
+
|
|
3334
|
+
if (isParameterByAttribute(figure == null ? void 0 : figure.fillColor)) {
|
|
3335
|
+
var _figure$fillColor;
|
|
3336
|
+
|
|
3337
|
+
item == null ? void 0 : item.fill(createSvgGradient(SVGContainer, figure == null ? void 0 : (_figure$fillColor = figure.fillColor) == null ? void 0 : _figure$fillColor.values));
|
|
3338
|
+
}
|
|
3339
|
+
|
|
3340
|
+
if (isParameterByAttribute(figure == null ? void 0 : figure.strokeColor)) {
|
|
3341
|
+
var _figure$strokeColor;
|
|
3342
|
+
|
|
3343
|
+
item == null ? void 0 : item.stroke({
|
|
3344
|
+
color: createSvgGradient(SVGContainer, figure == null ? void 0 : (_figure$strokeColor = figure.strokeColor) == null ? void 0 : _figure$strokeColor.values)
|
|
3345
|
+
});
|
|
3346
|
+
}
|
|
3332
3347
|
});
|
|
3333
3348
|
}
|
|
3334
3349
|
}
|
|
@@ -4372,6 +4387,8 @@ function deserializeSvgPointSymbolParams(_ref) {
|
|
|
4372
4387
|
})
|
|
4373
4388
|
} : {}, figure ? {
|
|
4374
4389
|
figure: _extends({}, figure, {
|
|
4390
|
+
strokeColor: deserializeColor(getParameterValue(figure == null ? void 0 : figure.strokeColor)),
|
|
4391
|
+
strokeWidth: getParameterValue(figure == null ? void 0 : figure.strokeWidth),
|
|
4375
4392
|
fillColor: deserializeColor(getParameterValue(figure == null ? void 0 : figure.fillColor))
|
|
4376
4393
|
})
|
|
4377
4394
|
} : {});
|
|
@@ -6033,7 +6050,7 @@ const MapLegendValuesOther = /*#__PURE__*/styled(MapLegendOther)(_templateObject
|
|
|
6033
6050
|
const MapLegendExpandButton = /*#__PURE__*/styled.div(_templateObject37 || (_templateObject37 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n cursor: pointer;\n margin-top: 0.1rem;\n font-size: 0.625rem;\n color: #1fb3aa;\n"])));
|
|
6034
6051
|
const ClusterLegendContainer = /*#__PURE__*/styled.div(_templateObject38 || (_templateObject38 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin: -0.9rem;\n transform: scale(0.5);\n"])));
|
|
6035
6052
|
|
|
6036
|
-
const useSvgSymbol = (symbol, skipOffset,
|
|
6053
|
+
const useSvgSymbol = (symbol, skipOffset, isClassified) => {
|
|
6037
6054
|
const SVGWrapperRefElement = useRef(null);
|
|
6038
6055
|
const SVGContainer = useMemo(() => SVG(), []);
|
|
6039
6056
|
const initSvg = useCallback(() => {
|
|
@@ -6045,14 +6062,14 @@ const useSvgSymbol = (symbol, skipOffset, isClassifiedValue) => {
|
|
|
6045
6062
|
svg,
|
|
6046
6063
|
bg,
|
|
6047
6064
|
newSymbol,
|
|
6048
|
-
|
|
6065
|
+
isClassified
|
|
6049
6066
|
} = _ref;
|
|
6050
6067
|
manipulateSvgSymbol({
|
|
6051
6068
|
SVGContainer,
|
|
6052
6069
|
symbol: newSymbol || symbol,
|
|
6053
6070
|
svg,
|
|
6054
6071
|
bg,
|
|
6055
|
-
|
|
6072
|
+
isClassified
|
|
6056
6073
|
});
|
|
6057
6074
|
}, [SVGContainer, symbol]);
|
|
6058
6075
|
const getUpdatedSvgSymbol = useCallback((field, value) => {
|
|
@@ -6093,7 +6110,7 @@ const useSvgSymbol = (symbol, skipOffset, isClassifiedValue) => {
|
|
|
6093
6110
|
svg: getParameterValue(data),
|
|
6094
6111
|
newSymbol,
|
|
6095
6112
|
bg: (_newSymbol$background = newSymbol.background) == null ? void 0 : _newSymbol$background.type,
|
|
6096
|
-
|
|
6113
|
+
isClassified
|
|
6097
6114
|
});
|
|
6098
6115
|
return _extends({}, newSymbol, {
|
|
6099
6116
|
data: SVGContainer.svg()
|
|
@@ -6150,7 +6167,7 @@ const SvgSymbol = /*#__PURE__*/memo(_ref7 => {
|
|
|
6150
6167
|
text,
|
|
6151
6168
|
fontSettings,
|
|
6152
6169
|
skipOffset,
|
|
6153
|
-
|
|
6170
|
+
isClassified,
|
|
6154
6171
|
onClick
|
|
6155
6172
|
} = _ref7;
|
|
6156
6173
|
const {
|
|
@@ -6158,7 +6175,7 @@ const SvgSymbol = /*#__PURE__*/memo(_ref7 => {
|
|
|
6158
6175
|
initSvg,
|
|
6159
6176
|
getSvgData,
|
|
6160
6177
|
manipulateSvg
|
|
6161
|
-
} = useSvgSymbol(symbol, skipOffset,
|
|
6178
|
+
} = useSvgSymbol(symbol, skipOffset, isClassified);
|
|
6162
6179
|
const onSelectSymbol = useCallback(() => {
|
|
6163
6180
|
onClick == null ? void 0 : onClick(getSvgData(), _extends({}, symbol, bg ? {
|
|
6164
6181
|
background: _extends({}, symbol.background, {
|
|
@@ -6179,9 +6196,9 @@ const SvgSymbol = /*#__PURE__*/memo(_ref7 => {
|
|
|
6179
6196
|
svg,
|
|
6180
6197
|
bg,
|
|
6181
6198
|
newSymbol: symbol,
|
|
6182
|
-
|
|
6199
|
+
isClassified
|
|
6183
6200
|
});
|
|
6184
|
-
}, [svg, symbol, bg, manipulateSvg,
|
|
6201
|
+
}, [svg, symbol, bg, manipulateSvg, isClassified]);
|
|
6185
6202
|
return text ? React.createElement(SvgSymbolContainer, null, renderSymbol, React.createElement(SvgSymbolLabel, {
|
|
6186
6203
|
fontSettings: fontSettings
|
|
6187
6204
|
}, text), !!(fontSettings != null && fontSettings.haloColor) && !!(fontSettings != null && fontSettings.haloWidth) && React.createElement(SvgSymbolLabel, {
|
|
@@ -6221,7 +6238,7 @@ const ClusterSymbolPreview = _ref => {
|
|
|
6221
6238
|
return React.createElement(SvgSymbol, {
|
|
6222
6239
|
svg: DEFAULT_CLUSTER_SVG,
|
|
6223
6240
|
symbol: svgSymbol,
|
|
6224
|
-
|
|
6241
|
+
isClassified: isClassified,
|
|
6225
6242
|
text: '99',
|
|
6226
6243
|
fontSettings: _extends({}, symbol.labelSymbol, {
|
|
6227
6244
|
fontSize: fontSize || ((_symbol$labelSymbol = symbol.labelSymbol) == null ? void 0 : _symbol$labelSymbol.fontSize)
|