@evergis/react 2.0.151 → 2.0.153
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/components/MapLegend/MapLegendDescription.d.ts +2 -1
- package/dist/components/MapLegend/styled.d.ts +6 -1
- package/dist/components/MapLegend/types.d.ts +2 -2
- package/dist/react.cjs.development.js +1350 -1304
- 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 +1351 -1305
- package/dist/react.esm.js.map +1 -1
- package/dist/utils/isParameterType.d.ts +3 -2
- package/package.json +5 -5
package/dist/react.esm.js
CHANGED
|
@@ -18,12 +18,8 @@ import { ImageFill } from '@evergis/sgis/es/symbols/polygon/ImageFill';
|
|
|
18
18
|
import { PolygonSymbol } from '@evergis/sgis/es/symbols/polygon/Simple';
|
|
19
19
|
import { PolylineSymbol } from '@evergis/sgis/es/symbols/PolylineSymbol';
|
|
20
20
|
import { PolyRender, FillStyle } from '@evergis/sgis/es/renders/Poly';
|
|
21
|
-
import { projectRings, length, area
|
|
21
|
+
import { projectRings, distance, length, area } from '@evergis/sgis/es/geotools';
|
|
22
22
|
import { simplifyCoordinates, softEquals } from '@evergis/sgis/es/utils/math';
|
|
23
|
-
import { PolylineControl } from '@evergis/sgis/es/controls/PolylineControl';
|
|
24
|
-
import { LabelFeature } from '@evergis/sgis/es/features/Label';
|
|
25
|
-
import { DrawingFinishEvent } from '@evergis/sgis/es/controls/Control';
|
|
26
|
-
import { PolyEditor } from '@evergis/sgis/es/controls/PolyEditor';
|
|
27
23
|
import ReactDOM from 'react-dom';
|
|
28
24
|
import { DynamicPointSymbol, Symbol as Symbol$1 } from '@evergis/sgis/es/symbols/Symbol';
|
|
29
25
|
import { Poly } from '@evergis/sgis/es/features/Poly';
|
|
@@ -38,6 +34,7 @@ import { H3Symbol } from '@evergis/sgis/es/symbols/H3Symbol';
|
|
|
38
34
|
import { H3Feature } from '@evergis/sgis/es/features/H3Feature';
|
|
39
35
|
import { Canvas } from '@evergis/sgis/es/painters/DomPainter/Canvas';
|
|
40
36
|
import { sGisClickEvent } from '@evergis/sgis/es/commonEvents';
|
|
37
|
+
import { LabelFeature } from '@evergis/sgis/es/features/Label';
|
|
41
38
|
import { ClusterLayer as ClusterLayer$1 } from '@evergis/sgis/es/layers/ClusterLayer';
|
|
42
39
|
import { GridClusterProvider } from '@evergis/sgis/es/layers/clusterProviders/GridClusterProvider';
|
|
43
40
|
import { PointEditor } from '@evergis/sgis/es/controls/PointEditor';
|
|
@@ -45,6 +42,9 @@ import { debounce } from '@evergis/sgis/es/utils/utils';
|
|
|
45
42
|
import styled, { css } from 'styled-components';
|
|
46
43
|
import punycode from 'punycode';
|
|
47
44
|
import { TileLayer as TileLayer$1 } from '@evergis/sgis/es/layers/TileLayer';
|
|
45
|
+
import { PolylineControl } from '@evergis/sgis/es/controls/PolylineControl';
|
|
46
|
+
import { DrawingFinishEvent } from '@evergis/sgis/es/controls/Control';
|
|
47
|
+
import { PolyEditor } from '@evergis/sgis/es/controls/PolyEditor';
|
|
48
48
|
|
|
49
49
|
function _classCallCheck(instance, Constructor) {
|
|
50
50
|
if (!(instance instanceof Constructor)) {
|
|
@@ -65,9 +65,6 @@ function _defineProperties(target, props) {
|
|
|
65
65
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
66
66
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
67
67
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
68
|
-
Object.defineProperty(Constructor, "prototype", {
|
|
69
|
-
writable: false
|
|
70
|
-
});
|
|
71
68
|
return Constructor;
|
|
72
69
|
}
|
|
73
70
|
|
|
@@ -101,9 +98,6 @@ function _inherits(subClass, superClass) {
|
|
|
101
98
|
configurable: true
|
|
102
99
|
}
|
|
103
100
|
});
|
|
104
|
-
Object.defineProperty(subClass, "prototype", {
|
|
105
|
-
writable: false
|
|
106
|
-
});
|
|
107
101
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
108
102
|
}
|
|
109
103
|
|
|
@@ -162,8 +156,6 @@ function _assertThisInitialized(self) {
|
|
|
162
156
|
function _possibleConstructorReturn(self, call) {
|
|
163
157
|
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
164
158
|
return call;
|
|
165
|
-
} else if (call !== void 0) {
|
|
166
|
-
throw new TypeError("Derived constructors may only return object or undefined");
|
|
167
159
|
}
|
|
168
160
|
|
|
169
161
|
return _assertThisInitialized(self);
|
|
@@ -197,7 +189,7 @@ function _superPropBase(object, property) {
|
|
|
197
189
|
return object;
|
|
198
190
|
}
|
|
199
191
|
|
|
200
|
-
function _get() {
|
|
192
|
+
function _get(target, property, receiver) {
|
|
201
193
|
if (typeof Reflect !== "undefined" && Reflect.get) {
|
|
202
194
|
_get = Reflect.get;
|
|
203
195
|
} else {
|
|
@@ -208,14 +200,14 @@ function _get() {
|
|
|
208
200
|
var desc = Object.getOwnPropertyDescriptor(base, property);
|
|
209
201
|
|
|
210
202
|
if (desc.get) {
|
|
211
|
-
return desc.get.call(
|
|
203
|
+
return desc.get.call(receiver);
|
|
212
204
|
}
|
|
213
205
|
|
|
214
206
|
return desc.value;
|
|
215
207
|
};
|
|
216
208
|
}
|
|
217
209
|
|
|
218
|
-
return _get
|
|
210
|
+
return _get(target, property, receiver || target);
|
|
219
211
|
}
|
|
220
212
|
|
|
221
213
|
function _taggedTemplateLiteralLoose(strings, raw) {
|
|
@@ -244,7 +236,7 @@ const defaultApi = /*#__PURE__*/new Api({
|
|
|
244
236
|
url: BASE_URL
|
|
245
237
|
});
|
|
246
238
|
const evergisContext = /*#__PURE__*/createContext(defaultApi);
|
|
247
|
-
const EvergisProvider = _ref => {
|
|
239
|
+
const EvergisProvider = (_ref) => {
|
|
248
240
|
let {
|
|
249
241
|
api,
|
|
250
242
|
children
|
|
@@ -262,7 +254,7 @@ const mapContext = /*#__PURE__*/createContext({
|
|
|
262
254
|
map: defaultMap,
|
|
263
255
|
painter: defaultPainter
|
|
264
256
|
});
|
|
265
|
-
const MapProvider = _ref => {
|
|
257
|
+
const MapProvider = (_ref) => {
|
|
266
258
|
let {
|
|
267
259
|
map,
|
|
268
260
|
painter,
|
|
@@ -284,7 +276,7 @@ const tooltipContext = /*#__PURE__*/createContext({
|
|
|
284
276
|
layer: defaultLayer,
|
|
285
277
|
popupLayer: defaultPopupLayer
|
|
286
278
|
});
|
|
287
|
-
const TooltipProvider = _ref => {
|
|
279
|
+
const TooltipProvider = (_ref) => {
|
|
288
280
|
let {
|
|
289
281
|
layer,
|
|
290
282
|
popupLayer,
|
|
@@ -301,7 +293,7 @@ const TooltipProvider = _ref => {
|
|
|
301
293
|
const useTooltipContext = () => useContext(tooltipContext);
|
|
302
294
|
|
|
303
295
|
const LegendContext = /*#__PURE__*/createContext(null);
|
|
304
|
-
const LegendProvider = _ref => {
|
|
296
|
+
const LegendProvider = (_ref) => {
|
|
305
297
|
let {
|
|
306
298
|
symbol,
|
|
307
299
|
children
|
|
@@ -313,7 +305,7 @@ const LegendProvider = _ref => {
|
|
|
313
305
|
const useLegendContext = () => useContext(LegendContext);
|
|
314
306
|
|
|
315
307
|
const evergisSelectContext = /*#__PURE__*/createContext([]);
|
|
316
|
-
const EvergisSelectProvider = _ref => {
|
|
308
|
+
const EvergisSelectProvider = (_ref) => {
|
|
317
309
|
let {
|
|
318
310
|
layers,
|
|
319
311
|
children
|
|
@@ -358,7 +350,7 @@ function useMapViewActions() {
|
|
|
358
350
|
}, [map]);
|
|
359
351
|
const zoomIn = useCallback(() => zoomTo(1), [zoomTo]);
|
|
360
352
|
const zoomOut = useCallback(() => zoomTo(-1), [zoomTo]);
|
|
361
|
-
const animateTo = useCallback(_ref => {
|
|
353
|
+
const animateTo = useCallback((_ref) => {
|
|
362
354
|
let {
|
|
363
355
|
position,
|
|
364
356
|
resolution,
|
|
@@ -388,7 +380,7 @@ function useMapViewActions() {
|
|
|
388
380
|
const {
|
|
389
381
|
tileScheme
|
|
390
382
|
} = map;
|
|
391
|
-
let tileLevel = tileScheme.levels.find(_ref2 => {
|
|
383
|
+
let tileLevel = tileScheme.levels.find((_ref2) => {
|
|
392
384
|
let {
|
|
393
385
|
zIndex
|
|
394
386
|
} = _ref2;
|
|
@@ -564,7 +556,7 @@ const formatStringAttribute = value => {
|
|
|
564
556
|
|
|
565
557
|
const attributeValues = value.split(/[\s|]/).map(convertStringAttribute);
|
|
566
558
|
|
|
567
|
-
if (attributeValues.every(_ref => {
|
|
559
|
+
if (attributeValues.every((_ref) => {
|
|
568
560
|
let {
|
|
569
561
|
type
|
|
570
562
|
} = _ref;
|
|
@@ -572,7 +564,7 @@ const formatStringAttribute = value => {
|
|
|
572
564
|
}
|
|
573
565
|
/* String */
|
|
574
566
|
)) {
|
|
575
|
-
return [stringAttribute(attributeValues.map(_ref2 => {
|
|
567
|
+
return [stringAttribute(attributeValues.map((_ref2) => {
|
|
576
568
|
let {
|
|
577
569
|
value
|
|
578
570
|
} = _ref2;
|
|
@@ -1055,7 +1047,7 @@ const getFeatureAttributeType = attributeValue => {
|
|
|
1055
1047
|
};
|
|
1056
1048
|
const getLayerAttributes = layerDefinition => {
|
|
1057
1049
|
const attributes = layerDefinition && layerDefinition.attributes || {};
|
|
1058
|
-
return Object.entries(attributes).map(_ref => {
|
|
1050
|
+
return Object.entries(attributes).map((_ref) => {
|
|
1059
1051
|
let [name, definition] = _ref;
|
|
1060
1052
|
return _extends({
|
|
1061
1053
|
name
|
|
@@ -1063,7 +1055,7 @@ const getLayerAttributes = layerDefinition => {
|
|
|
1063
1055
|
});
|
|
1064
1056
|
};
|
|
1065
1057
|
const getFeatureAttributes = attributes => {
|
|
1066
|
-
return attributes ? Object.entries(attributes).map(_ref2 => {
|
|
1058
|
+
return attributes ? Object.entries(attributes).map((_ref2) => {
|
|
1067
1059
|
let [name, value] = _ref2;
|
|
1068
1060
|
return {
|
|
1069
1061
|
name,
|
|
@@ -1081,7 +1073,7 @@ const getClassificationAttribute = (attributeName, attributes) => {
|
|
|
1081
1073
|
return attribute ? _extends({}, attrNamePart, attribute) : attrNamePart;
|
|
1082
1074
|
};
|
|
1083
1075
|
const mergeAttributes = (attributes1, attributes2) => {
|
|
1084
|
-
return attributes1.map(attribute => _extends({}, attribute, attributes2.find(_ref3 => {
|
|
1076
|
+
return attributes1.map(attribute => _extends({}, attribute, attributes2.find((_ref3) => {
|
|
1085
1077
|
let {
|
|
1086
1078
|
name
|
|
1087
1079
|
} = _ref3;
|
|
@@ -1496,7 +1488,7 @@ let SGisPolygonSymbol = /*#__PURE__*/function (_sPolygonSymbol) {
|
|
|
1496
1488
|
const adaptMiterRings = (rings, resolution, fromCrs, toCrs) => {
|
|
1497
1489
|
const projected = projectRings(rings, fromCrs, toCrs);
|
|
1498
1490
|
return simplifyCoordinates(projected.map(ring => // @ts-ignore
|
|
1499
|
-
ring.map(_ref => {
|
|
1491
|
+
ring.map((_ref) => {
|
|
1500
1492
|
let [x, y] = _ref;
|
|
1501
1493
|
return [x / resolution, y / -resolution];
|
|
1502
1494
|
})), 1);
|
|
@@ -1588,1124 +1580,776 @@ let ArrowLineMiterRender = /*#__PURE__*/function (_LineMiterRender) {
|
|
|
1588
1580
|
return ArrowLineMiterRender;
|
|
1589
1581
|
}(LineMiterRender);
|
|
1590
1582
|
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
length: formatLength
|
|
1594
|
-
};
|
|
1595
|
-
|
|
1596
|
-
const COORD_FRACTION = 6;
|
|
1597
|
-
const DEFAULT_LABEL_POSITION = [Infinity, Infinity];
|
|
1598
|
-
let BaseMeasureToolCreator = /*#__PURE__*/function (_PolylineControl) {
|
|
1599
|
-
_inherits(BaseMeasureToolCreator, _PolylineControl);
|
|
1600
|
-
|
|
1601
|
-
var _super = /*#__PURE__*/_createSuper(BaseMeasureToolCreator);
|
|
1583
|
+
let CircleLineMiterRender = /*#__PURE__*/function (_LineMiterRender) {
|
|
1584
|
+
_inherits(CircleLineMiterRender, _LineMiterRender);
|
|
1602
1585
|
|
|
1603
|
-
|
|
1604
|
-
var _this;
|
|
1586
|
+
var _super = /*#__PURE__*/_createSuper(CircleLineMiterRender);
|
|
1605
1587
|
|
|
1606
|
-
|
|
1588
|
+
function CircleLineMiterRender() {
|
|
1589
|
+
_classCallCheck(this, CircleLineMiterRender);
|
|
1607
1590
|
|
|
1608
|
-
|
|
1591
|
+
return _super.apply(this, arguments);
|
|
1592
|
+
}
|
|
1609
1593
|
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1594
|
+
_createClass(CircleLineMiterRender, [{
|
|
1595
|
+
key: "usageSize",
|
|
1596
|
+
get: function get() {
|
|
1597
|
+
return this.miterSize + this.strokeWidth * 3;
|
|
1598
|
+
}
|
|
1599
|
+
}, {
|
|
1600
|
+
key: "createRings",
|
|
1601
|
+
value: function createRings(_ref, xMultiplier) {
|
|
1602
|
+
let [x, y] = _ref;
|
|
1603
|
+
return [[[x + (this.miterSize / 2 + this.strokeWidth) * xMultiplier, y]]];
|
|
1604
|
+
}
|
|
1605
|
+
}, {
|
|
1606
|
+
key: "createRender",
|
|
1607
|
+
value: function createRender(miterRings) {
|
|
1608
|
+
const isFilled = this.kind === LineMiterKind.FilledCircle;
|
|
1609
|
+
return new PolyRender(polygonCircleFromPoint(miterRings[0][0], this.miterSize), {
|
|
1610
|
+
fillColor: isFilled ? this.color : 'transparent',
|
|
1611
|
+
strokeColor: this.color,
|
|
1612
|
+
strokeWidth: this.strokeWidth,
|
|
1613
|
+
enclosed: true
|
|
1614
|
+
});
|
|
1615
|
+
}
|
|
1616
|
+
}]);
|
|
1613
1617
|
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
_this.formatters = params.formatters || DEFAULT_FORMATTERS;
|
|
1617
|
-
_this.areaSymbol = params.areaSymbol;
|
|
1618
|
+
return CircleLineMiterRender;
|
|
1619
|
+
}(LineMiterRender);
|
|
1618
1620
|
|
|
1619
|
-
|
|
1621
|
+
let SquareLineMiterRender = /*#__PURE__*/function (_LineMiterRender) {
|
|
1622
|
+
_inherits(SquareLineMiterRender, _LineMiterRender);
|
|
1620
1623
|
|
|
1624
|
+
var _super = /*#__PURE__*/_createSuper(SquareLineMiterRender);
|
|
1621
1625
|
|
|
1622
|
-
|
|
1626
|
+
function SquareLineMiterRender() {
|
|
1627
|
+
_classCallCheck(this, SquareLineMiterRender);
|
|
1623
1628
|
|
|
1624
|
-
return
|
|
1629
|
+
return _super.apply(this, arguments);
|
|
1625
1630
|
}
|
|
1626
1631
|
|
|
1627
|
-
_createClass(
|
|
1628
|
-
key: "
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
this.drawPointOnMouseMove(event);
|
|
1632
|
+
_createClass(SquareLineMiterRender, [{
|
|
1633
|
+
key: "usageSize",
|
|
1634
|
+
get: function get() {
|
|
1635
|
+
return this.miterSize + this.strokeWidth;
|
|
1633
1636
|
}
|
|
1634
1637
|
}, {
|
|
1635
|
-
key: "
|
|
1636
|
-
value: function
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
this.addTempLabel();
|
|
1640
|
-
this.setCursor('pointer');
|
|
1638
|
+
key: "createRings",
|
|
1639
|
+
value: function createRings(_ref, xMultiplier) {
|
|
1640
|
+
let [x, y] = _ref;
|
|
1641
|
+
return [[[x, y + this.miterSize / 2], [x, y - this.miterSize / 2], [x + this.miterSize * xMultiplier, y - this.miterSize / 2], [x + this.miterSize * xMultiplier, y + this.miterSize / 2]]];
|
|
1641
1642
|
}
|
|
1642
1643
|
}, {
|
|
1643
|
-
key: "
|
|
1644
|
-
value: function
|
|
1645
|
-
|
|
1644
|
+
key: "createRender",
|
|
1645
|
+
value: function createRender(miterRings) {
|
|
1646
|
+
const isFilled = this.kind === LineMiterKind.FilledSquare;
|
|
1647
|
+
return new PolyRender(miterRings, {
|
|
1648
|
+
enclosed: true,
|
|
1649
|
+
fillColor: isFilled ? this.color : void 0,
|
|
1650
|
+
fillStyle: isFilled ? FillStyle.Color : FillStyle.None,
|
|
1651
|
+
lineCap: 'square',
|
|
1652
|
+
lineJoin: 'miter',
|
|
1653
|
+
strokeColor: this.color,
|
|
1654
|
+
strokeWidth: this.strokeWidth
|
|
1655
|
+
});
|
|
1656
|
+
}
|
|
1657
|
+
}]);
|
|
1646
1658
|
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1659
|
+
return SquareLineMiterRender;
|
|
1660
|
+
}(LineMiterRender);
|
|
1661
|
+
|
|
1662
|
+
const getLineMiterRender = options => {
|
|
1663
|
+
switch (options.kind) {
|
|
1664
|
+
case LineMiterKind.Arrow:
|
|
1665
|
+
case LineMiterKind.FilledArrow:
|
|
1666
|
+
return new ArrowLineMiterRender(options);
|
|
1667
|
+
|
|
1668
|
+
case LineMiterKind.Square:
|
|
1669
|
+
case LineMiterKind.FilledSquare:
|
|
1670
|
+
return new SquareLineMiterRender(options);
|
|
1671
|
+
|
|
1672
|
+
case LineMiterKind.Circle:
|
|
1673
|
+
case LineMiterKind.FilledCircle:
|
|
1674
|
+
return new CircleLineMiterRender(options);
|
|
1675
|
+
|
|
1676
|
+
default:
|
|
1677
|
+
return null;
|
|
1678
|
+
}
|
|
1679
|
+
};
|
|
1680
|
+
|
|
1681
|
+
const updateRingForRightMiter = (ring, miterSize, isLastRing) => {
|
|
1682
|
+
const reversedRing = ring.slice().reverse();
|
|
1683
|
+
|
|
1684
|
+
for (let i = 0; i < reversedRing.length; i++) {
|
|
1685
|
+
const coordinates = reversedRing[i];
|
|
1686
|
+
|
|
1687
|
+
if (isLastRing && i === 0) {
|
|
1688
|
+
reversedRing[i] = [coordinates[0] - miterSize, coordinates[1]];
|
|
1652
1689
|
}
|
|
1653
|
-
}, {
|
|
1654
|
-
key: "handlePointAdd",
|
|
1655
|
-
value: function handlePointAdd() {
|
|
1656
|
-
const feature = this.activeFeature;
|
|
1657
|
-
if (!feature) return;
|
|
1658
|
-
const {
|
|
1659
|
-
rings,
|
|
1660
|
-
crs
|
|
1661
|
-
} = feature;
|
|
1662
1690
|
|
|
1663
|
-
|
|
1664
|
-
this.finishDrawing();
|
|
1665
|
-
this.fire(new DrawingFinishEvent(feature, new MouseEvent('mouseup')));
|
|
1666
|
-
return;
|
|
1667
|
-
}
|
|
1691
|
+
const nextCoordinates = reversedRing[i - 1];
|
|
1668
1692
|
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
const point = rings[0][0];
|
|
1672
|
-
if (!projection) return;
|
|
1673
|
-
const [lat, long] = projection(point);
|
|
1674
|
-
this.removeTempLabel();
|
|
1675
|
-
this.addMeasureResultLabel();
|
|
1676
|
-
this.addCoordLabel(lat.toFixed(COORD_FRACTION) + ", " + long.toFixed(COORD_FRACTION), point);
|
|
1677
|
-
} else {
|
|
1678
|
-
this.removeCoordLabel();
|
|
1679
|
-
}
|
|
1693
|
+
if (nextCoordinates && nextCoordinates[0] < coordinates[0]) {
|
|
1694
|
+
reversedRing[i] = [nextCoordinates[0] - Math.abs(nextCoordinates[0] - coordinates[0]), coordinates[1]];
|
|
1680
1695
|
}
|
|
1681
|
-
}
|
|
1682
|
-
key: "polygonPreview",
|
|
1683
|
-
value: function polygonPreview() {
|
|
1684
|
-
if (this.tempPolygon) {
|
|
1685
|
-
this._tempLayer && this._tempLayer.remove(this.tempPolygon);
|
|
1686
|
-
}
|
|
1696
|
+
}
|
|
1687
1697
|
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
this.tempPolygon.symbol = this.areaSymbol || measureAreaSymbol;
|
|
1700
|
-
this.activeFeature && this.activeFeature.hide();
|
|
1701
|
-
this._tempLayer && this._tempLayer.add(this.tempPolygon);
|
|
1698
|
+
return reversedRing.reverse();
|
|
1699
|
+
};
|
|
1700
|
+
|
|
1701
|
+
const updateRingForLeftMiter = (ring, miterSize, isFirstRing) => {
|
|
1702
|
+
const newRing = ring.slice();
|
|
1703
|
+
|
|
1704
|
+
for (let i = 0; i < newRing.length; i++) {
|
|
1705
|
+
const coordinates = newRing[i];
|
|
1706
|
+
|
|
1707
|
+
if (i === 0 && isFirstRing) {
|
|
1708
|
+
newRing[i] = [coordinates[0] + miterSize, coordinates[1]];
|
|
1702
1709
|
}
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
delete this.tempPolygon;
|
|
1709
|
-
}
|
|
1710
|
+
|
|
1711
|
+
const prevCoordinates = newRing[i - 1];
|
|
1712
|
+
|
|
1713
|
+
if (prevCoordinates && prevCoordinates[0] > coordinates[0]) {
|
|
1714
|
+
newRing[i] = [prevCoordinates[0] + Math.abs(coordinates[0] - prevCoordinates[0]), coordinates[1]];
|
|
1710
1715
|
}
|
|
1711
|
-
}
|
|
1712
|
-
key: "updateDistance",
|
|
1713
|
-
value: function updateDistance(event) {
|
|
1714
|
-
const feature = this.activeFeature;
|
|
1715
|
-
const {
|
|
1716
|
-
ringIndex,
|
|
1717
|
-
pointIndex
|
|
1718
|
-
} = event;
|
|
1719
|
-
if (!feature || ringIndex === null || pointIndex === null) return;
|
|
1720
|
-
const {
|
|
1721
|
-
rings,
|
|
1722
|
-
crs
|
|
1723
|
-
} = feature;
|
|
1724
|
-
const position = rings[ringIndex][pointIndex];
|
|
1725
|
-
const length$1 = length(rings, crs);
|
|
1726
|
-
let content = this.formatters.length(length$1);
|
|
1716
|
+
}
|
|
1727
1717
|
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
const area$1 = area(rings, crs);
|
|
1731
|
-
content = this.formatters.polygon(area$1, length$1);
|
|
1732
|
-
} else if (this.tempPolygon) {
|
|
1733
|
-
feature.show();
|
|
1734
|
-
this.removeTempPolygon();
|
|
1735
|
-
}
|
|
1718
|
+
return newRing;
|
|
1719
|
+
};
|
|
1736
1720
|
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1721
|
+
const updateRingsForMiter = (rings, position, miterSize) => {
|
|
1722
|
+
return rings.map((ring, ringIndex) => {
|
|
1723
|
+
switch (position) {
|
|
1724
|
+
case 'right':
|
|
1725
|
+
return updateRingForRightMiter(ring, miterSize, ringIndex === rings.length - 1);
|
|
1726
|
+
|
|
1727
|
+
default:
|
|
1728
|
+
return updateRingForLeftMiter(ring, miterSize, ringIndex === 0);
|
|
1741
1729
|
}
|
|
1742
|
-
}
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1730
|
+
});
|
|
1731
|
+
};
|
|
1732
|
+
|
|
1733
|
+
const copyRings = rings => rings.map(ring => ring.map(coordinates => coordinates.slice()));
|
|
1734
|
+
let SGisPolylineSymbol = /*#__PURE__*/function (_sPolylineSymbol) {
|
|
1735
|
+
_inherits(SGisPolylineSymbol, _sPolylineSymbol);
|
|
1736
|
+
|
|
1737
|
+
var _super = /*#__PURE__*/_createSuper(SGisPolylineSymbol);
|
|
1738
|
+
|
|
1739
|
+
function SGisPolylineSymbol(originalSymbol) {
|
|
1740
|
+
var _originalSymbol$strok, _originalSymbol$strok2;
|
|
1741
|
+
|
|
1742
|
+
var _this;
|
|
1743
|
+
|
|
1744
|
+
_classCallCheck(this, SGisPolylineSymbol);
|
|
1745
|
+
|
|
1746
|
+
_this = _super.call(this, {
|
|
1747
|
+
// @ts-ignore
|
|
1748
|
+
strokeColor: getHexColor(getParameterValue((_originalSymbol$strok = originalSymbol.stroke) == null ? void 0 : _originalSymbol$strok.color)),
|
|
1749
|
+
strokeWidth: clamp( // @ts-ignore
|
|
1750
|
+
getParameterValue((_originalSymbol$strok2 = originalSymbol.stroke) == null ? void 0 : _originalSymbol$strok2.width), PREVIEW_LIMITS.STROKE_WIDTH_MIN, PREVIEW_LIMITS.STROKE_WIDTH_MAX),
|
|
1751
|
+
// @ts-ignore
|
|
1752
|
+
lineDash: getLineDash(originalSymbol.stroke),
|
|
1753
|
+
// @ts-ignore
|
|
1754
|
+
lineCap: isDashedBrush(originalSymbol.stroke) ? 'square' : 'round'
|
|
1755
|
+
});
|
|
1756
|
+
_this.originalSymbol = originalSymbol;
|
|
1757
|
+
return _this;
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
_createClass(SGisPolylineSymbol, [{
|
|
1761
|
+
key: "renderFunction",
|
|
1762
|
+
value: function renderFunction(feature, resolution, crs) {
|
|
1763
|
+
if (!isSimplePolylineSymbol(this.originalSymbol)) return _get(_getPrototypeOf(SGisPolylineSymbol.prototype), "renderFunction", this).call(this, feature, resolution, crs);
|
|
1764
|
+
const {
|
|
1765
|
+
ending,
|
|
1766
|
+
beginningSize,
|
|
1767
|
+
beginning,
|
|
1768
|
+
endingSize
|
|
1769
|
+
} = this.originalSymbol;
|
|
1770
|
+
const renders = [];
|
|
1771
|
+
const featureCopy = feature.clone();
|
|
1772
|
+
const beginningMiterRender = getLineMiterRender({
|
|
1773
|
+
color: this.strokeColor,
|
|
1774
|
+
// @ts-ignore
|
|
1775
|
+
kind: beginning,
|
|
1776
|
+
position: 'left',
|
|
1777
|
+
// @ts-ignore
|
|
1778
|
+
size: beginningSize,
|
|
1779
|
+
strokeWidth: this.strokeWidth
|
|
1764
1780
|
});
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
renderLabel: this.renderLabelSymbol
|
|
1774
|
-
})
|
|
1781
|
+
const endingMiterRender = getLineMiterRender({
|
|
1782
|
+
color: this.strokeColor,
|
|
1783
|
+
// @ts-ignore
|
|
1784
|
+
kind: ending,
|
|
1785
|
+
position: 'right',
|
|
1786
|
+
// @ts-ignore
|
|
1787
|
+
size: endingSize,
|
|
1788
|
+
strokeWidth: this.strokeWidth
|
|
1775
1789
|
});
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
this._tempLayer && this._tempLayer.remove(this.tempLabel);
|
|
1783
|
-
delete this.tempLabel;
|
|
1784
|
-
}
|
|
1785
|
-
}
|
|
1786
|
-
}, {
|
|
1787
|
-
key: "removeCoordLabel",
|
|
1788
|
-
value: function removeCoordLabel() {
|
|
1789
|
-
if (this.coordLabel) {
|
|
1790
|
-
this._tempLayer && this._tempLayer.remove(this.coordLabel);
|
|
1791
|
-
delete this.coordLabel;
|
|
1792
|
-
}
|
|
1793
|
-
}
|
|
1794
|
-
}, {
|
|
1795
|
-
key: "removeMeasureLabel",
|
|
1796
|
-
value: function removeMeasureLabel() {
|
|
1797
|
-
if (this.measureResultLabel) {
|
|
1798
|
-
this._tempLayer && this._tempLayer.remove(this.measureResultLabel);
|
|
1799
|
-
delete this.measureResultLabel;
|
|
1800
|
-
}
|
|
1801
|
-
}
|
|
1802
|
-
}, {
|
|
1803
|
-
key: "drawPointOnMouseMove",
|
|
1804
|
-
value: function drawPointOnMouseMove(event) {
|
|
1805
|
-
if (this.tempLabel) {
|
|
1806
|
-
this.tempLabel.position = event.point.position;
|
|
1790
|
+
|
|
1791
|
+
if (beginningMiterRender) {
|
|
1792
|
+
const updatedRings = updateRingsForMiter(featureCopy.rings, 'left', beginningMiterRender.usageSize);
|
|
1793
|
+
const render = beginningMiterRender.getRender(updatedRings, feature.crs, resolution, crs);
|
|
1794
|
+
featureCopy.rings = updatedRings;
|
|
1795
|
+
renders.push(render);
|
|
1807
1796
|
}
|
|
1797
|
+
|
|
1798
|
+
if (endingMiterRender) {
|
|
1799
|
+
const updatedRings = updateRingsForMiter(featureCopy.rings, 'right', endingMiterRender.usageSize);
|
|
1800
|
+
const render = endingMiterRender.getRender(updatedRings, feature.crs, resolution, crs);
|
|
1801
|
+
featureCopy.rings = updatedRings;
|
|
1802
|
+
renders.push(render);
|
|
1803
|
+
} // NOTE: линия должна быть в начале чтобы быть под митерами
|
|
1804
|
+
|
|
1805
|
+
|
|
1806
|
+
renders.unshift(..._get(_getPrototypeOf(SGisPolylineSymbol.prototype), "renderFunction", this).call(this, featureCopy, resolution, crs));
|
|
1807
|
+
return renders;
|
|
1808
1808
|
}
|
|
1809
1809
|
}, {
|
|
1810
|
-
key: "
|
|
1811
|
-
value: function
|
|
1812
|
-
|
|
1813
|
-
wrapper
|
|
1814
|
-
} = this.painter;
|
|
1815
|
-
|
|
1816
|
-
if (wrapper && typeof wrapper !== 'string') {
|
|
1817
|
-
wrapper.style.cursor = cursor;
|
|
1818
|
-
}
|
|
1810
|
+
key: "clone",
|
|
1811
|
+
value: function clone() {
|
|
1812
|
+
return new SGisPolylineSymbol(this.originalSymbol);
|
|
1819
1813
|
}
|
|
1820
1814
|
}]);
|
|
1821
1815
|
|
|
1822
|
-
return
|
|
1823
|
-
}(
|
|
1816
|
+
return SGisPolylineSymbol;
|
|
1817
|
+
}(PolylineSymbol);
|
|
1824
1818
|
|
|
1825
|
-
let
|
|
1826
|
-
_inherits(
|
|
1819
|
+
let LabelSymbol = /*#__PURE__*/function (_DynamicPointSymbol) {
|
|
1820
|
+
_inherits(LabelSymbol, _DynamicPointSymbol);
|
|
1827
1821
|
|
|
1828
|
-
var _super = /*#__PURE__*/_createSuper(
|
|
1822
|
+
var _super = /*#__PURE__*/_createSuper(LabelSymbol);
|
|
1829
1823
|
|
|
1830
|
-
function
|
|
1824
|
+
function LabelSymbol(_temp) {
|
|
1831
1825
|
var _this;
|
|
1832
1826
|
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
_this.measureResult = () => {
|
|
1838
|
-
const feature = _this.activeFeature;
|
|
1839
|
-
if (!feature) return null;
|
|
1840
|
-
const {
|
|
1841
|
-
rings,
|
|
1842
|
-
isEnclosed,
|
|
1843
|
-
crs
|
|
1844
|
-
} = feature;
|
|
1845
|
-
const pointsCount = rings[0].length;
|
|
1846
|
-
const position = rings[0][pointsCount - 1];
|
|
1847
|
-
const area$1 = area(rings, crs);
|
|
1848
|
-
const length$1 = length(rings, crs, isEnclosed);
|
|
1849
|
-
const content = isEnclosed ? _this.formatters.polygon(area$1, length$1) : _this.formatters.length(length$1);
|
|
1850
|
-
return {
|
|
1851
|
-
content,
|
|
1852
|
-
position
|
|
1853
|
-
};
|
|
1854
|
-
};
|
|
1855
|
-
|
|
1856
|
-
_this.removeFeature = () => {
|
|
1857
|
-
_this.fire('remove');
|
|
1858
|
-
};
|
|
1859
|
-
|
|
1860
|
-
_this.painter = painter;
|
|
1861
|
-
_this.renderLabelSymbol = params.renderLabelSymbol;
|
|
1862
|
-
_this.formatters = params.formatters || DEFAULT_FORMATTERS;
|
|
1863
|
-
|
|
1864
|
-
_this.on('change', _this.updateMeasureResult);
|
|
1827
|
+
let {
|
|
1828
|
+
component,
|
|
1829
|
+
offset
|
|
1830
|
+
} = _temp === void 0 ? {} : _temp;
|
|
1865
1831
|
|
|
1866
|
-
|
|
1832
|
+
_classCallCheck(this, LabelSymbol);
|
|
1867
1833
|
|
|
1834
|
+
_this = _super.call(this, {
|
|
1835
|
+
offset
|
|
1836
|
+
});
|
|
1837
|
+
_this.component = component;
|
|
1868
1838
|
return _this;
|
|
1869
1839
|
}
|
|
1870
1840
|
|
|
1871
|
-
_createClass(
|
|
1872
|
-
key: "
|
|
1873
|
-
value: function
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1841
|
+
_createClass(LabelSymbol, [{
|
|
1842
|
+
key: "_getFeatureNode",
|
|
1843
|
+
value: function _getFeatureNode(feature) {
|
|
1844
|
+
const node = document.createElement('div');
|
|
1845
|
+
this.renderDom(feature.content, node);
|
|
1846
|
+
return node;
|
|
1877
1847
|
}
|
|
1878
1848
|
}, {
|
|
1879
|
-
key: "
|
|
1880
|
-
value: function
|
|
1881
|
-
|
|
1882
|
-
if (measureResult === null) return;
|
|
1883
|
-
const {
|
|
1884
|
-
content,
|
|
1885
|
-
position
|
|
1886
|
-
} = measureResult;
|
|
1887
|
-
this.measureResultLabel = new LabelFeature(position, {
|
|
1888
|
-
content,
|
|
1889
|
-
crs: this.map.crs,
|
|
1890
|
-
symbol: createLabelSymbol({
|
|
1891
|
-
onClose: this.removeFeature,
|
|
1892
|
-
renderLabel: this.renderLabelSymbol
|
|
1893
|
-
})
|
|
1894
|
-
});
|
|
1895
|
-
this._tempLayer && this._tempLayer.add(this.measureResultLabel);
|
|
1849
|
+
key: "_updateFeatureNode",
|
|
1850
|
+
value: function _updateFeatureNode(feature) {
|
|
1851
|
+
this.renderDom(feature.content, this.getNode(feature));
|
|
1896
1852
|
}
|
|
1897
1853
|
}, {
|
|
1898
|
-
key: "
|
|
1899
|
-
value: function
|
|
1900
|
-
if (
|
|
1901
|
-
|
|
1902
|
-
if (measureResult === null) return;
|
|
1903
|
-
const {
|
|
1904
|
-
content,
|
|
1905
|
-
position
|
|
1906
|
-
} = measureResult;
|
|
1907
|
-
this.measureResultLabel.content = content;
|
|
1908
|
-
this.measureResultLabel.position = position;
|
|
1854
|
+
key: "renderDom",
|
|
1855
|
+
value: function renderDom(content, node) {
|
|
1856
|
+
if (!node) {
|
|
1857
|
+
return;
|
|
1909
1858
|
}
|
|
1910
|
-
}
|
|
1911
|
-
}]);
|
|
1912
1859
|
|
|
1913
|
-
|
|
1914
|
-
}(PolyEditor);
|
|
1860
|
+
const Component = this.component;
|
|
1915
1861
|
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
const maxWidthPoint = painter.getPointFromPxPosition(width, 0).projectTo(crs);
|
|
1926
|
-
const widthDistance = distance(zeroPoint, maxWidthPoint);
|
|
1927
|
-
const pxK = width / (widthDistance || 1);
|
|
1928
|
-
return Math.round(meters * pxK);
|
|
1929
|
-
};
|
|
1930
|
-
|
|
1931
|
-
const polygonCircleFromPoint = (center, diameter) => {
|
|
1932
|
-
const coordinates = [];
|
|
1933
|
-
const radius = diameter / 2;
|
|
1934
|
-
const endAngle = Math.PI * 2;
|
|
1935
|
-
const step = Math.max(Math.PI / 2 / radius, endAngle / 128);
|
|
1936
|
-
let start = 0;
|
|
1937
|
-
let end = endAngle;
|
|
1862
|
+
if (Component) {
|
|
1863
|
+
ReactDOM.render(React.createElement(Component, {
|
|
1864
|
+
content: content
|
|
1865
|
+
}), node);
|
|
1866
|
+
} else {
|
|
1867
|
+
node.innerText = content;
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
}]);
|
|
1938
1871
|
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
}
|
|
1872
|
+
return LabelSymbol;
|
|
1873
|
+
}(DynamicPointSymbol);
|
|
1942
1874
|
|
|
1943
|
-
|
|
1875
|
+
const defaultOffset = [8, -16];
|
|
1876
|
+
const createLabelSymbol = props => {
|
|
1877
|
+
const {
|
|
1878
|
+
offset = defaultOffset,
|
|
1879
|
+
renderLabel = (_ref) => {
|
|
1880
|
+
let {
|
|
1881
|
+
content
|
|
1882
|
+
} = _ref;
|
|
1883
|
+
return React.createElement("div", null, content);
|
|
1884
|
+
},
|
|
1885
|
+
onClose = undefined
|
|
1886
|
+
} = props || {};
|
|
1887
|
+
return new LabelSymbol({
|
|
1888
|
+
offset,
|
|
1889
|
+
component: (_ref2) => {
|
|
1890
|
+
let {
|
|
1891
|
+
content
|
|
1892
|
+
} = _ref2;
|
|
1893
|
+
return renderLabel({
|
|
1894
|
+
content,
|
|
1895
|
+
onClose
|
|
1896
|
+
});
|
|
1897
|
+
}
|
|
1898
|
+
});
|
|
1944
1899
|
};
|
|
1945
1900
|
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
};
|
|
1901
|
+
function createShadowRender(position, _ref) {
|
|
1902
|
+
let {
|
|
1903
|
+
strokeWidth = 2,
|
|
1904
|
+
shadowColor,
|
|
1905
|
+
shadowSize,
|
|
1906
|
+
size = 6
|
|
1907
|
+
} = _ref;
|
|
1908
|
+
const shadowDiameter = size + strokeWidth + shadowSize;
|
|
1909
|
+
return new PolyRender(polygonCircleFromPoint(position, shadowDiameter), {
|
|
1910
|
+
fillColor: 'transparent',
|
|
1911
|
+
strokeColor: shadowColor,
|
|
1912
|
+
strokeWidth: shadowSize,
|
|
1913
|
+
enclosed: true
|
|
1914
|
+
});
|
|
1915
|
+
}
|
|
1916
|
+
function getEditorPointRenderer(position, _ref2) {
|
|
1917
|
+
let {
|
|
1918
|
+
strokeColor,
|
|
1919
|
+
strokeWidth,
|
|
1920
|
+
shadowColor,
|
|
1921
|
+
fillColor,
|
|
1922
|
+
shadowSize,
|
|
1923
|
+
size = 0
|
|
1924
|
+
} = _ref2;
|
|
1925
|
+
return [createShadowRender(position, {
|
|
1926
|
+
strokeWidth,
|
|
1927
|
+
strokeColor,
|
|
1928
|
+
shadowSize,
|
|
1929
|
+
shadowColor,
|
|
1930
|
+
size
|
|
1931
|
+
}), new PolyRender(polygonCircleFromPoint(position, size), {
|
|
1932
|
+
fillColor,
|
|
1933
|
+
strokeColor,
|
|
1934
|
+
strokeWidth,
|
|
1935
|
+
enclosed: true
|
|
1936
|
+
})];
|
|
1937
|
+
}
|
|
1953
1938
|
|
|
1954
|
-
let
|
|
1955
|
-
_inherits(
|
|
1939
|
+
let ShadowedPointSymbol = /*#__PURE__*/function (_PointSymbol) {
|
|
1940
|
+
_inherits(ShadowedPointSymbol, _PointSymbol);
|
|
1956
1941
|
|
|
1957
|
-
var _super = /*#__PURE__*/_createSuper(
|
|
1942
|
+
var _super = /*#__PURE__*/_createSuper(ShadowedPointSymbol);
|
|
1958
1943
|
|
|
1959
|
-
|
|
1960
|
-
|
|
1944
|
+
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
1945
|
+
function ShadowedPointSymbol(options) {
|
|
1946
|
+
_classCallCheck(this, ShadowedPointSymbol);
|
|
1961
1947
|
|
|
1962
|
-
return _super.
|
|
1948
|
+
return _super.call(this, options);
|
|
1963
1949
|
}
|
|
1964
1950
|
|
|
1965
|
-
_createClass(
|
|
1966
|
-
key: "
|
|
1967
|
-
|
|
1968
|
-
|
|
1951
|
+
_createClass(ShadowedPointSymbol, [{
|
|
1952
|
+
key: "renderFunction",
|
|
1953
|
+
value: function renderFunction(feature, resolution, crs) {
|
|
1954
|
+
if (!(feature instanceof PointFeature)) return [];
|
|
1955
|
+
const {
|
|
1956
|
+
position
|
|
1957
|
+
} = feature.projectTo(crs);
|
|
1958
|
+
const pxPosition = [position[0] / resolution + (this.offset[0] || 0), -position[1] / resolution + (this.offset[1] || 0)];
|
|
1959
|
+
const shadowRender = this.getShadow(pxPosition, feature);
|
|
1960
|
+
const pointArc = this.getPoint(pxPosition, feature);
|
|
1961
|
+
return shadowRender ? [shadowRender, pointArc] : [pointArc];
|
|
1969
1962
|
}
|
|
1970
1963
|
}, {
|
|
1971
|
-
key: "
|
|
1972
|
-
value: function
|
|
1973
|
-
|
|
1974
|
-
return [[[x + (this.miterSize / 2 + this.strokeWidth) * xMultiplier, y]]];
|
|
1964
|
+
key: "getShadow",
|
|
1965
|
+
value: function getShadow(position, _feature) {
|
|
1966
|
+
return ShadowedPointSymbol.getShadowArc(position, this);
|
|
1975
1967
|
}
|
|
1976
1968
|
}, {
|
|
1977
|
-
key: "
|
|
1978
|
-
value: function
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1969
|
+
key: "getPoint",
|
|
1970
|
+
value: function getPoint(position, _feature) {
|
|
1971
|
+
return ShadowedPointSymbol.getPointArc(position, this);
|
|
1972
|
+
}
|
|
1973
|
+
}], [{
|
|
1974
|
+
key: "getShadowArc",
|
|
1975
|
+
value: function getShadowArc(position, _ref) {
|
|
1976
|
+
let {
|
|
1977
|
+
strokeWidth = 2,
|
|
1978
|
+
shadowColor,
|
|
1979
|
+
shadowSize,
|
|
1980
|
+
size = 6
|
|
1981
|
+
} = _ref;
|
|
1982
|
+
return new PolyRender(polygonCircleFromPoint(position, size + strokeWidth + shadowSize), {
|
|
1983
|
+
fillColor: 'transparent',
|
|
1984
|
+
strokeColor: shadowColor,
|
|
1985
|
+
strokeWidth: shadowSize,
|
|
1984
1986
|
enclosed: true
|
|
1985
1987
|
});
|
|
1986
1988
|
}
|
|
1987
|
-
}]);
|
|
1988
|
-
|
|
1989
|
-
return CircleLineMiterRender;
|
|
1990
|
-
}(LineMiterRender);
|
|
1991
|
-
|
|
1992
|
-
let SquareLineMiterRender = /*#__PURE__*/function (_LineMiterRender) {
|
|
1993
|
-
_inherits(SquareLineMiterRender, _LineMiterRender);
|
|
1994
|
-
|
|
1995
|
-
var _super = /*#__PURE__*/_createSuper(SquareLineMiterRender);
|
|
1996
|
-
|
|
1997
|
-
function SquareLineMiterRender() {
|
|
1998
|
-
_classCallCheck(this, SquareLineMiterRender);
|
|
1999
|
-
|
|
2000
|
-
return _super.apply(this, arguments);
|
|
2001
|
-
}
|
|
2002
|
-
|
|
2003
|
-
_createClass(SquareLineMiterRender, [{
|
|
2004
|
-
key: "usageSize",
|
|
2005
|
-
get: function get() {
|
|
2006
|
-
return this.miterSize + this.strokeWidth;
|
|
2007
|
-
}
|
|
2008
1989
|
}, {
|
|
2009
|
-
key: "
|
|
2010
|
-
value: function
|
|
2011
|
-
let
|
|
2012
|
-
|
|
1990
|
+
key: "getPointArc",
|
|
1991
|
+
value: function getPointArc(position, _ref2) {
|
|
1992
|
+
let {
|
|
1993
|
+
strokeWidth,
|
|
1994
|
+
fillColor,
|
|
1995
|
+
strokeColor,
|
|
1996
|
+
size = 6
|
|
1997
|
+
} = _ref2;
|
|
1998
|
+
return new PolyRender(polygonCircleFromPoint(position, size), {
|
|
1999
|
+
fillColor,
|
|
2000
|
+
strokeColor,
|
|
2001
|
+
strokeWidth,
|
|
2002
|
+
enclosed: true
|
|
2003
|
+
});
|
|
2013
2004
|
}
|
|
2014
2005
|
}, {
|
|
2015
|
-
key: "
|
|
2016
|
-
value: function
|
|
2017
|
-
const
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
fillColor: isFilled ? this.color : void 0,
|
|
2021
|
-
fillStyle: isFilled ? FillStyle.Color : FillStyle.None,
|
|
2022
|
-
lineCap: 'square',
|
|
2023
|
-
lineJoin: 'miter',
|
|
2024
|
-
strokeColor: this.color,
|
|
2025
|
-
strokeWidth: this.strokeWidth
|
|
2026
|
-
});
|
|
2006
|
+
key: "getArcs",
|
|
2007
|
+
value: function getArcs(position, params) {
|
|
2008
|
+
const shadowRender = ShadowedPointSymbol.getShadowArc(position, params);
|
|
2009
|
+
const pointRender = ShadowedPointSymbol.getPointArc(position, params);
|
|
2010
|
+
return shadowRender ? [shadowRender, pointRender] : [pointRender];
|
|
2027
2011
|
}
|
|
2028
2012
|
}]);
|
|
2029
2013
|
|
|
2030
|
-
return
|
|
2031
|
-
}(
|
|
2014
|
+
return ShadowedPointSymbol;
|
|
2015
|
+
}(PointSymbol);
|
|
2032
2016
|
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
case LineMiterKind.Arrow:
|
|
2036
|
-
case LineMiterKind.FilledArrow:
|
|
2037
|
-
return new ArrowLineMiterRender(options);
|
|
2017
|
+
let ShadowedPolySymbol = /*#__PURE__*/function (_PolylineSymbol) {
|
|
2018
|
+
_inherits(ShadowedPolySymbol, _PolylineSymbol);
|
|
2038
2019
|
|
|
2039
|
-
|
|
2040
|
-
case LineMiterKind.FilledSquare:
|
|
2041
|
-
return new SquareLineMiterRender(options);
|
|
2020
|
+
var _super = /*#__PURE__*/_createSuper(ShadowedPolySymbol);
|
|
2042
2021
|
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2022
|
+
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
2023
|
+
function ShadowedPolySymbol(options) {
|
|
2024
|
+
_classCallCheck(this, ShadowedPolySymbol);
|
|
2046
2025
|
|
|
2047
|
-
|
|
2048
|
-
return null;
|
|
2026
|
+
return _super.call(this, options);
|
|
2049
2027
|
}
|
|
2050
|
-
};
|
|
2051
|
-
|
|
2052
|
-
const updateRingForRightMiter = (ring, miterSize, isLastRing) => {
|
|
2053
|
-
const reversedRing = ring.slice().reverse();
|
|
2054
2028
|
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
reversedRing[i] = [coordinates[0] - miterSize, coordinates[1]];
|
|
2060
|
-
}
|
|
2029
|
+
_createClass(ShadowedPolySymbol, [{
|
|
2030
|
+
key: "renderFunction",
|
|
2031
|
+
value: function renderFunction(feature, resolution, crs) {
|
|
2032
|
+
if (!(feature instanceof Poly)) return [];
|
|
2061
2033
|
|
|
2062
|
-
|
|
2034
|
+
const coordinates = _get(_getPrototypeOf(ShadowedPolySymbol.prototype), "getRenderedCoordinates", this).call(this, feature, resolution, crs);
|
|
2063
2035
|
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
return reversedRing.reverse();
|
|
2070
|
-
};
|
|
2036
|
+
const polyRender = this.getPolyRender(coordinates, feature);
|
|
2037
|
+
const shadowRender = this.getShadow(coordinates, feature);
|
|
2038
|
+
const vertexRenders = this.getVertexRenders(coordinates);
|
|
2039
|
+
let renders = [polyRender];
|
|
2071
2040
|
|
|
2072
|
-
|
|
2073
|
-
|
|
2041
|
+
if (shadowRender) {
|
|
2042
|
+
renders = [shadowRender, polyRender];
|
|
2043
|
+
}
|
|
2074
2044
|
|
|
2075
|
-
|
|
2076
|
-
|
|
2045
|
+
if (vertexRenders) {
|
|
2046
|
+
renders = renders.concat(vertexRenders);
|
|
2047
|
+
}
|
|
2077
2048
|
|
|
2078
|
-
|
|
2079
|
-
newRing[i] = [coordinates[0] + miterSize, coordinates[1]];
|
|
2049
|
+
return renders;
|
|
2080
2050
|
}
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2051
|
+
}, {
|
|
2052
|
+
key: "getShadow",
|
|
2053
|
+
value: function getShadow(coordinates, _feature) {
|
|
2054
|
+
return new PolyRender(coordinates, {
|
|
2055
|
+
fillStyle: FillStyle.None,
|
|
2056
|
+
enclosed: this.enclose,
|
|
2057
|
+
strokeColor: this.shadowColor,
|
|
2058
|
+
strokeWidth: this.shadowSize,
|
|
2059
|
+
lineDash: this.lineDash
|
|
2060
|
+
});
|
|
2086
2061
|
}
|
|
2087
|
-
}
|
|
2062
|
+
}, {
|
|
2063
|
+
key: "getPolyRender",
|
|
2064
|
+
value: function getPolyRender(coordinates, _feature) {
|
|
2065
|
+
return new PolyRender(coordinates, {
|
|
2066
|
+
fillStyle: this.enclose ? FillStyle.Color : FillStyle.None,
|
|
2067
|
+
enclosed: this.enclose,
|
|
2068
|
+
fillColor: this.fillColor,
|
|
2069
|
+
strokeColor: this.strokeColor,
|
|
2070
|
+
strokeWidth: this.strokeWidth,
|
|
2071
|
+
lineDash: this.lineDash
|
|
2072
|
+
});
|
|
2073
|
+
}
|
|
2074
|
+
}, {
|
|
2075
|
+
key: "getVertexRenders",
|
|
2076
|
+
value: function getVertexRenders(coordinates) {
|
|
2077
|
+
if (!this.showVertex) return;
|
|
2078
|
+
const vertexCoordinates = coordinates.reduce((acc, curr) => {
|
|
2079
|
+
return acc.concat(curr);
|
|
2080
|
+
}, []);
|
|
2081
|
+
return vertexCoordinates.map(coord => getEditorPointRenderer(coord, {
|
|
2082
|
+
size: 6,
|
|
2083
|
+
strokeWidth: 2,
|
|
2084
|
+
shadowColor: this.shadowColor,
|
|
2085
|
+
strokeColor: this.strokeColor,
|
|
2086
|
+
shadowSize: this.vertexShadowSize !== undefined ? this.vertexShadowSize : 2,
|
|
2087
|
+
fillColor: '#ffffff'
|
|
2088
|
+
})).reduce((acc, curr) => acc.concat(curr), []);
|
|
2089
|
+
}
|
|
2090
|
+
}]);
|
|
2088
2091
|
|
|
2089
|
-
return
|
|
2092
|
+
return ShadowedPolySymbol;
|
|
2093
|
+
}(PolylineSymbol);
|
|
2094
|
+
const polySymbolParams = {
|
|
2095
|
+
strokeWidth: 2,
|
|
2096
|
+
strokeColor: '#e33600',
|
|
2097
|
+
shadowSize: 8,
|
|
2098
|
+
shadowColor: 'rgba(227, 54, 0, 0.3)'
|
|
2090
2099
|
};
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
case 'right':
|
|
2096
|
-
return updateRingForRightMiter(ring, miterSize, ringIndex === rings.length - 1);
|
|
2097
|
-
|
|
2098
|
-
default:
|
|
2099
|
-
return updateRingForLeftMiter(ring, miterSize, ringIndex === 0);
|
|
2100
|
-
}
|
|
2101
|
-
});
|
|
2100
|
+
const measureSymbolParams = {
|
|
2101
|
+
strokeColor: '#ff6933',
|
|
2102
|
+
shadowSize: 0,
|
|
2103
|
+
vertexShadowSize: 0
|
|
2102
2104
|
};
|
|
2105
|
+
const measureLengthSymbol = /*#__PURE__*/new ShadowedPolySymbol( /*#__PURE__*/_extends({}, polySymbolParams, measureSymbolParams, {
|
|
2106
|
+
enclose: false,
|
|
2107
|
+
showVertex: true
|
|
2108
|
+
}));
|
|
2109
|
+
const measureAreaSymbol = /*#__PURE__*/new ShadowedPolySymbol( /*#__PURE__*/_extends({}, polySymbolParams, measureSymbolParams, {
|
|
2110
|
+
fillColor: 'rgba(255, 105, 51, 0.25)',
|
|
2111
|
+
enclose: true,
|
|
2112
|
+
showVertex: true
|
|
2113
|
+
}));
|
|
2114
|
+
const snapSymbolParams = {
|
|
2115
|
+
size: 10,
|
|
2116
|
+
strokeWidth: 2,
|
|
2117
|
+
strokeColor: '#e33600',
|
|
2118
|
+
fillColor: '#ffffff',
|
|
2119
|
+
shadowColor: 'rgba(227, 54, 0, 0.3)',
|
|
2120
|
+
shadowSize: 3
|
|
2121
|
+
};
|
|
2122
|
+
const measurePolygonSnapSymbol = /*#__PURE__*/new ShadowedPointSymbol( /*#__PURE__*/_extends({}, snapSymbolParams, {
|
|
2123
|
+
strokeColor: '#ff6933',
|
|
2124
|
+
shadowSize: 0
|
|
2125
|
+
}));
|
|
2103
2126
|
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
_inherits(SGisPolylineSymbol, _sPolylineSymbol);
|
|
2107
|
-
|
|
2108
|
-
var _super = /*#__PURE__*/_createSuper(SGisPolylineSymbol);
|
|
2109
|
-
|
|
2110
|
-
function SGisPolylineSymbol(originalSymbol) {
|
|
2111
|
-
var _originalSymbol$strok, _originalSymbol$strok2;
|
|
2127
|
+
let SelectedPointSymbol = /*#__PURE__*/function (_ShadowedPointSymbol) {
|
|
2128
|
+
_inherits(SelectedPointSymbol, _ShadowedPointSymbol);
|
|
2112
2129
|
|
|
2113
|
-
|
|
2130
|
+
var _super = /*#__PURE__*/_createSuper(SelectedPointSymbol);
|
|
2114
2131
|
|
|
2115
|
-
|
|
2132
|
+
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
2133
|
+
function SelectedPointSymbol(props) {
|
|
2134
|
+
_classCallCheck(this, SelectedPointSymbol);
|
|
2116
2135
|
|
|
2117
|
-
|
|
2118
|
-
// @ts-ignore
|
|
2119
|
-
strokeColor: getHexColor(getParameterValue((_originalSymbol$strok = originalSymbol.stroke) == null ? void 0 : _originalSymbol$strok.color)),
|
|
2120
|
-
strokeWidth: clamp( // @ts-ignore
|
|
2121
|
-
getParameterValue((_originalSymbol$strok2 = originalSymbol.stroke) == null ? void 0 : _originalSymbol$strok2.width), PREVIEW_LIMITS.STROKE_WIDTH_MIN, PREVIEW_LIMITS.STROKE_WIDTH_MAX),
|
|
2122
|
-
// @ts-ignore
|
|
2123
|
-
lineDash: getLineDash(originalSymbol.stroke),
|
|
2124
|
-
// @ts-ignore
|
|
2125
|
-
lineCap: isDashedBrush(originalSymbol.stroke) ? 'square' : 'round'
|
|
2126
|
-
});
|
|
2127
|
-
_this.originalSymbol = originalSymbol;
|
|
2128
|
-
return _this;
|
|
2136
|
+
return _super.call(this, props);
|
|
2129
2137
|
}
|
|
2130
2138
|
|
|
2131
|
-
_createClass(
|
|
2132
|
-
key: "
|
|
2133
|
-
value: function
|
|
2134
|
-
if (
|
|
2135
|
-
|
|
2136
|
-
ending,
|
|
2137
|
-
beginningSize,
|
|
2138
|
-
beginning,
|
|
2139
|
-
endingSize
|
|
2140
|
-
} = this.originalSymbol;
|
|
2141
|
-
const renders = [];
|
|
2142
|
-
const featureCopy = feature.clone();
|
|
2143
|
-
const beginningMiterRender = getLineMiterRender({
|
|
2144
|
-
color: this.strokeColor,
|
|
2145
|
-
// @ts-ignore
|
|
2146
|
-
kind: beginning,
|
|
2147
|
-
position: 'left',
|
|
2148
|
-
// @ts-ignore
|
|
2149
|
-
size: beginningSize,
|
|
2150
|
-
strokeWidth: this.strokeWidth
|
|
2151
|
-
});
|
|
2152
|
-
const endingMiterRender = getLineMiterRender({
|
|
2153
|
-
color: this.strokeColor,
|
|
2154
|
-
// @ts-ignore
|
|
2155
|
-
kind: ending,
|
|
2156
|
-
position: 'right',
|
|
2157
|
-
// @ts-ignore
|
|
2158
|
-
size: endingSize,
|
|
2159
|
-
strokeWidth: this.strokeWidth
|
|
2160
|
-
});
|
|
2161
|
-
|
|
2162
|
-
if (beginningMiterRender) {
|
|
2163
|
-
const updatedRings = updateRingsForMiter(featureCopy.rings, 'left', beginningMiterRender.usageSize);
|
|
2164
|
-
const render = beginningMiterRender.getRender(updatedRings, feature.crs, resolution, crs);
|
|
2165
|
-
featureCopy.rings = updatedRings;
|
|
2166
|
-
renders.push(render);
|
|
2139
|
+
_createClass(SelectedPointSymbol, [{
|
|
2140
|
+
key: "getShadow",
|
|
2141
|
+
value: function getShadow(position, feature) {
|
|
2142
|
+
if (feature.isSelected) {
|
|
2143
|
+
return _get(_getPrototypeOf(SelectedPointSymbol.prototype), "getShadow", this).call(this, position, feature);
|
|
2167
2144
|
}
|
|
2168
|
-
|
|
2169
|
-
if (endingMiterRender) {
|
|
2170
|
-
const updatedRings = updateRingsForMiter(featureCopy.rings, 'right', endingMiterRender.usageSize);
|
|
2171
|
-
const render = endingMiterRender.getRender(updatedRings, feature.crs, resolution, crs);
|
|
2172
|
-
featureCopy.rings = updatedRings;
|
|
2173
|
-
renders.push(render);
|
|
2174
|
-
} // NOTE: линия должна быть в начале чтобы быть под митерами
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
renders.unshift(..._get(_getPrototypeOf(SGisPolylineSymbol.prototype), "renderFunction", this).call(this, featureCopy, resolution, crs));
|
|
2178
|
-
return renders;
|
|
2179
2145
|
}
|
|
2180
2146
|
}, {
|
|
2181
|
-
key: "
|
|
2182
|
-
value: function
|
|
2183
|
-
|
|
2184
|
-
}
|
|
2185
|
-
}]);
|
|
2147
|
+
key: "getPoint",
|
|
2148
|
+
value: function getPoint(position, feature) {
|
|
2149
|
+
const pointRender = _get(_getPrototypeOf(SelectedPointSymbol.prototype), "getPoint", this).call(this, position, feature);
|
|
2186
2150
|
|
|
2187
|
-
|
|
2188
|
-
|
|
2151
|
+
if (feature.isSelected) {
|
|
2152
|
+
pointRender.strokeColor = this.selectedStrokeColor;
|
|
2153
|
+
pointRender.fillColor = this.selectedFillColor;
|
|
2154
|
+
}
|
|
2189
2155
|
|
|
2190
|
-
|
|
2191
|
-
|
|
2156
|
+
return pointRender;
|
|
2157
|
+
}
|
|
2158
|
+
}]);
|
|
2192
2159
|
|
|
2193
|
-
|
|
2160
|
+
return SelectedPointSymbol;
|
|
2161
|
+
}(ShadowedPointSymbol);
|
|
2194
2162
|
|
|
2195
|
-
|
|
2196
|
-
|
|
2163
|
+
let SelectedPolySymbol = /*#__PURE__*/function (_ShadowedPolySymbol) {
|
|
2164
|
+
_inherits(SelectedPolySymbol, _ShadowedPolySymbol);
|
|
2197
2165
|
|
|
2198
|
-
|
|
2199
|
-
component,
|
|
2200
|
-
offset
|
|
2201
|
-
} = _temp === void 0 ? {} : _temp;
|
|
2166
|
+
var _super = /*#__PURE__*/_createSuper(SelectedPolySymbol);
|
|
2202
2167
|
|
|
2203
|
-
|
|
2168
|
+
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
2169
|
+
function SelectedPolySymbol(props) {
|
|
2170
|
+
_classCallCheck(this, SelectedPolySymbol);
|
|
2204
2171
|
|
|
2205
|
-
|
|
2206
|
-
offset
|
|
2207
|
-
});
|
|
2208
|
-
_this.component = component;
|
|
2209
|
-
return _this;
|
|
2172
|
+
return _super.call(this, props);
|
|
2210
2173
|
}
|
|
2211
2174
|
|
|
2212
|
-
_createClass(
|
|
2213
|
-
key: "
|
|
2214
|
-
value: function
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
}
|
|
2219
|
-
}, {
|
|
2220
|
-
key: "_updateFeatureNode",
|
|
2221
|
-
value: function _updateFeatureNode(feature) {
|
|
2222
|
-
this.renderDom(feature.content, this.getNode(feature));
|
|
2175
|
+
_createClass(SelectedPolySymbol, [{
|
|
2176
|
+
key: "getShadow",
|
|
2177
|
+
value: function getShadow(coordinates, feature) {
|
|
2178
|
+
if (feature.isSelected) {
|
|
2179
|
+
return _get(_getPrototypeOf(SelectedPolySymbol.prototype), "getShadow", this).call(this, coordinates, feature);
|
|
2180
|
+
}
|
|
2223
2181
|
}
|
|
2224
2182
|
}, {
|
|
2225
|
-
key: "
|
|
2226
|
-
value: function
|
|
2227
|
-
|
|
2228
|
-
return;
|
|
2229
|
-
}
|
|
2183
|
+
key: "getPolyRender",
|
|
2184
|
+
value: function getPolyRender(coordinates, feature) {
|
|
2185
|
+
const polyRender = _get(_getPrototypeOf(SelectedPolySymbol.prototype), "getPolyRender", this).call(this, coordinates, feature);
|
|
2230
2186
|
|
|
2231
|
-
|
|
2187
|
+
if (feature.isSelected) {
|
|
2188
|
+
polyRender.fillColor = this.selectedFillColor;
|
|
2189
|
+
polyRender.strokeColor = this.selectedStrokeColor;
|
|
2232
2190
|
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
}), node);
|
|
2237
|
-
} else {
|
|
2238
|
-
node.innerText = content;
|
|
2191
|
+
if (this.selectedStrokeWidth !== void 0) {
|
|
2192
|
+
polyRender.strokeWidth = this.selectedStrokeWidth;
|
|
2193
|
+
}
|
|
2239
2194
|
}
|
|
2195
|
+
|
|
2196
|
+
return polyRender;
|
|
2240
2197
|
}
|
|
2241
2198
|
}]);
|
|
2242
2199
|
|
|
2243
|
-
return
|
|
2244
|
-
}(
|
|
2200
|
+
return SelectedPolySymbol;
|
|
2201
|
+
}(ShadowedPolySymbol);
|
|
2245
2202
|
|
|
2246
|
-
const
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2203
|
+
const selectedPoint = /*#__PURE__*/new SelectedPointSymbol({
|
|
2204
|
+
size: 8,
|
|
2205
|
+
strokeWidth: 2,
|
|
2206
|
+
strokeColor: 'rgba(255, 87, 34, 0.3)',
|
|
2207
|
+
fillColor: 'rgba(255, 255, 255, 0.65)',
|
|
2208
|
+
shadowColor: 'rgba(255, 87, 34, 0.3)',
|
|
2209
|
+
shadowSize: 3,
|
|
2210
|
+
selectedStrokeColor: '#ff5722',
|
|
2211
|
+
selectedFillColor: 'rgba(255, 255, 255, 0.65)'
|
|
2212
|
+
});
|
|
2213
|
+
const selectedPolyline = /*#__PURE__*/new SelectedPolySymbol({
|
|
2214
|
+
strokeWidth: 6,
|
|
2215
|
+
strokeColor: 'rgba(255, 87, 34, 0.2)',
|
|
2216
|
+
shadowSize: 8,
|
|
2217
|
+
shadowColor: 'rgba(255, 87, 34, 0.3)',
|
|
2218
|
+
selectedStrokeColor: '#ff5722',
|
|
2219
|
+
selectedStrokeWidth: 2
|
|
2220
|
+
});
|
|
2221
|
+
const selectedPolygon = /*#__PURE__*/new SelectedPolySymbol({
|
|
2222
|
+
strokeWidth: 2,
|
|
2223
|
+
strokeColor: 'rgba(255, 87, 34, 0.3)',
|
|
2224
|
+
shadowSize: 8,
|
|
2225
|
+
shadowColor: 'rgba(255, 87, 34, 0.3)',
|
|
2226
|
+
fillColor: 'rgba(255, 255, 255, 0.36)',
|
|
2227
|
+
enclose: true,
|
|
2228
|
+
selectedFillColor: 'rgba(255, 255, 255, 0.56)',
|
|
2229
|
+
selectedStrokeColor: '#ff5722'
|
|
2230
|
+
});
|
|
2271
2231
|
|
|
2272
|
-
|
|
2232
|
+
const metersToPixels = (meters, _ref) => {
|
|
2273
2233
|
let {
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
shadowSize,
|
|
2277
|
-
size = 6
|
|
2234
|
+
painter,
|
|
2235
|
+
crs = geo
|
|
2278
2236
|
} = _ref;
|
|
2279
|
-
const
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
let {
|
|
2289
|
-
strokeColor,
|
|
2290
|
-
strokeWidth,
|
|
2291
|
-
shadowColor,
|
|
2292
|
-
fillColor,
|
|
2293
|
-
shadowSize,
|
|
2294
|
-
size = 0
|
|
2295
|
-
} = _ref2;
|
|
2296
|
-
return [createShadowRender(position, {
|
|
2297
|
-
strokeWidth,
|
|
2298
|
-
strokeColor,
|
|
2299
|
-
shadowSize,
|
|
2300
|
-
shadowColor,
|
|
2301
|
-
size
|
|
2302
|
-
}), new PolyRender(polygonCircleFromPoint(position, size), {
|
|
2303
|
-
fillColor,
|
|
2304
|
-
strokeColor,
|
|
2305
|
-
strokeWidth,
|
|
2306
|
-
enclosed: true
|
|
2307
|
-
})];
|
|
2308
|
-
}
|
|
2237
|
+
const {
|
|
2238
|
+
width
|
|
2239
|
+
} = painter;
|
|
2240
|
+
const zeroPoint = painter.getPointFromPxPosition(0, 0).projectTo(crs);
|
|
2241
|
+
const maxWidthPoint = painter.getPointFromPxPosition(width, 0).projectTo(crs);
|
|
2242
|
+
const widthDistance = distance(zeroPoint, maxWidthPoint);
|
|
2243
|
+
const pxK = width / (widthDistance || 1);
|
|
2244
|
+
return Math.round(meters * pxK);
|
|
2245
|
+
};
|
|
2309
2246
|
|
|
2310
|
-
|
|
2311
|
-
|
|
2247
|
+
const defaultPathStyles = {
|
|
2248
|
+
strokeWidth: 2,
|
|
2249
|
+
strokeColor: 'rgb(0, 163, 245)',
|
|
2250
|
+
fillStyle: FillStyle.None
|
|
2251
|
+
};
|
|
2252
|
+
let SVGPoly = /*#__PURE__*/function (_Symbol) {
|
|
2253
|
+
_inherits(SVGPoly, _Symbol);
|
|
2312
2254
|
|
|
2313
|
-
var _super = /*#__PURE__*/_createSuper(
|
|
2255
|
+
var _super = /*#__PURE__*/_createSuper(SVGPoly);
|
|
2314
2256
|
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
_classCallCheck(this, ShadowedPointSymbol);
|
|
2257
|
+
function SVGPoly(_temp) {
|
|
2258
|
+
var _this;
|
|
2318
2259
|
|
|
2319
|
-
|
|
2260
|
+
let {
|
|
2261
|
+
redrawFeatureNode,
|
|
2262
|
+
pathStyles,
|
|
2263
|
+
circle,
|
|
2264
|
+
className,
|
|
2265
|
+
appendToSvg
|
|
2266
|
+
} = _temp === void 0 ? {} : _temp;
|
|
2267
|
+
|
|
2268
|
+
_classCallCheck(this, SVGPoly);
|
|
2269
|
+
|
|
2270
|
+
_this = _super.call(this);
|
|
2271
|
+
_this.container = document.createElement('div');
|
|
2272
|
+
_this.container.style.position = 'absolute';
|
|
2273
|
+
_this.redrawFeatureNode = redrawFeatureNode;
|
|
2274
|
+
_this.pathStyles = _extends({
|
|
2275
|
+
center: [0, 0],
|
|
2276
|
+
fillColor: 'none'
|
|
2277
|
+
}, pathStyles);
|
|
2278
|
+
_this.circle = circle;
|
|
2279
|
+
_this.className = className;
|
|
2280
|
+
_this.appendToSvg = appendToSvg;
|
|
2281
|
+
return _this;
|
|
2320
2282
|
}
|
|
2321
2283
|
|
|
2322
|
-
_createClass(
|
|
2284
|
+
_createClass(SVGPoly, [{
|
|
2323
2285
|
key: "renderFunction",
|
|
2324
2286
|
value: function renderFunction(feature, resolution, crs) {
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2287
|
+
const coordinates = feature instanceof Poly ? new PolylineSymbol().getRenderedCoordinates(feature, resolution, crs) : feature.centroid;
|
|
2288
|
+
this.setCirclePxRaius(crs);
|
|
2289
|
+
this.container.innerHTML = '';
|
|
2290
|
+
const svg = this.setSvg(coordinates);
|
|
2291
|
+
svg && this.container.append(svg);
|
|
2292
|
+
feature.__dynamicSymbolRender = new DynamicRender({
|
|
2293
|
+
node: this.container,
|
|
2294
|
+
update: (bbox, resolution) => this.update({
|
|
2295
|
+
bbox,
|
|
2296
|
+
resolution,
|
|
2297
|
+
feature,
|
|
2298
|
+
crs
|
|
2299
|
+
}),
|
|
2300
|
+
redraw: () => {
|
|
2301
|
+
this.redrawFeatureNode && this.redrawFeatureNode(feature);
|
|
2302
|
+
}
|
|
2303
|
+
});
|
|
2304
|
+
|
|
2305
|
+
this._setEventListeners(feature);
|
|
2306
|
+
|
|
2307
|
+
return [feature.__dynamicSymbolRender];
|
|
2333
2308
|
}
|
|
2334
2309
|
}, {
|
|
2335
|
-
key: "
|
|
2336
|
-
value: function
|
|
2337
|
-
|
|
2310
|
+
key: "setCirclePxRaius",
|
|
2311
|
+
value: function setCirclePxRaius(crs) {
|
|
2312
|
+
if (this.circle && this.pathStyles) {
|
|
2313
|
+
var _this$circle;
|
|
2314
|
+
|
|
2315
|
+
this.pathStyles.radius = metersToPixels(this.circle.radius, {
|
|
2316
|
+
painter: this.circle.painter,
|
|
2317
|
+
crs
|
|
2318
|
+
}) + (((_this$circle = this.circle) == null ? void 0 : _this$circle.pxOffset) || 0);
|
|
2319
|
+
}
|
|
2338
2320
|
}
|
|
2339
2321
|
}, {
|
|
2340
|
-
key: "
|
|
2341
|
-
value: function
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
}], [{
|
|
2345
|
-
key: "getShadowArc",
|
|
2346
|
-
value: function getShadowArc(position, _ref) {
|
|
2322
|
+
key: "update",
|
|
2323
|
+
value: function update(_ref) {
|
|
2324
|
+
var _this$pathStyles, _this$pathStyles2, _this$pathStyles3, _this$pathStyles4;
|
|
2325
|
+
|
|
2347
2326
|
let {
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2327
|
+
bbox,
|
|
2328
|
+
resolution,
|
|
2329
|
+
feature,
|
|
2330
|
+
crs
|
|
2352
2331
|
} = _ref;
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
});
|
|
2375
|
-
}
|
|
2376
|
-
}, {
|
|
2377
|
-
key: "getArcs",
|
|
2378
|
-
value: function getArcs(position, params) {
|
|
2379
|
-
const shadowRender = ShadowedPointSymbol.getShadowArc(position, params);
|
|
2380
|
-
const pointRender = ShadowedPointSymbol.getPointArc(position, params);
|
|
2381
|
-
return shadowRender ? [shadowRender, pointRender] : [pointRender];
|
|
2382
|
-
}
|
|
2383
|
-
}]);
|
|
2384
|
-
|
|
2385
|
-
return ShadowedPointSymbol;
|
|
2386
|
-
}(PointSymbol);
|
|
2387
|
-
|
|
2388
|
-
let ShadowedPolySymbol = /*#__PURE__*/function (_PolylineSymbol) {
|
|
2389
|
-
_inherits(ShadowedPolySymbol, _PolylineSymbol);
|
|
2390
|
-
|
|
2391
|
-
var _super = /*#__PURE__*/_createSuper(ShadowedPolySymbol);
|
|
2392
|
-
|
|
2393
|
-
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
2394
|
-
function ShadowedPolySymbol(options) {
|
|
2395
|
-
_classCallCheck(this, ShadowedPolySymbol);
|
|
2396
|
-
|
|
2397
|
-
return _super.call(this, options);
|
|
2398
|
-
}
|
|
2399
|
-
|
|
2400
|
-
_createClass(ShadowedPolySymbol, [{
|
|
2401
|
-
key: "renderFunction",
|
|
2402
|
-
value: function renderFunction(feature, resolution, crs) {
|
|
2403
|
-
if (!(feature instanceof Poly)) return [];
|
|
2404
|
-
|
|
2405
|
-
const coordinates = _get(_getPrototypeOf(ShadowedPolySymbol.prototype), "getRenderedCoordinates", this).call(this, feature, resolution, crs);
|
|
2406
|
-
|
|
2407
|
-
const polyRender = this.getPolyRender(coordinates, feature);
|
|
2408
|
-
const shadowRender = this.getShadow(coordinates, feature);
|
|
2409
|
-
const vertexRenders = this.getVertexRenders(coordinates);
|
|
2410
|
-
let renders = [polyRender];
|
|
2411
|
-
|
|
2412
|
-
if (shadowRender) {
|
|
2413
|
-
renders = [shadowRender, polyRender];
|
|
2414
|
-
}
|
|
2415
|
-
|
|
2416
|
-
if (vertexRenders) {
|
|
2417
|
-
renders = renders.concat(vertexRenders);
|
|
2418
|
-
}
|
|
2419
|
-
|
|
2420
|
-
return renders;
|
|
2421
|
-
}
|
|
2422
|
-
}, {
|
|
2423
|
-
key: "getShadow",
|
|
2424
|
-
value: function getShadow(coordinates, _feature) {
|
|
2425
|
-
return new PolyRender(coordinates, {
|
|
2426
|
-
fillStyle: FillStyle.None,
|
|
2427
|
-
enclosed: this.enclose,
|
|
2428
|
-
strokeColor: this.shadowColor,
|
|
2429
|
-
strokeWidth: this.shadowSize,
|
|
2430
|
-
lineDash: this.lineDash
|
|
2431
|
-
});
|
|
2432
|
-
}
|
|
2433
|
-
}, {
|
|
2434
|
-
key: "getPolyRender",
|
|
2435
|
-
value: function getPolyRender(coordinates, _feature) {
|
|
2436
|
-
return new PolyRender(coordinates, {
|
|
2437
|
-
fillStyle: this.enclose ? FillStyle.Color : FillStyle.None,
|
|
2438
|
-
enclosed: this.enclose,
|
|
2439
|
-
fillColor: this.fillColor,
|
|
2440
|
-
strokeColor: this.strokeColor,
|
|
2441
|
-
strokeWidth: this.strokeWidth,
|
|
2442
|
-
lineDash: this.lineDash
|
|
2443
|
-
});
|
|
2444
|
-
}
|
|
2445
|
-
}, {
|
|
2446
|
-
key: "getVertexRenders",
|
|
2447
|
-
value: function getVertexRenders(coordinates) {
|
|
2448
|
-
if (!this.showVertex) return;
|
|
2449
|
-
const vertexCoordinates = coordinates.reduce((acc, curr) => {
|
|
2450
|
-
return acc.concat(curr);
|
|
2451
|
-
}, []);
|
|
2452
|
-
return vertexCoordinates.map(coord => getEditorPointRenderer(coord, {
|
|
2453
|
-
size: 6,
|
|
2454
|
-
strokeWidth: 2,
|
|
2455
|
-
shadowColor: this.shadowColor,
|
|
2456
|
-
strokeColor: this.strokeColor,
|
|
2457
|
-
shadowSize: this.vertexShadowSize !== undefined ? this.vertexShadowSize : 2,
|
|
2458
|
-
fillColor: '#ffffff'
|
|
2459
|
-
})).reduce((acc, curr) => acc.concat(curr), []);
|
|
2460
|
-
}
|
|
2461
|
-
}]);
|
|
2462
|
-
|
|
2463
|
-
return ShadowedPolySymbol;
|
|
2464
|
-
}(PolylineSymbol);
|
|
2465
|
-
const polySymbolParams = {
|
|
2466
|
-
strokeWidth: 2,
|
|
2467
|
-
strokeColor: '#e33600',
|
|
2468
|
-
shadowSize: 8,
|
|
2469
|
-
shadowColor: 'rgba(227, 54, 0, 0.3)'
|
|
2470
|
-
};
|
|
2471
|
-
const measureSymbolParams = {
|
|
2472
|
-
strokeColor: '#ff6933',
|
|
2473
|
-
shadowSize: 0,
|
|
2474
|
-
vertexShadowSize: 0
|
|
2475
|
-
};
|
|
2476
|
-
const measureLengthSymbol = /*#__PURE__*/new ShadowedPolySymbol( /*#__PURE__*/_extends({}, polySymbolParams, measureSymbolParams, {
|
|
2477
|
-
enclose: false,
|
|
2478
|
-
showVertex: true
|
|
2479
|
-
}));
|
|
2480
|
-
const measureAreaSymbol = /*#__PURE__*/new ShadowedPolySymbol( /*#__PURE__*/_extends({}, polySymbolParams, measureSymbolParams, {
|
|
2481
|
-
fillColor: 'rgba(255, 105, 51, 0.25)',
|
|
2482
|
-
enclose: true,
|
|
2483
|
-
showVertex: true
|
|
2484
|
-
}));
|
|
2485
|
-
const snapSymbolParams = {
|
|
2486
|
-
size: 10,
|
|
2487
|
-
strokeWidth: 2,
|
|
2488
|
-
strokeColor: '#e33600',
|
|
2489
|
-
fillColor: '#ffffff',
|
|
2490
|
-
shadowColor: 'rgba(227, 54, 0, 0.3)',
|
|
2491
|
-
shadowSize: 3
|
|
2492
|
-
};
|
|
2493
|
-
const measurePolygonSnapSymbol = /*#__PURE__*/new ShadowedPointSymbol( /*#__PURE__*/_extends({}, snapSymbolParams, {
|
|
2494
|
-
strokeColor: '#ff6933',
|
|
2495
|
-
shadowSize: 0
|
|
2496
|
-
}));
|
|
2497
|
-
|
|
2498
|
-
let SelectedPointSymbol = /*#__PURE__*/function (_ShadowedPointSymbol) {
|
|
2499
|
-
_inherits(SelectedPointSymbol, _ShadowedPointSymbol);
|
|
2500
|
-
|
|
2501
|
-
var _super = /*#__PURE__*/_createSuper(SelectedPointSymbol);
|
|
2502
|
-
|
|
2503
|
-
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
2504
|
-
function SelectedPointSymbol(props) {
|
|
2505
|
-
_classCallCheck(this, SelectedPointSymbol);
|
|
2506
|
-
|
|
2507
|
-
return _super.call(this, props);
|
|
2508
|
-
}
|
|
2509
|
-
|
|
2510
|
-
_createClass(SelectedPointSymbol, [{
|
|
2511
|
-
key: "getShadow",
|
|
2512
|
-
value: function getShadow(position, feature) {
|
|
2513
|
-
if (feature.isSelected) {
|
|
2514
|
-
return _get(_getPrototypeOf(SelectedPointSymbol.prototype), "getShadow", this).call(this, position, feature);
|
|
2515
|
-
}
|
|
2516
|
-
}
|
|
2517
|
-
}, {
|
|
2518
|
-
key: "getPoint",
|
|
2519
|
-
value: function getPoint(position, feature) {
|
|
2520
|
-
const pointRender = _get(_getPrototypeOf(SelectedPointSymbol.prototype), "getPoint", this).call(this, position, feature);
|
|
2521
|
-
|
|
2522
|
-
if (feature.isSelected) {
|
|
2523
|
-
pointRender.strokeColor = this.selectedStrokeColor;
|
|
2524
|
-
pointRender.fillColor = this.selectedFillColor;
|
|
2525
|
-
}
|
|
2526
|
-
|
|
2527
|
-
return pointRender;
|
|
2528
|
-
}
|
|
2529
|
-
}]);
|
|
2530
|
-
|
|
2531
|
-
return SelectedPointSymbol;
|
|
2532
|
-
}(ShadowedPointSymbol);
|
|
2533
|
-
|
|
2534
|
-
let SelectedPolySymbol = /*#__PURE__*/function (_ShadowedPolySymbol) {
|
|
2535
|
-
_inherits(SelectedPolySymbol, _ShadowedPolySymbol);
|
|
2536
|
-
|
|
2537
|
-
var _super = /*#__PURE__*/_createSuper(SelectedPolySymbol);
|
|
2538
|
-
|
|
2539
|
-
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
2540
|
-
function SelectedPolySymbol(props) {
|
|
2541
|
-
_classCallCheck(this, SelectedPolySymbol);
|
|
2542
|
-
|
|
2543
|
-
return _super.call(this, props);
|
|
2544
|
-
}
|
|
2545
|
-
|
|
2546
|
-
_createClass(SelectedPolySymbol, [{
|
|
2547
|
-
key: "getShadow",
|
|
2548
|
-
value: function getShadow(coordinates, feature) {
|
|
2549
|
-
if (feature.isSelected) {
|
|
2550
|
-
return _get(_getPrototypeOf(SelectedPolySymbol.prototype), "getShadow", this).call(this, coordinates, feature);
|
|
2551
|
-
}
|
|
2552
|
-
}
|
|
2553
|
-
}, {
|
|
2554
|
-
key: "getPolyRender",
|
|
2555
|
-
value: function getPolyRender(coordinates, feature) {
|
|
2556
|
-
const polyRender = _get(_getPrototypeOf(SelectedPolySymbol.prototype), "getPolyRender", this).call(this, coordinates, feature);
|
|
2557
|
-
|
|
2558
|
-
if (feature.isSelected) {
|
|
2559
|
-
polyRender.fillColor = this.selectedFillColor;
|
|
2560
|
-
polyRender.strokeColor = this.selectedStrokeColor;
|
|
2561
|
-
|
|
2562
|
-
if (this.selectedStrokeWidth !== void 0) {
|
|
2563
|
-
polyRender.strokeWidth = this.selectedStrokeWidth;
|
|
2564
|
-
}
|
|
2565
|
-
}
|
|
2566
|
-
|
|
2567
|
-
return polyRender;
|
|
2568
|
-
}
|
|
2569
|
-
}]);
|
|
2570
|
-
|
|
2571
|
-
return SelectedPolySymbol;
|
|
2572
|
-
}(ShadowedPolySymbol);
|
|
2573
|
-
|
|
2574
|
-
const selectedPoint = /*#__PURE__*/new SelectedPointSymbol({
|
|
2575
|
-
size: 8,
|
|
2576
|
-
strokeWidth: 2,
|
|
2577
|
-
strokeColor: 'rgba(255, 87, 34, 0.3)',
|
|
2578
|
-
fillColor: 'rgba(255, 255, 255, 0.65)',
|
|
2579
|
-
shadowColor: 'rgba(255, 87, 34, 0.3)',
|
|
2580
|
-
shadowSize: 3,
|
|
2581
|
-
selectedStrokeColor: '#ff5722',
|
|
2582
|
-
selectedFillColor: 'rgba(255, 255, 255, 0.65)'
|
|
2583
|
-
});
|
|
2584
|
-
const selectedPolyline = /*#__PURE__*/new SelectedPolySymbol({
|
|
2585
|
-
strokeWidth: 6,
|
|
2586
|
-
strokeColor: 'rgba(255, 87, 34, 0.2)',
|
|
2587
|
-
shadowSize: 8,
|
|
2588
|
-
shadowColor: 'rgba(255, 87, 34, 0.3)',
|
|
2589
|
-
selectedStrokeColor: '#ff5722',
|
|
2590
|
-
selectedStrokeWidth: 2
|
|
2591
|
-
});
|
|
2592
|
-
const selectedPolygon = /*#__PURE__*/new SelectedPolySymbol({
|
|
2593
|
-
strokeWidth: 2,
|
|
2594
|
-
strokeColor: 'rgba(255, 87, 34, 0.3)',
|
|
2595
|
-
shadowSize: 8,
|
|
2596
|
-
shadowColor: 'rgba(255, 87, 34, 0.3)',
|
|
2597
|
-
fillColor: 'rgba(255, 255, 255, 0.36)',
|
|
2598
|
-
enclose: true,
|
|
2599
|
-
selectedFillColor: 'rgba(255, 255, 255, 0.56)',
|
|
2600
|
-
selectedStrokeColor: '#ff5722'
|
|
2601
|
-
});
|
|
2602
|
-
|
|
2603
|
-
const defaultPathStyles = {
|
|
2604
|
-
strokeWidth: 2,
|
|
2605
|
-
strokeColor: 'rgb(0, 163, 245)',
|
|
2606
|
-
fillStyle: FillStyle.None
|
|
2607
|
-
};
|
|
2608
|
-
let SVGPoly = /*#__PURE__*/function (_Symbol) {
|
|
2609
|
-
_inherits(SVGPoly, _Symbol);
|
|
2610
|
-
|
|
2611
|
-
var _super = /*#__PURE__*/_createSuper(SVGPoly);
|
|
2612
|
-
|
|
2613
|
-
function SVGPoly(_temp) {
|
|
2614
|
-
var _this;
|
|
2615
|
-
|
|
2616
|
-
let {
|
|
2617
|
-
redrawFeatureNode,
|
|
2618
|
-
pathStyles,
|
|
2619
|
-
circle,
|
|
2620
|
-
className,
|
|
2621
|
-
appendToSvg
|
|
2622
|
-
} = _temp === void 0 ? {} : _temp;
|
|
2623
|
-
|
|
2624
|
-
_classCallCheck(this, SVGPoly);
|
|
2625
|
-
|
|
2626
|
-
_this = _super.call(this);
|
|
2627
|
-
_this.container = document.createElement('div');
|
|
2628
|
-
_this.container.style.position = 'absolute';
|
|
2629
|
-
_this.redrawFeatureNode = redrawFeatureNode;
|
|
2630
|
-
_this.pathStyles = _extends({
|
|
2631
|
-
center: [0, 0],
|
|
2632
|
-
fillColor: 'none'
|
|
2633
|
-
}, pathStyles);
|
|
2634
|
-
_this.circle = circle;
|
|
2635
|
-
_this.className = className;
|
|
2636
|
-
_this.appendToSvg = appendToSvg;
|
|
2637
|
-
return _this;
|
|
2638
|
-
}
|
|
2639
|
-
|
|
2640
|
-
_createClass(SVGPoly, [{
|
|
2641
|
-
key: "renderFunction",
|
|
2642
|
-
value: function renderFunction(feature, resolution, crs) {
|
|
2643
|
-
const coordinates = feature instanceof Poly ? new PolylineSymbol().getRenderedCoordinates(feature, resolution, crs) : feature.centroid;
|
|
2644
|
-
this.setCirclePxRaius(crs);
|
|
2645
|
-
this.container.innerHTML = '';
|
|
2646
|
-
const svg = this.setSvg(coordinates);
|
|
2647
|
-
svg && this.container.append(svg);
|
|
2648
|
-
feature.__dynamicSymbolRender = new DynamicRender({
|
|
2649
|
-
node: this.container,
|
|
2650
|
-
update: (bbox, resolution) => this.update({
|
|
2651
|
-
bbox,
|
|
2652
|
-
resolution,
|
|
2653
|
-
feature,
|
|
2654
|
-
crs
|
|
2655
|
-
}),
|
|
2656
|
-
redraw: () => {
|
|
2657
|
-
this.redrawFeatureNode && this.redrawFeatureNode(feature);
|
|
2658
|
-
}
|
|
2659
|
-
});
|
|
2660
|
-
|
|
2661
|
-
this._setEventListeners(feature);
|
|
2662
|
-
|
|
2663
|
-
return [feature.__dynamicSymbolRender];
|
|
2664
|
-
}
|
|
2665
|
-
}, {
|
|
2666
|
-
key: "setCirclePxRaius",
|
|
2667
|
-
value: function setCirclePxRaius(crs) {
|
|
2668
|
-
if (this.circle && this.pathStyles) {
|
|
2669
|
-
var _this$circle;
|
|
2670
|
-
|
|
2671
|
-
this.pathStyles.radius = metersToPixels(this.circle.radius, {
|
|
2672
|
-
painter: this.circle.painter,
|
|
2673
|
-
crs
|
|
2674
|
-
}) + (((_this$circle = this.circle) == null ? void 0 : _this$circle.pxOffset) || 0);
|
|
2675
|
-
}
|
|
2676
|
-
}
|
|
2677
|
-
}, {
|
|
2678
|
-
key: "update",
|
|
2679
|
-
value: function update(_ref) {
|
|
2680
|
-
var _this$pathStyles, _this$pathStyles2, _this$pathStyles3, _this$pathStyles4;
|
|
2681
|
-
|
|
2682
|
-
let {
|
|
2683
|
-
bbox,
|
|
2684
|
-
resolution,
|
|
2685
|
-
feature,
|
|
2686
|
-
crs
|
|
2687
|
-
} = _ref;
|
|
2688
|
-
if (!feature) return;
|
|
2689
|
-
if (!bbox) bbox = feature.__lastBbox;
|
|
2690
|
-
if (!resolution) resolution = feature.__lastResolution;
|
|
2691
|
-
if (!bbox || !resolution || !feature.crs.canProjectTo(bbox.crs)) return;
|
|
2692
|
-
|
|
2693
|
-
if (feature.__lastResolution && resolution !== feature.__lastResolution) {
|
|
2694
|
-
const newCoordinates = feature instanceof Poly ? new PolylineSymbol().getRenderedCoordinates(feature, resolution, crs) : feature.centroid;
|
|
2695
|
-
this.setCirclePxRaius(crs);
|
|
2696
|
-
this.container.innerHTML = '';
|
|
2697
|
-
const svg = this.setSvg(newCoordinates);
|
|
2698
|
-
svg && this.container.append(svg);
|
|
2699
|
-
}
|
|
2700
|
-
|
|
2701
|
-
const polygon = feature.projectTo(bbox.crs);
|
|
2702
|
-
const radiusOffset = (_this$pathStyles = this.pathStyles) != null && _this$pathStyles.radius ? ((_this$pathStyles2 = this.pathStyles) == null ? void 0 : _this$pathStyles2.radius) + ((_this$pathStyles3 = this.pathStyles) != null && _this$pathStyles3.strokeWidth ? ((_this$pathStyles4 = this.pathStyles) == null ? void 0 : _this$pathStyles4.strokeWidth) / 2 : 0) : 0;
|
|
2703
|
-
const dx = Math.round((polygon.bbox.xMin - bbox.xMin) / resolution) - radiusOffset;
|
|
2704
|
-
const dy = Math.round((bbox.yMax - polygon.bbox.yMax) / resolution) - radiusOffset;
|
|
2705
|
-
this.container.style.left = dx.toString() + "px";
|
|
2706
|
-
this.container.style.top = dy.toString() + "px";
|
|
2707
|
-
feature.__lastBbox = bbox;
|
|
2708
|
-
feature.__lastResolution = resolution;
|
|
2332
|
+
if (!feature) return;
|
|
2333
|
+
if (!bbox) bbox = feature.__lastBbox;
|
|
2334
|
+
if (!resolution) resolution = feature.__lastResolution;
|
|
2335
|
+
if (!bbox || !resolution || !feature.crs.canProjectTo(bbox.crs)) return;
|
|
2336
|
+
|
|
2337
|
+
if (feature.__lastResolution && resolution !== feature.__lastResolution) {
|
|
2338
|
+
const newCoordinates = feature instanceof Poly ? new PolylineSymbol().getRenderedCoordinates(feature, resolution, crs) : feature.centroid;
|
|
2339
|
+
this.setCirclePxRaius(crs);
|
|
2340
|
+
this.container.innerHTML = '';
|
|
2341
|
+
const svg = this.setSvg(newCoordinates);
|
|
2342
|
+
svg && this.container.append(svg);
|
|
2343
|
+
}
|
|
2344
|
+
|
|
2345
|
+
const polygon = feature.projectTo(bbox.crs);
|
|
2346
|
+
const radiusOffset = (_this$pathStyles = this.pathStyles) != null && _this$pathStyles.radius ? ((_this$pathStyles2 = this.pathStyles) == null ? void 0 : _this$pathStyles2.radius) + ((_this$pathStyles3 = this.pathStyles) != null && _this$pathStyles3.strokeWidth ? ((_this$pathStyles4 = this.pathStyles) == null ? void 0 : _this$pathStyles4.strokeWidth) / 2 : 0) : 0;
|
|
2347
|
+
const dx = Math.round((polygon.bbox.xMin - bbox.xMin) / resolution) - radiusOffset;
|
|
2348
|
+
const dy = Math.round((bbox.yMax - polygon.bbox.yMax) / resolution) - radiusOffset;
|
|
2349
|
+
this.container.style.left = dx.toString() + "px";
|
|
2350
|
+
this.container.style.top = dy.toString() + "px";
|
|
2351
|
+
feature.__lastBbox = bbox;
|
|
2352
|
+
feature.__lastResolution = resolution;
|
|
2709
2353
|
}
|
|
2710
2354
|
}, {
|
|
2711
2355
|
key: "setSvg",
|
|
@@ -3174,7 +2818,7 @@ function evaluateCondition(condition, attributes) {
|
|
|
3174
2818
|
}
|
|
3175
2819
|
|
|
3176
2820
|
function getAttributeValue(attributes, attributeName) {
|
|
3177
|
-
const attributeMeta = attributes.find(_ref => {
|
|
2821
|
+
const attributeMeta = attributes.find((_ref) => {
|
|
3178
2822
|
let {
|
|
3179
2823
|
name
|
|
3180
2824
|
} = _ref;
|
|
@@ -3188,7 +2832,7 @@ const getAttributeNameFromClassified = values => values.length > 0 ? getAttribut
|
|
|
3188
2832
|
|
|
3189
2833
|
function findFeatureValue(parameterValues, _ref2) {
|
|
3190
2834
|
let [name, value] = _ref2;
|
|
3191
|
-
return value !== null ? parameterValues.find(_ref3 => {
|
|
2835
|
+
return value !== null ? parameterValues.find((_ref3) => {
|
|
3192
2836
|
let {
|
|
3193
2837
|
condition
|
|
3194
2838
|
} = _ref3;
|
|
@@ -3228,7 +2872,7 @@ function evaluateFeatureSymbol(attributes) {
|
|
|
3228
2872
|
}
|
|
3229
2873
|
|
|
3230
2874
|
function findChildFeatureStyle(childStyles, attributes) {
|
|
3231
|
-
return (childStyles || []).find(_ref5 => {
|
|
2875
|
+
return (childStyles || []).find((_ref5) => {
|
|
3232
2876
|
let {
|
|
3233
2877
|
condition
|
|
3234
2878
|
} = _ref5;
|
|
@@ -3289,7 +2933,7 @@ let EvergisLayer = /*#__PURE__*/function () {
|
|
|
3289
2933
|
feature.attributes = mergeAttributes(feature.attributes || [], this.attributes || []);
|
|
3290
2934
|
feature.symbol = this.style && getFeatureSymbol(this.style, feature.attributes);
|
|
3291
2935
|
feature.layerAlias = this.alias;
|
|
3292
|
-
const titleAttribute = (feature.attributes || []).find(_ref => {
|
|
2936
|
+
const titleAttribute = (feature.attributes || []).find((_ref) => {
|
|
3293
2937
|
let {
|
|
3294
2938
|
name
|
|
3295
2939
|
} = _ref;
|
|
@@ -3312,7 +2956,7 @@ const evaluateFeature = layers => feature => {
|
|
|
3312
2956
|
};
|
|
3313
2957
|
|
|
3314
2958
|
const OTHERS_TITLE = 'Другое';
|
|
3315
|
-
const createLegendItem = _ref => {
|
|
2959
|
+
const createLegendItem = (_ref) => {
|
|
3316
2960
|
let {
|
|
3317
2961
|
attributes,
|
|
3318
2962
|
renderTitle,
|
|
@@ -3358,7 +3002,7 @@ function createStyleLegend(style, config) {
|
|
|
3358
3002
|
classificationManager,
|
|
3359
3003
|
symbol
|
|
3360
3004
|
} = style;
|
|
3361
|
-
const items = classificationManager.filter(_ref => {
|
|
3005
|
+
const items = classificationManager.filter((_ref) => {
|
|
3362
3006
|
let {
|
|
3363
3007
|
parameter
|
|
3364
3008
|
} = _ref;
|
|
@@ -3474,7 +3118,7 @@ const useMapLegend = (layer, config) => {
|
|
|
3474
3118
|
};
|
|
3475
3119
|
|
|
3476
3120
|
const LEGEND_SYMBOL_MAX_SIZE = 32;
|
|
3477
|
-
const useLegendValueSymbol = _ref => {
|
|
3121
|
+
const useLegendValueSymbol = (_ref) => {
|
|
3478
3122
|
let {
|
|
3479
3123
|
parameter,
|
|
3480
3124
|
parameterValue
|
|
@@ -3721,11 +3365,10 @@ function useFeatureLayer(_ref) {
|
|
|
3721
3365
|
}),
|
|
3722
3366
|
destructor: layer => map.indexOf(layer) !== -1 && map.removeLayer(layer),
|
|
3723
3367
|
update: (layer, _ref2) => {
|
|
3724
|
-
let [features
|
|
3368
|
+
let [features] = _ref2;
|
|
3725
3369
|
layer.features = features;
|
|
3726
|
-
layer.opacity = opacity != null ? opacity : 1;
|
|
3727
3370
|
}
|
|
3728
|
-
}, [features
|
|
3371
|
+
}, [features]);
|
|
3729
3372
|
useLayerOrder(layer, zIndex);
|
|
3730
3373
|
useLayerVisibility(layer, isDisplayed);
|
|
3731
3374
|
useLayerOpacity(layer, opacity);
|
|
@@ -3882,7 +3525,7 @@ function useMapWrapper() {
|
|
|
3882
3525
|
return wrapperRef;
|
|
3883
3526
|
}
|
|
3884
3527
|
|
|
3885
|
-
const byScale = scale => _ref => {
|
|
3528
|
+
const byScale = scale => (_ref) => {
|
|
3886
3529
|
let {
|
|
3887
3530
|
zIndex
|
|
3888
3531
|
} = _ref;
|
|
@@ -4081,7 +3724,7 @@ const useTooltip = function useTooltip(zIndex) {
|
|
|
4081
3724
|
|
|
4082
3725
|
return reset;
|
|
4083
3726
|
}, [reset, map, layer, zIndex]);
|
|
4084
|
-
const onSetLabelFeature = useCallback(_ref => {
|
|
3727
|
+
const onSetLabelFeature = useCallback((_ref) => {
|
|
4085
3728
|
let {
|
|
4086
3729
|
point,
|
|
4087
3730
|
position,
|
|
@@ -4245,7 +3888,7 @@ function useClusterLayer(_ref) {
|
|
|
4245
3888
|
}
|
|
4246
3889
|
|
|
4247
3890
|
const INIT_FEATURES = [];
|
|
4248
|
-
const useEvergisSelect = _ref => {
|
|
3891
|
+
const useEvergisSelect = (_ref) => {
|
|
4249
3892
|
let {
|
|
4250
3893
|
onPick,
|
|
4251
3894
|
onFeatures
|
|
@@ -4278,7 +3921,7 @@ function none() {
|
|
|
4278
3921
|
return;
|
|
4279
3922
|
}
|
|
4280
3923
|
|
|
4281
|
-
const useDraggableMarker = _ref => {
|
|
3924
|
+
const useDraggableMarker = (_ref) => {
|
|
4282
3925
|
let {
|
|
4283
3926
|
position,
|
|
4284
3927
|
onChange,
|
|
@@ -4400,7 +4043,7 @@ const useToggle = initial => {
|
|
|
4400
4043
|
return [state, toggle, setState];
|
|
4401
4044
|
};
|
|
4402
4045
|
|
|
4403
|
-
const Symbol = _ref => {
|
|
4046
|
+
const Symbol = (_ref) => {
|
|
4404
4047
|
let {
|
|
4405
4048
|
symbol,
|
|
4406
4049
|
size,
|
|
@@ -4421,19 +4064,19 @@ const Symbol = _ref => {
|
|
|
4421
4064
|
};
|
|
4422
4065
|
|
|
4423
4066
|
var _templateObject, _templateObject2;
|
|
4424
|
-
const CompoundIcon = /*#__PURE__*/styled.div(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n background: ", ";\n height: 32px;\n width: 32px;\n"])), _ref => {
|
|
4067
|
+
const CompoundIcon = /*#__PURE__*/styled.div(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n background: ", ";\n height: 32px;\n width: 32px;\n"])), (_ref) => {
|
|
4425
4068
|
let {
|
|
4426
4069
|
geometryType,
|
|
4427
4070
|
icons
|
|
4428
4071
|
} = _ref;
|
|
4429
4072
|
return "url(" + icons[geometryType] + ") center center / " + (geometryType === GeometryType.Polyline ? '2rem 1.3rem' : 'auto 1rem') + " no-repeat";
|
|
4430
4073
|
});
|
|
4431
|
-
const ClusterSymbol = /*#__PURE__*/styled.div(_templateObject2 || (_templateObject2 = /*#__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 => {
|
|
4074
|
+
const ClusterSymbol = /*#__PURE__*/styled.div(_templateObject2 || (_templateObject2 = /*#__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) => {
|
|
4432
4075
|
let {
|
|
4433
4076
|
color
|
|
4434
4077
|
} = _ref2;
|
|
4435
4078
|
return color;
|
|
4436
|
-
}, _ref3 => {
|
|
4079
|
+
}, (_ref3) => {
|
|
4437
4080
|
let {
|
|
4438
4081
|
color
|
|
4439
4082
|
} = _ref3;
|
|
@@ -4441,7 +4084,7 @@ const ClusterSymbol = /*#__PURE__*/styled.div(_templateObject2 || (_templateObje
|
|
|
4441
4084
|
});
|
|
4442
4085
|
|
|
4443
4086
|
const MAX_SIZE = 32;
|
|
4444
|
-
const StyleSymbol = _ref => {
|
|
4087
|
+
const StyleSymbol = (_ref) => {
|
|
4445
4088
|
let {
|
|
4446
4089
|
symbol,
|
|
4447
4090
|
size = MAX_SIZE,
|
|
@@ -4498,7 +4141,7 @@ const AttributeValueContainer = /*#__PURE__*/styled.div(_templateObject14 || (_t
|
|
|
4498
4141
|
const SimpleAttribute = /*#__PURE__*/styled.div(_templateObject15 || (_templateObject15 = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
4499
4142
|
const ValueLink = /*#__PURE__*/styled.a(_templateObject16 || (_templateObject16 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n padding: 0 0.25rem;\n color: #1fb3aa;\n text-decoration: none;\n"])));
|
|
4500
4143
|
|
|
4501
|
-
const MailValue = _ref => {
|
|
4144
|
+
const MailValue = (_ref) => {
|
|
4502
4145
|
let {
|
|
4503
4146
|
mail
|
|
4504
4147
|
} = _ref;
|
|
@@ -4509,7 +4152,7 @@ const MailValue = _ref => {
|
|
|
4509
4152
|
}, mail);
|
|
4510
4153
|
};
|
|
4511
4154
|
|
|
4512
|
-
const PhoneValue = _ref => {
|
|
4155
|
+
const PhoneValue = (_ref) => {
|
|
4513
4156
|
let {
|
|
4514
4157
|
phone
|
|
4515
4158
|
} = _ref;
|
|
@@ -4520,7 +4163,7 @@ const PhoneValue = _ref => {
|
|
|
4520
4163
|
}, phone);
|
|
4521
4164
|
};
|
|
4522
4165
|
|
|
4523
|
-
const UrlValue = _ref => {
|
|
4166
|
+
const UrlValue = (_ref) => {
|
|
4524
4167
|
let {
|
|
4525
4168
|
url
|
|
4526
4169
|
} = _ref;
|
|
@@ -4531,7 +4174,7 @@ const UrlValue = _ref => {
|
|
|
4531
4174
|
}, url);
|
|
4532
4175
|
};
|
|
4533
4176
|
|
|
4534
|
-
const AttributeValue = _ref => {
|
|
4177
|
+
const AttributeValue = (_ref) => {
|
|
4535
4178
|
let {
|
|
4536
4179
|
attribute
|
|
4537
4180
|
} = _ref;
|
|
@@ -4545,29 +4188,29 @@ const AttributeValue = _ref => {
|
|
|
4545
4188
|
if (attributeValue.type === 2
|
|
4546
4189
|
/* Url */
|
|
4547
4190
|
) {
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4191
|
+
return React.createElement(UrlValue, {
|
|
4192
|
+
key: key,
|
|
4193
|
+
url: punycodeDecode(value)
|
|
4194
|
+
});
|
|
4195
|
+
}
|
|
4553
4196
|
|
|
4554
4197
|
if (attributeValue.type === 3
|
|
4555
4198
|
/* Mail */
|
|
4556
4199
|
) {
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4200
|
+
return React.createElement(MailValue, {
|
|
4201
|
+
key: key,
|
|
4202
|
+
mail: value
|
|
4203
|
+
});
|
|
4204
|
+
}
|
|
4562
4205
|
|
|
4563
4206
|
if (attributeValue.type === 1
|
|
4564
4207
|
/* Phone */
|
|
4565
4208
|
) {
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4209
|
+
return React.createElement(PhoneValue, {
|
|
4210
|
+
key: key,
|
|
4211
|
+
phone: value
|
|
4212
|
+
});
|
|
4213
|
+
}
|
|
4571
4214
|
|
|
4572
4215
|
return React.createElement(SimpleAttribute, {
|
|
4573
4216
|
key: value
|
|
@@ -4583,7 +4226,7 @@ function punycodeDecode(domains) {
|
|
|
4583
4226
|
}
|
|
4584
4227
|
}
|
|
4585
4228
|
|
|
4586
|
-
const EvergisCardAttribute = _ref => {
|
|
4229
|
+
const EvergisCardAttribute = (_ref) => {
|
|
4587
4230
|
let {
|
|
4588
4231
|
attribute,
|
|
4589
4232
|
className
|
|
@@ -4595,7 +4238,7 @@ const EvergisCardAttribute = _ref => {
|
|
|
4595
4238
|
}));
|
|
4596
4239
|
};
|
|
4597
4240
|
|
|
4598
|
-
const StyledCard = _ref => {
|
|
4241
|
+
const StyledCard = (_ref) => {
|
|
4599
4242
|
let {
|
|
4600
4243
|
features = [],
|
|
4601
4244
|
className,
|
|
@@ -4641,7 +4284,7 @@ const StyledCard = _ref => {
|
|
|
4641
4284
|
};
|
|
4642
4285
|
|
|
4643
4286
|
const _excluded$1 = ["renderCard", "className", "children"];
|
|
4644
|
-
const EvergisCard = _ref => {
|
|
4287
|
+
const EvergisCard = (_ref) => {
|
|
4645
4288
|
let {
|
|
4646
4289
|
renderCard,
|
|
4647
4290
|
className,
|
|
@@ -4693,7 +4336,7 @@ const toSgis = feature => feature.sGisFeature(); // TODO inner hooks???
|
|
|
4693
4336
|
|
|
4694
4337
|
const useSGisFeatures = (features, currentIndex) => useMemo(() => features.map(toSgis).filter(truthly).map(setSelected(currentIndex)), [features, currentIndex]);
|
|
4695
4338
|
|
|
4696
|
-
const EvergisSelectLayer = _ref => {
|
|
4339
|
+
const EvergisSelectLayer = (_ref) => {
|
|
4697
4340
|
let {
|
|
4698
4341
|
features,
|
|
4699
4342
|
zIndex,
|
|
@@ -4738,7 +4381,7 @@ const TileLayer = props => {
|
|
|
4738
4381
|
};
|
|
4739
4382
|
|
|
4740
4383
|
const defaultZIndex = 200;
|
|
4741
|
-
const EvergisSelect = _ref => {
|
|
4384
|
+
const EvergisSelect = (_ref) => {
|
|
4742
4385
|
let {
|
|
4743
4386
|
onPick,
|
|
4744
4387
|
className,
|
|
@@ -4773,7 +4416,7 @@ const LegendSymbolTitle = /*#__PURE__*/styled.p(_templateObject3$1 || (_template
|
|
|
4773
4416
|
const LegendValueContainer = /*#__PURE__*/styled.div(_templateObject4$1 || (_templateObject4$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n font-size: 0.75rem;\n\n ", " {\n padding-left: 0.5rem;\n }\n"])), LegendSymbolTitle);
|
|
4774
4417
|
const LegendSectionHeader = /*#__PURE__*/styled.div(_templateObject5$1 || (_templateObject5$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 0.75rem;\n font-weight: 600;\n line-height: 1rem;\n"])));
|
|
4775
4418
|
|
|
4776
|
-
const LegendSection = _ref => {
|
|
4419
|
+
const LegendSection = (_ref) => {
|
|
4777
4420
|
let {
|
|
4778
4421
|
item,
|
|
4779
4422
|
renderLegendTitle,
|
|
@@ -4787,7 +4430,7 @@ var _templateObject$3, _templateObject2$3;
|
|
|
4787
4430
|
const InputContainer = /*#__PURE__*/styled.div(_templateObject$3 || (_templateObject$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n border-radius: 0.125rem;\n box-sizing: border-box;\n border: 0.0625rem solid rgba(48, 69, 79, 0.12);\n margin-bottom: 0.5rem;\n \n i {\n color: rgba(48, 69, 79, 0.54);\n padding: 0.25rem;\n\n &:hover {\n cursor: pointer;\n color: rgba(48, 69, 79, 0.87);\n }\n }\n"])));
|
|
4788
4431
|
const InputField = /*#__PURE__*/styled.input(_templateObject2$3 || (_templateObject2$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 100%;\n border: none;\n outline: none;\n font-size: 1rem;\n line-height: 1.1875rem;\n padding: 0 0.5rem;\n background-color: transparent;\n color: rgba(48, 69, 79, 0.87);\n"])));
|
|
4789
4432
|
|
|
4790
|
-
const SearchInput = _ref => {
|
|
4433
|
+
const SearchInput = (_ref) => {
|
|
4791
4434
|
let {
|
|
4792
4435
|
onChange
|
|
4793
4436
|
} = _ref;
|
|
@@ -4796,7 +4439,7 @@ const SearchInput = _ref => {
|
|
|
4796
4439
|
}));
|
|
4797
4440
|
};
|
|
4798
4441
|
|
|
4799
|
-
const LegendSymbol = _ref => {
|
|
4442
|
+
const LegendSymbol = (_ref) => {
|
|
4800
4443
|
let {
|
|
4801
4444
|
parameter,
|
|
4802
4445
|
parameterValue,
|
|
@@ -4814,7 +4457,7 @@ const LegendSymbol = _ref => {
|
|
|
4814
4457
|
return React.createElement(React.Fragment, null, children(symbol));
|
|
4815
4458
|
};
|
|
4816
4459
|
|
|
4817
|
-
const LegendValue = _ref => {
|
|
4460
|
+
const LegendValue = (_ref) => {
|
|
4818
4461
|
let {
|
|
4819
4462
|
value,
|
|
4820
4463
|
parameter,
|
|
@@ -4836,7 +4479,7 @@ const getNumberParam = (parameterValue, param) => {
|
|
|
4836
4479
|
return typeof parameterValue === 'object' && param in parameterValue && typeof parameterValue[param] === 'number' ? parameterValue[param] : null;
|
|
4837
4480
|
};
|
|
4838
4481
|
|
|
4839
|
-
const getSymbolSize = _ref => {
|
|
4482
|
+
const getSymbolSize = (_ref) => {
|
|
4840
4483
|
let {
|
|
4841
4484
|
parameterValue,
|
|
4842
4485
|
maxSize
|
|
@@ -4861,7 +4504,7 @@ const getSymbolSize = _ref => {
|
|
|
4861
4504
|
}
|
|
4862
4505
|
};
|
|
4863
4506
|
|
|
4864
|
-
const Legend = _ref => {
|
|
4507
|
+
const Legend = (_ref) => {
|
|
4865
4508
|
let {
|
|
4866
4509
|
layer,
|
|
4867
4510
|
children,
|
|
@@ -4889,13 +4532,13 @@ const Legend = _ref => {
|
|
|
4889
4532
|
className: className
|
|
4890
4533
|
}, searchable && searchLayer && React.createElement(SearchInput, {
|
|
4891
4534
|
onChange: searchLayer
|
|
4892
|
-
}), renderCustomLegend && layer ? renderCustomLegend(layer) : children ? legend && children(legend) : legend && legend.items.map(legendItem => React.createElement(LegendSection, {
|
|
4535
|
+
}), renderCustomLegend && layer ? renderCustomLegend(layer) : children ? legend && children(legend) : legend && legend.items.map((legendItem, index) => React.createElement(LegendSection, {
|
|
4893
4536
|
key: legendItem.attribute + "-" + legendItem.parameter,
|
|
4894
4537
|
item: legendItem,
|
|
4895
4538
|
hideTitle: (layer == null ? void 0 : layer.alias) === legendItem.title,
|
|
4896
4539
|
renderLegendTitle: config && config.renderLegendTitle
|
|
4897
4540
|
}, legendValue => React.createElement(LegendValue, {
|
|
4898
|
-
key: legendValue.title,
|
|
4541
|
+
key: legendValue.title + "-" + index,
|
|
4899
4542
|
value: legendValue,
|
|
4900
4543
|
parameter: legendItem.parameter,
|
|
4901
4544
|
maxSize: getSymbolSize({
|
|
@@ -4905,275 +4548,663 @@ const Legend = _ref => {
|
|
|
4905
4548
|
})))));
|
|
4906
4549
|
};
|
|
4907
4550
|
|
|
4908
|
-
const Map = _ref => {
|
|
4551
|
+
const Map = (_ref) => {
|
|
4552
|
+
let {
|
|
4553
|
+
className,
|
|
4554
|
+
position,
|
|
4555
|
+
resolution,
|
|
4556
|
+
minScale,
|
|
4557
|
+
maxScale,
|
|
4558
|
+
children,
|
|
4559
|
+
onBboxChange,
|
|
4560
|
+
style
|
|
4561
|
+
} = _ref;
|
|
4562
|
+
const wrapperRef = useMapWrapper();
|
|
4563
|
+
const {
|
|
4564
|
+
map
|
|
4565
|
+
} = useMapContext();
|
|
4566
|
+
const handleBboxChange = useCallback(state => {
|
|
4567
|
+
if (onBboxChange && shouldUpdateMapState(map, {
|
|
4568
|
+
position,
|
|
4569
|
+
resolution
|
|
4570
|
+
})) {
|
|
4571
|
+
onBboxChange(state);
|
|
4572
|
+
}
|
|
4573
|
+
}, [map, onBboxChange, position, resolution]);
|
|
4574
|
+
useUpdateMapView({
|
|
4575
|
+
position,
|
|
4576
|
+
resolution
|
|
4577
|
+
});
|
|
4578
|
+
useMaxMinScale(minScale, maxScale, position, resolution);
|
|
4579
|
+
useMapBboxChange(handleBboxChange);
|
|
4580
|
+
return React.createElement("div", {
|
|
4581
|
+
className: className,
|
|
4582
|
+
ref: wrapperRef,
|
|
4583
|
+
style: style
|
|
4584
|
+
}, children);
|
|
4585
|
+
};
|
|
4586
|
+
|
|
4587
|
+
var _templateObject$4, _templateObject2$4, _templateObject3$2, _templateObject4$2, _templateObject5$2;
|
|
4588
|
+
|
|
4589
|
+
const topLeft = distance => css(_templateObject$4 || (_templateObject$4 = _taggedTemplateLiteralLoose(["\n top: ", ";\n left: ", ";\n"])), distance, distance);
|
|
4590
|
+
|
|
4591
|
+
const topRight = distance => css(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteralLoose(["\n top: ", ";\n right: ", ";\n"])), distance, distance);
|
|
4592
|
+
|
|
4593
|
+
const bottomLeft = distance => css(_templateObject3$2 || (_templateObject3$2 = _taggedTemplateLiteralLoose(["\n bottom: ", ";\n left: ", ";\n"])), distance, distance);
|
|
4594
|
+
|
|
4595
|
+
const bottomRight = distance => css(_templateObject4$2 || (_templateObject4$2 = _taggedTemplateLiteralLoose(["\n bottom: ", ";\n right: ", ";\n"])), distance, distance);
|
|
4596
|
+
|
|
4597
|
+
const placementMixin = function placementMixin(placement, distance) {
|
|
4598
|
+
if (placement === void 0) {
|
|
4599
|
+
placement = 'bottom-left';
|
|
4600
|
+
}
|
|
4601
|
+
|
|
4602
|
+
if (distance === void 0) {
|
|
4603
|
+
distance = '1rem';
|
|
4604
|
+
}
|
|
4605
|
+
|
|
4606
|
+
return css(_templateObject5$2 || (_templateObject5$2 = _taggedTemplateLiteralLoose(["\n ", "\n ", "\n ", "\n ", "\n"])), placement === 'top-left' && topLeft(distance), placement === 'top-right' && topRight(distance), placement === 'bottom-left' && bottomLeft(distance), placement === 'bottom-right' && bottomRight(distance));
|
|
4607
|
+
};
|
|
4608
|
+
|
|
4609
|
+
var _templateObject$5, _templateObject2$5, _templateObject3$3, _templateObject4$3, _templateObject5$3, _templateObject6$1, _templateObject7$1, _templateObject8$1;
|
|
4610
|
+
const mapControlBtnMixin = /*#__PURE__*/css(_templateObject$5 || (_templateObject$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 2rem;\n height: 2rem;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n color: #fff;\n"])));
|
|
4611
|
+
const ZoomInBtn = /*#__PURE__*/styled(Icon)(_templateObject2$5 || (_templateObject2$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n ", "\n"])), mapControlBtnMixin); // ZoomInBtn.defaultProps = { kind: "plus" };
|
|
4612
|
+
|
|
4613
|
+
const ZoomOutBtn = /*#__PURE__*/styled(Icon)(_templateObject3$3 || (_templateObject3$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n ", "\n"])), mapControlBtnMixin); // ZoomOutBtn.defaultProps = { kind: "minus" };
|
|
4614
|
+
|
|
4615
|
+
const SearchBtn = /*#__PURE__*/styled(Icon)(_templateObject4$3 || (_templateObject4$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n ", "\n"])), mapControlBtnMixin); // SearchBtn.defaultProps = { kind: "search" };
|
|
4616
|
+
// TODO not exists in fonts
|
|
4617
|
+
|
|
4618
|
+
const FullscreenBtn = /*#__PURE__*/styled(Icon)(_templateObject5$3 || (_templateObject5$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n ", "\n"])), mapControlBtnMixin); // FullscreenBtn.defaultProps = { kind: "maximize" };
|
|
4619
|
+
|
|
4620
|
+
const MeasureBtn = /*#__PURE__*/styled(Icon)(_templateObject6$1 || (_templateObject6$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n ", "\n"])), mapControlBtnMixin); // MeasureBtn.defaultProps = { kind: "measure_length" };
|
|
4621
|
+
|
|
4622
|
+
const MapControl = /*#__PURE__*/styled.div(_templateObject7$1 || (_templateObject7$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border-radius: 0.15rem;\n background: rgba(28, 33, 48, 0.8);\n display: flex;\n align-items: center;\n justify-content: center;\n color: #fff;\n font-size: 1.5rem;\n cursor: pointer;\n height: auto;\n width: auto;\n padding: 0.25rem;\n"])));
|
|
4623
|
+
const MapControls = /*#__PURE__*/styled.div(_templateObject8$1 || (_templateObject8$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: absolute;\n display: flex;\n flex-direction: ", ";\n\n ", "\n\n ", " {\n margin-bottom: ", ";\n margin-right: ", ";\n flex-direction: ", ";\n }\n"])), (_ref) => {
|
|
4624
|
+
let {
|
|
4625
|
+
vertical
|
|
4626
|
+
} = _ref;
|
|
4627
|
+
return vertical ? 'column' : 'row';
|
|
4628
|
+
}, (_ref2) => {
|
|
4629
|
+
let {
|
|
4630
|
+
placement
|
|
4631
|
+
} = _ref2;
|
|
4632
|
+
return placementMixin(placement);
|
|
4633
|
+
}, MapControl, (_ref3) => {
|
|
4634
|
+
let {
|
|
4635
|
+
vertical
|
|
4636
|
+
} = _ref3;
|
|
4637
|
+
return vertical ? '0.5rem' : '0';
|
|
4638
|
+
}, (_ref4) => {
|
|
4639
|
+
let {
|
|
4640
|
+
vertical
|
|
4641
|
+
} = _ref4;
|
|
4642
|
+
return vertical ? '0' : '0.5rem';
|
|
4643
|
+
}, (_ref5) => {
|
|
4644
|
+
let {
|
|
4645
|
+
vertical
|
|
4646
|
+
} = _ref5;
|
|
4647
|
+
return vertical ? 'column' : 'row';
|
|
4648
|
+
});
|
|
4649
|
+
|
|
4650
|
+
const Measure = () => {
|
|
4651
|
+
return React.createElement(MapControl, null, React.createElement(MeasureBtn, {
|
|
4652
|
+
onClick: () => {}
|
|
4653
|
+
}));
|
|
4654
|
+
};
|
|
4655
|
+
|
|
4656
|
+
const Search = () => {
|
|
4657
|
+
return React.createElement(MapControl, null, React.createElement(SearchBtn, {
|
|
4658
|
+
onClick: () => {}
|
|
4659
|
+
}));
|
|
4660
|
+
};
|
|
4661
|
+
|
|
4662
|
+
const Fullscreen = () => {
|
|
4663
|
+
return React.createElement(MapControl, null, React.createElement(FullscreenBtn, {
|
|
4664
|
+
onClick: () => {}
|
|
4665
|
+
}));
|
|
4666
|
+
};
|
|
4667
|
+
|
|
4668
|
+
const isParameterType = (types, parameter) => {
|
|
4669
|
+
var _parameter$toLowerCas;
|
|
4670
|
+
|
|
4671
|
+
return (typeof types === "string" ? parameter == null ? void 0 : (_parameter$toLowerCas = parameter.toLowerCase()) == null ? void 0 : _parameter$toLowerCas.includes(types.toLowerCase()) : types.some(type => {
|
|
4672
|
+
var _parameter$toLowerCas2;
|
|
4673
|
+
|
|
4674
|
+
return parameter == null ? void 0 : (_parameter$toLowerCas2 = parameter.toLowerCase()) == null ? void 0 : _parameter$toLowerCas2.includes(type.toLowerCase());
|
|
4675
|
+
})) || false;
|
|
4676
|
+
};
|
|
4677
|
+
|
|
4678
|
+
var _templateObject$6, _templateObject2$6, _templateObject3$4, _templateObject4$4, _templateObject5$4, _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;
|
|
4679
|
+
const MapLegendControl = /*#__PURE__*/styled(MapControl)(_templateObject$6 || (_templateObject$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n cursor: default;\n"])));
|
|
4680
|
+
const MapLegendContainer = /*#__PURE__*/styled.div(_templateObject2$6 || (_templateObject2$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n width: 12.5rem;\n padding-bottom: 1rem;\n box-sizing: border-box;\n\n canvas {\n height: 1.625rem;\n width: 1.625rem;\n }\n"])));
|
|
4681
|
+
const MapLegendHeader = /*#__PURE__*/styled(LegendSectionHeader)(_templateObject3$4 || (_templateObject3$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n max-width: 15rem;\n margin-bottom: 0.25rem;\n font-weight: 500;\n"])));
|
|
4682
|
+
const MapLegendDescriptionContainer = /*#__PURE__*/styled.div(_templateObject4$4 || (_templateObject4$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-bottom: 0.5rem;\n font-weight: 400;\n font-size: 0.625rem;\n color: rgba(255, 255, 255, 0.65);\n"])));
|
|
4683
|
+
const MinimizedLegendContainer = /*#__PURE__*/styled.div(_templateObject5$4 || (_templateObject5$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n :not(:first-child) {\n margin-top: 1rem;\n }\n"])));
|
|
4684
|
+
const MapLegendValueDescr = /*#__PURE__*/styled.div(_templateObject6$2 || (_templateObject6$2 = /*#__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"])));
|
|
4685
|
+
|
|
4686
|
+
const SizeLegendItemMixin = function SizeLegendItemMixin(value) {
|
|
4687
|
+
if (value === void 0) {
|
|
4688
|
+
value = 0;
|
|
4689
|
+
}
|
|
4690
|
+
|
|
4691
|
+
return css(_templateObject7$2 || (_templateObject7$2 = _taggedTemplateLiteralLoose(["\n position: absolute;\n top: 0;\n left: 50%;\n flex: none;\n height: inherit;\n width: inherit;\n margin: 0 0 0 -1rem;\n background: none;\n border: none;\n\n :after {\n content: \"\";\n position: absolute;\n top: 0;\n left: 50%;\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);
|
|
4692
|
+
};
|
|
4693
|
+
|
|
4694
|
+
const StrokeWidthLegendItemMixin = function StrokeWidthLegendItemMixin(value) {
|
|
4695
|
+
if (value === void 0) {
|
|
4696
|
+
value = 0;
|
|
4697
|
+
}
|
|
4698
|
+
|
|
4699
|
+
return css(_templateObject8$2 || (_templateObject8$2 = _taggedTemplateLiteralLoose(["\n position: relative;\n background: none;\n border: none;\n display: flex;\n align-items: center;\n flex: none;\n min-height: 1rem;\n height: auto;\n width: calc(100% - 2rem);\n margin: 0 0 0.25rem 0;\n padding-left: 2rem;\n font-size: 0.75rem;\n \n :after {\n content: \"\";\n position: absolute;\n top: 50%;\n left: 0;\n width: 1.5rem;\n height: ", "px;\n margin-top: -", ";\n background: rgb(224, 224, 224);\n }\n"])), value, Math.round(value / 2));
|
|
4700
|
+
};
|
|
4701
|
+
|
|
4702
|
+
const MapLegendItem = /*#__PURE__*/styled.div(_templateObject9$1 || (_templateObject9$1 = /*#__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\n ", "\n\n ", "\n"])), (_ref) => {
|
|
4703
|
+
let {
|
|
4704
|
+
parameter
|
|
4705
|
+
} = _ref;
|
|
4706
|
+
return isParameterType(["strokeColor", "stroke.color"], parameter) ? 0.25 : 1;
|
|
4707
|
+
}, (_ref2) => {
|
|
4708
|
+
let {
|
|
4709
|
+
value
|
|
4710
|
+
} = _ref2;
|
|
4711
|
+
return typeof value === "number" ? "none" : value;
|
|
4712
|
+
}, (_ref3) => {
|
|
4713
|
+
let {
|
|
4714
|
+
value,
|
|
4715
|
+
parameter
|
|
4716
|
+
} = _ref3;
|
|
4717
|
+
return isParameterType("size", parameter) && SizeLegendItemMixin(value);
|
|
4718
|
+
}, (_ref4) => {
|
|
4719
|
+
let {
|
|
4720
|
+
value,
|
|
4721
|
+
parameter
|
|
4722
|
+
} = _ref4;
|
|
4723
|
+
return isParameterType(["strokeWidth", "stroke.width"], parameter) && StrokeWidthLegendItemMixin(value);
|
|
4724
|
+
});
|
|
4725
|
+
const MapLegendOther = /*#__PURE__*/styled(MapLegendItem)(_templateObject10$1 || (_templateObject10$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n flex: none;\n position: relative;\n width: 1rem;\n margin-left: 0.25rem;\n border-radius: 0.125rem;\n"])));
|
|
4726
|
+
const SizeLegendItemsMixin = /*#__PURE__*/css(_templateObject11$1 || (_templateObject11$1 = /*#__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);
|
|
4727
|
+
const StrokeWidthLegendItemsMixin = /*#__PURE__*/css(_templateObject12$1 || (_templateObject12$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n flex-direction: column;\n\n ", " {\n width: calc(100% - 2rem);\n margin-left: 0;\n }\n"])), MapLegendOther);
|
|
4728
|
+
const SizeMinimizedLegend = /*#__PURE__*/styled.div(_templateObject13$1 || (_templateObject13$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n margin-top: 0.5rem;\n"])));
|
|
4729
|
+
const SizeMinimizedLegendSymbol = /*#__PURE__*/styled.div(_templateObject14$1 || (_templateObject14$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 4rem;\n margin-right: 0.75rem;\n"])));
|
|
4730
|
+
const SizeMinimizedLegendLabel = /*#__PURE__*/styled.div(_templateObject15$1 || (_templateObject15$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 0.75rem;\n"])));
|
|
4731
|
+
const SizeMinimizedLegendDown = /*#__PURE__*/styled.div(_templateObject16$1 || (_templateObject16$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: white;\n opacity: 0.28;\n"])));
|
|
4732
|
+
const SizeMinimizedLegendUp = /*#__PURE__*/styled.div(_templateObject17 || (_templateObject17 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: white;\n opacity: 0.65;\n"])));
|
|
4733
|
+
const MapLegendItems = /*#__PURE__*/styled.div(_templateObject18 || (_templateObject18 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n width: 100%;\n border-radius: 0.125rem;\n\n ", ";\n ", ";\n"])), (_ref5) => {
|
|
4734
|
+
let {
|
|
4735
|
+
isSize
|
|
4736
|
+
} = _ref5;
|
|
4737
|
+
return isSize && SizeLegendItemsMixin;
|
|
4738
|
+
}, (_ref6) => {
|
|
4739
|
+
let {
|
|
4740
|
+
isStrokeWidth
|
|
4741
|
+
} = _ref6;
|
|
4742
|
+
return isStrokeWidth && StrokeWidthLegendItemsMixin;
|
|
4743
|
+
});
|
|
4744
|
+
const MapLegendValues = /*#__PURE__*/styled.div(_templateObject19 || (_templateObject19 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n width: 100%;\n font-size: 0.75rem;\n color: rgba(48, 69, 79, 0.65);\n"])));
|
|
4745
|
+
const MapLegendValuesRange = /*#__PURE__*/styled.div(_templateObject20 || (_templateObject20 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n width: 100%;\n"])));
|
|
4746
|
+
const MapLegendValuesOther = /*#__PURE__*/styled(MapLegendOther)(_templateObject21 || (_templateObject21 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border: 0;\n text-align: center;\n overflow: visible;\n"])));
|
|
4747
|
+
const MapLegendExpandButton = /*#__PURE__*/styled.div(_templateObject22 || (_templateObject22 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n cursor: pointer;\n margin: 0.1rem 0 0.5rem;\n font-size: 0.625rem;\n color: #1FB3AA;\n"])));
|
|
4748
|
+
|
|
4749
|
+
const MapLegendDescription = (_ref) => {
|
|
4750
|
+
let {
|
|
4751
|
+
parameter
|
|
4752
|
+
} = _ref;
|
|
4753
|
+
const isSize = isParameterType("size", parameter);
|
|
4754
|
+
const isStrokeWidth = isParameterType(["strokeWidth", "stroke.width"], parameter);
|
|
4755
|
+
const isStrokeColor = isParameterType(["strokeColor", "stroke.color"], parameter);
|
|
4756
|
+
console.info("MapLegendDescription", parameter, isSize, isStrokeWidth, isStrokeColor);
|
|
4757
|
+
return React.createElement(MapLegendDescriptionContainer, null, isStrokeWidth || isStrokeColor ? isStrokeWidth ? "Толщина обводки" : "Цвет обводки" : isSize ? "Размер знака" : "Цвет символа");
|
|
4758
|
+
};
|
|
4759
|
+
|
|
4760
|
+
const isNumeric = number => !isNaN(parseFloat(number)) && isFinite(number);
|
|
4761
|
+
|
|
4762
|
+
const getValueFromLegendTitle = (title, minOrMax) => {
|
|
4763
|
+
var _title$split;
|
|
4764
|
+
|
|
4765
|
+
if (title.includes(" - ")) {
|
|
4766
|
+
const result = title == null ? void 0 : title.split(" - ");
|
|
4767
|
+
return minOrMax === "min" ? result == null ? void 0 : result[0] : result == null ? void 0 : result[1];
|
|
4768
|
+
}
|
|
4769
|
+
|
|
4770
|
+
return (title == null ? void 0 : (_title$split = title.split(" ")) == null ? void 0 : _title$split.find(isNumeric)) || "";
|
|
4771
|
+
};
|
|
4772
|
+
|
|
4773
|
+
const MinimizedLegend = (_ref) => {
|
|
4774
|
+
var _currentValues$, _currentValues, _currentValues$2, _currentValues2;
|
|
4775
|
+
|
|
4776
|
+
let {
|
|
4777
|
+
values,
|
|
4778
|
+
title,
|
|
4779
|
+
parameter
|
|
4780
|
+
} = _ref;
|
|
4781
|
+
const currentValues = [...values];
|
|
4782
|
+
const other = currentValues.pop();
|
|
4783
|
+
const isSize = isParameterType("size", parameter);
|
|
4784
|
+
const isStrokeWidth = isParameterType(["strokeWidth", "stroke.width"], parameter);
|
|
4785
|
+
const titleMax = getValueFromLegendTitle((_currentValues$ = currentValues[0]) == null ? void 0 : _currentValues$.title, "max");
|
|
4786
|
+
const titleMin = getValueFromLegendTitle((_currentValues = currentValues[currentValues.length - 1]) == null ? void 0 : _currentValues.title, "min");
|
|
4787
|
+
return React.createElement(MinimizedLegendContainer, null, !!title && React.createElement(MapLegendValueDescr, null, title), React.createElement(MapLegendDescription, {
|
|
4788
|
+
parameter: parameter
|
|
4789
|
+
}), isSize ? React.createElement(React.Fragment, null, React.createElement(SizeMinimizedLegend, null, React.createElement(SizeMinimizedLegendSymbol, null, React.createElement(MapLegendItems, {
|
|
4790
|
+
isSize: true
|
|
4791
|
+
}, currentValues.map((value, index) => React.createElement(MapLegendItem, {
|
|
4792
|
+
key: "" + value.title + index,
|
|
4793
|
+
title: value.title,
|
|
4794
|
+
value: value.parameterValue,
|
|
4795
|
+
parameter: parameter
|
|
4796
|
+
})))), React.createElement(SizeMinimizedLegendLabel, null, React.createElement(SizeMinimizedLegendDown, null, (_currentValues$2 = currentValues[0]) == null ? void 0 : _currentValues$2.title), React.createElement(SizeMinimizedLegendUp, null, (_currentValues2 = currentValues[currentValues.length - 1]) == null ? void 0 : _currentValues2.title))), React.createElement(SizeMinimizedLegend, null, React.createElement(SizeMinimizedLegendSymbol, null, React.createElement(MapLegendItems, {
|
|
4797
|
+
isSize: true
|
|
4798
|
+
}, React.createElement(MapLegendOther, {
|
|
4799
|
+
title: "\u0414\u0440\u0443\u0433\u043E\u0435",
|
|
4800
|
+
value: other == null ? void 0 : other.parameterValue,
|
|
4801
|
+
parameter: parameter
|
|
4802
|
+
}))), React.createElement(SizeMinimizedLegendLabel, null, React.createElement(SizeMinimizedLegendUp, null, "\u0414\u0440\u0443\u0433\u043E\u0435")))) : isStrokeWidth ? React.createElement(MapLegendItems, {
|
|
4803
|
+
isStrokeWidth: true
|
|
4804
|
+
}, currentValues.map((value, index) => React.createElement(MapLegendItem, {
|
|
4805
|
+
key: "" + value.title + index,
|
|
4806
|
+
title: value.title,
|
|
4807
|
+
value: value.parameterValue,
|
|
4808
|
+
parameter: parameter
|
|
4809
|
+
}, (!index || index === currentValues.length - 1) && value.title)), React.createElement(MapLegendOther, {
|
|
4810
|
+
title: "\u0414\u0440\u0443\u0433\u043E\u0435",
|
|
4811
|
+
value: other == null ? void 0 : other.parameterValue,
|
|
4812
|
+
parameter: parameter
|
|
4813
|
+
}, "\u0414\u0440\u0443\u0433\u043E\u0435")) : React.createElement(MapLegendItems, null, currentValues.map((value, index) => React.createElement(MapLegendItem, {
|
|
4814
|
+
key: "" + value.title + index,
|
|
4815
|
+
title: value.title,
|
|
4816
|
+
value: value.parameterValue,
|
|
4817
|
+
parameter: parameter
|
|
4818
|
+
})), React.createElement(MapLegendOther, {
|
|
4819
|
+
title: "\u0414\u0440\u0443\u0433\u043E\u0435",
|
|
4820
|
+
value: other == null ? void 0 : other.parameterValue,
|
|
4821
|
+
parameter: parameter
|
|
4822
|
+
})), typeof (other == null ? void 0 : other.parameterValue) === "string" && (titleMax || titleMin) && React.createElement(MapLegendValues, null, React.createElement(MapLegendValuesRange, null, React.createElement("div", null, titleMax), React.createElement("div", null, titleMin)), React.createElement(MapLegendValuesOther, null, "-")));
|
|
4823
|
+
};
|
|
4824
|
+
|
|
4825
|
+
const MapLegend = (_ref) => {
|
|
4826
|
+
let {
|
|
4827
|
+
layer,
|
|
4828
|
+
config,
|
|
4829
|
+
className,
|
|
4830
|
+
hideTitle
|
|
4831
|
+
} = _ref;
|
|
4832
|
+
const legend = useMapLegend(layer, config);
|
|
4833
|
+
const [isExpanded, toggleExpanded] = useToggle();
|
|
4834
|
+
|
|
4835
|
+
if (!legend) {
|
|
4836
|
+
return null;
|
|
4837
|
+
}
|
|
4838
|
+
|
|
4839
|
+
const {
|
|
4840
|
+
symbol,
|
|
4841
|
+
items
|
|
4842
|
+
} = legend;
|
|
4843
|
+
return React.createElement(LegendProvider, {
|
|
4844
|
+
symbol: symbol
|
|
4845
|
+
}, React.createElement(MapLegendControl, {
|
|
4846
|
+
className: className
|
|
4847
|
+
}, !hideTitle && React.createElement(MapLegendHeader, null, layer == null ? void 0 : layer.alias), !!items.length && React.createElement(MapLegendContainer, null, isExpanded ? React.createElement(Legend, {
|
|
4848
|
+
layer: layer,
|
|
4849
|
+
config: config
|
|
4850
|
+
}) : React.createElement(React.Fragment, null, items.map(item => {
|
|
4851
|
+
var _symbol$fill;
|
|
4852
|
+
|
|
4853
|
+
return React.createElement(Fragment, {
|
|
4854
|
+
key: item.title
|
|
4855
|
+
}, React.createElement(MinimizedLegend, {
|
|
4856
|
+
values: item.values,
|
|
4857
|
+
defaultValue: (_symbol$fill = symbol.fill) == null ? void 0 : _symbol$fill.color,
|
|
4858
|
+
title: item.title !== (layer == null ? void 0 : layer.alias) ? item.title : "",
|
|
4859
|
+
parameter: item.parameter
|
|
4860
|
+
}));
|
|
4861
|
+
})), React.createElement(MapLegendExpandButton, {
|
|
4862
|
+
onClick: toggleExpanded,
|
|
4863
|
+
"data-html2canvas-ignore": true
|
|
4864
|
+
}, isExpanded ? "Свернуть" : "Развернуть"))));
|
|
4865
|
+
};
|
|
4866
|
+
|
|
4867
|
+
const MAX_SIZE$2 = 100;
|
|
4868
|
+
const MapLegendSymbol = (_ref) => {
|
|
4909
4869
|
let {
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
resolution,
|
|
4913
|
-
minScale,
|
|
4914
|
-
maxScale,
|
|
4915
|
-
children,
|
|
4916
|
-
onBboxChange,
|
|
4917
|
-
style
|
|
4870
|
+
value,
|
|
4871
|
+
parameter
|
|
4918
4872
|
} = _ref;
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
onBboxChange(state);
|
|
4929
|
-
}
|
|
4930
|
-
}, [map, onBboxChange, position, resolution]);
|
|
4931
|
-
useUpdateMapView({
|
|
4932
|
-
position,
|
|
4933
|
-
resolution
|
|
4934
|
-
});
|
|
4935
|
-
useMaxMinScale(minScale, maxScale, position, resolution);
|
|
4936
|
-
useMapBboxChange(handleBboxChange);
|
|
4937
|
-
return React.createElement("div", {
|
|
4938
|
-
className: className,
|
|
4939
|
-
ref: wrapperRef,
|
|
4940
|
-
style: style
|
|
4941
|
-
}, children);
|
|
4873
|
+
return React.createElement(LegendSymbol, {
|
|
4874
|
+
key: value.title,
|
|
4875
|
+
parameter: parameter,
|
|
4876
|
+
parameterValue: value.parameterValue
|
|
4877
|
+
}, symbol => React.createElement(Symbol, {
|
|
4878
|
+
render: getMapLegendSymbolRenders,
|
|
4879
|
+
symbol: symbol,
|
|
4880
|
+
size: MAX_SIZE$2
|
|
4881
|
+
}));
|
|
4942
4882
|
};
|
|
4943
4883
|
|
|
4944
|
-
|
|
4884
|
+
const DEFAULT_FORMATTERS = {
|
|
4885
|
+
polygon: formatPolygonMeasure,
|
|
4886
|
+
length: formatLength
|
|
4887
|
+
};
|
|
4945
4888
|
|
|
4946
|
-
const
|
|
4889
|
+
const COORD_FRACTION = 6;
|
|
4890
|
+
const DEFAULT_LABEL_POSITION = [Infinity, Infinity];
|
|
4891
|
+
let BaseMeasureToolCreator = /*#__PURE__*/function (_PolylineControl) {
|
|
4892
|
+
_inherits(BaseMeasureToolCreator, _PolylineControl);
|
|
4947
4893
|
|
|
4948
|
-
|
|
4894
|
+
var _super = /*#__PURE__*/_createSuper(BaseMeasureToolCreator);
|
|
4949
4895
|
|
|
4950
|
-
|
|
4896
|
+
function BaseMeasureToolCreator(map, painter, params) {
|
|
4897
|
+
var _this;
|
|
4951
4898
|
|
|
4952
|
-
|
|
4899
|
+
_classCallCheck(this, BaseMeasureToolCreator);
|
|
4953
4900
|
|
|
4954
|
-
|
|
4955
|
-
if (placement === void 0) {
|
|
4956
|
-
placement = 'bottom-left';
|
|
4957
|
-
}
|
|
4901
|
+
_this = _super.call(this, map, params);
|
|
4958
4902
|
|
|
4959
|
-
|
|
4960
|
-
|
|
4903
|
+
_this.cancel = () => {
|
|
4904
|
+
_this.fire('cancel');
|
|
4905
|
+
};
|
|
4906
|
+
|
|
4907
|
+
_this.painter = painter;
|
|
4908
|
+
_this.renderLabelSymbol = params.renderLabelSymbol;
|
|
4909
|
+
_this.formatters = params.formatters || DEFAULT_FORMATTERS;
|
|
4910
|
+
_this.areaSymbol = params.areaSymbol;
|
|
4911
|
+
|
|
4912
|
+
_this.on('pointAdd', _this.handlePointAdd); // @ts-ignore
|
|
4913
|
+
|
|
4914
|
+
|
|
4915
|
+
_this.on('change', _this.updateDistance);
|
|
4916
|
+
|
|
4917
|
+
return _this;
|
|
4961
4918
|
}
|
|
4962
4919
|
|
|
4963
|
-
|
|
4964
|
-
|
|
4920
|
+
_createClass(BaseMeasureToolCreator, [{
|
|
4921
|
+
key: "_handleMousemove",
|
|
4922
|
+
value: function _handleMousemove(event) {
|
|
4923
|
+
_get(_getPrototypeOf(BaseMeasureToolCreator.prototype), "_handleMousemove", this).call(this, event);
|
|
4965
4924
|
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4925
|
+
this.drawPointOnMouseMove(event);
|
|
4926
|
+
}
|
|
4927
|
+
}, {
|
|
4928
|
+
key: "_activate",
|
|
4929
|
+
value: function _activate() {
|
|
4930
|
+
_get(_getPrototypeOf(BaseMeasureToolCreator.prototype), "_activate", this).call(this);
|
|
4969
4931
|
|
|
4970
|
-
|
|
4932
|
+
this.addTempLabel();
|
|
4933
|
+
this.setCursor('pointer');
|
|
4934
|
+
}
|
|
4935
|
+
}, {
|
|
4936
|
+
key: "_deactivate",
|
|
4937
|
+
value: function _deactivate() {
|
|
4938
|
+
_get(_getPrototypeOf(BaseMeasureToolCreator.prototype), "_deactivate", this).call(this);
|
|
4971
4939
|
|
|
4972
|
-
|
|
4973
|
-
|
|
4940
|
+
this.removeCoordLabel();
|
|
4941
|
+
this.removeTempLabel();
|
|
4942
|
+
this.removeMeasureLabel();
|
|
4943
|
+
this.removeTempPolygon();
|
|
4944
|
+
this.setCursor('default');
|
|
4945
|
+
}
|
|
4946
|
+
}, {
|
|
4947
|
+
key: "handlePointAdd",
|
|
4948
|
+
value: function handlePointAdd() {
|
|
4949
|
+
const feature = this.activeFeature;
|
|
4950
|
+
if (!feature) return;
|
|
4951
|
+
const {
|
|
4952
|
+
rings,
|
|
4953
|
+
crs
|
|
4954
|
+
} = feature;
|
|
4974
4955
|
|
|
4975
|
-
|
|
4956
|
+
if (isPolylineLikePolygon(rings, this.map.resolution)) {
|
|
4957
|
+
this.finishDrawing();
|
|
4958
|
+
this.fire(new DrawingFinishEvent(feature, new MouseEvent('mouseup')));
|
|
4959
|
+
return;
|
|
4960
|
+
}
|
|
4976
4961
|
|
|
4977
|
-
|
|
4962
|
+
if (rings[0].length === 2) {
|
|
4963
|
+
const projection = crs.projectionTo(geo);
|
|
4964
|
+
const point = rings[0][0];
|
|
4965
|
+
if (!projection) return;
|
|
4966
|
+
const [lat, long] = projection(point);
|
|
4967
|
+
this.removeTempLabel();
|
|
4968
|
+
this.addMeasureResultLabel();
|
|
4969
|
+
this.addCoordLabel(lat.toFixed(COORD_FRACTION) + ", " + long.toFixed(COORD_FRACTION), point);
|
|
4970
|
+
} else {
|
|
4971
|
+
this.removeCoordLabel();
|
|
4972
|
+
}
|
|
4973
|
+
}
|
|
4974
|
+
}, {
|
|
4975
|
+
key: "polygonPreview",
|
|
4976
|
+
value: function polygonPreview() {
|
|
4977
|
+
if (this.tempPolygon) {
|
|
4978
|
+
this._tempLayer && this._tempLayer.remove(this.tempPolygon);
|
|
4979
|
+
}
|
|
4978
4980
|
|
|
4979
|
-
const
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
}
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
4981
|
+
const feature = this.activeFeature;
|
|
4982
|
+
if (!feature) return;
|
|
4983
|
+
const {
|
|
4984
|
+
rings,
|
|
4985
|
+
crs
|
|
4986
|
+
} = feature;
|
|
4987
|
+
const polygonRings = [...rings[0]];
|
|
4988
|
+
polygonRings.shift();
|
|
4989
|
+
this.tempPolygon = new Polygon(polygonRings, {
|
|
4990
|
+
crs
|
|
4991
|
+
});
|
|
4992
|
+
this.tempPolygon.symbol = this.areaSymbol || measureAreaSymbol;
|
|
4993
|
+
this.activeFeature && this.activeFeature.hide();
|
|
4994
|
+
this._tempLayer && this._tempLayer.add(this.tempPolygon);
|
|
4995
|
+
}
|
|
4996
|
+
}, {
|
|
4997
|
+
key: "removeTempPolygon",
|
|
4998
|
+
value: function removeTempPolygon() {
|
|
4999
|
+
if (this.tempPolygon) {
|
|
5000
|
+
this._tempLayer && this._tempLayer.remove(this.tempPolygon);
|
|
5001
|
+
delete this.tempPolygon;
|
|
5002
|
+
}
|
|
5003
|
+
}
|
|
5004
|
+
}, {
|
|
5005
|
+
key: "updateDistance",
|
|
5006
|
+
value: function updateDistance(event) {
|
|
5007
|
+
const feature = this.activeFeature;
|
|
5008
|
+
const {
|
|
5009
|
+
ringIndex,
|
|
5010
|
+
pointIndex
|
|
5011
|
+
} = event;
|
|
5012
|
+
if (!feature || ringIndex === null || pointIndex === null) return;
|
|
5013
|
+
const {
|
|
5014
|
+
rings,
|
|
5015
|
+
crs
|
|
5016
|
+
} = feature;
|
|
5017
|
+
const position = rings[ringIndex][pointIndex];
|
|
5018
|
+
const length$1 = length(rings, crs);
|
|
5019
|
+
let content = this.formatters.length(length$1);
|
|
5006
5020
|
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
}
|
|
5021
|
+
if (isPolylineLikePolygon(rings, this.map.resolution)) {
|
|
5022
|
+
this.polygonPreview();
|
|
5023
|
+
const area$1 = area(rings, crs);
|
|
5024
|
+
content = this.formatters.polygon(area$1, length$1);
|
|
5025
|
+
} else if (this.tempPolygon) {
|
|
5026
|
+
feature.show();
|
|
5027
|
+
this.removeTempPolygon();
|
|
5028
|
+
}
|
|
5012
5029
|
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
}
|
|
5030
|
+
if (this.measureResultLabel) {
|
|
5031
|
+
this.measureResultLabel.position = position;
|
|
5032
|
+
this.measureResultLabel.content = content;
|
|
5033
|
+
}
|
|
5034
|
+
}
|
|
5035
|
+
}, {
|
|
5036
|
+
key: "addTempLabel",
|
|
5037
|
+
value: function addTempLabel() {
|
|
5038
|
+
this.tempLabel = new LabelFeature(DEFAULT_LABEL_POSITION, {
|
|
5039
|
+
content: 'Нажмите на карту, чтобы начать измерение',
|
|
5040
|
+
crs: this.map.crs,
|
|
5041
|
+
symbol: createLabelSymbol({
|
|
5042
|
+
renderLabel: this.renderLabelSymbol
|
|
5043
|
+
})
|
|
5044
|
+
});
|
|
5045
|
+
this._tempLayer && this._tempLayer.add(this.tempLabel);
|
|
5046
|
+
}
|
|
5047
|
+
}, {
|
|
5048
|
+
key: "addCoordLabel",
|
|
5049
|
+
value: function addCoordLabel(content, position) {
|
|
5050
|
+
this.coordLabel = new LabelFeature(position, {
|
|
5051
|
+
content,
|
|
5052
|
+
crs: this.map.crs,
|
|
5053
|
+
symbol: createLabelSymbol({
|
|
5054
|
+
renderLabel: this.renderLabelSymbol,
|
|
5055
|
+
onClose: this.cancel
|
|
5056
|
+
})
|
|
5057
|
+
});
|
|
5058
|
+
this._tempLayer && this.coordLabel && this._tempLayer.add(this.coordLabel);
|
|
5059
|
+
}
|
|
5060
|
+
}, {
|
|
5061
|
+
key: "addMeasureResultLabel",
|
|
5062
|
+
value: function addMeasureResultLabel() {
|
|
5063
|
+
this.measureResultLabel = new LabelFeature(DEFAULT_LABEL_POSITION, {
|
|
5064
|
+
crs: this.map.crs,
|
|
5065
|
+
symbol: createLabelSymbol({
|
|
5066
|
+
renderLabel: this.renderLabelSymbol
|
|
5067
|
+
})
|
|
5068
|
+
});
|
|
5069
|
+
this._tempLayer && this.measureResultLabel && this._tempLayer.add(this.measureResultLabel);
|
|
5070
|
+
}
|
|
5071
|
+
}, {
|
|
5072
|
+
key: "removeTempLabel",
|
|
5073
|
+
value: function removeTempLabel() {
|
|
5074
|
+
if (this.tempLabel) {
|
|
5075
|
+
this._tempLayer && this._tempLayer.remove(this.tempLabel);
|
|
5076
|
+
delete this.tempLabel;
|
|
5077
|
+
}
|
|
5078
|
+
}
|
|
5079
|
+
}, {
|
|
5080
|
+
key: "removeCoordLabel",
|
|
5081
|
+
value: function removeCoordLabel() {
|
|
5082
|
+
if (this.coordLabel) {
|
|
5083
|
+
this._tempLayer && this._tempLayer.remove(this.coordLabel);
|
|
5084
|
+
delete this.coordLabel;
|
|
5085
|
+
}
|
|
5086
|
+
}
|
|
5087
|
+
}, {
|
|
5088
|
+
key: "removeMeasureLabel",
|
|
5089
|
+
value: function removeMeasureLabel() {
|
|
5090
|
+
if (this.measureResultLabel) {
|
|
5091
|
+
this._tempLayer && this._tempLayer.remove(this.measureResultLabel);
|
|
5092
|
+
delete this.measureResultLabel;
|
|
5093
|
+
}
|
|
5094
|
+
}
|
|
5095
|
+
}, {
|
|
5096
|
+
key: "drawPointOnMouseMove",
|
|
5097
|
+
value: function drawPointOnMouseMove(event) {
|
|
5098
|
+
if (this.tempLabel) {
|
|
5099
|
+
this.tempLabel.position = event.point.position;
|
|
5100
|
+
}
|
|
5101
|
+
}
|
|
5102
|
+
}, {
|
|
5103
|
+
key: "setCursor",
|
|
5104
|
+
value: function setCursor(cursor) {
|
|
5105
|
+
const {
|
|
5106
|
+
wrapper
|
|
5107
|
+
} = this.painter;
|
|
5018
5108
|
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
};
|
|
5109
|
+
if (wrapper && typeof wrapper !== 'string') {
|
|
5110
|
+
wrapper.style.cursor = cursor;
|
|
5111
|
+
}
|
|
5112
|
+
}
|
|
5113
|
+
}]);
|
|
5024
5114
|
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
const MapLegendContainer = /*#__PURE__*/styled.div(_templateObject2$6 || (_templateObject2$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n width: 12.5rem;\n padding-bottom: 1rem;\n box-sizing: border-box;\n\n canvas {\n height: 1.625rem;\n width: 1.625rem;\n }\n"])));
|
|
5028
|
-
const MapLegendHeader = /*#__PURE__*/styled(LegendSectionHeader)(_templateObject3$4 || (_templateObject3$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n max-width: 15rem;\n margin-bottom: 0.25rem;\n font-weight: 500;\n"])));
|
|
5029
|
-
const MapLegendDescriptionContainer = /*#__PURE__*/styled.div(_templateObject4$4 || (_templateObject4$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-bottom: 0.5rem;\n font-weight: 400;\n font-size: 0.625rem;\n color: rgba(255, 255, 255, 0.65);\n"])));
|
|
5030
|
-
const MapLegendValueDescr = /*#__PURE__*/styled.div(_templateObject5$4 || (_templateObject5$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n min-height: 1rem;\n margin-bottom: 0.5rem;\n font-size: 0.75rem;\n font-weight: 600;\n line-height: 1rem;\n"])));
|
|
5031
|
-
const MapLegendItem = /*#__PURE__*/styled.div(_templateObject6$2 || (_templateObject6$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n flex: 1;\n height: 1rem;\n background: ", ";\n border: 1px rgba(48, 69, 79, 0.1) solid;\n margin-right: -1px;\n \n ", "\n"])), _ref => {
|
|
5032
|
-
let {
|
|
5033
|
-
value
|
|
5034
|
-
} = _ref;
|
|
5035
|
-
return typeof value === "number" ? "none" : value;
|
|
5036
|
-
}, _ref2 => {
|
|
5037
|
-
let {
|
|
5038
|
-
value
|
|
5039
|
-
} = _ref2;
|
|
5040
|
-
return !!value && typeof value === "number" && SizeLegendMixin(value);
|
|
5041
|
-
});
|
|
5042
|
-
const MapLegendOther = /*#__PURE__*/styled(MapLegendItem)(_templateObject7$2 || (_templateObject7$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n flex: none;\n width: 1rem;\n margin-left: 0.25rem;\n border-radius: 0.125rem;\n"])));
|
|
5043
|
-
const SizeOverlayLegendMixin = /*#__PURE__*/css(_templateObject8$2 || (_templateObject8$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n width: 2rem;\n height: 2rem;\n margin: 0 auto;\n \n ", ", ", " {\n flex: none;\n position: absolute;\n top: 0;\n left: 50%;\n width: inherit;\n height: inherit;\n margin-left: -1rem;\n \n :after {\n top: 0;\n margin-top: 0;\n }\n }\n"])), MapLegendItem, MapLegendOther);
|
|
5044
|
-
const SizeMinimizedLegend = /*#__PURE__*/styled.div(_templateObject9$1 || (_templateObject9$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n margin-top: 0.5rem;\n \n ", " {\n margin: 0 auto;\n }\n"])), MapLegendItem);
|
|
5045
|
-
const SizeMinimizedLegendSymbol = /*#__PURE__*/styled.div(_templateObject10$1 || (_templateObject10$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 4rem;\n margin-right: 0.75rem;\n"])));
|
|
5046
|
-
const SizeMinimizedLegendLabel = /*#__PURE__*/styled.div(_templateObject11$1 || (_templateObject11$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 0.75rem;\n"])));
|
|
5047
|
-
const SizeMinimizedLegendDown = /*#__PURE__*/styled.div(_templateObject12$1 || (_templateObject12$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: white;\n opacity: 0.28;\n"])));
|
|
5048
|
-
const SizeMinimizedLegendUp = /*#__PURE__*/styled.div(_templateObject13$1 || (_templateObject13$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: white;\n opacity: 0.65;\n"])));
|
|
5049
|
-
const MapLegendItems = /*#__PURE__*/styled.div(_templateObject14$1 || (_templateObject14$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n width: 100%;\n border-radius: 0.125rem;\n\n ", ";\n"])), _ref3 => {
|
|
5050
|
-
let {
|
|
5051
|
-
overlay
|
|
5052
|
-
} = _ref3;
|
|
5053
|
-
return overlay && SizeOverlayLegendMixin;
|
|
5054
|
-
});
|
|
5115
|
+
return BaseMeasureToolCreator;
|
|
5116
|
+
}(PolylineControl);
|
|
5055
5117
|
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
value = 0;
|
|
5059
|
-
}
|
|
5118
|
+
let BaseMeasureToolEditor = /*#__PURE__*/function (_PolyEditor) {
|
|
5119
|
+
_inherits(BaseMeasureToolEditor, _PolyEditor);
|
|
5060
5120
|
|
|
5061
|
-
|
|
5062
|
-
};
|
|
5121
|
+
var _super = /*#__PURE__*/_createSuper(BaseMeasureToolEditor);
|
|
5063
5122
|
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
const MapLegendValuesOther = /*#__PURE__*/styled(MapLegendOther)(_templateObject18 || (_templateObject18 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border: 0;\n text-align: center;\n overflow: visible;\n"])));
|
|
5067
|
-
const MapLegendExpandButton = /*#__PURE__*/styled.div(_templateObject19 || (_templateObject19 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n cursor: pointer;\n margin: 0.1rem 0 0.5rem;\n font-size: 0.625rem;\n color: #1FB3AA;\n"])));
|
|
5123
|
+
function BaseMeasureToolEditor(map, painter, params) {
|
|
5124
|
+
var _this;
|
|
5068
5125
|
|
|
5069
|
-
|
|
5070
|
-
let {
|
|
5071
|
-
isSize
|
|
5072
|
-
} = _ref;
|
|
5073
|
-
return React.createElement(MapLegendDescriptionContainer, null, isSize ? "Размер знака" : "Цвет символа");
|
|
5074
|
-
};
|
|
5126
|
+
_classCallCheck(this, BaseMeasureToolEditor);
|
|
5075
5127
|
|
|
5076
|
-
|
|
5077
|
-
var _title$split;
|
|
5128
|
+
_this = _super.call(this, map, params);
|
|
5078
5129
|
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
|
|
5130
|
+
_this.measureResult = () => {
|
|
5131
|
+
const feature = _this.activeFeature;
|
|
5132
|
+
if (!feature) return null;
|
|
5133
|
+
const {
|
|
5134
|
+
rings,
|
|
5135
|
+
isEnclosed,
|
|
5136
|
+
crs
|
|
5137
|
+
} = feature;
|
|
5138
|
+
const pointsCount = rings[0].length;
|
|
5139
|
+
const position = rings[0][pointsCount - 1];
|
|
5140
|
+
const area$1 = area(rings, crs);
|
|
5141
|
+
const length$1 = length(rings, crs, isEnclosed);
|
|
5142
|
+
const content = isEnclosed ? _this.formatters.polygon(area$1, length$1) : _this.formatters.length(length$1);
|
|
5143
|
+
return {
|
|
5144
|
+
content,
|
|
5145
|
+
position
|
|
5146
|
+
};
|
|
5147
|
+
};
|
|
5083
5148
|
|
|
5084
|
-
|
|
5085
|
-
|
|
5149
|
+
_this.removeFeature = () => {
|
|
5150
|
+
_this.fire('remove');
|
|
5151
|
+
};
|
|
5086
5152
|
|
|
5087
|
-
|
|
5088
|
-
|
|
5153
|
+
_this.painter = painter;
|
|
5154
|
+
_this.renderLabelSymbol = params.renderLabelSymbol;
|
|
5155
|
+
_this.formatters = params.formatters || DEFAULT_FORMATTERS;
|
|
5089
5156
|
|
|
5090
|
-
|
|
5091
|
-
values,
|
|
5092
|
-
title,
|
|
5093
|
-
isSize
|
|
5094
|
-
} = _ref;
|
|
5095
|
-
const currentValues = [...values];
|
|
5096
|
-
const other = currentValues.pop();
|
|
5097
|
-
return React.createElement(React.Fragment, null, !!title && React.createElement(MapLegendValueDescr, null, title), React.createElement(MapLegendDescription, {
|
|
5098
|
-
isSize: isSize
|
|
5099
|
-
}), isSize ? React.createElement(React.Fragment, null, React.createElement(SizeMinimizedLegend, null, React.createElement(SizeMinimizedLegendSymbol, null, React.createElement(MapLegendItems, {
|
|
5100
|
-
overlay: true
|
|
5101
|
-
}, currentValues.map(value => React.createElement(MapLegendItem, {
|
|
5102
|
-
key: value.title,
|
|
5103
|
-
title: value.title,
|
|
5104
|
-
value: value.parameterValue
|
|
5105
|
-
})))), React.createElement(SizeMinimizedLegendLabel, null, React.createElement(SizeMinimizedLegendDown, null, (_currentValues$ = currentValues[0]) == null ? void 0 : _currentValues$.title), React.createElement(SizeMinimizedLegendUp, null, (_currentValues = currentValues[currentValues.length - 1]) == null ? void 0 : _currentValues.title))), React.createElement(SizeMinimizedLegend, null, React.createElement(SizeMinimizedLegendSymbol, null, React.createElement(MapLegendOther, {
|
|
5106
|
-
title: "\u0414\u0440\u0443\u0433\u043E\u0435",
|
|
5107
|
-
value: other == null ? void 0 : other.parameterValue
|
|
5108
|
-
})), React.createElement(SizeMinimizedLegendLabel, null, React.createElement(SizeMinimizedLegendUp, null, "\u0414\u0440\u0443\u0433\u043E\u0435")))) : React.createElement(MapLegendItems, {
|
|
5109
|
-
overlay: isSize
|
|
5110
|
-
}, currentValues.map(value => React.createElement(MapLegendItem, {
|
|
5111
|
-
key: value.title,
|
|
5112
|
-
title: value.title,
|
|
5113
|
-
value: value.parameterValue
|
|
5114
|
-
})), React.createElement(MapLegendOther, {
|
|
5115
|
-
title: "\u0414\u0440\u0443\u0433\u043E\u0435",
|
|
5116
|
-
value: other == null ? void 0 : other.parameterValue
|
|
5117
|
-
})), typeof (other == null ? void 0 : other.parameterValue) === "string" && React.createElement(MapLegendValues, null, React.createElement(MapLegendValuesRange, null, React.createElement("div", null, getValueFromLegendTitle((_currentValues$2 = currentValues[0]) == null ? void 0 : _currentValues$2.title, "max")), React.createElement("div", null, getValueFromLegendTitle((_currentValues2 = currentValues[currentValues.length - 1]) == null ? void 0 : _currentValues2.title, "min"))), React.createElement(MapLegendValuesOther, null, "-")));
|
|
5118
|
-
};
|
|
5157
|
+
_this.on('change', _this.updateMeasureResult);
|
|
5119
5158
|
|
|
5120
|
-
|
|
5121
|
-
let {
|
|
5122
|
-
layer,
|
|
5123
|
-
config,
|
|
5124
|
-
className,
|
|
5125
|
-
hideTitle
|
|
5126
|
-
} = _ref;
|
|
5127
|
-
const legend = useMapLegend(layer, config);
|
|
5128
|
-
const [isExpanded, toggleExpanded] = useToggle();
|
|
5159
|
+
_this.on('edit', _this.updateMeasureResult);
|
|
5129
5160
|
|
|
5130
|
-
|
|
5131
|
-
return null;
|
|
5161
|
+
return _this;
|
|
5132
5162
|
}
|
|
5133
5163
|
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
return React.createElement(LegendProvider, {
|
|
5139
|
-
symbol: symbol
|
|
5140
|
-
}, React.createElement(MapLegendControl, {
|
|
5141
|
-
className: className
|
|
5142
|
-
}, !hideTitle && React.createElement(MapLegendHeader, null, layer == null ? void 0 : layer.alias), !!items.length && React.createElement(MapLegendContainer, null, isExpanded ? React.createElement(Legend, {
|
|
5143
|
-
layer: layer,
|
|
5144
|
-
config: config
|
|
5145
|
-
}) : React.createElement(React.Fragment, null, items.map(item => {
|
|
5146
|
-
var _symbol$fill;
|
|
5164
|
+
_createClass(BaseMeasureToolEditor, [{
|
|
5165
|
+
key: "_activate",
|
|
5166
|
+
value: function _activate() {
|
|
5167
|
+
_get(_getPrototypeOf(BaseMeasureToolEditor.prototype), "_activate", this).call(this);
|
|
5147
5168
|
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5169
|
+
this.addMeasureResultLabel();
|
|
5170
|
+
}
|
|
5171
|
+
}, {
|
|
5172
|
+
key: "addMeasureResultLabel",
|
|
5173
|
+
value: function addMeasureResultLabel() {
|
|
5174
|
+
const measureResult = this.measureResult();
|
|
5175
|
+
if (measureResult === null) return;
|
|
5176
|
+
const {
|
|
5177
|
+
content,
|
|
5178
|
+
position
|
|
5179
|
+
} = measureResult;
|
|
5180
|
+
this.measureResultLabel = new LabelFeature(position, {
|
|
5181
|
+
content,
|
|
5182
|
+
crs: this.map.crs,
|
|
5183
|
+
symbol: createLabelSymbol({
|
|
5184
|
+
onClose: this.removeFeature,
|
|
5185
|
+
renderLabel: this.renderLabelSymbol
|
|
5186
|
+
})
|
|
5187
|
+
});
|
|
5188
|
+
this._tempLayer && this._tempLayer.add(this.measureResultLabel);
|
|
5189
|
+
}
|
|
5190
|
+
}, {
|
|
5191
|
+
key: "updateMeasureResult",
|
|
5192
|
+
value: function updateMeasureResult() {
|
|
5193
|
+
if (this.measureResultLabel) {
|
|
5194
|
+
const measureResult = this.measureResult();
|
|
5195
|
+
if (measureResult === null) return;
|
|
5196
|
+
const {
|
|
5197
|
+
content,
|
|
5198
|
+
position
|
|
5199
|
+
} = measureResult;
|
|
5200
|
+
this.measureResultLabel.content = content;
|
|
5201
|
+
this.measureResultLabel.position = position;
|
|
5202
|
+
}
|
|
5203
|
+
}
|
|
5204
|
+
}]);
|
|
5160
5205
|
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
let {
|
|
5164
|
-
value,
|
|
5165
|
-
parameter
|
|
5166
|
-
} = _ref;
|
|
5167
|
-
return React.createElement(LegendSymbol, {
|
|
5168
|
-
key: value.title,
|
|
5169
|
-
parameter: parameter,
|
|
5170
|
-
parameterValue: value.parameterValue
|
|
5171
|
-
}, symbol => React.createElement(Symbol, {
|
|
5172
|
-
render: getMapLegendSymbolRenders,
|
|
5173
|
-
symbol: symbol,
|
|
5174
|
-
size: MAX_SIZE$2
|
|
5175
|
-
}));
|
|
5176
|
-
};
|
|
5206
|
+
return BaseMeasureToolEditor;
|
|
5207
|
+
}(PolyEditor);
|
|
5177
5208
|
|
|
5178
5209
|
let MeasureTool = /*#__PURE__*/function (_React$Component) {
|
|
5179
5210
|
_inherits(MeasureTool, _React$Component);
|
|
@@ -5363,7 +5394,7 @@ let MeasureTool = /*#__PURE__*/function (_React$Component) {
|
|
|
5363
5394
|
}(React.Component);
|
|
5364
5395
|
|
|
5365
5396
|
const _excluded$3 = ["isActive"];
|
|
5366
|
-
const Measurer = _ref => {
|
|
5397
|
+
const Measurer = (_ref) => {
|
|
5367
5398
|
let {
|
|
5368
5399
|
isActive
|
|
5369
5400
|
} = _ref,
|
|
@@ -5381,18 +5412,18 @@ const Measurer = _ref => {
|
|
|
5381
5412
|
|
|
5382
5413
|
var _templateObject$7, _templateObject2$7, _templateObject3$5;
|
|
5383
5414
|
const ScaleRulerContainer = /*#__PURE__*/styled.div(_templateObject$7 || (_templateObject$7 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n height: 2rem;\n cursor: default;\n display: flex;\n align-items: flex-end;\n padding: 0 0.5rem 0.5rem;\n box-sizing: border-box;\n"])));
|
|
5384
|
-
const ScaleRulerBlock = /*#__PURE__*/styled.div(_templateObject2$7 || (_templateObject2$7 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: flex-end;\n justify-content: center;\n width: ", ";\n height: 0.25rem;\n border: 0.0625rem solid white;\n border-top: 0;\n"])), _ref => {
|
|
5415
|
+
const ScaleRulerBlock = /*#__PURE__*/styled.div(_templateObject2$7 || (_templateObject2$7 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: flex-end;\n justify-content: center;\n width: ", ";\n height: 0.25rem;\n border: 0.0625rem solid white;\n border-top: 0;\n"])), (_ref) => {
|
|
5385
5416
|
let {
|
|
5386
5417
|
width
|
|
5387
5418
|
} = _ref;
|
|
5388
5419
|
return width + "px";
|
|
5389
5420
|
});
|
|
5390
|
-
const TextContainer = /*#__PURE__*/styled.div(_templateObject3$5 || (_templateObject3$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n height: 2rem;\n display: flex;\n justify-content: center;\n align-items: ", ";\n width: ", ";\n color: #fff;\n font-size: 1rem;\n cursor: default;\n padding: 0 0.5rem;\n"])), _ref2 => {
|
|
5421
|
+
const TextContainer = /*#__PURE__*/styled.div(_templateObject3$5 || (_templateObject3$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n height: 2rem;\n display: flex;\n justify-content: center;\n align-items: ", ";\n width: ", ";\n color: #fff;\n font-size: 1rem;\n cursor: default;\n padding: 0 0.5rem;\n"])), (_ref2) => {
|
|
5391
5422
|
let {
|
|
5392
5423
|
alignEnd
|
|
5393
5424
|
} = _ref2;
|
|
5394
5425
|
return alignEnd ? 'flex-end' : 'center';
|
|
5395
|
-
}, _ref3 => {
|
|
5426
|
+
}, (_ref3) => {
|
|
5396
5427
|
let {
|
|
5397
5428
|
width
|
|
5398
5429
|
} = _ref3;
|
|
@@ -5417,7 +5448,7 @@ const ScaleRuler = () => {
|
|
|
5417
5448
|
}, currentScale >= 1000 ? currentScale / 1000 + "km" : currentScale + "m")));
|
|
5418
5449
|
};
|
|
5419
5450
|
|
|
5420
|
-
const Zoom = _ref => {
|
|
5451
|
+
const Zoom = (_ref) => {
|
|
5421
5452
|
let {
|
|
5422
5453
|
children
|
|
5423
5454
|
} = _ref;
|
|
@@ -5466,7 +5497,7 @@ const placementMixin$1 = function placementMixin(placement, distance, cornerSize
|
|
|
5466
5497
|
return css(_templateObject9$2 || (_templateObject9$2 = _taggedTemplateLiteralLoose(["\n ", "\n ", "\n ", "\n ", "\n"])), placement === 'top' && top(distance, cornerSize), placement === 'right' && right(distance, cornerSize), placement === 'left' && left(distance, cornerSize), placement === 'bottom' && bottom(distance, cornerSize));
|
|
5467
5498
|
};
|
|
5468
5499
|
const corner = /*#__PURE__*/css(_templateObject10$2 || (_templateObject10$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n &:before {\n content: '';\n width: 0;\n height: 0;\n position: absolute;\n }\n"])));
|
|
5469
|
-
const TooltipComponent = /*#__PURE__*/styled.div(_templateObject11$2 || (_templateObject11$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: absolute;\n z-index: 999;\n display: flex;\n font-size: 0.625rem;\n color: #fff;\n background-color: rgba(28, 33, 48, 0.8);\n padding: 0.4em 0.6em;\n border-radius: 2px;\n user-select: none;\n box-sizing: border-box;\n white-space: pre;\n ", "\n ", "\n"])), _ref => {
|
|
5500
|
+
const TooltipComponent = /*#__PURE__*/styled.div(_templateObject11$2 || (_templateObject11$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: absolute;\n z-index: 999;\n display: flex;\n font-size: 0.625rem;\n color: #fff;\n background-color: rgba(28, 33, 48, 0.8);\n padding: 0.4em 0.6em;\n border-radius: 2px;\n user-select: none;\n box-sizing: border-box;\n white-space: pre;\n ", "\n ", "\n"])), (_ref) => {
|
|
5470
5501
|
let {
|
|
5471
5502
|
placement,
|
|
5472
5503
|
distance = '0.5rem',
|
|
@@ -5474,7 +5505,7 @@ const TooltipComponent = /*#__PURE__*/styled.div(_templateObject11$2 || (_templa
|
|
|
5474
5505
|
cornerSize = '0.25rem'
|
|
5475
5506
|
} = _ref;
|
|
5476
5507
|
return placementMixin$1(placement, distance, withArrow ? cornerSize : null);
|
|
5477
|
-
}, _ref2 => {
|
|
5508
|
+
}, (_ref2) => {
|
|
5478
5509
|
let {
|
|
5479
5510
|
withArrow
|
|
5480
5511
|
} = _ref2;
|
|
@@ -5488,7 +5519,7 @@ const {
|
|
|
5488
5519
|
Consumer
|
|
5489
5520
|
} = /*#__PURE__*/createContext([]); // TODO I just cant read that
|
|
5490
5521
|
|
|
5491
|
-
const Tooltip = _ref => {
|
|
5522
|
+
const Tooltip = (_ref) => {
|
|
5492
5523
|
let {
|
|
5493
5524
|
features = [],
|
|
5494
5525
|
map,
|
|
@@ -5527,7 +5558,7 @@ const Noop = () => React.createElement("div", {
|
|
|
5527
5558
|
}
|
|
5528
5559
|
});
|
|
5529
5560
|
|
|
5530
|
-
const DraggableMarker = _ref => {
|
|
5561
|
+
const DraggableMarker = (_ref) => {
|
|
5531
5562
|
let {
|
|
5532
5563
|
position,
|
|
5533
5564
|
onChange,
|
|
@@ -5541,5 +5572,20 @@ const DraggableMarker = _ref => {
|
|
|
5541
5572
|
return React.createElement(Fragment, null);
|
|
5542
5573
|
};
|
|
5543
5574
|
|
|
5575
|
+
const polygonCircleFromPoint = (center, diameter) => {
|
|
5576
|
+
const coordinates = [];
|
|
5577
|
+
const radius = diameter / 2;
|
|
5578
|
+
const endAngle = Math.PI * 2;
|
|
5579
|
+
const step = Math.max(Math.PI / 2 / radius, endAngle / 128);
|
|
5580
|
+
let start = 0;
|
|
5581
|
+
let end = endAngle;
|
|
5582
|
+
|
|
5583
|
+
for (let ang = start; ang < end; ang += step) {
|
|
5584
|
+
coordinates.push([Math.cos(ang) * radius + center[0], Math.sin(ang) * radius + center[1]]);
|
|
5585
|
+
}
|
|
5586
|
+
|
|
5587
|
+
return [coordinates];
|
|
5588
|
+
};
|
|
5589
|
+
|
|
5544
5590
|
export { ArrowLineMiterRender, BaseMeasureToolCreator, BaseMeasureToolEditor, CRS_MAP, CardAttributes, CardHeader, CircleLineMiterRender, ClassificationCondition, ClassificationManager, ClusterLayer, ClusterSymbol, CompoundIcon, DEFAULT_CRS, DEFAULT_SRID, DEFAULT_SYMBOL_SIZE, DraggableMarker, EvergisCard, EvergisCardAttribute, AttributeContainer as EvergisCardAttributeContainer, AttributeTitle as EvergisCardAttributeTitle, AttributeValueContainer as EvergisCardAttributeValueContainer, CardControls as EvergisCardCardControls, CardTitle as EvergisCardCardTitle, EvergisCardContainer, CurrentFeatureIndex as EvergisCardCurrentFeatureIndex, FeatureName as EvergisCardFeatureName, LayerName as EvergisCardLayerName, CardPagination as EvergisCardPagination, PaginationDescription as EvergisCardPaginationDescription, SimpleAttribute as EvergisCardSimpleValue, StickyHeader as EvergisCardStickyHeader, ValueLink as EvergisCardValueLink, EvergisDynamicLayer, EvergisFeature, EvergisLayer, EvergisProvider, EvergisSelect, EvergisSelectLayer, EvergisSelectProvider, EvergisStyle, EvergisTileLayer, FeatureLayer, Fullscreen, LabelSymbol, Legend, LegendContainer, LegendProvider, LegendSection, LegendSectionContainer, LegendSymbol, LegendValue, LegendValueContainer, LineMiterKind, LineMiterRender, Map, MapControl, MapControls, MapLegend, MapLegendContainer, MapLegendDescription, MapLegendDescriptionContainer, MapLegendExpandButton, MapLegendHeader, MapLegendItem, MapLegendSymbol, MapLegendValueDescr, MapLegendValues, MapProvider, Measure, MeasureTool, Measurer, NO_CONTENT_VALUE, Noop, PREVIEW_LIMITS, SGisBrushFill, SGisImageFill, SGisPolygonSymbol, SGisPolylineSymbol, SOLID_INTERVALS, SVGPoly, ScaleRuler, ScaleRulerBlock, ScaleRulerContainer, Search, SelectedPointSymbol, SelectedPolySymbol, ShadowedPointSymbol, ShadowedPolySymbol, SizeMinimizedLegendDown, SizeMinimizedLegendUp, SquareLineMiterRender, SrId, StyleSymbol, Symbol, TextContainer, TileLayer, Tooltip, TooltipComponent, TooltipProvider, Zoom, ZoomLevel, adjustSymbol, applyParameterValue, clamp, copyRings, createCompositeSymbol, createLabelSymbol, createStyleLegend, createValueTitle, defaultOffset, defineStrokeStylePreset, deserializeSymbol, evaluateFeature, extractStyle, extractSymbol, findChildFeatureStyle, findChildFeatureSymbol, formatArea, formatAttributeValue, formatLength, formatPolygonMeasure, getAttributeNameFromClassified, getAttributeNameFromCondition, getChildSymbols, getCrs, getDashStylePreset, getFeatureSymbol, getLegendSymbolRenders, getLineDash, getMapLegendSymbolRenders, getMapState, getParameterValue, getScale, getSymbolRenders, isArrowLineMiter, isCalculatedParameter, isCircleLineMiter, isCompositeSymbol, isDashedBrush, isFilledLineMitter, isHatchBrush, isImageSymbol, isLabelSymbol, isMaskedImageSymbol, isMiterExist, isNumeric, isParameterByAttribute, isParameterType, isParameterValueSimple, isParameterValueSymbol, isPatternBrush, isPointLabelSymbol, isPointSymbol, isPolygonHasHatchBrush, isPolygonHasPatternBrush, isPolygonLabelSymbol, isPolygonSymbol, isPolylineLabelSymbol, isPolylineLikePolygon, isPolylineSymbol, isPolylineSymbols, isRangeClass, isRasterSymbol, isSGisClusterSymbol, isSGisH3Symbol, isSGisImageSymbol, isSGisPointSymbol, isSGisPolygonSymbol, isSGisPolylineSymbol, isScalablePolylineSymbol, isSimpleOffset, isSimplePolylineSymbol, isSimpleSymbol, isSizableSymbol, isSolidBrush, isSquareLineMiter, isSquareSymbol, isStaticImageSymbol, isStringParameterValue, isStrokeStyledSymbol, isStyle, isSymbolWithOffset, isTwoDimensionalSymbol, isUniqueClass, isValidParameter, measureAreaSymbol, measureLengthSymbol, measurePolygonSnapSymbol, metersToPixels, numberWithSpaces, packStyle, polygonCircleFromPoint, printRangeClass, renderSymbolToCanvas, selectedPoint, selectedPolygon, selectedPolyline, setDefaultParameterValue, setParameterValue, shouldUpdateMapState, solidStrokeStylePreset, strokeStylePresets, symbolParameterWalker, symbolTypeGuard, toIntervals, toLineDash, unClassify, updateMapResolution, useCanvas, useClusterLayer, useCrs, useDebouncedCallback, useDraggableMarker, useEventPoint, useEvergisContext, useEvergisDynamicLayer, useEvergisSelect, useEvergisSelectContext, useEvergisTileLayer, useFeatureLayer, useLayerLegend, useLayerOrder, useLayerVisibility, useLegend, useLegendContext, useLegendValueSymbol, useMapBboxChange, useMapContext, useMapLegend, useMapLevel, useMapPick, useMapResize, useMapState, useMapView, useMapViewActions, useMapWrapper, useMaxMinScale, useMetersToPixels, useMetersToPixelsCb, useMount, useProperty, useScale, useSymbol, useToggle, useTooltip, useTooltipContext, useUpdate, useUpdateMapView };
|
|
5545
5591
|
//# sourceMappingURL=react.esm.js.map
|