@evergis/react 3.0.19 → 3.0.20
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/LICENSE +20 -20
- package/README.md +31 -31
- package/dist/contexts/LegendContext.d.ts +1 -1
- package/dist/core/feature/getFeatureSymbol.d.ts +1 -1
- package/dist/core/style/EvergisStyle.d.ts +1 -1
- package/dist/react.cjs.development.js +178 -170
- 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 +179 -171
- package/dist/react.esm.js.map +1 -1
- package/package.json +5 -5
|
@@ -27,6 +27,8 @@ var PolylineSymbol = require('@evergis/sgis/es/symbols/PolylineSymbol');
|
|
|
27
27
|
var Poly = require('@evergis/sgis/es/renders/Poly');
|
|
28
28
|
var geotools = require('@evergis/sgis/es/geotools');
|
|
29
29
|
var math = require('@evergis/sgis/es/utils/math');
|
|
30
|
+
var Canvas = require('@evergis/sgis/es/painters/DomPainter/Canvas');
|
|
31
|
+
var Crs = require('@evergis/sgis/es/Crs');
|
|
30
32
|
var Poly$1 = require('@evergis/sgis/es/features/Poly');
|
|
31
33
|
var Point = require('@evergis/sgis/es/symbols/point/Point');
|
|
32
34
|
var PointFeature = require('@evergis/sgis/es/features/PointFeature');
|
|
@@ -36,7 +38,6 @@ var Render = require('@evergis/sgis/es/renders/Render');
|
|
|
36
38
|
var SvgRender = require('@evergis/sgis/es/painters/DomPainter/SvgRender');
|
|
37
39
|
var domEvent = require('@evergis/sgis/es/utils/domEvent');
|
|
38
40
|
var EventHandler = require('@evergis/sgis/es/EventHandler');
|
|
39
|
-
var Crs = require('@evergis/sgis/es/Crs');
|
|
40
41
|
var StaticImageSymbol = require('@evergis/sgis/es/symbols/point/StaticImageSymbol');
|
|
41
42
|
var Square = require('@evergis/sgis/es/symbols/point/Square');
|
|
42
43
|
var MaskedImage = require('@evergis/sgis/es/symbols/point/MaskedImage');
|
|
@@ -46,7 +47,6 @@ var Polygon = require('@evergis/sgis/es/features/Polygon');
|
|
|
46
47
|
var Polyline = require('@evergis/sgis/es/features/Polyline');
|
|
47
48
|
var H3Feature = require('@evergis/sgis/es/features/H3Feature');
|
|
48
49
|
var CombinedPolyline = require('@evergis/sgis/es/features/CombinedPolyline');
|
|
49
|
-
var Canvas = require('@evergis/sgis/es/painters/DomPainter/Canvas');
|
|
50
50
|
|
|
51
51
|
function _classCallCheck(instance, Constructor) {
|
|
52
52
|
if (!(instance instanceof Constructor)) {
|
|
@@ -67,6 +67,9 @@ function _defineProperties(target, props) {
|
|
|
67
67
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
68
68
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
69
69
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
70
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
71
|
+
writable: false
|
|
72
|
+
});
|
|
70
73
|
return Constructor;
|
|
71
74
|
}
|
|
72
75
|
|
|
@@ -100,6 +103,9 @@ function _inherits(subClass, superClass) {
|
|
|
100
103
|
configurable: true
|
|
101
104
|
}
|
|
102
105
|
});
|
|
106
|
+
Object.defineProperty(subClass, "prototype", {
|
|
107
|
+
writable: false
|
|
108
|
+
});
|
|
103
109
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
104
110
|
}
|
|
105
111
|
|
|
@@ -158,6 +164,8 @@ function _assertThisInitialized(self) {
|
|
|
158
164
|
function _possibleConstructorReturn(self, call) {
|
|
159
165
|
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
160
166
|
return call;
|
|
167
|
+
} else if (call !== void 0) {
|
|
168
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
161
169
|
}
|
|
162
170
|
|
|
163
171
|
return _assertThisInitialized(self);
|
|
@@ -191,7 +199,7 @@ function _superPropBase(object, property) {
|
|
|
191
199
|
return object;
|
|
192
200
|
}
|
|
193
201
|
|
|
194
|
-
function _get(
|
|
202
|
+
function _get() {
|
|
195
203
|
if (typeof Reflect !== "undefined" && Reflect.get) {
|
|
196
204
|
_get = Reflect.get;
|
|
197
205
|
} else {
|
|
@@ -202,14 +210,14 @@ function _get(target, property, receiver) {
|
|
|
202
210
|
var desc = Object.getOwnPropertyDescriptor(base, property);
|
|
203
211
|
|
|
204
212
|
if (desc.get) {
|
|
205
|
-
return desc.get.call(receiver);
|
|
213
|
+
return desc.get.call(arguments.length < 3 ? target : receiver);
|
|
206
214
|
}
|
|
207
215
|
|
|
208
216
|
return desc.value;
|
|
209
217
|
};
|
|
210
218
|
}
|
|
211
219
|
|
|
212
|
-
return _get(
|
|
220
|
+
return _get.apply(this, arguments);
|
|
213
221
|
}
|
|
214
222
|
|
|
215
223
|
function _taggedTemplateLiteralLoose(strings, raw) {
|
|
@@ -233,7 +241,7 @@ const isParameterType = (types, parameter) => {
|
|
|
233
241
|
|
|
234
242
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33, _templateObject34, _templateObject35, _templateObject36, _templateObject37, _templateObject38;
|
|
235
243
|
const MapLegendDescription = /*#__PURE__*/styled__default.div(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 0.75rem;\n"])));
|
|
236
|
-
const ItemText = /*#__PURE__*/styled__default.div(_templateObject2 || (_templateObject2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n max-width: calc(100% - 2rem);\n font: ", ";\n"])),
|
|
244
|
+
const ItemText = /*#__PURE__*/styled__default.div(_templateObject2 || (_templateObject2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n max-width: calc(100% - 2rem);\n font: ", ";\n"])), _ref => {
|
|
237
245
|
let {
|
|
238
246
|
theme: {
|
|
239
247
|
fonts
|
|
@@ -243,28 +251,28 @@ const ItemText = /*#__PURE__*/styled__default.div(_templateObject2 || (_template
|
|
|
243
251
|
});
|
|
244
252
|
const ItemSeparator = /*#__PURE__*/styled__default.div(_templateObject3 || (_templateObject3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n :after {\n content: '-';\n margin: 0 0.5rem;\n font-size: 0.75rem;\n }\n"])));
|
|
245
253
|
const SymbolContainer = /*#__PURE__*/styled__default('span')(_templateObject4 || (_templateObject4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: center;\n min-width: 1.5rem;\n margin-right: 0.5rem;\n"])));
|
|
246
|
-
const ClassifiedItem = /*#__PURE__*/styled__default.div(_templateObject5 || (_templateObject5 = /*#__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\n ", " {\n margin-left: 0.5rem;\n }\n"])),
|
|
254
|
+
const ClassifiedItem = /*#__PURE__*/styled__default.div(_templateObject5 || (_templateObject5 = /*#__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\n ", " {\n margin-left: 0.5rem;\n }\n"])), _ref2 => {
|
|
247
255
|
let {
|
|
248
256
|
isClusterFillColor
|
|
249
257
|
} = _ref2;
|
|
250
258
|
return isClusterFillColor ? 'default' : 'pointer';
|
|
251
|
-
},
|
|
259
|
+
}, _ref3 => {
|
|
252
260
|
let {
|
|
253
261
|
isClusterFillColor
|
|
254
262
|
} = _ref3;
|
|
255
263
|
return isClusterFillColor ? 'none' : 'auto';
|
|
256
|
-
}, ItemText, SymbolContainer, ItemText,
|
|
264
|
+
}, ItemText, SymbolContainer, ItemText, _ref4 => {
|
|
257
265
|
let {
|
|
258
266
|
isHidden
|
|
259
267
|
} = _ref4;
|
|
260
268
|
return isHidden ? 0.28 : 0.65;
|
|
261
|
-
}, SymbolContainer,
|
|
269
|
+
}, SymbolContainer, _ref5 => {
|
|
262
270
|
let {
|
|
263
271
|
isHidden
|
|
264
272
|
} = _ref5;
|
|
265
273
|
return isHidden ? 0.28 : 1;
|
|
266
274
|
}, ItemText, SymbolContainer, icons.IconButton);
|
|
267
|
-
const SymbolButtonWithClick = /*#__PURE__*/styled.css(_templateObject6 || (_templateObject6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 3.875rem;\n height: 3.875rem;\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n }\n"])),
|
|
275
|
+
const SymbolButtonWithClick = /*#__PURE__*/styled.css(_templateObject6 || (_templateObject6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 3.875rem;\n height: 3.875rem;\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n }\n"])), _ref6 => {
|
|
268
276
|
let {
|
|
269
277
|
theme: {
|
|
270
278
|
palette
|
|
@@ -272,7 +280,7 @@ const SymbolButtonWithClick = /*#__PURE__*/styled.css(_templateObject6 || (_temp
|
|
|
272
280
|
} = _ref6;
|
|
273
281
|
return palette.elementDeep;
|
|
274
282
|
});
|
|
275
|
-
const SymbolButton = /*#__PURE__*/styled__default.span(_templateObject7 || (_templateObject7 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n transition: background-color 150ms;\n ", ";\n\n svg {\n max-width: 4rem;\n max-height: 4rem;\n }\n"])),
|
|
283
|
+
const SymbolButton = /*#__PURE__*/styled__default.span(_templateObject7 || (_templateObject7 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n transition: background-color 150ms;\n ", ";\n\n svg {\n max-width: 4rem;\n max-height: 4rem;\n }\n"])), _ref7 => {
|
|
276
284
|
let {
|
|
277
285
|
onClick
|
|
278
286
|
} = _ref7;
|
|
@@ -281,21 +289,21 @@ const SymbolButton = /*#__PURE__*/styled__default.span(_templateObject7 || (_tem
|
|
|
281
289
|
const MapLegendContainer = /*#__PURE__*/styled__default.div(_templateObject8 || (_templateObject8 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n width: 100%;\n padding-bottom: 1rem;\n box-sizing: border-box;\n\n canvas {\n height: 1.625rem;\n width: 1.625rem;\n }\n"])));
|
|
282
290
|
const MapLegendHeader = /*#__PURE__*/styled__default.div(_templateObject9 || (_templateObject9 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n max-width: 15rem;\n margin-bottom: 0.25rem;\n font-size: 0.75rem;\n font-weight: bold;\n"])));
|
|
283
291
|
const MapLegendDescriptionContainer = /*#__PURE__*/styled__default.div(_templateObject10 || (_templateObject10 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-bottom: 0.5rem;\n font-weight: 400;\n font-size: 0.625rem;\n color: rgba(48, 69, 79, 0.65);\n"])));
|
|
284
|
-
const MapLegendBadge = /*#__PURE__*/styled__default.span(_templateObject11 || (_templateObject11 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n min-width: 0.5rem;\n height: 0.75rem;\n display: inline-block;\n margin-left: 0.25rem;\n padding: 0.125rem 0.25rem;\n border-radius: ", ";\n background-color: ", ";\n color: ", ";\n text-align: center;\n"])),
|
|
292
|
+
const MapLegendBadge = /*#__PURE__*/styled__default.span(_templateObject11 || (_templateObject11 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n min-width: 0.5rem;\n height: 0.75rem;\n display: inline-block;\n margin-left: 0.25rem;\n padding: 0.125rem 0.25rem;\n border-radius: ", ";\n background-color: ", ";\n color: ", ";\n text-align: center;\n"])), _ref8 => {
|
|
285
293
|
let {
|
|
286
294
|
theme: {
|
|
287
295
|
borderRadius
|
|
288
296
|
}
|
|
289
297
|
} = _ref8;
|
|
290
298
|
return borderRadius.xSmall;
|
|
291
|
-
},
|
|
299
|
+
}, _ref9 => {
|
|
292
300
|
let {
|
|
293
301
|
theme: {
|
|
294
302
|
palette
|
|
295
303
|
}
|
|
296
304
|
} = _ref9;
|
|
297
305
|
return palette.element;
|
|
298
|
-
},
|
|
306
|
+
}, _ref10 => {
|
|
299
307
|
let {
|
|
300
308
|
theme: {
|
|
301
309
|
palette
|
|
@@ -303,17 +311,17 @@ const MapLegendBadge = /*#__PURE__*/styled__default.span(_templateObject11 || (_
|
|
|
303
311
|
} = _ref10;
|
|
304
312
|
return palette.textPrimary;
|
|
305
313
|
});
|
|
306
|
-
const MaximizedLegendContainer = /*#__PURE__*/styled__default.div(_templateObject12 || (_templateObject12 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: ", ";\n top: 0;\n opacity: ", ";\n visibility: ", ";\n overflow: hidden;\n transition: opacity 0.5s, visibility 0.5s;\n"])),
|
|
314
|
+
const MaximizedLegendContainer = /*#__PURE__*/styled__default.div(_templateObject12 || (_templateObject12 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: ", ";\n top: 0;\n opacity: ", ";\n visibility: ", ";\n overflow: hidden;\n transition: opacity 0.5s, visibility 0.5s;\n"])), _ref11 => {
|
|
307
315
|
let {
|
|
308
316
|
isShown
|
|
309
317
|
} = _ref11;
|
|
310
318
|
return isShown ? 'relative' : 'absolute';
|
|
311
|
-
},
|
|
319
|
+
}, _ref12 => {
|
|
312
320
|
let {
|
|
313
321
|
isShown
|
|
314
322
|
} = _ref12;
|
|
315
323
|
return isShown ? 1 : 0;
|
|
316
|
-
},
|
|
324
|
+
}, _ref13 => {
|
|
317
325
|
let {
|
|
318
326
|
isShown
|
|
319
327
|
} = _ref13;
|
|
@@ -321,7 +329,7 @@ const MaximizedLegendContainer = /*#__PURE__*/styled__default.div(_templateObjec
|
|
|
321
329
|
});
|
|
322
330
|
const MinimizedLegendContainer = /*#__PURE__*/styled__default(MaximizedLegendContainer)(_templateObject13 || (_templateObject13 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: calc(100% - 1.5rem);\n padding-right: 1.5rem;\n"])));
|
|
323
331
|
const LegendHeaderButton = /*#__PURE__*/styled__default.span(_templateObject14 || (_templateObject14 = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
324
|
-
const MapLegendSectionContainer = /*#__PURE__*/styled__default.div(_templateObject15 || (_templateObject15 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 100%;\n\n :not(:last-child) {\n margin-bottom: 1rem;\n }\n\n ", " {\n padding-left: 0.75rem;\n visibility: hidden;\n\n :first-child {\n padding-left: 1rem;\n }\n\n :last-child {\n margin-left: 0.75rem;\n border-left: 1px ", " solid;\n }\n }\n \n :hover {\n ", " {\n visibility: visible;\n }\n }\n"])), LegendHeaderButton,
|
|
332
|
+
const MapLegendSectionContainer = /*#__PURE__*/styled__default.div(_templateObject15 || (_templateObject15 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 100%;\n\n :not(:last-child) {\n margin-bottom: 1rem;\n }\n\n ", " {\n padding-left: 0.75rem;\n visibility: hidden;\n\n :first-child {\n padding-left: 1rem;\n }\n\n :last-child {\n margin-left: 0.75rem;\n border-left: 1px ", " solid;\n }\n }\n \n :hover {\n ", " {\n visibility: visible;\n }\n }\n"])), LegendHeaderButton, _ref14 => {
|
|
325
333
|
let {
|
|
326
334
|
theme: {
|
|
327
335
|
palette
|
|
@@ -329,14 +337,14 @@ const MapLegendSectionContainer = /*#__PURE__*/styled__default.div(_templateObje
|
|
|
329
337
|
} = _ref14;
|
|
330
338
|
return palette.elementDeep;
|
|
331
339
|
}, LegendHeaderButton);
|
|
332
|
-
const MapLegendSectionItems = /*#__PURE__*/styled__default.div(_templateObject16 || (_templateObject16 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n height: ", "px;\n overflow: ", ";\n transition: height 0.5s;\n"])),
|
|
340
|
+
const MapLegendSectionItems = /*#__PURE__*/styled__default.div(_templateObject16 || (_templateObject16 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n height: ", "px;\n overflow: ", ";\n transition: height 0.5s;\n"])), _ref15 => {
|
|
333
341
|
let {
|
|
334
342
|
minHeight,
|
|
335
343
|
maxHeight,
|
|
336
344
|
isExpanded
|
|
337
345
|
} = _ref15;
|
|
338
346
|
return isExpanded ? (maxHeight || 0) + 4 : minHeight;
|
|
339
|
-
},
|
|
347
|
+
}, _ref16 => {
|
|
340
348
|
let {
|
|
341
349
|
isExpanded
|
|
342
350
|
} = _ref16;
|
|
@@ -361,28 +369,28 @@ const StrokeWidthLegendItemMixin = function StrokeWidthLegendItemMixin(value) {
|
|
|
361
369
|
};
|
|
362
370
|
|
|
363
371
|
const StrokeColorLegendItemMixin = /*#__PURE__*/styled.css(_templateObject20 || (_templateObject20 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-right: 0.5rem;\n width: 1.5rem;\n"])));
|
|
364
|
-
const MapLegendItem = /*#__PURE__*/styled__default.div(_templateObject21 || (_templateObject21 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n flex: 1;\n height: ", "rem;\n background: ", ";\n border: 1px rgba(48, 69, 79, 0.1) solid;\n margin-right: -1px;\n color: rgba(48, 69, 79, 0.65);\n opacity: ", ";\n\n ", "\n\n ", "\n"])),
|
|
372
|
+
const MapLegendItem = /*#__PURE__*/styled__default.div(_templateObject21 || (_templateObject21 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n flex: 1;\n height: ", "rem;\n background: ", ";\n border: 1px rgba(48, 69, 79, 0.1) solid;\n margin-right: -1px;\n color: rgba(48, 69, 79, 0.65);\n opacity: ", ";\n\n ", "\n\n ", "\n"])), _ref17 => {
|
|
365
373
|
let {
|
|
366
374
|
parameter
|
|
367
375
|
} = _ref17;
|
|
368
376
|
return isParameterType(['strokeColor', 'stroke.color'], parameter) ? 0.25 : 1;
|
|
369
|
-
},
|
|
377
|
+
}, _ref18 => {
|
|
370
378
|
let {
|
|
371
379
|
value
|
|
372
380
|
} = _ref18;
|
|
373
381
|
return typeof value === 'number' ? 'none' : value;
|
|
374
|
-
},
|
|
382
|
+
}, _ref19 => {
|
|
375
383
|
let {
|
|
376
384
|
isHidden
|
|
377
385
|
} = _ref19;
|
|
378
386
|
return isHidden ? 0.28 : 1;
|
|
379
|
-
},
|
|
387
|
+
}, _ref20 => {
|
|
380
388
|
let {
|
|
381
389
|
value,
|
|
382
390
|
parameter
|
|
383
391
|
} = _ref20;
|
|
384
392
|
return isParameterType('size', parameter) && SizeLegendItemMixin(value);
|
|
385
|
-
},
|
|
393
|
+
}, _ref21 => {
|
|
386
394
|
let {
|
|
387
395
|
value,
|
|
388
396
|
parameter
|
|
@@ -398,28 +406,28 @@ const SizeMinimizedLegendLabel = /*#__PURE__*/styled__default.div(_templateObjec
|
|
|
398
406
|
const SizeMinimizedLegendDown = /*#__PURE__*/styled__default.div(_templateObject28 || (_templateObject28 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: rgba(48, 69, 79, 0.65);\n"])));
|
|
399
407
|
const SizeMinimizedLegendUp = /*#__PURE__*/styled__default(SizeMinimizedLegendDown)(_templateObject29 || (_templateObject29 = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
400
408
|
const SingleSizeLegendItemsMixin = /*#__PURE__*/styled.css(_templateObject30 || (_templateObject30 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 4rem;\n margin-right: 0.75rem;\n\n ", ":after {\n margin: 0 auto;\n }\n"])), MapLegendItem);
|
|
401
|
-
const SingleLegendItemsMixin = /*#__PURE__*/styled.css(_templateObject31 || (_templateObject31 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n justify-content: center;\n width: 2rem;\n height: auto;\n margin: 0;\n ", "\n\n ", " {\n position: relative;\n top: 0;\n left: 0;\n display: flex;\n align-content: center;\n justify-content: center;\n margin: 0;\n height: auto;\n width: auto;\n\n ", "\n }\n"])),
|
|
409
|
+
const SingleLegendItemsMixin = /*#__PURE__*/styled.css(_templateObject31 || (_templateObject31 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n justify-content: center;\n width: 2rem;\n height: auto;\n margin: 0;\n ", "\n\n ", " {\n position: relative;\n top: 0;\n left: 0;\n display: flex;\n align-content: center;\n justify-content: center;\n margin: 0;\n height: auto;\n width: auto;\n\n ", "\n }\n"])), _ref22 => {
|
|
402
410
|
let {
|
|
403
411
|
isSize
|
|
404
412
|
} = _ref22;
|
|
405
413
|
return isSize && SingleSizeLegendItemsMixin;
|
|
406
|
-
}, MapLegendItem,
|
|
414
|
+
}, MapLegendItem, _ref23 => {
|
|
407
415
|
let {
|
|
408
416
|
parameter
|
|
409
417
|
} = _ref23;
|
|
410
418
|
return isParameterType(['strokeColor', 'stroke.color'], parameter) && StrokeColorLegendItemMixin;
|
|
411
419
|
});
|
|
412
|
-
const MapLegendItems = /*#__PURE__*/styled__default.div(_templateObject32 || (_templateObject32 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n width: 100%;\n border-radius: 0.125rem;\n\n ", ";\n ", ";\n ", ";\n"])),
|
|
420
|
+
const MapLegendItems = /*#__PURE__*/styled__default.div(_templateObject32 || (_templateObject32 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n width: 100%;\n border-radius: 0.125rem;\n\n ", ";\n ", ";\n ", ";\n"])), _ref24 => {
|
|
413
421
|
let {
|
|
414
422
|
isSize
|
|
415
423
|
} = _ref24;
|
|
416
424
|
return isSize && SizeLegendItemsMixin;
|
|
417
|
-
},
|
|
425
|
+
}, _ref25 => {
|
|
418
426
|
let {
|
|
419
427
|
isStrokeWidth
|
|
420
428
|
} = _ref25;
|
|
421
429
|
return isStrokeWidth && StrokeWidthLegendItemsMixin;
|
|
422
|
-
},
|
|
430
|
+
}, _ref26 => {
|
|
423
431
|
let {
|
|
424
432
|
isSingle
|
|
425
433
|
} = _ref26;
|
|
@@ -593,7 +601,7 @@ const formatStringAttribute = value => {
|
|
|
593
601
|
|
|
594
602
|
const attributeValues = value.split(/[\s|]/).map(convertStringAttribute);
|
|
595
603
|
|
|
596
|
-
if (attributeValues.every(
|
|
604
|
+
if (attributeValues.every(_ref => {
|
|
597
605
|
let {
|
|
598
606
|
type
|
|
599
607
|
} = _ref;
|
|
@@ -601,7 +609,7 @@ const formatStringAttribute = value => {
|
|
|
601
609
|
}
|
|
602
610
|
/* String */
|
|
603
611
|
)) {
|
|
604
|
-
return [stringAttribute(attributeValues.map(
|
|
612
|
+
return [stringAttribute(attributeValues.map(_ref2 => {
|
|
605
613
|
let {
|
|
606
614
|
value
|
|
607
615
|
} = _ref2;
|
|
@@ -1202,7 +1210,7 @@ function evaluateCondition(condition$1, attributes) {
|
|
|
1202
1210
|
}
|
|
1203
1211
|
|
|
1204
1212
|
function getAttributeValue(attributes, attributeName) {
|
|
1205
|
-
const attributeMeta = attributes.find(
|
|
1213
|
+
const attributeMeta = attributes.find(_ref => {
|
|
1206
1214
|
let {
|
|
1207
1215
|
name
|
|
1208
1216
|
} = _ref;
|
|
@@ -1216,7 +1224,7 @@ const getAttributeNameFromClassified = values => values.length > 0 ? getAttribut
|
|
|
1216
1224
|
|
|
1217
1225
|
function findFeatureValue(parameterValues, _ref2) {
|
|
1218
1226
|
let [name, value] = _ref2;
|
|
1219
|
-
return value !== null ? parameterValues.find(
|
|
1227
|
+
return value !== null ? parameterValues.find(_ref3 => {
|
|
1220
1228
|
let {
|
|
1221
1229
|
condition
|
|
1222
1230
|
} = _ref3;
|
|
@@ -1256,7 +1264,7 @@ function evaluateFeatureSymbol(attributes) {
|
|
|
1256
1264
|
}
|
|
1257
1265
|
|
|
1258
1266
|
function findChildFeatureStyle(childStyles, attributes) {
|
|
1259
|
-
return (childStyles || []).find(
|
|
1267
|
+
return (childStyles || []).find(_ref5 => {
|
|
1260
1268
|
let {
|
|
1261
1269
|
condition
|
|
1262
1270
|
} = _ref5;
|
|
@@ -1436,7 +1444,7 @@ const createSvgGradient = (svg, values) => svg.gradient('linear', add => {
|
|
|
1436
1444
|
});
|
|
1437
1445
|
}).from(0, 0).to(1, 1); // eslint-disable-next-line max-lines-per-function
|
|
1438
1446
|
|
|
1439
|
-
const manipulateSvgSymbol =
|
|
1447
|
+
const manipulateSvgSymbol = _ref2 => {
|
|
1440
1448
|
var _$exec2;
|
|
1441
1449
|
|
|
1442
1450
|
let {
|
|
@@ -1848,7 +1856,7 @@ const checkLayerHasLegend = layerInfo => {
|
|
|
1848
1856
|
return (paramValue == null ? void 0 : paramValue.type) === 'byAttribute';
|
|
1849
1857
|
})) || false;
|
|
1850
1858
|
};
|
|
1851
|
-
const getTitleFromCondition =
|
|
1859
|
+
const getTitleFromCondition = _ref2 => {
|
|
1852
1860
|
let {
|
|
1853
1861
|
condition,
|
|
1854
1862
|
attribute,
|
|
@@ -2620,7 +2628,7 @@ let SGisPolygonSymbol = /*#__PURE__*/function (_sPolygonSymbol) {
|
|
|
2620
2628
|
const adaptMiterRings = (rings, resolution, fromCrs, toCrs) => {
|
|
2621
2629
|
const projected = geotools.projectRings(rings, fromCrs, toCrs);
|
|
2622
2630
|
return math.simplifyCoordinates(projected.map(ring => // @ts-ignore
|
|
2623
|
-
ring.map(
|
|
2631
|
+
ring.map(_ref => {
|
|
2624
2632
|
let [x, y] = _ref;
|
|
2625
2633
|
return [x / resolution, y / -resolution];
|
|
2626
2634
|
})), 1);
|
|
@@ -2712,6 +2720,111 @@ let ArrowLineMiterRender = /*#__PURE__*/function (_LineMiterRender) {
|
|
|
2712
2720
|
return ArrowLineMiterRender;
|
|
2713
2721
|
}(LineMiterRender);
|
|
2714
2722
|
|
|
2723
|
+
const LegendContext = /*#__PURE__*/React.createContext(null);
|
|
2724
|
+
const LegendProvider = _ref => {
|
|
2725
|
+
let {
|
|
2726
|
+
symbol,
|
|
2727
|
+
children
|
|
2728
|
+
} = _ref;
|
|
2729
|
+
return React__default.createElement(LegendContext.Provider, {
|
|
2730
|
+
value: symbol || null
|
|
2731
|
+
}, children);
|
|
2732
|
+
};
|
|
2733
|
+
const useLegendContext = () => React.useContext(LegendContext);
|
|
2734
|
+
|
|
2735
|
+
function useCanvas() {
|
|
2736
|
+
const canvas = React.useRef(null);
|
|
2737
|
+
const ref = React.useCallback(node => {
|
|
2738
|
+
if (node !== null) {
|
|
2739
|
+
canvas.current = new Canvas.Canvas(node);
|
|
2740
|
+
} else {
|
|
2741
|
+
canvas.current = null;
|
|
2742
|
+
}
|
|
2743
|
+
}, []);
|
|
2744
|
+
return {
|
|
2745
|
+
canvas,
|
|
2746
|
+
ref
|
|
2747
|
+
};
|
|
2748
|
+
}
|
|
2749
|
+
|
|
2750
|
+
function useMount(_ref) {
|
|
2751
|
+
let {
|
|
2752
|
+
onMount,
|
|
2753
|
+
onUnmount
|
|
2754
|
+
} = _ref;
|
|
2755
|
+
React.useEffect(() => {
|
|
2756
|
+
onMount && onMount();
|
|
2757
|
+
return onUnmount; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2758
|
+
}, []);
|
|
2759
|
+
}
|
|
2760
|
+
|
|
2761
|
+
function useNode() {
|
|
2762
|
+
const [node, onSetNode] = React.useState(null);
|
|
2763
|
+
const ref = React.useCallback(onSetNode, [onSetNode]);
|
|
2764
|
+
return [ref, node];
|
|
2765
|
+
}
|
|
2766
|
+
|
|
2767
|
+
const DEFAULT_SYMBOL_SIZE$1 = 26;
|
|
2768
|
+
function useSymbol(_ref, canvasRef) {
|
|
2769
|
+
let {
|
|
2770
|
+
symbol,
|
|
2771
|
+
size = DEFAULT_SYMBOL_SIZE$1,
|
|
2772
|
+
render = getSymbolRenders,
|
|
2773
|
+
maxWidth
|
|
2774
|
+
} = _ref;
|
|
2775
|
+
React.useEffect(() => {
|
|
2776
|
+
if (canvasRef.current !== null && symbol !== undefined) {
|
|
2777
|
+
const canvas = canvasRef.current;
|
|
2778
|
+
setCanvasSize(canvas, size, maxWidth);
|
|
2779
|
+
render(symbol, size).then(renders => {
|
|
2780
|
+
renderSymbolToCanvas(renders, canvas);
|
|
2781
|
+
});
|
|
2782
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2783
|
+
|
|
2784
|
+
}, [symbol, size, maxWidth]);
|
|
2785
|
+
}
|
|
2786
|
+
|
|
2787
|
+
function setCanvasSize(canvas, size, maxWidth) {
|
|
2788
|
+
canvas.node.height = size;
|
|
2789
|
+
canvas.node.width = maxWidth ? Math.min(size, maxWidth) : size;
|
|
2790
|
+
}
|
|
2791
|
+
|
|
2792
|
+
const useToggle = initial => {
|
|
2793
|
+
const [state, setState] = React.useState(initial !== undefined ? initial : false);
|
|
2794
|
+
const toggle = React.useCallback(() => setState(!state), [state]);
|
|
2795
|
+
return [state, toggle, setState];
|
|
2796
|
+
};
|
|
2797
|
+
|
|
2798
|
+
const metersToPixels = (meters, _ref) => {
|
|
2799
|
+
let {
|
|
2800
|
+
painter,
|
|
2801
|
+
crs = Crs.geo
|
|
2802
|
+
} = _ref;
|
|
2803
|
+
const {
|
|
2804
|
+
width
|
|
2805
|
+
} = painter;
|
|
2806
|
+
const zeroPoint = painter.getPointFromPxPosition(0, 0).projectTo(crs);
|
|
2807
|
+
const maxWidthPoint = painter.getPointFromPxPosition(width, 0).projectTo(crs);
|
|
2808
|
+
const widthDistance = geotools.distance(zeroPoint, maxWidthPoint);
|
|
2809
|
+
const pxK = width / (widthDistance || 1);
|
|
2810
|
+
return Math.round(meters * pxK);
|
|
2811
|
+
};
|
|
2812
|
+
|
|
2813
|
+
const polygonCircleFromPoint = (center, diameter) => {
|
|
2814
|
+
const coordinates = [];
|
|
2815
|
+
const radius = diameter / 2;
|
|
2816
|
+
const endAngle = Math.PI * 2;
|
|
2817
|
+
const step = Math.max(Math.PI / 2 / radius, endAngle / 128);
|
|
2818
|
+
let start = 0;
|
|
2819
|
+
let end = endAngle;
|
|
2820
|
+
|
|
2821
|
+
for (let ang = start; ang < end; ang += step) {
|
|
2822
|
+
coordinates.push([Math.cos(ang) * radius + center[0], Math.sin(ang) * radius + center[1]]);
|
|
2823
|
+
}
|
|
2824
|
+
|
|
2825
|
+
return [coordinates];
|
|
2826
|
+
};
|
|
2827
|
+
|
|
2715
2828
|
let CircleLineMiterRender = /*#__PURE__*/function (_LineMiterRender) {
|
|
2716
2829
|
_inherits(CircleLineMiterRender, _LineMiterRender);
|
|
2717
2830
|
|
|
@@ -3301,21 +3414,6 @@ const selectedPolygon = /*#__PURE__*/new SelectedPolySymbol({
|
|
|
3301
3414
|
selectedStrokeColor: '#ff5722'
|
|
3302
3415
|
});
|
|
3303
3416
|
|
|
3304
|
-
const metersToPixels = (meters, _ref) => {
|
|
3305
|
-
let {
|
|
3306
|
-
painter,
|
|
3307
|
-
crs = Crs.geo
|
|
3308
|
-
} = _ref;
|
|
3309
|
-
const {
|
|
3310
|
-
width
|
|
3311
|
-
} = painter;
|
|
3312
|
-
const zeroPoint = painter.getPointFromPxPosition(0, 0).projectTo(crs);
|
|
3313
|
-
const maxWidthPoint = painter.getPointFromPxPosition(width, 0).projectTo(crs);
|
|
3314
|
-
const widthDistance = geotools.distance(zeroPoint, maxWidthPoint);
|
|
3315
|
-
const pxK = width / (widthDistance || 1);
|
|
3316
|
-
return Math.round(meters * pxK);
|
|
3317
|
-
};
|
|
3318
|
-
|
|
3319
3417
|
const defaultPathStyles = {
|
|
3320
3418
|
strokeWidth: 2,
|
|
3321
3419
|
strokeColor: 'rgb(0, 163, 245)',
|
|
@@ -3816,7 +3914,7 @@ const useSvgSymbol = (symbol, skipOffset, isClassified) => {
|
|
|
3816
3914
|
SVGContainer.addTo(SVGWrapperRefElement.current);
|
|
3817
3915
|
}, [SVGContainer]);
|
|
3818
3916
|
const getSvgData = React.useCallback(() => SVGContainer.svg(), [SVGContainer]);
|
|
3819
|
-
const manipulateSvg = React.useCallback(
|
|
3917
|
+
const manipulateSvg = React.useCallback(_ref => {
|
|
3820
3918
|
let {
|
|
3821
3919
|
svg,
|
|
3822
3920
|
bg,
|
|
@@ -3886,38 +3984,38 @@ const useSvgSymbol = (symbol, skipOffset, isClassified) => {
|
|
|
3886
3984
|
|
|
3887
3985
|
var _templateObject$1, _templateObject2$1;
|
|
3888
3986
|
const SvgSymbolContainer = /*#__PURE__*/styled__default.div(_templateObject$1 || (_templateObject$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n"])));
|
|
3889
|
-
const SvgSymbolLabel = /*#__PURE__*/styled__default.div(_templateObject2$1 || (_templateObject2$1 = /*#__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"])),
|
|
3987
|
+
const SvgSymbolLabel = /*#__PURE__*/styled__default.div(_templateObject2$1 || (_templateObject2$1 = /*#__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 => {
|
|
3890
3988
|
let {
|
|
3891
3989
|
fontSettings
|
|
3892
3990
|
} = _ref;
|
|
3893
3991
|
return !!(fontSettings != null && fontSettings.fontFamily) && "font-family: " + fontSettings.fontFamily;
|
|
3894
|
-
},
|
|
3992
|
+
}, _ref2 => {
|
|
3895
3993
|
let {
|
|
3896
3994
|
fontSettings
|
|
3897
3995
|
} = _ref2;
|
|
3898
3996
|
return !!(fontSettings != null && fontSettings.fontWeight) && "font-weight: " + fontSettings.fontWeight;
|
|
3899
|
-
},
|
|
3997
|
+
}, _ref3 => {
|
|
3900
3998
|
let {
|
|
3901
3999
|
fontSettings
|
|
3902
4000
|
} = _ref3;
|
|
3903
4001
|
return !!(fontSettings != null && fontSettings.fontStyle) && "font-style: " + fontSettings.fontStyle;
|
|
3904
|
-
},
|
|
4002
|
+
}, _ref4 => {
|
|
3905
4003
|
let {
|
|
3906
4004
|
fontSettings
|
|
3907
4005
|
} = _ref4;
|
|
3908
4006
|
return !!(fontSettings != null && fontSettings.fontColor) && "color: " + fontSettings.fontColor;
|
|
3909
|
-
},
|
|
4007
|
+
}, _ref5 => {
|
|
3910
4008
|
let {
|
|
3911
4009
|
fontSettings
|
|
3912
4010
|
} = _ref5;
|
|
3913
4011
|
return !!(fontSettings != null && fontSettings.fontSize) && "font-size: " + (typeof fontSettings.fontSize === 'string' ? fontSettings.fontSize : fontSettings.fontSize + "px");
|
|
3914
|
-
},
|
|
4012
|
+
}, _ref6 => {
|
|
3915
4013
|
let {
|
|
3916
4014
|
fontSettings
|
|
3917
4015
|
} = _ref6;
|
|
3918
4016
|
return !!(fontSettings != null && fontSettings.haloColor) && !!(fontSettings != null && fontSettings.haloWidth) && "-webkit-text-stroke: " + fontSettings.haloWidth + "px " + fontSettings.haloColor + ";";
|
|
3919
4017
|
});
|
|
3920
|
-
const SvgSymbol = /*#__PURE__*/React.memo(
|
|
4018
|
+
const SvgSymbol = /*#__PURE__*/React.memo(_ref7 => {
|
|
3921
4019
|
let {
|
|
3922
4020
|
svg,
|
|
3923
4021
|
bg,
|
|
@@ -3968,7 +4066,7 @@ const SvgSymbol = /*#__PURE__*/React.memo((_ref7) => {
|
|
|
3968
4066
|
}, text)) : renderSymbol;
|
|
3969
4067
|
});
|
|
3970
4068
|
|
|
3971
|
-
const ClusterSymbolPreview =
|
|
4069
|
+
const ClusterSymbolPreview = _ref => {
|
|
3972
4070
|
var _symbol$fillColor$val, _symbol$labelSymbol;
|
|
3973
4071
|
|
|
3974
4072
|
let {
|
|
@@ -4005,7 +4103,7 @@ const ClusterSymbolPreview = (_ref) => {
|
|
|
4005
4103
|
});
|
|
4006
4104
|
};
|
|
4007
4105
|
|
|
4008
|
-
const SymbolByType =
|
|
4106
|
+
const SymbolByType = _ref => {
|
|
4009
4107
|
let {
|
|
4010
4108
|
type,
|
|
4011
4109
|
symbol,
|
|
@@ -4032,7 +4130,7 @@ const SymbolByType = (_ref) => {
|
|
|
4032
4130
|
}
|
|
4033
4131
|
};
|
|
4034
4132
|
|
|
4035
|
-
const LegendSymbolRenderer = /*#__PURE__*/React.memo(
|
|
4133
|
+
const LegendSymbolRenderer = /*#__PURE__*/React.memo(_ref => {
|
|
4036
4134
|
let {
|
|
4037
4135
|
symbol,
|
|
4038
4136
|
index
|
|
@@ -4054,7 +4152,7 @@ const LegendSymbolRenderer = /*#__PURE__*/React.memo((_ref) => {
|
|
|
4054
4152
|
});
|
|
4055
4153
|
});
|
|
4056
4154
|
|
|
4057
|
-
const LegendHeaderButtons =
|
|
4155
|
+
const LegendHeaderButtons = _ref => {
|
|
4058
4156
|
let {
|
|
4059
4157
|
layerName,
|
|
4060
4158
|
hasHiddenLegends,
|
|
@@ -4073,7 +4171,7 @@ const LegendHeaderButtons = (_ref) => {
|
|
|
4073
4171
|
const getConditionAttribute = (attributes, condition) => {
|
|
4074
4172
|
if (!condition) return null;
|
|
4075
4173
|
const attributeName = getAttributeNameFromCondition(condition);
|
|
4076
|
-
let attribute = attributes.find(
|
|
4174
|
+
let attribute = attributes.find(_ref => {
|
|
4077
4175
|
let {
|
|
4078
4176
|
name
|
|
4079
4177
|
} = _ref;
|
|
@@ -4106,7 +4204,7 @@ const renderColumn = (column, index) => {
|
|
|
4106
4204
|
}, dateTime[0], React__default.createElement(MapLegendDescription, null, dateTime[1])), index === 0 && React__default.createElement(ItemSeparator, null));
|
|
4107
4205
|
};
|
|
4108
4206
|
|
|
4109
|
-
const getLegendText =
|
|
4207
|
+
const getLegendText = _ref => {
|
|
4110
4208
|
let {
|
|
4111
4209
|
title,
|
|
4112
4210
|
index,
|
|
@@ -4139,7 +4237,7 @@ const getLegendText = (_ref) => {
|
|
|
4139
4237
|
|
|
4140
4238
|
const getLayerAttributes = layerDefinition => {
|
|
4141
4239
|
const attributes = layerDefinition && layerDefinition.attributes || {};
|
|
4142
|
-
return Object.entries(attributes).map(
|
|
4240
|
+
return Object.entries(attributes).map(_ref => {
|
|
4143
4241
|
let [name, definition] = _ref;
|
|
4144
4242
|
return _extends({
|
|
4145
4243
|
name
|
|
@@ -4147,7 +4245,7 @@ const getLayerAttributes = layerDefinition => {
|
|
|
4147
4245
|
});
|
|
4148
4246
|
};
|
|
4149
4247
|
|
|
4150
|
-
const LegendChildren =
|
|
4248
|
+
const LegendChildren = _ref => {
|
|
4151
4249
|
var _layerInfo$style, _layerInfo$style$chil;
|
|
4152
4250
|
|
|
4153
4251
|
let {
|
|
@@ -4187,7 +4285,7 @@ const LegendChildren = (_ref) => {
|
|
|
4187
4285
|
}));
|
|
4188
4286
|
};
|
|
4189
4287
|
|
|
4190
|
-
const LegendParameterDescription =
|
|
4288
|
+
const LegendParameterDescription = _ref => {
|
|
4191
4289
|
let {
|
|
4192
4290
|
parameter,
|
|
4193
4291
|
index
|
|
@@ -4215,7 +4313,7 @@ const getValueFromLegendTitle = (title, minOrMax) => {
|
|
|
4215
4313
|
return title.split(" ").find(isNumeric) || title || "";
|
|
4216
4314
|
};
|
|
4217
4315
|
|
|
4218
|
-
const MinimizedLegend =
|
|
4316
|
+
const MinimizedLegend = _ref => {
|
|
4219
4317
|
var _currentValues$, _currentValues, _currentValues$2, _currentValues2;
|
|
4220
4318
|
|
|
4221
4319
|
let {
|
|
@@ -4286,7 +4384,7 @@ const MinimizedLegend = (_ref) => {
|
|
|
4286
4384
|
})), typeof (other == null ? void 0 : other.parameterValue) === "string" && (titleMax || titleMin) && React__default.createElement(MapLegendValues, null, React__default.createElement(MapLegendValuesRange, null, React__default.createElement("div", null, titleMax), React__default.createElement("div", null, titleMin)), React__default.createElement(MapLegendValuesOther, null, "-")));
|
|
4287
4385
|
};
|
|
4288
4386
|
|
|
4289
|
-
const MaximizedLegend =
|
|
4387
|
+
const MaximizedLegend = _ref => {
|
|
4290
4388
|
let {
|
|
4291
4389
|
innerRef,
|
|
4292
4390
|
isShown,
|
|
@@ -4346,70 +4444,7 @@ const MaximizedLegend = (_ref) => {
|
|
|
4346
4444
|
}, values.map(renderLegend));
|
|
4347
4445
|
};
|
|
4348
4446
|
|
|
4349
|
-
|
|
4350
|
-
const canvas = React.useRef(null);
|
|
4351
|
-
const ref = React.useCallback(node => {
|
|
4352
|
-
if (node !== null) {
|
|
4353
|
-
canvas.current = new Canvas.Canvas(node);
|
|
4354
|
-
} else {
|
|
4355
|
-
canvas.current = null;
|
|
4356
|
-
}
|
|
4357
|
-
}, []);
|
|
4358
|
-
return {
|
|
4359
|
-
canvas,
|
|
4360
|
-
ref
|
|
4361
|
-
};
|
|
4362
|
-
}
|
|
4363
|
-
|
|
4364
|
-
function useMount(_ref) {
|
|
4365
|
-
let {
|
|
4366
|
-
onMount,
|
|
4367
|
-
onUnmount
|
|
4368
|
-
} = _ref;
|
|
4369
|
-
React.useEffect(() => {
|
|
4370
|
-
onMount && onMount();
|
|
4371
|
-
return onUnmount; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4372
|
-
}, []);
|
|
4373
|
-
}
|
|
4374
|
-
|
|
4375
|
-
function useNode() {
|
|
4376
|
-
const [node, onSetNode] = React.useState(null);
|
|
4377
|
-
const ref = React.useCallback(onSetNode, [onSetNode]);
|
|
4378
|
-
return [ref, node];
|
|
4379
|
-
}
|
|
4380
|
-
|
|
4381
|
-
const DEFAULT_SYMBOL_SIZE$1 = 26;
|
|
4382
|
-
function useSymbol(_ref, canvasRef) {
|
|
4383
|
-
let {
|
|
4384
|
-
symbol,
|
|
4385
|
-
size = DEFAULT_SYMBOL_SIZE$1,
|
|
4386
|
-
render = getSymbolRenders,
|
|
4387
|
-
maxWidth
|
|
4388
|
-
} = _ref;
|
|
4389
|
-
React.useEffect(() => {
|
|
4390
|
-
if (canvasRef.current !== null && symbol !== undefined) {
|
|
4391
|
-
const canvas = canvasRef.current;
|
|
4392
|
-
setCanvasSize(canvas, size, maxWidth);
|
|
4393
|
-
render(symbol, size).then(renders => {
|
|
4394
|
-
renderSymbolToCanvas(renders, canvas);
|
|
4395
|
-
});
|
|
4396
|
-
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4397
|
-
|
|
4398
|
-
}, [symbol, size, maxWidth]);
|
|
4399
|
-
}
|
|
4400
|
-
|
|
4401
|
-
function setCanvasSize(canvas, size, maxWidth) {
|
|
4402
|
-
canvas.node.height = size;
|
|
4403
|
-
canvas.node.width = maxWidth ? Math.min(size, maxWidth) : size;
|
|
4404
|
-
}
|
|
4405
|
-
|
|
4406
|
-
const useToggle = initial => {
|
|
4407
|
-
const [state, setState] = React.useState(initial !== undefined ? initial : false);
|
|
4408
|
-
const toggle = React.useCallback(() => setState(!state), [state]);
|
|
4409
|
-
return [state, toggle, setState];
|
|
4410
|
-
};
|
|
4411
|
-
|
|
4412
|
-
const LegendSection = (_ref) => {
|
|
4447
|
+
const LegendSection = _ref => {
|
|
4413
4448
|
var _hiddenLegends$layerN, _hiddenLegends$layerN2;
|
|
4414
4449
|
|
|
4415
4450
|
let {
|
|
@@ -4474,7 +4509,7 @@ const LegendSection = (_ref) => {
|
|
|
4474
4509
|
};
|
|
4475
4510
|
|
|
4476
4511
|
const _excluded$1 = ["layerInfo", "formatValue", "hiddenLegends", "toggleHiddenLegend", "clearHiddenLegends", "goToClassification"];
|
|
4477
|
-
const Legend = /*#__PURE__*/React.memo(
|
|
4512
|
+
const Legend = /*#__PURE__*/React.memo(_ref => {
|
|
4478
4513
|
var _layerInfo$style, _layerInfo$style$chil;
|
|
4479
4514
|
|
|
4480
4515
|
let {
|
|
@@ -4555,7 +4590,7 @@ const Legend = /*#__PURE__*/React.memo((_ref) => {
|
|
|
4555
4590
|
return React__default.createElement(MapLegendContainer, null, renderItems);
|
|
4556
4591
|
});
|
|
4557
4592
|
|
|
4558
|
-
const Symbol =
|
|
4593
|
+
const Symbol = _ref => {
|
|
4559
4594
|
let {
|
|
4560
4595
|
symbol,
|
|
4561
4596
|
size,
|
|
@@ -4576,19 +4611,19 @@ const Symbol = (_ref) => {
|
|
|
4576
4611
|
};
|
|
4577
4612
|
|
|
4578
4613
|
var _templateObject$2, _templateObject2$2;
|
|
4579
|
-
const CompoundIcon = /*#__PURE__*/styled__default.div(_templateObject$2 || (_templateObject$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n background: ", ";\n height: 32px;\n width: 32px;\n"])),
|
|
4614
|
+
const CompoundIcon = /*#__PURE__*/styled__default.div(_templateObject$2 || (_templateObject$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n background: ", ";\n height: 32px;\n width: 32px;\n"])), _ref => {
|
|
4580
4615
|
let {
|
|
4581
4616
|
geometryType,
|
|
4582
4617
|
icons
|
|
4583
4618
|
} = _ref;
|
|
4584
4619
|
return "url(" + icons[geometryType] + ") center center / " + (geometryType === api.GeometryType.Polyline ? '2rem 1.3rem' : 'auto 1rem') + " no-repeat";
|
|
4585
4620
|
});
|
|
4586
|
-
const ClusterSymbol = /*#__PURE__*/styled__default.div(_templateObject2$2 || (_templateObject2$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n width: 32px;\n height: 32px;\n\n :before {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n width: inherit;\n height: inherit;\n background-color: ", ";\n border-radius: 50%;\n opacity: 0.28;\n }\n \n :after {\n content: \"99\";\n position: absolute;\n top: 4px;\n left: 4px;\n display: flex;\n justify-content: center;\n align-items: center;\n width: 24px;\n height: 24px;\n background-color: ", ";\n border-radius: 50%;\n color: white;\n font-size: 0.75rem;\n line-height: 1;\n }\n"])),
|
|
4621
|
+
const ClusterSymbol = /*#__PURE__*/styled__default.div(_templateObject2$2 || (_templateObject2$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n width: 32px;\n height: 32px;\n\n :before {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n width: inherit;\n height: inherit;\n background-color: ", ";\n border-radius: 50%;\n opacity: 0.28;\n }\n \n :after {\n content: \"99\";\n position: absolute;\n top: 4px;\n left: 4px;\n display: flex;\n justify-content: center;\n align-items: center;\n width: 24px;\n height: 24px;\n background-color: ", ";\n border-radius: 50%;\n color: white;\n font-size: 0.75rem;\n line-height: 1;\n }\n"])), _ref2 => {
|
|
4587
4622
|
let {
|
|
4588
4623
|
color
|
|
4589
4624
|
} = _ref2;
|
|
4590
4625
|
return color;
|
|
4591
|
-
},
|
|
4626
|
+
}, _ref3 => {
|
|
4592
4627
|
let {
|
|
4593
4628
|
color
|
|
4594
4629
|
} = _ref3;
|
|
@@ -4596,7 +4631,7 @@ const ClusterSymbol = /*#__PURE__*/styled__default.div(_templateObject2$2 || (_t
|
|
|
4596
4631
|
});
|
|
4597
4632
|
|
|
4598
4633
|
const MAX_SIZE = 32;
|
|
4599
|
-
const StyleSymbol =
|
|
4634
|
+
const StyleSymbol = _ref => {
|
|
4600
4635
|
let {
|
|
4601
4636
|
symbol,
|
|
4602
4637
|
size = MAX_SIZE,
|
|
@@ -4635,33 +4670,6 @@ const StyleSymbol = (_ref) => {
|
|
|
4635
4670
|
});
|
|
4636
4671
|
};
|
|
4637
4672
|
|
|
4638
|
-
const LegendContext = /*#__PURE__*/React.createContext(null);
|
|
4639
|
-
const LegendProvider = (_ref) => {
|
|
4640
|
-
let {
|
|
4641
|
-
symbol,
|
|
4642
|
-
children
|
|
4643
|
-
} = _ref;
|
|
4644
|
-
return React__default.createElement(LegendContext.Provider, {
|
|
4645
|
-
value: symbol || null
|
|
4646
|
-
}, children);
|
|
4647
|
-
};
|
|
4648
|
-
const useLegendContext = () => React.useContext(LegendContext);
|
|
4649
|
-
|
|
4650
|
-
const polygonCircleFromPoint = (center, diameter) => {
|
|
4651
|
-
const coordinates = [];
|
|
4652
|
-
const radius = diameter / 2;
|
|
4653
|
-
const endAngle = Math.PI * 2;
|
|
4654
|
-
const step = Math.max(Math.PI / 2 / radius, endAngle / 128);
|
|
4655
|
-
let start = 0;
|
|
4656
|
-
let end = endAngle;
|
|
4657
|
-
|
|
4658
|
-
for (let ang = start; ang < end; ang += step) {
|
|
4659
|
-
coordinates.push([Math.cos(ang) * radius + center[0], Math.sin(ang) * radius + center[1]]);
|
|
4660
|
-
}
|
|
4661
|
-
|
|
4662
|
-
return [coordinates];
|
|
4663
|
-
};
|
|
4664
|
-
|
|
4665
4673
|
exports.ArrowLineMiterRender = ArrowLineMiterRender;
|
|
4666
4674
|
exports.BASE_OPERATORS = BASE_OPERATORS;
|
|
4667
4675
|
exports.BETWEEN_OPERATORS = BETWEEN_OPERATORS;
|