@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
|
@@ -37,11 +37,12 @@ const parseRegionDataToGeoJSON = (mapSource, data, regionAccessor, color) => {
|
|
|
37
37
|
const regionColor = (0, import_define_color.defineColor)(color, item);
|
|
38
38
|
const canvasColor = (0, import_charts._getCanvasColor)(regionColor);
|
|
39
39
|
const hoveredColor = (0, import_calculate_hovered_color.calculateHoveredColor)(canvasColor);
|
|
40
|
-
const { name } = feature.properties;
|
|
40
|
+
const { name, region_type } = feature.properties;
|
|
41
41
|
const feat = {
|
|
42
42
|
...feature,
|
|
43
43
|
properties: {
|
|
44
44
|
name,
|
|
45
|
+
region_type,
|
|
45
46
|
data: item,
|
|
46
47
|
...item,
|
|
47
48
|
__color: canvasColor,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Connection, InternalConnectionLayerProps } from '../../types/connection-layer.js';
|
|
3
3
|
export declare const ConnectionLayer: {
|
|
4
|
-
<T extends Connection>(props: React.PropsWithChildren<InternalConnectionLayerProps<T>>): React.JSX.Element
|
|
4
|
+
<T extends Connection>(props: React.PropsWithChildren<InternalConnectionLayerProps<T>>): React.JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
@@ -31,12 +31,15 @@ __export(ConnectionLayer_exports, {
|
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(ConnectionLayer_exports);
|
|
33
33
|
var import_react = __toESM(require("react"));
|
|
34
|
-
var import_maplibre = require("react-map-gl/maplibre");
|
|
35
34
|
var import_ConnectionLayerDirection = require("./ConnectionLayerDirection.js");
|
|
35
|
+
var import_ConnectionLayerLine = require("./ConnectionLayerLine.js");
|
|
36
36
|
var import_ConnectionLayerTooltip = require("./ConnectionLayerTooltip.js");
|
|
37
|
-
var import_use_connection_layer_mouse_move = require("./hooks/use-connection-layer-mouse-move.js");
|
|
38
37
|
var import_parse_connection_data_to_geo_json = require("./utils/parse-connection-data-to-geo-json.js");
|
|
39
38
|
var import_constants = require("../../constants.js");
|
|
39
|
+
var import_use_layer_coloring_strategy = require("../../hooks/use-layer-coloring-strategy.js");
|
|
40
|
+
var import_use_legend_interaction_highlighting = require("../../hooks/use-legend-interaction-highlighting.js");
|
|
41
|
+
var import_use_legend_interaction_visibility = require("../../hooks/use-legend-interaction-visibility.js");
|
|
42
|
+
var import_use_resolve_color = require("../../hooks/use-resolve-color.js");
|
|
40
43
|
var import_use_tooltip_template = require("../../hooks/use-tooltip-template.js");
|
|
41
44
|
var import_ConnectionLayerTooltip2 = require("../../slots/ConnectionLayerTooltip.js");
|
|
42
45
|
var import_tooltip_type_guards = require("../../utils/tooltip-type-guards.js");
|
|
@@ -45,66 +48,51 @@ const ConnectionLayer = (props) => {
|
|
|
45
48
|
data,
|
|
46
49
|
layerId,
|
|
47
50
|
children,
|
|
48
|
-
color = import_constants.DEFAULT_LINE_COLOR,
|
|
49
51
|
curve,
|
|
50
52
|
directionIndicator,
|
|
51
53
|
line,
|
|
52
54
|
thickness = import_constants.DEFAULT_LINE_THICKNESS
|
|
53
55
|
} = props;
|
|
56
|
+
const colorParser = (0, import_use_layer_coloring_strategy.useLayerColoringStrategy)();
|
|
57
|
+
const connectionColor = (0, import_use_resolve_color.useResolveConnectionColor)(
|
|
58
|
+
import_constants.DEFAULT_LINE_COLOR,
|
|
59
|
+
props,
|
|
60
|
+
colorParser
|
|
61
|
+
);
|
|
54
62
|
const sourceId = `source-${layerId}`;
|
|
63
|
+
(0, import_use_legend_interaction_highlighting.useLegendInteractionHighlighting)(props, sourceId);
|
|
64
|
+
(0, import_use_legend_interaction_visibility.useLegendInteractionVisibility)(props, layerId);
|
|
55
65
|
const geoJsonData = (0, import_parse_connection_data_to_geo_json.parseConnectionDataToGeoJSON)(
|
|
56
66
|
data,
|
|
57
67
|
thickness,
|
|
58
|
-
|
|
68
|
+
connectionColor,
|
|
59
69
|
curve
|
|
60
70
|
);
|
|
61
71
|
const tooltipTemplate = (0, import_use_tooltip_template.useTooltipTemplate)(
|
|
62
72
|
children,
|
|
63
73
|
import_ConnectionLayerTooltip2.ConnectionLayerTooltip
|
|
64
74
|
);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
import_maplibre.Source,
|
|
75
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
76
|
+
import_ConnectionLayerLine.ConnectionLayerLine,
|
|
68
77
|
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
},
|
|
74
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
75
|
-
import_maplibre.Layer,
|
|
76
|
-
{
|
|
77
|
-
type: "line",
|
|
78
|
-
id: layerIds[index],
|
|
79
|
-
layout: {
|
|
80
|
-
"line-cap": import_constants.DEFAULT_LINE_CAP,
|
|
81
|
-
"line-join": import_constants.DEFAULT_LINE_JOIN
|
|
82
|
-
},
|
|
83
|
-
paint: {
|
|
84
|
-
"line-color": [
|
|
85
|
-
"case",
|
|
86
|
-
["boolean", ["feature-state", "hover"], false],
|
|
87
|
-
["get", "__lineHoveredColor"],
|
|
88
|
-
["get", "__lineColor"]
|
|
89
|
-
],
|
|
90
|
-
"line-width": ["get", "__lineWidth"],
|
|
91
|
-
...line && line === "dashed" ? { "line-dasharray": import_constants.DEFAULT_LINE_DASH_ARRAY } : null
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
)
|
|
95
|
-
), /* @__PURE__ */ import_react.default.createElement(
|
|
96
|
-
import_ConnectionLayerTooltip.ConnectionLayerTooltip,
|
|
97
|
-
{
|
|
98
|
-
layerId: layerIds[index],
|
|
99
|
-
tooltipTemplate: (0, import_tooltip_type_guards.isConnectionTooltipTemplate)(tooltipTemplate) ? tooltipTemplate : void 0
|
|
78
|
+
geoJsonData,
|
|
79
|
+
layerId,
|
|
80
|
+
sourceId,
|
|
81
|
+
line
|
|
100
82
|
}
|
|
101
83
|
), directionIndicator && /* @__PURE__ */ import_react.default.createElement(
|
|
102
84
|
import_ConnectionLayerDirection.ConnectionLayerDirection,
|
|
103
85
|
{
|
|
104
|
-
geoJsonData
|
|
105
|
-
layerId
|
|
86
|
+
geoJsonData,
|
|
87
|
+
layerId,
|
|
106
88
|
directionIndicator
|
|
107
89
|
}
|
|
108
|
-
)
|
|
90
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
91
|
+
import_ConnectionLayerTooltip.ConnectionLayerTooltip,
|
|
92
|
+
{
|
|
93
|
+
layerId,
|
|
94
|
+
tooltipTemplate: (0, import_tooltip_type_guards.isConnectionTooltipTemplate)(tooltipTemplate) ? tooltipTemplate : void 0
|
|
95
|
+
}
|
|
96
|
+
));
|
|
109
97
|
};
|
|
110
98
|
ConnectionLayer["displayName"] = "ConnectionLayer";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Connection, InternalConnectionLayerProps } from '../../types/connection-layer.js';
|
|
3
3
|
interface ConnectionLayerDirectionProps<T extends Connection> extends Required<Pick<InternalConnectionLayerProps<T>, 'layerId' | 'directionIndicator'>> {
|
|
4
4
|
geoJsonData: GeoJSON.FeatureCollection;
|
|
5
5
|
}
|
|
@@ -30,8 +30,8 @@ __export(ConnectionLayerDirection_exports, {
|
|
|
30
30
|
ConnectionLayerDirection: () => ConnectionLayerDirection
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(ConnectionLayerDirection_exports);
|
|
33
|
+
var import_react_maplibre = require("@vis.gl/react-maplibre");
|
|
33
34
|
var import_react = __toESM(require("react"));
|
|
34
|
-
var import_react_map_gl = require("react-map-gl");
|
|
35
35
|
var import_strato_icons = require("@dynatrace/strato-icons");
|
|
36
36
|
var import_parse_direction_data_to_geo_json = require("./utils/parse-direction-data-to-geo-json.js");
|
|
37
37
|
var import_constants = require("../../constants.js");
|
|
@@ -51,7 +51,7 @@ const ConnectionLayerDirection = (props) => {
|
|
|
51
51
|
});
|
|
52
52
|
const iconRotationDegrees = 180;
|
|
53
53
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
54
|
-
|
|
54
|
+
import_react_maplibre.Source,
|
|
55
55
|
{
|
|
56
56
|
id: sourceId,
|
|
57
57
|
type: "geojson",
|
|
@@ -59,7 +59,7 @@ const ConnectionLayerDirection = (props) => {
|
|
|
59
59
|
promoteId: "id"
|
|
60
60
|
},
|
|
61
61
|
/* @__PURE__ */ import_react.default.createElement(
|
|
62
|
-
|
|
62
|
+
import_react_maplibre.Layer,
|
|
63
63
|
{
|
|
64
64
|
id: layerId,
|
|
65
65
|
beforeId: connectionLayerId,
|
|
@@ -84,7 +84,12 @@ const ConnectionLayerDirection = (props) => {
|
|
|
84
84
|
["get", "__lineHoveredColor"],
|
|
85
85
|
["get", "__lineColor"]
|
|
86
86
|
],
|
|
87
|
-
"icon-opacity": [
|
|
87
|
+
"icon-opacity": [
|
|
88
|
+
"case",
|
|
89
|
+
["boolean", ["feature-state", "legendHover"], true],
|
|
90
|
+
import_constants.SHAPE_OPACITY_DEFAULT,
|
|
91
|
+
import_constants.SHAPE_OPACITY_DIMMED
|
|
92
|
+
]
|
|
88
93
|
}
|
|
89
94
|
}
|
|
90
95
|
)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Connection, InternalConnectionLayerProps } from '../../types/connection-layer.js';
|
|
3
|
+
interface ConnectionLayerLineProps<T extends Connection> extends Required<Pick<InternalConnectionLayerProps<T>, 'layerId'>> {
|
|
4
|
+
geoJsonData: GeoJSON.FeatureCollection;
|
|
5
|
+
sourceId: string;
|
|
6
|
+
line: 'dashed' | 'solid' | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare const ConnectionLayerLine: {
|
|
9
|
+
<T extends Connection>(props: ConnectionLayerLineProps<T>): React.JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var ConnectionLayerLine_exports = {};
|
|
29
|
+
__export(ConnectionLayerLine_exports, {
|
|
30
|
+
ConnectionLayerLine: () => ConnectionLayerLine
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(ConnectionLayerLine_exports);
|
|
33
|
+
var import_react_maplibre = require("@vis.gl/react-maplibre");
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
var import_constants = require("../../constants.js");
|
|
36
|
+
const ConnectionLayerLine = (props) => {
|
|
37
|
+
const { geoJsonData, layerId, sourceId, line } = props;
|
|
38
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react_maplibre.Source, { id: sourceId, type: "geojson", data: geoJsonData, promoteId: "id" }, /* @__PURE__ */ import_react.default.createElement(
|
|
39
|
+
import_react_maplibre.Layer,
|
|
40
|
+
{
|
|
41
|
+
type: "line",
|
|
42
|
+
id: layerId,
|
|
43
|
+
layout: {
|
|
44
|
+
"line-cap": import_constants.DEFAULT_LINE_CAP,
|
|
45
|
+
"line-join": import_constants.DEFAULT_LINE_JOIN
|
|
46
|
+
},
|
|
47
|
+
paint: {
|
|
48
|
+
"line-color": [
|
|
49
|
+
"case",
|
|
50
|
+
["boolean", ["feature-state", "hover"], false],
|
|
51
|
+
["get", "__lineHoveredColor"],
|
|
52
|
+
["get", "__lineColor"]
|
|
53
|
+
],
|
|
54
|
+
"line-opacity": [
|
|
55
|
+
"case",
|
|
56
|
+
["boolean", ["feature-state", "legendHover"], true],
|
|
57
|
+
import_constants.SHAPE_OPACITY_DEFAULT,
|
|
58
|
+
import_constants.SHAPE_OPACITY_DIMMED
|
|
59
|
+
],
|
|
60
|
+
"line-width": ["get", "__lineWidth"],
|
|
61
|
+
...line && line === "dashed" ? { "line-dasharray": import_constants.DEFAULT_LINE_DASH_ARRAY } : null
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
));
|
|
65
|
+
};
|
|
66
|
+
ConnectionLayerLine["displayName"] = "ConnectionLayerLine";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type GeoJSON from 'geojson';
|
|
2
2
|
import type { FeatureProperties } from '../../../types/connection-layer.js';
|
|
3
3
|
import type { Location } from '../../../types/location.js';
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const getArcLineFeature: (path: Location[], featureProperties: FeatureProperties) => GeoJSON.Feature<GeoJSON.LineString>;
|
package/map/components/ConnectionLayer/utils/{get-arc-line-features.js → get-arc-line-feature.js}
RENAMED
|
@@ -25,11 +25,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
mod
|
|
26
26
|
));
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var
|
|
29
|
-
__export(
|
|
30
|
-
|
|
28
|
+
var get_arc_line_feature_exports = {};
|
|
29
|
+
__export(get_arc_line_feature_exports, {
|
|
30
|
+
getArcLineFeature: () => getArcLineFeature
|
|
31
31
|
});
|
|
32
|
-
module.exports = __toCommonJS(
|
|
32
|
+
module.exports = __toCommonJS(get_arc_line_feature_exports);
|
|
33
33
|
var import_bearing = __toESM(require("@turf/bearing"));
|
|
34
34
|
var import_destination = __toESM(require("@turf/destination"));
|
|
35
35
|
var import_distance = __toESM(require("@turf/distance"));
|
|
@@ -59,10 +59,7 @@ const getArcFeatureItem = (coordinates) => {
|
|
|
59
59
|
);
|
|
60
60
|
return (0, import_projection.toMercator)(lineArc);
|
|
61
61
|
};
|
|
62
|
-
const
|
|
63
|
-
if (path.length < 2) {
|
|
64
|
-
return [];
|
|
65
|
-
}
|
|
62
|
+
const getArcLineFeature = (path, featureProperties) => {
|
|
66
63
|
const finalCoordinates = [];
|
|
67
64
|
for (let i = 0; i < path.length - 1; i++) {
|
|
68
65
|
const start = path[i];
|
|
@@ -74,8 +71,7 @@ const getArcLineFeatures = (path, featureProperties) => {
|
|
|
74
71
|
const feature = getArcFeatureItem(coordinates);
|
|
75
72
|
finalCoordinates.push(...feature.geometry.coordinates.reverse());
|
|
76
73
|
}
|
|
77
|
-
|
|
74
|
+
return (0, import_helpers.lineString)(finalCoordinates, {
|
|
78
75
|
...featureProperties
|
|
79
76
|
});
|
|
80
|
-
return [finalFeature];
|
|
81
77
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type GeoJSON from 'geojson';
|
|
2
2
|
import type { FeatureProperties } from '../../../types/connection-layer.js';
|
|
3
3
|
import type { Location } from '../../../types/location.js';
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const getStraightLineFeature: (path: Location[], featureProperties: FeatureProperties) => GeoJSON.Feature;
|
|
@@ -15,16 +15,15 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
return to;
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var
|
|
19
|
-
__export(
|
|
20
|
-
|
|
18
|
+
var get_straight_line_feature_exports = {};
|
|
19
|
+
__export(get_straight_line_feature_exports, {
|
|
20
|
+
getStraightLineFeature: () => getStraightLineFeature
|
|
21
21
|
});
|
|
22
|
-
module.exports = __toCommonJS(
|
|
22
|
+
module.exports = __toCommonJS(get_straight_line_feature_exports);
|
|
23
23
|
var import_helpers = require("@turf/helpers");
|
|
24
|
-
const
|
|
24
|
+
const getStraightLineFeature = (path, featureProperties) => {
|
|
25
25
|
const coordinates = path.map((coord) => [coord.longitude, coord.latitude]);
|
|
26
|
-
|
|
26
|
+
return (0, import_helpers.lineString)(coordinates, {
|
|
27
27
|
...featureProperties
|
|
28
28
|
});
|
|
29
|
-
return [feature];
|
|
30
29
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type GeoJSON from 'geojson';
|
|
2
2
|
import type { Connection, CurvedLine } from '../../../types/connection-layer.js';
|
|
3
|
-
export declare const parseConnectionDataToGeoJSON: <T extends Connection>(data: T[], thickness: number, color: string | ((connection: T) => string), curve?: CurvedLine) => GeoJSON.FeatureCollection
|
|
3
|
+
export declare const parseConnectionDataToGeoJSON: <T extends Connection>(data: T[], thickness: number, color: string | ((connection: T) => string), curve?: CurvedLine) => GeoJSON.FeatureCollection;
|
|
@@ -20,10 +20,9 @@ __export(parse_connection_data_to_geo_json_exports, {
|
|
|
20
20
|
parseConnectionDataToGeoJSON: () => parseConnectionDataToGeoJSON
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(parse_connection_data_to_geo_json_exports);
|
|
23
|
-
var import_helpers = require("@turf/helpers");
|
|
24
23
|
var import_charts = require("@dynatrace/strato-components-preview/charts");
|
|
25
|
-
var
|
|
26
|
-
var
|
|
24
|
+
var import_get_arc_line_feature = require("./get-arc-line-feature.js");
|
|
25
|
+
var import_get_straight_line_feature = require("./get-straight-line-feature.js");
|
|
27
26
|
var import_constants = require("../../../constants.js");
|
|
28
27
|
var import_calculate_hovered_color = require("../../../utils/calculate-hovered-color.js");
|
|
29
28
|
var import_define_color = require("../../../utils/define-color.js");
|
|
@@ -45,12 +44,27 @@ const getFeatureProperties = (thickness, curve) => (properties, id) => {
|
|
|
45
44
|
curve
|
|
46
45
|
};
|
|
47
46
|
};
|
|
48
|
-
const
|
|
47
|
+
const getLineFeature = (path, featureProperties) => {
|
|
49
48
|
const isCurve = featureProperties.curve === "smooth";
|
|
50
49
|
if (isCurve) {
|
|
51
|
-
return (0,
|
|
50
|
+
return (0, import_get_arc_line_feature.getArcLineFeature)(path, featureProperties);
|
|
52
51
|
}
|
|
53
|
-
return (0,
|
|
52
|
+
return (0, import_get_straight_line_feature.getStraightLineFeature)(path, featureProperties);
|
|
53
|
+
};
|
|
54
|
+
const getFeatures = (data, thickness, color, curve) => {
|
|
55
|
+
const getProperties = getFeatureProperties(thickness, curve);
|
|
56
|
+
const features = [];
|
|
57
|
+
data.forEach((feature, index) => {
|
|
58
|
+
if (feature.path.length >= 2) {
|
|
59
|
+
const { path, ...properties } = feature;
|
|
60
|
+
const featureProperties = {
|
|
61
|
+
...getProperties({ path, ...properties }, `connection-${index}`),
|
|
62
|
+
...getConnectionColor(feature, color)
|
|
63
|
+
};
|
|
64
|
+
features.push(getLineFeature(path, featureProperties));
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
return features;
|
|
54
68
|
};
|
|
55
69
|
const getConnectionColor = (connection, color) => {
|
|
56
70
|
const parsedColor = (0, import_define_color.defineColor)(color, connection);
|
|
@@ -62,17 +76,8 @@ const getConnectionColor = (connection, color) => {
|
|
|
62
76
|
};
|
|
63
77
|
};
|
|
64
78
|
const parseConnectionDataToGeoJSON = (data, thickness, color, curve) => {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const featureProperties = {
|
|
70
|
-
...getProperties({ path, ...properties }, `connection-${index}`),
|
|
71
|
-
...getConnectionColor(connection, color)
|
|
72
|
-
};
|
|
73
|
-
const features = getFeatures(path, featureProperties);
|
|
74
|
-
const featuresCollection = (0, import_helpers.featureCollection)(features);
|
|
75
|
-
featuresCollections.push(featuresCollection);
|
|
76
|
-
});
|
|
77
|
-
return featuresCollections;
|
|
79
|
+
return {
|
|
80
|
+
type: "FeatureCollection",
|
|
81
|
+
features: getFeatures(data, thickness, color, curve)
|
|
82
|
+
};
|
|
78
83
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Connection, InternalConnectionLayerProps } from '../../../types/connection-layer.js';
|
|
2
2
|
interface ParseGeoJsonDataProps<T extends Connection> extends Required<Pick<InternalConnectionLayerProps<T>, 'directionIndicator'>> {
|
|
3
3
|
geoJsonData: GeoJSON.FeatureCollection;
|
|
4
4
|
}
|
|
@@ -30,15 +30,15 @@ __export(BackgroundLayer_exports, {
|
|
|
30
30
|
BackgroundLayer: () => BackgroundLayer
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(BackgroundLayer_exports);
|
|
33
|
+
var import_react_maplibre = require("@vis.gl/react-maplibre");
|
|
33
34
|
var import_react = __toESM(require("react"));
|
|
34
|
-
var import_react_map_gl = require("react-map-gl");
|
|
35
35
|
var import_calculate_circle_translate = require("./utils/calculate-circle-translate.js");
|
|
36
36
|
var import_constants = require("../../constants.js");
|
|
37
37
|
const BackgroundLayer = (props) => {
|
|
38
38
|
const { background, beforeId, source, radius, iconAnchor } = props;
|
|
39
39
|
const circleTranslate = (0, import_calculate_circle_translate.calculateCircleTranslate)(iconAnchor, radius);
|
|
40
40
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
41
|
-
|
|
41
|
+
import_react_maplibre.Layer,
|
|
42
42
|
{
|
|
43
43
|
type: "circle",
|
|
44
44
|
beforeId,
|
|
@@ -30,8 +30,8 @@ __export(DotLayer_exports, {
|
|
|
30
30
|
DotLayer: () => DotLayer
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(DotLayer_exports);
|
|
33
|
+
var import_react_maplibre = require("@vis.gl/react-maplibre");
|
|
33
34
|
var import_react = __toESM(require("react"));
|
|
34
|
-
var import_maplibre = require("react-map-gl/maplibre");
|
|
35
35
|
var import_BackgroundLayer = require("./BackgroundLayer.js");
|
|
36
36
|
var import_DotLayerTooltip = require("./DotLayerTooltip.js");
|
|
37
37
|
var import_parse_dot_data_to_geo_json = require("./utils/parse-dot-data-to-geo-json.js");
|
|
@@ -78,8 +78,8 @@ const DotLayer = (props) => {
|
|
|
78
78
|
background
|
|
79
79
|
);
|
|
80
80
|
const iconAnchor = shape === "pin" ? "bottom" : "center";
|
|
81
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
82
|
-
|
|
81
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_react_maplibre.Source, { id: sourceId, type: "geojson", data: dataGeoJson, generateId: true }, /* @__PURE__ */ import_react.default.createElement(
|
|
82
|
+
import_react_maplibre.Layer,
|
|
83
83
|
{
|
|
84
84
|
type: "symbol",
|
|
85
85
|
id: layerId,
|
|
@@ -96,8 +96,8 @@ const DotLayer = (props) => {
|
|
|
96
96
|
"icon-opacity": [
|
|
97
97
|
"case",
|
|
98
98
|
["boolean", ["feature-state", "legendHover"], true],
|
|
99
|
-
import_constants.
|
|
100
|
-
import_constants.
|
|
99
|
+
import_constants.SHAPE_OPACITY_DEFAULT,
|
|
100
|
+
import_constants.SHAPE_OPACITY_DIMMED
|
|
101
101
|
]
|
|
102
102
|
}
|
|
103
103
|
}
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
+
import type GeoJSON from 'geojson';
|
|
1
2
|
import type { Location } from '../../../types/location.js';
|
|
2
|
-
export declare const parseDotDataToGeoJSON: <T extends Location>(data: T[], color: string | ((item: T) => string), bearing: number | ((item: T) => number), backgroundColor: boolean | string | ((item: T) => string)) =>
|
|
3
|
-
type: string;
|
|
4
|
-
features: {
|
|
5
|
-
type: string;
|
|
6
|
-
properties: {
|
|
7
|
-
data: T;
|
|
8
|
-
} & Omit<T, "latitude" | "longitude"> & {
|
|
9
|
-
__color: string;
|
|
10
|
-
__hoveredColor: string;
|
|
11
|
-
__backgroundColor: string;
|
|
12
|
-
__hoveredBackgroundColor: string;
|
|
13
|
-
__bearing: number;
|
|
14
|
-
};
|
|
15
|
-
geometry: {
|
|
16
|
-
type: string;
|
|
17
|
-
coordinates: number[];
|
|
18
|
-
};
|
|
19
|
-
}[];
|
|
20
|
-
};
|
|
3
|
+
export declare const parseDotDataToGeoJSON: <T extends Location>(data: T[], color: string | ((item: T) => string), bearing: number | ((item: T) => number), backgroundColor: boolean | string | ((item: T) => string)) => GeoJSON.FeatureCollection;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MapViewProps, MapViewRef } from '../types/map-view.js';
|
|
3
|
-
|
|
3
|
+
type MapContentProps = MapViewProps & {
|
|
4
|
+
onMapLoad: () => void;
|
|
5
|
+
};
|
|
6
|
+
export declare const MapContent: (props: React.PropsWithChildren<MapContentProps> & React.RefAttributes<MapViewRef>) => React.ReactElement | null;
|
|
7
|
+
export {};
|
|
@@ -30,9 +30,9 @@ __export(MapContent_exports, {
|
|
|
30
30
|
MapContent: () => MapContent
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(MapContent_exports);
|
|
33
|
+
var import_react_maplibre = require("@vis.gl/react-maplibre");
|
|
33
34
|
var import_lodash_es = require("lodash");
|
|
34
35
|
var import_react = __toESM(require("react"));
|
|
35
|
-
var import_maplibre = require("react-map-gl/maplibre");
|
|
36
36
|
var import_charts = require("@dynatrace/strato-components-preview/charts");
|
|
37
37
|
var import_core = require("@dynatrace/strato-components-preview/core");
|
|
38
38
|
var import_constants = require("../constants.js");
|
|
@@ -63,8 +63,8 @@ const fillLayer = {
|
|
|
63
63
|
};
|
|
64
64
|
const MapSource = () => {
|
|
65
65
|
const baseLayerFeatures = (0, import_use_map_base_layer_features.useMapBaseLayerFeatures)();
|
|
66
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
67
|
-
|
|
66
|
+
return baseLayerFeatures && /* @__PURE__ */ import_react.default.createElement(import_react_maplibre.Source, { id: "data", type: "geojson", data: baseLayerFeatures }, /* @__PURE__ */ import_react.default.createElement(
|
|
67
|
+
import_react_maplibre.Layer,
|
|
68
68
|
{
|
|
69
69
|
...fillLayer,
|
|
70
70
|
paint: {
|
|
@@ -72,11 +72,23 @@ const MapSource = () => {
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
), /* @__PURE__ */ import_react.default.createElement(
|
|
75
|
-
|
|
75
|
+
import_react_maplibre.Layer,
|
|
76
76
|
{
|
|
77
77
|
...lineLayer,
|
|
78
|
+
type: "line",
|
|
79
|
+
filter: [
|
|
80
|
+
"any",
|
|
81
|
+
["==", "region_type", "COUNTRY"],
|
|
82
|
+
["==", "region_type", "REGION"]
|
|
83
|
+
],
|
|
78
84
|
paint: {
|
|
79
|
-
"line-color": (0, import_get_color_from_token.getColorFromToken)(import_constants.
|
|
85
|
+
"line-color": (0, import_get_color_from_token.getColorFromToken)(import_constants.DEFAULT_BOUNDARIES_BORDER_COLOR),
|
|
86
|
+
"line-width": [
|
|
87
|
+
"case",
|
|
88
|
+
["==", ["get", "region_type"], "REGION"],
|
|
89
|
+
import_constants.REGION_BORDER_WIDTH,
|
|
90
|
+
import_constants.COUNTRY_BORDER_WIDTH
|
|
91
|
+
]
|
|
80
92
|
}
|
|
81
93
|
}
|
|
82
94
|
));
|
|
@@ -93,6 +105,7 @@ const MapContent = (0, import_react.forwardRef)((props, forwardedRef) => {
|
|
|
93
105
|
style,
|
|
94
106
|
mapStyle = import_default_style.defaultStyle,
|
|
95
107
|
onViewStateChange,
|
|
108
|
+
onMapLoad,
|
|
96
109
|
...remaining
|
|
97
110
|
} = props;
|
|
98
111
|
const loading = (0, import_use_map_loading.useMapLoading)();
|
|
@@ -130,7 +143,7 @@ const MapContent = (0, import_react.forwardRef)((props, forwardedRef) => {
|
|
|
130
143
|
onMouseLeave: handleMouseLeave
|
|
131
144
|
},
|
|
132
145
|
/* @__PURE__ */ import_react.default.createElement(
|
|
133
|
-
|
|
146
|
+
import_react_maplibre.Map,
|
|
134
147
|
{
|
|
135
148
|
onMove: (evt) => {
|
|
136
149
|
onViewStateChange?.(evt.viewState);
|
|
@@ -144,15 +157,22 @@ const MapContent = (0, import_react.forwardRef)((props, forwardedRef) => {
|
|
|
144
157
|
mapStyle,
|
|
145
158
|
dragRotate: false,
|
|
146
159
|
fadeDuration: 0,
|
|
147
|
-
RTLTextPlugin: false,
|
|
148
160
|
renderWorldCopies: false,
|
|
149
161
|
interactiveLayerIds: layerIds,
|
|
162
|
+
maxBounds: [
|
|
163
|
+
[import_constants.MIN_LONGITUDE, import_constants.MIN_LATITUDE],
|
|
164
|
+
[import_constants.MAX_LONGITUDE, import_constants.MAX_LATITUDE]
|
|
165
|
+
],
|
|
150
166
|
onMouseMove: (e) => handleMouseMove(e),
|
|
151
167
|
onClick: (e) => handleMouseClick(e),
|
|
152
168
|
onZoom: handleZoom,
|
|
153
169
|
onDrag: handleDrag,
|
|
170
|
+
attributionControl: false,
|
|
154
171
|
onRender: () => onRenderHandler && onRenderHandler(),
|
|
155
|
-
onLoad: () =>
|
|
172
|
+
onLoad: () => {
|
|
173
|
+
onMapLoad();
|
|
174
|
+
onLoadHandler && onLoadHandler();
|
|
175
|
+
},
|
|
156
176
|
ref: (0, import_use_set_map_initial_configuration.useSetMapInitialConfiguration)(),
|
|
157
177
|
interactive: true,
|
|
158
178
|
...remaining
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface MapUnavailableProps {
|
|
3
|
-
|
|
3
|
+
isFetchingFeatures: boolean;
|
|
4
4
|
isDisabled: boolean;
|
|
5
5
|
error: boolean;
|
|
6
6
|
chartHeight: string | number;
|
|
7
7
|
}
|
|
8
8
|
export declare const MapUnavailable: {
|
|
9
|
-
({ chartHeight, error, isDisabled,
|
|
9
|
+
({ chartHeight, error, isDisabled, isFetchingFeatures, }: MapUnavailableProps): React.JSX.Element | undefined;
|
|
10
10
|
displayName: string;
|
|
11
11
|
};
|
|
12
12
|
export {};
|
|
@@ -37,12 +37,12 @@ const MapUnavailable = ({
|
|
|
37
37
|
chartHeight,
|
|
38
38
|
error,
|
|
39
39
|
isDisabled,
|
|
40
|
-
|
|
40
|
+
isFetchingFeatures
|
|
41
41
|
}) => {
|
|
42
42
|
if (error) {
|
|
43
43
|
return /* @__PURE__ */ import_react.default.createElement(import_BaseLayerDataError.BaseLayerDataError, { height: chartHeight });
|
|
44
44
|
}
|
|
45
|
-
if (!
|
|
45
|
+
if (!isFetchingFeatures && isDisabled) {
|
|
46
46
|
return /* @__PURE__ */ import_react.default.createElement(import_DisabledState.DisabledState, { height: chartHeight });
|
|
47
47
|
}
|
|
48
48
|
};
|
|
@@ -30,16 +30,16 @@ __export(MapResetButton_exports, {
|
|
|
30
30
|
MapResetButton: () => MapResetButton
|
|
31
31
|
});
|
|
32
32
|
module.exports = __toCommonJS(MapResetButton_exports);
|
|
33
|
+
var import_react_maplibre = require("@vis.gl/react-maplibre");
|
|
33
34
|
var import_react = __toESM(require("react"));
|
|
34
35
|
var import_react_intl = require("react-intl");
|
|
35
|
-
var import_maplibre = require("react-map-gl/maplibre");
|
|
36
36
|
var import_charts = require("@dynatrace/strato-components-preview/charts");
|
|
37
37
|
var import_strato_icons = require("@dynatrace/strato-icons");
|
|
38
38
|
var import_use_initial_view_context = require("../../../hooks/use-initial-view-context.js");
|
|
39
39
|
var import_constants = require("../constants.js");
|
|
40
40
|
var import_use_a11y_toolbar_tab_index = require("../hooks/use-a11y-toolbar-tab-index.js");
|
|
41
41
|
const MapResetButton = () => {
|
|
42
|
-
const { current: map } = (0,
|
|
42
|
+
const { current: map } = (0, import_react_maplibre.useMap)();
|
|
43
43
|
const { longitude = 0, latitude = 0, zoom = 0 } = (0, import_use_initial_view_context.useInitialViewContext)();
|
|
44
44
|
const intl = (0, import_react_intl.useIntl)();
|
|
45
45
|
const resetButtonRef = (0, import_react.useRef)();
|