@splunk/visualizations 24.5.0 → 24.5.3
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/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer_Dynamic_coloring.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer_Result_Limit_Set_To_3.png +0 -0
- package/Area.js +2 -2
- package/Bar.js +2 -2
- package/Bubble.js +2 -2
- package/ChoroplethSvg.js +2 -2
- package/Column.js +2 -2
- package/Ellipse.js +2 -2
- package/FillerGauge.js +2 -2
- package/Image.js +2 -2
- package/Line.js +2 -2
- package/LinkGraph.js +2 -2
- package/Map.js +37 -46
- package/Map.js.map +1 -1
- package/Markdown.js +2 -2
- package/MarkerGauge.js +2 -2
- package/ParallelCoordinates.js +2 -2
- package/Pie.js +2 -2
- package/Punchcard.js +2 -2
- package/Rectangle.js +2 -2
- package/Sankey.js +2 -2
- package/Scatter.js +2 -2
- package/SingleValue.js +2 -2
- package/SingleValueIcon.js +2 -2
- package/SingleValueRadial.js +2 -2
- package/Table.js +9 -3
- package/Table.js.map +1 -1
- package/common/withDashboardViz.js +2 -2
- package/package.json +10 -10
|
Binary file
|
package/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer_Dynamic_coloring.png
CHANGED
|
Binary file
|
package/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer_Result_Limit_Set_To_3.png
CHANGED
|
Binary file
|
package/Area.js
CHANGED
|
@@ -582,7 +582,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
582
582
|
|
|
583
583
|
return React.createElement(FixSizeItem, {
|
|
584
584
|
"data-test": "fix-size-item",
|
|
585
|
-
"data-splunk-visualization-version": "24.5.
|
|
585
|
+
"data-splunk-visualization-version": "24.5.3 - 3129e19a7",
|
|
586
586
|
width: width,
|
|
587
587
|
height: height,
|
|
588
588
|
backgroundColor: backgroundColor
|
|
@@ -1555,7 +1555,7 @@ var Cover = styled_components_1.default.div.withConfig({
|
|
|
1555
1555
|
componentId: "sc-1gsbnxb-0"
|
|
1556
1556
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
1557
1557
|
var Blocker = styled_components_1.default.div.attrs({
|
|
1558
|
-
'data-splunk-visualization-version': "24.5.
|
|
1558
|
+
'data-splunk-visualization-version': "24.5.3 - 3129e19a7"
|
|
1559
1559
|
}).withConfig({
|
|
1560
1560
|
displayName: "withEditModeCover__Blocker",
|
|
1561
1561
|
componentId: "sc-1gsbnxb-1"
|
package/Bar.js
CHANGED
|
@@ -582,7 +582,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
582
582
|
|
|
583
583
|
return React.createElement(FixSizeItem, {
|
|
584
584
|
"data-test": "fix-size-item",
|
|
585
|
-
"data-splunk-visualization-version": "24.5.
|
|
585
|
+
"data-splunk-visualization-version": "24.5.3 - 3129e19a7",
|
|
586
586
|
width: width,
|
|
587
587
|
height: height,
|
|
588
588
|
backgroundColor: backgroundColor
|
|
@@ -1555,7 +1555,7 @@ var Cover = styled_components_1.default.div.withConfig({
|
|
|
1555
1555
|
componentId: "sc-1gsbnxb-0"
|
|
1556
1556
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
1557
1557
|
var Blocker = styled_components_1.default.div.attrs({
|
|
1558
|
-
'data-splunk-visualization-version': "24.5.
|
|
1558
|
+
'data-splunk-visualization-version': "24.5.3 - 3129e19a7"
|
|
1559
1559
|
}).withConfig({
|
|
1560
1560
|
displayName: "withEditModeCover__Blocker",
|
|
1561
1561
|
componentId: "sc-1gsbnxb-1"
|
package/Bubble.js
CHANGED
|
@@ -582,7 +582,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
582
582
|
|
|
583
583
|
return React.createElement(FixSizeItem, {
|
|
584
584
|
"data-test": "fix-size-item",
|
|
585
|
-
"data-splunk-visualization-version": "24.5.
|
|
585
|
+
"data-splunk-visualization-version": "24.5.3 - 3129e19a7",
|
|
586
586
|
width: width,
|
|
587
587
|
height: height,
|
|
588
588
|
backgroundColor: backgroundColor
|
|
@@ -1555,7 +1555,7 @@ var Cover = styled_components_1.default.div.withConfig({
|
|
|
1555
1555
|
componentId: "sc-1gsbnxb-0"
|
|
1556
1556
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
1557
1557
|
var Blocker = styled_components_1.default.div.attrs({
|
|
1558
|
-
'data-splunk-visualization-version': "24.5.
|
|
1558
|
+
'data-splunk-visualization-version': "24.5.3 - 3129e19a7"
|
|
1559
1559
|
}).withConfig({
|
|
1560
1560
|
displayName: "withEditModeCover__Blocker",
|
|
1561
1561
|
componentId: "sc-1gsbnxb-1"
|
package/ChoroplethSvg.js
CHANGED
|
@@ -582,7 +582,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
582
582
|
|
|
583
583
|
return React.createElement(FixSizeItem, {
|
|
584
584
|
"data-test": "fix-size-item",
|
|
585
|
-
"data-splunk-visualization-version": "24.5.
|
|
585
|
+
"data-splunk-visualization-version": "24.5.3 - 3129e19a7",
|
|
586
586
|
width: width,
|
|
587
587
|
height: height,
|
|
588
588
|
backgroundColor: backgroundColor
|
|
@@ -1550,7 +1550,7 @@ var Cover = styled_components_1.default.div.withConfig({
|
|
|
1550
1550
|
componentId: "sc-1gsbnxb-0"
|
|
1551
1551
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
1552
1552
|
var Blocker = styled_components_1.default.div.attrs({
|
|
1553
|
-
'data-splunk-visualization-version': "24.5.
|
|
1553
|
+
'data-splunk-visualization-version': "24.5.3 - 3129e19a7"
|
|
1554
1554
|
}).withConfig({
|
|
1555
1555
|
displayName: "withEditModeCover__Blocker",
|
|
1556
1556
|
componentId: "sc-1gsbnxb-1"
|
package/Column.js
CHANGED
|
@@ -582,7 +582,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
582
582
|
|
|
583
583
|
return React.createElement(FixSizeItem, {
|
|
584
584
|
"data-test": "fix-size-item",
|
|
585
|
-
"data-splunk-visualization-version": "24.5.
|
|
585
|
+
"data-splunk-visualization-version": "24.5.3 - 3129e19a7",
|
|
586
586
|
width: width,
|
|
587
587
|
height: height,
|
|
588
588
|
backgroundColor: backgroundColor
|
|
@@ -1555,7 +1555,7 @@ var Cover = styled_components_1.default.div.withConfig({
|
|
|
1555
1555
|
componentId: "sc-1gsbnxb-0"
|
|
1556
1556
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
1557
1557
|
var Blocker = styled_components_1.default.div.attrs({
|
|
1558
|
-
'data-splunk-visualization-version': "24.5.
|
|
1558
|
+
'data-splunk-visualization-version': "24.5.3 - 3129e19a7"
|
|
1559
1559
|
}).withConfig({
|
|
1560
1560
|
displayName: "withEditModeCover__Blocker",
|
|
1561
1561
|
componentId: "sc-1gsbnxb-1"
|
package/Ellipse.js
CHANGED
|
@@ -582,7 +582,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
582
582
|
|
|
583
583
|
return React.createElement(FixSizeItem, {
|
|
584
584
|
"data-test": "fix-size-item",
|
|
585
|
-
"data-splunk-visualization-version": "24.5.
|
|
585
|
+
"data-splunk-visualization-version": "24.5.3 - 3129e19a7",
|
|
586
586
|
width: width,
|
|
587
587
|
height: height,
|
|
588
588
|
backgroundColor: backgroundColor
|
|
@@ -1555,7 +1555,7 @@ var Cover = styled_components_1.default.div.withConfig({
|
|
|
1555
1555
|
componentId: "sc-1gsbnxb-0"
|
|
1556
1556
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
1557
1557
|
var Blocker = styled_components_1.default.div.attrs({
|
|
1558
|
-
'data-splunk-visualization-version': "24.5.
|
|
1558
|
+
'data-splunk-visualization-version': "24.5.3 - 3129e19a7"
|
|
1559
1559
|
}).withConfig({
|
|
1560
1560
|
displayName: "withEditModeCover__Blocker",
|
|
1561
1561
|
componentId: "sc-1gsbnxb-1"
|
package/FillerGauge.js
CHANGED
|
@@ -582,7 +582,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
582
582
|
|
|
583
583
|
return React.createElement(FixSizeItem, {
|
|
584
584
|
"data-test": "fix-size-item",
|
|
585
|
-
"data-splunk-visualization-version": "24.5.
|
|
585
|
+
"data-splunk-visualization-version": "24.5.3 - 3129e19a7",
|
|
586
586
|
width: width,
|
|
587
587
|
height: height,
|
|
588
588
|
backgroundColor: backgroundColor
|
|
@@ -1555,7 +1555,7 @@ var Cover = styled_components_1.default.div.withConfig({
|
|
|
1555
1555
|
componentId: "sc-1gsbnxb-0"
|
|
1556
1556
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
1557
1557
|
var Blocker = styled_components_1.default.div.attrs({
|
|
1558
|
-
'data-splunk-visualization-version': "24.5.
|
|
1558
|
+
'data-splunk-visualization-version': "24.5.3 - 3129e19a7"
|
|
1559
1559
|
}).withConfig({
|
|
1560
1560
|
displayName: "withEditModeCover__Blocker",
|
|
1561
1561
|
componentId: "sc-1gsbnxb-1"
|
package/Image.js
CHANGED
|
@@ -390,7 +390,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
390
390
|
|
|
391
391
|
return React.createElement(FixSizeItem, {
|
|
392
392
|
"data-test": "fix-size-item",
|
|
393
|
-
"data-splunk-visualization-version": "24.5.
|
|
393
|
+
"data-splunk-visualization-version": "24.5.3 - 3129e19a7",
|
|
394
394
|
width: width,
|
|
395
395
|
height: height,
|
|
396
396
|
backgroundColor: backgroundColor
|
|
@@ -1591,7 +1591,7 @@ var Cover = styled_components_1.default.div.withConfig({
|
|
|
1591
1591
|
componentId: "sc-1gsbnxb-0"
|
|
1592
1592
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
1593
1593
|
var Blocker = styled_components_1.default.div.attrs({
|
|
1594
|
-
'data-splunk-visualization-version': "24.5.
|
|
1594
|
+
'data-splunk-visualization-version': "24.5.3 - 3129e19a7"
|
|
1595
1595
|
}).withConfig({
|
|
1596
1596
|
displayName: "withEditModeCover__Blocker",
|
|
1597
1597
|
componentId: "sc-1gsbnxb-1"
|
package/Line.js
CHANGED
|
@@ -582,7 +582,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
582
582
|
|
|
583
583
|
return React.createElement(FixSizeItem, {
|
|
584
584
|
"data-test": "fix-size-item",
|
|
585
|
-
"data-splunk-visualization-version": "24.5.
|
|
585
|
+
"data-splunk-visualization-version": "24.5.3 - 3129e19a7",
|
|
586
586
|
width: width,
|
|
587
587
|
height: height,
|
|
588
588
|
backgroundColor: backgroundColor
|
|
@@ -1555,7 +1555,7 @@ var Cover = styled_components_1.default.div.withConfig({
|
|
|
1555
1555
|
componentId: "sc-1gsbnxb-0"
|
|
1556
1556
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
1557
1557
|
var Blocker = styled_components_1.default.div.attrs({
|
|
1558
|
-
'data-splunk-visualization-version': "24.5.
|
|
1558
|
+
'data-splunk-visualization-version': "24.5.3 - 3129e19a7"
|
|
1559
1559
|
}).withConfig({
|
|
1560
1560
|
displayName: "withEditModeCover__Blocker",
|
|
1561
1561
|
componentId: "sc-1gsbnxb-1"
|
package/LinkGraph.js
CHANGED
|
@@ -582,7 +582,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
582
582
|
|
|
583
583
|
return React.createElement(FixSizeItem, {
|
|
584
584
|
"data-test": "fix-size-item",
|
|
585
|
-
"data-splunk-visualization-version": "24.5.
|
|
585
|
+
"data-splunk-visualization-version": "24.5.3 - 3129e19a7",
|
|
586
586
|
width: width,
|
|
587
587
|
height: height,
|
|
588
588
|
backgroundColor: backgroundColor
|
|
@@ -1550,7 +1550,7 @@ var Cover = styled_components_1.default.div.withConfig({
|
|
|
1550
1550
|
componentId: "sc-1gsbnxb-0"
|
|
1551
1551
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
1552
1552
|
var Blocker = styled_components_1.default.div.attrs({
|
|
1553
|
-
'data-splunk-visualization-version': "24.5.
|
|
1553
|
+
'data-splunk-visualization-version': "24.5.3 - 3129e19a7"
|
|
1554
1554
|
}).withConfig({
|
|
1555
1555
|
displayName: "withEditModeCover__Blocker",
|
|
1556
1556
|
componentId: "sc-1gsbnxb-1"
|
package/Map.js
CHANGED
|
@@ -582,7 +582,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
582
582
|
|
|
583
583
|
return React.createElement(FixSizeItem, {
|
|
584
584
|
"data-test": "fix-size-item",
|
|
585
|
-
"data-splunk-visualization-version": "24.5.
|
|
585
|
+
"data-splunk-visualization-version": "24.5.3 - 3129e19a7",
|
|
586
586
|
width: width,
|
|
587
587
|
height: height,
|
|
588
588
|
backgroundColor: backgroundColor
|
|
@@ -1545,7 +1545,7 @@ var Cover = styled_components_1.default.div.withConfig({
|
|
|
1545
1545
|
componentId: "sc-1gsbnxb-0"
|
|
1546
1546
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
1547
1547
|
var Blocker = styled_components_1.default.div.attrs({
|
|
1548
|
-
'data-splunk-visualization-version': "24.5.
|
|
1548
|
+
'data-splunk-visualization-version': "24.5.3 - 3129e19a7"
|
|
1549
1549
|
}).withConfig({
|
|
1550
1550
|
displayName: "withEditModeCover__Blocker",
|
|
1551
1551
|
componentId: "sc-1gsbnxb-1"
|
|
@@ -2372,8 +2372,6 @@ exports.default = MarkerWrapper;
|
|
|
2372
2372
|
"use strict";
|
|
2373
2373
|
|
|
2374
2374
|
|
|
2375
|
-
var _slicedToArray = __webpack_require__(51);
|
|
2376
|
-
|
|
2377
2375
|
var __rest = this && this.__rest || function (s, e) {
|
|
2378
2376
|
var t = {};
|
|
2379
2377
|
|
|
@@ -2390,7 +2388,7 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
2390
2388
|
Object.defineProperty(exports, "__esModule", {
|
|
2391
2389
|
value: true
|
|
2392
2390
|
});
|
|
2393
|
-
exports.PureMap = exports.config = exports.themes = exports.computeVizProps = exports.convertToArrOfObjects = void 0;
|
|
2391
|
+
exports.PureMap = exports.config = exports.themes = exports.useIconPlaceholder = exports.computeVizProps = exports.convertToArrOfObjects = void 0;
|
|
2394
2392
|
/* eslint-disable no-sequences */
|
|
2395
2393
|
|
|
2396
2394
|
var React = __webpack_require__(1);
|
|
@@ -2492,7 +2490,7 @@ exports.computeVizProps = computeVizProps;
|
|
|
2492
2490
|
|
|
2493
2491
|
var withTooltipFields = function withTooltipFields(Viz) {
|
|
2494
2492
|
var VizWithTooltipFields = function VizWithTooltipFields(_a) {
|
|
2495
|
-
var _b;
|
|
2493
|
+
var _b, _c, _d, _e;
|
|
2496
2494
|
|
|
2497
2495
|
var dataSources = _a.dataSources,
|
|
2498
2496
|
options = _a.options,
|
|
@@ -2504,42 +2502,29 @@ var withTooltipFields = function withTooltipFields(Viz) {
|
|
|
2504
2502
|
}));
|
|
2505
2503
|
}
|
|
2506
2504
|
|
|
2507
|
-
|
|
2508
|
-
options.layers.forEach(function (l) {
|
|
2509
|
-
var _a;
|
|
2510
|
-
|
|
2511
|
-
var layer = l;
|
|
2512
|
-
|
|
2513
|
-
if (layer.type === 'bubble') {
|
|
2514
|
-
var defaultOptions = JSONSchemaUtils_1.pickFieldFromJSONSchema(config_1.default.optionsSchema, 'default');
|
|
2515
|
-
|
|
2516
|
-
var _defaultOptions$layer = defaultOptions.layers.filter(function (_ref) {
|
|
2517
|
-
var type = _ref.type;
|
|
2518
|
-
return type === 'bubble';
|
|
2519
|
-
}),
|
|
2520
|
-
_defaultOptions$layer2 = _slicedToArray(_defaultOptions$layer, 1),
|
|
2521
|
-
defaultBubbleLayer = _defaultOptions$layer2[0];
|
|
2505
|
+
var mergedOptions = hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, JSONSchemaUtils_1.pickFieldFromJSONSchema(config_1.default.optionsSchema, 'default'));
|
|
2522
2506
|
|
|
2523
|
-
|
|
2524
|
-
|
|
2507
|
+
if ((_b = mergedOptions.layers) === null || _b === void 0 ? void 0 : _b[0]) {
|
|
2508
|
+
if (((_d = (_c = mergedOptions.layers) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.type) === 'bubble') {
|
|
2509
|
+
mergedOptions.layers[0].bubbleSizeFields = dsl_1.getFieldsFromDSL((_e = mergedOptions.layers[0].bubbleSize) !== null && _e !== void 0 ? _e : mergedOptions.layers[0].bubbleSize, dataSources);
|
|
2510
|
+
}
|
|
2525
2511
|
|
|
2526
|
-
|
|
2512
|
+
var fields = dataSources.primary.data.fields;
|
|
2527
2513
|
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
});
|
|
2514
|
+
if (Array.isArray(mergedOptions.layers[0].additionalTooltipFields) && Array.isArray(fields) && fields.length) {
|
|
2515
|
+
var _mergedOptions$layers = mergedOptions.layers[0].bubbleSizeFields,
|
|
2516
|
+
bubbleSizeFields = _mergedOptions$layers === void 0 ? [] : _mergedOptions$layers;
|
|
2517
|
+
mergedOptions.layers[0].additionalTooltipFields = mergedOptions.layers[0].additionalTooltipFields.filter(function (field) {
|
|
2518
|
+
return (typeof fields[0] === 'string' ? fields.includes(field) : fields.map(function (f) {
|
|
2519
|
+
return f.name;
|
|
2520
|
+
}).includes(field)) && !bubbleSizeFields.includes(field);
|
|
2521
|
+
});
|
|
2522
|
+
}
|
|
2538
2523
|
}
|
|
2539
2524
|
|
|
2540
2525
|
return React.createElement(Viz, Object.assign({
|
|
2541
2526
|
dataSources: dataSources,
|
|
2542
|
-
options:
|
|
2527
|
+
options: mergedOptions
|
|
2543
2528
|
}, otherProps));
|
|
2544
2529
|
};
|
|
2545
2530
|
|
|
@@ -2664,14 +2649,17 @@ var withNullToZeros = function withNullToZeros(Viz) {
|
|
|
2664
2649
|
return VizWithColumnsNullToZeros;
|
|
2665
2650
|
};
|
|
2666
2651
|
|
|
2652
|
+
function useIconPlaceholder(dataSources, loading) {
|
|
2653
|
+
return loading;
|
|
2654
|
+
}
|
|
2655
|
+
|
|
2656
|
+
exports.useIconPlaceholder = useIconPlaceholder;
|
|
2667
2657
|
var Map = withoutInternalFields(withTooltipFields(withNullToZeros(withDashboardViz_1.default({
|
|
2668
2658
|
ReactViz: PureMap_1.default,
|
|
2669
2659
|
vizConfig: config_1.default,
|
|
2670
2660
|
computeVizProps: exports.computeVizProps,
|
|
2671
2661
|
disableEditModeCover: true,
|
|
2672
|
-
useIconPlaceholder:
|
|
2673
|
-
return false;
|
|
2674
|
-
}
|
|
2662
|
+
useIconPlaceholder: useIconPlaceholder
|
|
2675
2663
|
}))));
|
|
2676
2664
|
var themes = config_1.default.themes;
|
|
2677
2665
|
exports.themes = themes;
|
|
@@ -2784,7 +2772,8 @@ var PureMap = function PureMap(props) {
|
|
|
2784
2772
|
}
|
|
2785
2773
|
|
|
2786
2774
|
return [center[1], center[0]];
|
|
2787
|
-
}, [center]); //
|
|
2775
|
+
}, [center]); // TODO: take out zoomLevel to use zoom instead (set prop zoom = DEFAULT_ZOOM)
|
|
2776
|
+
// Assign default zoom when no zoom is defined
|
|
2788
2777
|
|
|
2789
2778
|
var zoomLevel = react_1.useMemo(function () {
|
|
2790
2779
|
if (zoom === undefined) {
|
|
@@ -2822,23 +2811,25 @@ var PureMap = function PureMap(props) {
|
|
|
2822
2811
|
setTimeout(function () {
|
|
2823
2812
|
return onMapLoad();
|
|
2824
2813
|
}, 500);
|
|
2825
|
-
});
|
|
2826
|
-
map.current.on('zoomend', function () {
|
|
2827
|
-
setCurrentZoomLevel(map.current.getZoom());
|
|
2828
|
-
}); // drag
|
|
2814
|
+
}); // register event listener - drag
|
|
2829
2815
|
|
|
2830
2816
|
map.current.on('dragend', function () {
|
|
2831
2817
|
var newCenter = map.current.getCenter();
|
|
2832
2818
|
onOptionsChange({
|
|
2833
2819
|
center: [newCenter.lat, newCenter.lng]
|
|
2834
2820
|
});
|
|
2835
|
-
}); // zoom
|
|
2821
|
+
}); // register event listener - zoom
|
|
2836
2822
|
|
|
2837
2823
|
map.current.on('zoomend', function () {
|
|
2824
|
+
setCurrentZoomLevel(map.current.getZoom()); // when zooming with mouse/track pad,
|
|
2825
|
+
// zooming centers at the cursor position, need to update center as well
|
|
2826
|
+
|
|
2827
|
+
var newCenter = map.current.getCenter();
|
|
2838
2828
|
onOptionsChange({
|
|
2829
|
+
center: [newCenter.lat, newCenter.lng],
|
|
2839
2830
|
zoom: map.current.getZoom()
|
|
2840
2831
|
});
|
|
2841
|
-
}); // zoom
|
|
2832
|
+
}); // add zoom control
|
|
2842
2833
|
|
|
2843
2834
|
zoomControl.current = new maplibre_gl_1.NavigationControl({
|
|
2844
2835
|
showCompass: false
|
|
@@ -2907,7 +2898,7 @@ var PureMap = function PureMap(props) {
|
|
|
2907
2898
|
zoom: zoomLevel
|
|
2908
2899
|
});
|
|
2909
2900
|
}
|
|
2910
|
-
}, [lngLatCenter,
|
|
2901
|
+
}, [lngLatCenter, zoomLevel]);
|
|
2911
2902
|
react_1.useEffect(function () {
|
|
2912
2903
|
return function () {
|
|
2913
2904
|
if (map.current) {
|