@trackunit/react-map-adapter-shared 0.0.142-alpha-7fd06f36b49.0 → 0.0.144

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/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@trackunit/react-map-adapter-shared",
3
- "version": "0.0.142-alpha-7fd06f36b49.0",
3
+ "version": "0.0.144",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
7
7
  "node": ">=24.x"
8
8
  },
9
9
  "dependencies": {
10
- "@trackunit/react-map-color-utils": "0.0.117-alpha-7fd06f36b49.0",
11
- "@trackunit/geo-json-utils": "1.16.1-alpha-7fd06f36b49.0",
12
- "@trackunit/ui-design-tokens": "1.16.1-alpha-7fd06f36b49.0",
10
+ "@trackunit/react-map-color-utils": "0.0.119",
11
+ "@trackunit/geo-json-utils": "1.16.3",
12
+ "@trackunit/ui-design-tokens": "1.16.3",
13
13
  "es-toolkit": "^1.39.10",
14
14
  "zod": "^3.25.76"
15
15
  },
@@ -1,7 +1,7 @@
1
1
  import type { GeoJsonBbox } from "@trackunit/geo-json-utils";
2
2
  import type { Entity } from "./interactionTypes";
3
- import type { ShapeStyleDefaults } from "./shapeStyleDefaults";
4
3
  import type { AdaptiveMarkerResolution, ClusterConfig, ClusterRenderConfig, ClusterRenderState, DomRenderState, GeoJsonFeatureCollection, GeoJsonGeometry, RenderConfig, RouteStyle, ShapeInteractiveMode, ShapeStyle } from "./layerApiTypes";
4
+ import type { ShapeStyleDefaults } from "./shapeStyleDefaults";
5
5
  type ReactNode = import("react").ReactNode;
6
6
  /**
7
7
  * Full interactive marker with clustering and adapter-managed entity events.
@@ -83,6 +83,24 @@ export type ImageOverlayConfig = Readonly<{
83
83
  imageBounds: GeoJsonBbox;
84
84
  opacity: number;
85
85
  }>;
86
+ /**
87
+ * Configuration for a heatmap source.
88
+ * The adapter uses this to configure the heatmap layer used by the map.
89
+ *
90
+ * Different map adapters may use different heatmap engines
91
+ * (provider-specific or open source), but we are not building our own renderer for heatmaps.
92
+ */
93
+ export type HeatmapRenderStyle = Readonly<{
94
+ radiusPixels: number;
95
+ intensity: number;
96
+ opacity: number;
97
+ }>;
98
+ /** Snapshot payload for `layerType: "heatmap"` — adapter picks renderer (ADR-0029). */
99
+ export type HeatmapSourceConfig = Readonly<{
100
+ id: string;
101
+ features: GeoJsonFeatureCollection;
102
+ style: HeatmapRenderStyle;
103
+ }>;
86
104
  /**
87
105
  * A typed layer description — the declarative unit passed to `setSnapshot`.
88
106
  *
@@ -100,7 +118,9 @@ export type MapLayer = ({
100
118
  readonly layerType: "route";
101
119
  } & RouteSourceConfig) | ({
102
120
  readonly layerType: "image-overlay";
103
- } & ImageOverlayConfig);
121
+ } & ImageOverlayConfig) | ({
122
+ readonly layerType: "heatmap";
123
+ } & HeatmapSourceConfig);
104
124
  /**
105
125
  * Shape interaction state — which shape feature is currently selected/hovered.
106
126
  * Both fields are null when nothing is selected/hovered.
package/src/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { GeoJsonBbox } from "@trackunit/geo-json-utils";
2
2
  import type { AdapterRendererProps } from "./adapterContract";
3
- import type { InitialViewport, MapTheme } from "./primitiveMapTypes";
3
+ import type { InitialViewport, MapTheme, MapType } from "./primitiveMapTypes";
4
4
  type CSSProperties = import("react").CSSProperties;
5
5
  type ReactNode = import("react").ReactNode;
6
6
  /**
@@ -32,6 +32,26 @@ export type BaseAdapterConfig = Readonly<{
32
32
  region?: string;
33
33
  /** Map theme - light or dark */
34
34
  theme?: MapTheme;
35
+ /**
36
+ * Initial map type (base layer). Like `theme`, this seeds the adapter's
37
+ * appearance at construction so the first map is created with the right base
38
+ * layer (e.g. from a persisted user preference) instead of being corrected
39
+ * after mount. Defaults to the adapter's default appearance (roadmap).
40
+ */
41
+ mapType?: MapType;
42
+ /**
43
+ * Initial roads-overlay preference for satellite/hybrid map types.
44
+ * Seeds the adapter's appearance at construction; defaults to off.
45
+ */
46
+ showRoads?: boolean;
47
+ /**
48
+ * Initial traffic preference. Seeds the adapter's appearance at construction
49
+ * so a provider that needs a specific map mode for traffic (e.g. Google's
50
+ * raster rendering type, see ADR 0028) can create the first map correctly
51
+ * instead of recreating it once the persisted preference arrives. Adapters
52
+ * without traffic support ignore it. Defaults to off.
53
+ */
54
+ showTraffic?: boolean;
35
55
  /** Initial viewport: either center+zoom or bounds */
36
56
  initialViewport?: InitialViewport;
37
57
  /**
@@ -1 +0,0 @@
1
- {"version":3,"file":"entry.js","sourceRoot":"","sources":["../../../../../libs/react/map-adapter-shared/migrations/entry.ts"],"names":[],"mappings":"","sourcesContent":["export {};\n"]}