@classic-homes/maps-core 0.1.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.
@@ -0,0 +1,141 @@
1
+ /**
2
+ * Map data types
3
+ *
4
+ * Re-exports GeoJSON types and defines additional map-specific data structures
5
+ */
6
+ /**
7
+ * Longitude/Latitude coordinate pair
8
+ * Following GeoJSON convention: [longitude, latitude]
9
+ */
10
+ type LngLat = [number, number];
11
+ /**
12
+ * Map bounds defined by southwest and northeast corners
13
+ */
14
+ interface MapBounds {
15
+ /** Southwest corner [lng, lat] */
16
+ southwest: LngLat;
17
+ /** Northeast corner [lng, lat] */
18
+ northeast: LngLat;
19
+ }
20
+ /**
21
+ * Shorthand for bounds as array: [[sw_lng, sw_lat], [ne_lng, ne_lat]]
22
+ */
23
+ type BoundsArray = [LngLat, LngLat];
24
+ /**
25
+ * Map viewport/camera state
26
+ */
27
+ interface MapViewport {
28
+ /** Center coordinates [lng, lat] */
29
+ center: LngLat;
30
+ /** Zoom level (0-24) */
31
+ zoom: number;
32
+ /** Map bearing/rotation in degrees (0-360) */
33
+ bearing?: number;
34
+ /** Map pitch/tilt in degrees (0-85) */
35
+ pitch?: number;
36
+ }
37
+ /**
38
+ * GeoJSON Feature type (simplified for our use)
39
+ */
40
+ interface GeoJSONFeature<G extends GeoJSONGeometry = GeoJSONGeometry, P = Record<string, unknown>> {
41
+ type: 'Feature';
42
+ id?: string | number;
43
+ geometry: G;
44
+ properties: P;
45
+ }
46
+ /**
47
+ * GeoJSON FeatureCollection
48
+ */
49
+ interface GeoJSONFeatureCollection<G extends GeoJSONGeometry = GeoJSONGeometry, P = Record<string, unknown>> {
50
+ type: 'FeatureCollection';
51
+ features: GeoJSONFeature<G, P>[];
52
+ }
53
+ /**
54
+ * GeoJSON Geometry types
55
+ */
56
+ type GeoJSONGeometry = GeoJSONPoint | GeoJSONMultiPoint | GeoJSONLineString | GeoJSONMultiLineString | GeoJSONPolygon | GeoJSONMultiPolygon;
57
+ interface GeoJSONPoint {
58
+ type: 'Point';
59
+ coordinates: LngLat;
60
+ }
61
+ interface GeoJSONMultiPoint {
62
+ type: 'MultiPoint';
63
+ coordinates: LngLat[];
64
+ }
65
+ interface GeoJSONLineString {
66
+ type: 'LineString';
67
+ coordinates: LngLat[];
68
+ }
69
+ interface GeoJSONMultiLineString {
70
+ type: 'MultiLineString';
71
+ coordinates: LngLat[][];
72
+ }
73
+ interface GeoJSONPolygon {
74
+ type: 'Polygon';
75
+ coordinates: LngLat[][];
76
+ }
77
+ interface GeoJSONMultiPolygon {
78
+ type: 'MultiPolygon';
79
+ coordinates: LngLat[][][];
80
+ }
81
+ /**
82
+ * Marker data for displaying points of interest
83
+ */
84
+ interface MarkerData {
85
+ /** Unique identifier */
86
+ id: string;
87
+ /** Marker position [lng, lat] */
88
+ coordinates: LngLat;
89
+ /** Optional marker label */
90
+ label?: string;
91
+ /** Optional marker color */
92
+ color?: string;
93
+ /** Optional custom icon name */
94
+ icon?: string;
95
+ /** Optional popup content */
96
+ popup?: string | {
97
+ title?: string;
98
+ content: string;
99
+ };
100
+ /** Custom properties for the marker */
101
+ properties?: Record<string, unknown>;
102
+ }
103
+ /**
104
+ * Cluster configuration for grouping markers
105
+ */
106
+ interface ClusterConfig {
107
+ /** Enable clustering */
108
+ enabled: boolean;
109
+ /** Radius of each cluster */
110
+ radius?: number;
111
+ /** Max zoom level for clustering */
112
+ maxZoom?: number;
113
+ /** Properties to aggregate in clusters */
114
+ clusterProperties?: Record<string, [string, unknown]>;
115
+ }
116
+ /**
117
+ * Heatmap data point
118
+ */
119
+ interface HeatmapPoint {
120
+ /** Point coordinates [lng, lat] */
121
+ coordinates: LngLat;
122
+ /** Weight/intensity of the point (0-1) */
123
+ weight?: number;
124
+ }
125
+ /**
126
+ * Building extrusion data
127
+ */
128
+ interface ExtrusionData {
129
+ /** Height of the extrusion in meters */
130
+ height: number;
131
+ /** Base height of the extrusion in meters */
132
+ baseHeight?: number;
133
+ /** Extrusion color */
134
+ color?: string;
135
+ }
136
+ /**
137
+ * Source data types that can be used with map sources
138
+ */
139
+ type MapSourceData = GeoJSONFeatureCollection | GeoJSONFeature | string | MarkerData[];
140
+
141
+ export type { BoundsArray as B, ClusterConfig as C, ExtrusionData as E, GeoJSONFeatureCollection as G, HeatmapPoint as H, LngLat as L, MapBounds as M, GeoJSONFeature as a, MarkerData as b, GeoJSONPolygon as c, MapViewport as d, GeoJSONGeometry as e, GeoJSONPoint as f, GeoJSONMultiPoint as g, GeoJSONLineString as h, GeoJSONMultiLineString as i, GeoJSONMultiPolygon as j, MapSourceData as k };