@dynatrace/strato-geo 1.0.3 → 1.2.1
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/esm/index.js.map +2 -2
- package/esm/map/MapView.js +14 -10
- package/esm/map/MapView.js.map +2 -2
- package/esm/map/components/BubbleLayer/BubbleCircleLayer.js +6 -6
- package/esm/map/components/BubbleLayer/BubbleCircleLayer.js.map +2 -2
- package/esm/map/components/BubbleLayer/BubbleLayer.js +1 -1
- package/esm/map/components/BubbleLayer/BubbleLayer.js.map +2 -2
- package/esm/map/components/BubbleLayer/BubbleOutlineLayer.js +1 -1
- package/esm/map/components/BubbleLayer/BubbleOutlineLayer.js.map +2 -2
- package/esm/map/components/BubbleLayer/utils/parse-bubble-data-to-geo-json.js.map +2 -2
- package/esm/map/components/ChoroplethLayer/ChoroplethLayer.js +47 -24
- package/esm/map/components/ChoroplethLayer/ChoroplethLayer.js.map +2 -2
- package/esm/map/components/ChoroplethLayer/utils/parse-region-data-to-geo-json.js +2 -1
- package/esm/map/components/ChoroplethLayer/utils/parse-region-data-to-geo-json.js.map +2 -2
- package/esm/map/components/ConnectionLayer/ConnectionLayer.js +30 -48
- package/esm/map/components/ConnectionLayer/ConnectionLayer.js.map +2 -2
- package/esm/map/components/ConnectionLayer/ConnectionLayerDirection.js +10 -3
- package/esm/map/components/ConnectionLayer/ConnectionLayerDirection.js.map +2 -2
- package/esm/map/components/ConnectionLayer/ConnectionLayerLine.js +44 -0
- package/esm/map/components/ConnectionLayer/ConnectionLayerLine.js.map +7 -0
- package/esm/map/components/ConnectionLayer/utils/{get-arc-line-features.js → get-arc-line-feature.js} +4 -8
- package/esm/map/components/ConnectionLayer/utils/{get-arc-line-features.js.map → get-arc-line-feature.js.map} +3 -3
- package/esm/map/components/ConnectionLayer/utils/get-straight-line-feature.js +11 -0
- package/esm/map/components/ConnectionLayer/utils/get-straight-line-feature.js.map +7 -0
- package/esm/map/components/ConnectionLayer/utils/parse-connection-data-to-geo-json.js +24 -19
- package/esm/map/components/ConnectionLayer/utils/parse-connection-data-to-geo-json.js.map +2 -2
- package/esm/map/components/ConnectionLayer/utils/parse-direction-data-to-geo-json.js.map +1 -1
- package/esm/map/components/DotLayer/BackgroundLayer.js +1 -1
- package/esm/map/components/DotLayer/BackgroundLayer.js.map +2 -2
- package/esm/map/components/DotLayer/DotLayer.js +5 -5
- package/esm/map/components/DotLayer/DotLayer.js.map +2 -2
- package/esm/map/components/DotLayer/utils/parse-dot-data-to-geo-json.js.map +2 -2
- package/esm/map/components/MapContent.js +33 -7
- package/esm/map/components/MapContent.js.map +2 -2
- package/esm/map/components/MapUnavailable.js +2 -2
- package/esm/map/components/MapUnavailable.js.map +2 -2
- package/esm/map/components/toolbar/buttons/MapResetButton.js +1 -1
- package/esm/map/components/toolbar/buttons/MapResetButton.js.map +2 -2
- package/esm/map/components/toolbar/buttons/MapZoomInOutButtons.js +1 -1
- package/esm/map/components/toolbar/buttons/MapZoomInOutButtons.js.map +2 -2
- package/esm/map/components/toolbar/buttons/MapZoomToFitButton.js +1 -1
- package/esm/map/components/toolbar/buttons/MapZoomToFitButton.js.map +2 -2
- package/esm/map/constants.js +23 -17
- package/esm/map/constants.js.map +2 -2
- package/esm/map/contexts/map-data-bounding-box.context.js +2 -2
- package/esm/map/contexts/map-data-bounding-box.context.js.map +2 -2
- package/esm/map/hooks/use-active-interaction.js +14 -1
- package/esm/map/hooks/use-active-interaction.js.map +2 -2
- package/esm/map/hooks/use-attach-image-from-icon.js +4 -1
- package/esm/map/hooks/use-attach-image-from-icon.js.map +2 -2
- package/esm/map/hooks/use-attach-symbol-to-map.js +2 -2
- package/esm/map/hooks/use-attach-symbol-to-map.js.map +2 -2
- package/esm/map/hooks/use-hover-interaction.js +1 -1
- package/esm/map/hooks/use-hover-interaction.js.map +2 -2
- package/esm/map/hooks/use-legend-interaction-highlighting.js +30 -1
- package/esm/map/hooks/use-legend-interaction-highlighting.js.map +2 -2
- package/esm/map/hooks/use-legend-interaction-visibility.js +10 -1
- package/esm/map/hooks/use-legend-interaction-visibility.js.map +2 -2
- package/esm/map/hooks/use-load-map-base-layer.js +4 -4
- package/esm/map/hooks/use-load-map-base-layer.js.map +2 -2
- package/esm/map/hooks/use-map-mouse-move.js +1 -1
- package/esm/map/hooks/use-map-mouse-move.js.map +2 -2
- package/esm/map/hooks/use-resolve-color.js +4 -0
- package/esm/map/hooks/use-resolve-color.js.map +2 -2
- package/esm/map/providers/imperative-handler.provider.js +1 -1
- package/esm/map/providers/imperative-handler.provider.js.map +2 -2
- package/esm/map/providers/map-initial-view.provider.js +1 -1
- package/esm/map/providers/map-initial-view.provider.js.map +2 -2
- package/esm/map/slots/BaseLayer.js.map +2 -2
- package/esm/map/slots/BubbleLayer.js.map +2 -2
- package/esm/map/slots/CategoricalLegend.js.map +2 -2
- package/esm/map/slots/ChartInteractions.js +3 -3
- package/esm/map/slots/ChartInteractions.js.map +2 -2
- package/esm/map/slots/ChoroplethLayer.js.map +2 -2
- package/esm/map/slots/ConnectionLayer.js.map +2 -2
- package/esm/map/slots/DotLayer.js.map +2 -2
- package/esm/map/slots/SequentialLegend.js.map +2 -2
- package/esm/map/slots/ThresholdLegend.js.map +2 -2
- package/esm/map/slots/states/ErrorStateSlot.js.map +2 -2
- package/esm/map/types/bubble-layer.js.map +2 -2
- package/esm/map/types/coloring.js.map +2 -2
- package/esm/map/utils/attach-image-from-shape.js +3 -0
- package/esm/map/utils/attach-image-from-shape.js.map +2 -2
- package/esm/map/utils/attach-image-from-string.js.map +1 -1
- package/esm/map/utils/attach-image-from-text.js.map +1 -1
- package/esm/map/utils/attach-image-to-map.js +12 -5
- package/esm/map/utils/attach-image-to-map.js.map +2 -2
- package/esm/map/utils/build-scale-from-legend-config.js +5 -1
- package/esm/map/utils/build-scale-from-legend-config.js.map +2 -2
- package/esm/map/utils/create-categorical-color-scheme-from-custom-color-object.js +17 -0
- package/esm/map/utils/create-categorical-color-scheme-from-custom-color-object.js.map +7 -0
- package/esm/map/utils/extract-layers-data.js +50 -13
- package/esm/map/utils/extract-layers-data.js.map +2 -2
- package/esm/map/utils/iterate-config-slots.js +4 -2
- package/esm/map/utils/iterate-config-slots.js.map +2 -2
- package/esm/map/utils/set-layers-id.js +12 -4
- package/esm/map/utils/set-layers-id.js.map +2 -2
- package/esm/map/utils/tooltip-type-guards.js +1 -1
- package/esm/map/utils/tooltip-type-guards.js.map +2 -2
- package/esm/map/utils/use-set-map-initial-configuration.js.map +2 -2
- package/index.d.ts +2 -2
- package/map/MapView.d.ts +1 -1
- package/map/MapView.js +13 -9
- package/map/components/BubbleLayer/BubbleCircleLayer.js +5 -5
- package/map/components/BubbleLayer/BubbleLayer.js +2 -2
- package/map/components/BubbleLayer/BubbleOutlineLayer.js +2 -2
- package/map/components/BubbleLayer/utils/parse-bubble-data-to-geo-json.d.ts +2 -18
- package/map/components/ChoroplethLayer/ChoroplethLayer.d.ts +1 -1
- package/map/components/ChoroplethLayer/ChoroplethLayer.js +42 -22
- package/map/components/ChoroplethLayer/utils/parse-region-data-to-geo-json.js +2 -1
- package/map/components/ConnectionLayer/ConnectionLayer.d.ts +2 -2
- package/map/components/ConnectionLayer/ConnectionLayer.js +29 -41
- package/map/components/ConnectionLayer/ConnectionLayerDirection.d.ts +1 -1
- package/map/components/ConnectionLayer/ConnectionLayerDirection.js +9 -4
- package/map/components/ConnectionLayer/ConnectionLayerLine.d.ts +12 -0
- package/map/components/ConnectionLayer/ConnectionLayerLine.js +66 -0
- package/map/components/ConnectionLayer/utils/{get-arc-line-features.d.ts → get-arc-line-feature.d.ts} +1 -1
- package/map/components/ConnectionLayer/utils/{get-arc-line-features.js → get-arc-line-feature.js} +6 -10
- package/map/components/ConnectionLayer/utils/{get-straight-line-features.d.ts → get-straight-line-feature.d.ts} +1 -1
- package/map/components/ConnectionLayer/utils/{get-straight-line-features.js → get-straight-line-feature.js} +6 -7
- package/map/components/ConnectionLayer/utils/parse-connection-data-to-geo-json.d.ts +1 -1
- package/map/components/ConnectionLayer/utils/parse-connection-data-to-geo-json.js +24 -19
- package/map/components/ConnectionLayer/utils/parse-direction-data-to-geo-json.d.ts +1 -1
- package/map/components/DotLayer/BackgroundLayer.js +2 -2
- package/map/components/DotLayer/DotLayer.js +5 -5
- package/map/components/DotLayer/utils/parse-dot-data-to-geo-json.d.ts +2 -19
- package/map/components/MapContent.d.ts +5 -1
- package/map/components/MapContent.js +28 -8
- package/map/components/MapUnavailable.d.ts +2 -2
- package/map/components/MapUnavailable.js +2 -2
- package/map/components/toolbar/buttons/MapResetButton.js +2 -2
- package/map/components/toolbar/buttons/MapZoomInOutButtons.js +2 -2
- package/map/components/toolbar/buttons/MapZoomToFitButton.js +2 -2
- package/map/constants.d.ts +13 -10
- package/map/constants.js +23 -17
- package/map/contexts/map-data-bounding-box.context.js +1 -1
- package/map/hooks/use-active-interaction.js +15 -2
- package/map/hooks/use-attach-image-from-icon.js +5 -2
- package/map/hooks/use-attach-symbol-to-map.js +2 -2
- package/map/hooks/use-hover-interaction.js +2 -2
- package/map/hooks/use-legend-interaction-highlighting.d.ts +2 -1
- package/map/hooks/use-legend-interaction-highlighting.js +31 -2
- package/map/hooks/use-legend-interaction-visibility.d.ts +2 -1
- package/map/hooks/use-legend-interaction-visibility.js +11 -2
- package/map/hooks/use-load-map-base-layer.d.ts +1 -1
- package/map/hooks/use-load-map-base-layer.js +4 -4
- package/map/hooks/use-map-mouse-move.js +2 -2
- package/map/hooks/use-resolve-color.d.ts +4 -2
- package/map/hooks/use-resolve-color.js +4 -0
- package/map/providers/imperative-handler.provider.js +2 -2
- package/map/providers/map-initial-view.provider.js +2 -2
- package/map/slots/BaseLayer.d.ts +4 -1
- package/map/slots/BubbleLayer.d.ts +1 -0
- package/map/slots/CategoricalLegend.d.ts +4 -1
- package/map/slots/ChartInteractions.d.ts +4 -1
- package/map/slots/ChartInteractions.js +3 -3
- package/map/slots/ChoroplethLayer.d.ts +1 -0
- package/map/slots/ConnectionLayer.d.ts +2 -1
- package/map/slots/DotLayer.d.ts +1 -0
- package/map/slots/SequentialLegend.d.ts +4 -1
- package/map/slots/ThresholdLegend.d.ts +4 -1
- package/map/slots/states/ErrorStateSlot.d.ts +6 -0
- package/map/types/base-layer.d.ts +4 -0
- package/map/types/bubble-layer.d.ts +4 -0
- package/map/types/choropleth-layer.d.ts +2 -0
- package/map/types/coloring.d.ts +16 -0
- package/map/types/connection-layer.d.ts +11 -7
- package/map/types/dot-layer.d.ts +2 -0
- package/map/types/legend.d.ts +18 -6
- package/map/types/location.d.ts +4 -1
- package/map/types/map-view.d.ts +10 -1
- package/map/types/shapes.d.ts +5 -1
- package/map/types/toolbar.d.ts +4 -1
- package/map/types/tooltip.d.ts +16 -1
- package/map/utils/attach-image-from-shape.d.ts +1 -1
- package/map/utils/attach-image-from-shape.js +3 -0
- package/map/utils/attach-image-from-string.d.ts +1 -1
- package/map/utils/attach-image-from-text.d.ts +1 -1
- package/map/utils/attach-image-to-map.d.ts +1 -1
- package/map/utils/attach-image-to-map.js +12 -5
- package/map/utils/build-scale-from-legend-config.js +5 -1
- package/map/utils/create-categorical-color-scheme-from-custom-color-object.d.ts +5 -0
- package/map/utils/create-categorical-color-scheme-from-custom-color-object.js +35 -0
- package/map/utils/extract-layers-data.d.ts +3 -2
- package/map/utils/extract-layers-data.js +50 -13
- package/map/utils/iterate-config-slots.d.ts +2 -1
- package/map/utils/iterate-config-slots.js +4 -2
- package/map/utils/set-layers-id.d.ts +1 -1
- package/map/utils/set-layers-id.js +12 -4
- package/map/utils/tooltip-type-guards.js +1 -1
- package/map/utils/use-set-map-initial-configuration.d.ts +1 -1
- package/package.json +8 -9
- package/esm/map/components/ConnectionLayer/utils/get-straight-line-features.js +0 -12
- package/esm/map/components/ConnectionLayer/utils/get-straight-line-features.js.map +0 -7
|
@@ -3,6 +3,7 @@ import type { MapConfig } from '../types/configuration.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Generate map config based on slots
|
|
5
5
|
* @param children - Map children
|
|
6
|
+
* @param legendDomain - Domain containing min and max value relevant for legend
|
|
6
7
|
* @returns Map slot config
|
|
7
8
|
*/
|
|
8
|
-
export declare const iterateConfigSlots: (children: React.ReactNode) => MapConfig;
|
|
9
|
+
export declare const iterateConfigSlots: (children: React.ReactNode, legendDomain: [number, number]) => MapConfig;
|
|
@@ -39,7 +39,7 @@ var import_CategoricalLegend = require("../slots/CategoricalLegend.js");
|
|
|
39
39
|
var import_ChartInteractions = require("../slots/ChartInteractions.js");
|
|
40
40
|
var import_SequentialLegend = require("../slots/SequentialLegend.js");
|
|
41
41
|
var import_ThresholdLegend = require("../slots/ThresholdLegend.js");
|
|
42
|
-
const iterateConfigSlots = (children) => {
|
|
42
|
+
const iterateConfigSlots = (children, legendDomain) => {
|
|
43
43
|
let slots = {
|
|
44
44
|
toolbar: void 0,
|
|
45
45
|
interactions: void 0,
|
|
@@ -82,7 +82,9 @@ const iterateConfigSlots = (children) => {
|
|
|
82
82
|
colorPalette: import_constants.DEFAULT_SEQUENTIAL_LEGEND_COLOR_PALETTE,
|
|
83
83
|
position: import_constants.DEFAULT_MAP_POSITION,
|
|
84
84
|
ratio: import_constants.DEFAULT_MAP_LEGEND_RATIO,
|
|
85
|
-
...legend
|
|
85
|
+
...legend,
|
|
86
|
+
min: legend.min ?? legendDomain[0],
|
|
87
|
+
max: legend.max ?? legendDomain[1]
|
|
86
88
|
}
|
|
87
89
|
};
|
|
88
90
|
break;
|
|
@@ -30,6 +30,7 @@ __export(set_layers_id_exports, {
|
|
|
30
30
|
setLayersId: () => setLayersId
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(set_layers_id_exports);
|
|
33
|
+
var import_lodash_es = require("lodash");
|
|
33
34
|
var import_react = __toESM(require("react"));
|
|
34
35
|
var import_react_is = require("react-is");
|
|
35
36
|
var import_BubbleLayer = require("../components/BubbleLayer/BubbleLayer.js");
|
|
@@ -40,6 +41,12 @@ var import_BubbleLayer2 = require("../slots/BubbleLayer.js");
|
|
|
40
41
|
var import_ChoroplethLayer2 = require("../slots/ChoroplethLayer.js");
|
|
41
42
|
var import_ConnectionLayer2 = require("../slots/ConnectionLayer.js");
|
|
42
43
|
var import_DotLayer2 = require("../slots/DotLayer.js");
|
|
44
|
+
const sanitizeData = (child, key) => {
|
|
45
|
+
return child.props.data.filter((datapoint) => {
|
|
46
|
+
const value = datapoint[key];
|
|
47
|
+
return !(value === null || (0, import_lodash_es.isUndefined)(value));
|
|
48
|
+
});
|
|
49
|
+
};
|
|
43
50
|
const layers = new WeakMap([
|
|
44
51
|
[import_BubbleLayer2.BubbleLayer, { component: import_BubbleLayer.BubbleLayer, prefix: "bubble" }],
|
|
45
52
|
[import_DotLayer2.DotLayer, { component: import_DotLayer.DotLayer, prefix: "dot" }],
|
|
@@ -49,7 +56,7 @@ const layers = new WeakMap([
|
|
|
49
56
|
const setLayersId = (children) => {
|
|
50
57
|
const layerIds = [];
|
|
51
58
|
let index = 0;
|
|
52
|
-
|
|
59
|
+
const valueAccessors = /* @__PURE__ */ new Map();
|
|
53
60
|
const parsedChildren = import_react.default.Children.map(children, (child) => {
|
|
54
61
|
if ((0, import_react_is.isElement)(child)) {
|
|
55
62
|
switch (child.type) {
|
|
@@ -58,14 +65,15 @@ const setLayersId = (children) => {
|
|
|
58
65
|
case import_ChoroplethLayer2.ChoroplethLayer:
|
|
59
66
|
case import_DotLayer2.DotLayer: {
|
|
60
67
|
const layer = layers.get(child.type);
|
|
68
|
+
const layerId = `${layer?.prefix}-${index}`;
|
|
61
69
|
if (child.props.color === "legend" && child.props.valueAccessor) {
|
|
62
|
-
|
|
70
|
+
valueAccessors.set(layerId, child.props.valueAccessor);
|
|
63
71
|
}
|
|
64
|
-
const layerId = `${layer?.prefix}-${index}`;
|
|
65
72
|
index += 1;
|
|
66
73
|
layerIds.push(layerId);
|
|
67
74
|
const newProps = {
|
|
68
75
|
...child.props,
|
|
76
|
+
data: valueAccessors.get(layerId) ? sanitizeData(child, valueAccessors.get(layerId)) : child.props.data,
|
|
69
77
|
layerId
|
|
70
78
|
};
|
|
71
79
|
return {
|
|
@@ -82,5 +90,5 @@ const setLayersId = (children) => {
|
|
|
82
90
|
}
|
|
83
91
|
return child;
|
|
84
92
|
});
|
|
85
|
-
return { layerIds, parsedChildren,
|
|
93
|
+
return { layerIds, parsedChildren, valueAccessors };
|
|
86
94
|
};
|
|
@@ -33,5 +33,5 @@ const isDotTooltipTemplate = (template) => typeof template === typeof import_Dot
|
|
|
33
33
|
const isBubbleTooltipTemplate = (template) => typeof template === typeof import_BubbleLayerTooltip.BubbleLayerTooltip;
|
|
34
34
|
const isConnectionTooltipTemplate = (template) => typeof template === typeof import_ConnectionLayerTooltip.ConnectionLayerTooltip;
|
|
35
35
|
const isChoroplethTooltipTemplate = (template) => typeof template === typeof import_ChoroplethLayerTooltip.ChoroplethLayerTooltip;
|
|
36
|
-
const isConnection = (data) => "path" in data;
|
|
36
|
+
const isConnection = (data) => "path" in data.data;
|
|
37
37
|
const isRegion = (data) => "name" in data;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { MapRef } from 'react-
|
|
1
|
+
import { MapRef } from '@vis.gl/react-maplibre';
|
|
2
2
|
export declare const useSetMapInitialConfiguration: () => (mapRef: MapRef) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynatrace/strato-geo",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"lang": "lang/uncompiled",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"exports": {
|
|
15
15
|
".": {
|
|
16
16
|
"types": "./index.d.ts",
|
|
17
|
+
"require": "./index.js",
|
|
17
18
|
"browser": "./esm/index.js",
|
|
18
19
|
"module": "./esm/index.js",
|
|
19
|
-
"import": "./esm/index.js"
|
|
20
|
-
"require": "./index.js"
|
|
20
|
+
"import": "./esm/index.js"
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
@@ -36,9 +36,8 @@
|
|
|
36
36
|
"d3-array": "^3.2.4",
|
|
37
37
|
"d3-interpolate": "^3.0.1",
|
|
38
38
|
"d3-scale": "^4.0.2",
|
|
39
|
-
"
|
|
40
|
-
"maplibre
|
|
41
|
-
"react-map-gl": "^7.1.7"
|
|
39
|
+
"maplibre-gl": "^5.0.0",
|
|
40
|
+
"@vis.gl/react-maplibre": "^8.0.0"
|
|
42
41
|
},
|
|
43
42
|
"peerDependencies": {
|
|
44
43
|
"@dynatrace-sdk/client-classic-environment-v2": "^3.6.1",
|
|
@@ -48,10 +47,10 @@
|
|
|
48
47
|
"react-dom": "^18.0.0",
|
|
49
48
|
"react-intl": "^6.0.8",
|
|
50
49
|
"react-is": "^18.0.0",
|
|
51
|
-
"@dynatrace/strato-components": "^1.
|
|
52
|
-
"@dynatrace/strato-components-preview": "^1.
|
|
50
|
+
"@dynatrace/strato-components": "^1.2.0",
|
|
51
|
+
"@dynatrace/strato-components-preview": "^1.2.1",
|
|
53
52
|
"@dynatrace/strato-design-tokens": "^1.0.0",
|
|
54
|
-
"@dynatrace/strato-icons": "^1.
|
|
53
|
+
"@dynatrace/strato-icons": "^1.1.0"
|
|
55
54
|
},
|
|
56
55
|
"sideEffects": [
|
|
57
56
|
"./map/styles/react-mapgl-styles.css",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { lineString as turfLineString } from "@turf/helpers";
|
|
2
|
-
const getStraightLineFeatures = (path, featureProperties) => {
|
|
3
|
-
const coordinates = path.map((coord) => [coord.longitude, coord.latitude]);
|
|
4
|
-
const feature = turfLineString(coordinates, {
|
|
5
|
-
...featureProperties
|
|
6
|
-
});
|
|
7
|
-
return [feature];
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
getStraightLineFeatures
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=get-straight-line-features.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/map/components/ConnectionLayer/utils/get-straight-line-features.ts"],
|
|
4
|
-
"sourcesContent": ["import { lineString as turfLineString } from '@turf/helpers';\nimport type GeoJSON from 'geojson';\n\nimport type { FeatureProperties } from '../../../types/connection-layer.js';\nimport type { Location } from '../../../types/location.js';\n\nexport const getStraightLineFeatures = (\n path: Location[],\n featureProperties: FeatureProperties,\n): GeoJSON.Feature[] => {\n const coordinates = path.map((coord) => [coord.longitude, coord.latitude]);\n const feature = turfLineString(coordinates, {\n ...featureProperties,\n });\n\n return [feature];\n};\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,cAAc,sBAAsB;AAMtC,MAAM,0BAA0B,CACrC,MACA,sBACsB;AACtB,QAAM,cAAc,KAAK,IAAI,CAAC,UAAU,CAAC,MAAM,WAAW,MAAM,QAAQ,CAAC;AACzE,QAAM,UAAU,eAAe,aAAa;AAAA,IAC1C,GAAG;AAAA,EACL,CAAC;AAED,SAAO,CAAC,OAAO;AACjB;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|