@mapvx/web-js 1.1.0 → 1.1.2-alpha.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/LICENSE.md +2 -2
- package/README.md +12 -9
- package/dist/cjs/assets/icons.js +6 -8
- package/dist/cjs/assets/icons.js.map +1 -1
- package/dist/cjs/controllers/routeController.js +19 -19
- package/dist/cjs/controllers/routeController.js.map +1 -1
- package/dist/cjs/domain/models/animation.js +2 -2
- package/dist/cjs/domain/models/categories.js +23 -10
- package/dist/cjs/domain/models/categories.js.map +1 -1
- package/dist/cjs/domain/models/circle.js +253 -0
- package/dist/cjs/domain/models/circle.js.map +1 -0
- package/dist/cjs/domain/models/mapConfig.js +10 -1
- package/dist/cjs/domain/models/mapConfig.js.map +1 -1
- package/dist/cjs/domain/models/marker.js +92 -80
- package/dist/cjs/domain/models/marker.js.map +1 -1
- package/dist/cjs/domain/models/routeConfiguration.js +3 -1
- package/dist/cjs/domain/models/routeConfiguration.js.map +1 -1
- package/dist/cjs/index.js +24 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/logger/logger.js +21 -9
- package/dist/cjs/logger/logger.js.map +1 -1
- package/dist/cjs/logger/rollbar.js +21 -8
- package/dist/cjs/logger/rollbar.js.map +1 -1
- package/dist/cjs/map/map.js +446 -28
- package/dist/cjs/map/map.js.map +1 -1
- package/dist/cjs/map/mapInteractionOptions.js +56 -0
- package/dist/cjs/map/mapInteractionOptions.js.map +1 -0
- package/dist/cjs/repository/repository.js +25 -26
- package/dist/cjs/repository/repository.js.map +1 -1
- package/dist/cjs/repository/requester.js +71 -91
- package/dist/cjs/repository/requester.js.map +1 -1
- package/dist/cjs/sdk.js +18 -1
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/cjs/utils/preconnect.js +131 -0
- package/dist/cjs/utils/preconnect.js.map +1 -0
- package/dist/cjs/utils/semaphore.js +143 -0
- package/dist/cjs/utils/semaphore.js.map +1 -0
- package/dist/es/assets/icons.d.ts +4 -4
- package/dist/es/assets/icons.d.ts.map +1 -1
- package/dist/es/assets/icons.js +6 -8
- package/dist/es/assets/icons.js.map +1 -1
- package/dist/es/controllers/routeController.d.ts.map +1 -1
- package/dist/es/controllers/routeController.js +19 -19
- package/dist/es/controllers/routeController.js.map +1 -1
- package/dist/es/domain/models/animation.d.ts +3 -3
- package/dist/es/domain/models/animation.js +2 -2
- package/dist/es/domain/models/categories.d.ts +34 -10
- package/dist/es/domain/models/categories.d.ts.map +1 -1
- package/dist/es/domain/models/categories.js +21 -9
- package/dist/es/domain/models/categories.js.map +1 -1
- package/dist/es/domain/models/circle.d.ts +222 -0
- package/dist/es/domain/models/circle.d.ts.map +1 -0
- package/dist/es/domain/models/circle.js +246 -0
- package/dist/es/domain/models/circle.js.map +1 -0
- package/dist/es/domain/models/configuration.d.ts +8 -0
- package/dist/es/domain/models/configuration.d.ts.map +1 -1
- package/dist/es/domain/models/mapConfig.d.ts +118 -3
- package/dist/es/domain/models/mapConfig.d.ts.map +1 -1
- package/dist/es/domain/models/mapConfig.js +9 -0
- package/dist/es/domain/models/mapConfig.js.map +1 -1
- package/dist/es/domain/models/marker.d.ts +16 -0
- package/dist/es/domain/models/marker.d.ts.map +1 -1
- package/dist/es/domain/models/marker.js +92 -80
- package/dist/es/domain/models/marker.js.map +1 -1
- package/dist/es/domain/models/routeConfiguration.d.ts +47 -0
- package/dist/es/domain/models/routeConfiguration.d.ts.map +1 -1
- package/dist/es/domain/models/routeConfiguration.js +3 -1
- package/dist/es/domain/models/routeConfiguration.js.map +1 -1
- package/dist/es/index.d.ts +15 -11
- package/dist/es/index.d.ts.map +1 -1
- package/dist/es/index.js +10 -5
- package/dist/es/index.js.map +1 -1
- package/dist/es/interfaces/routeCacheResponse.d.ts.map +1 -1
- package/dist/es/logger/logger.d.ts.map +1 -1
- package/dist/es/logger/logger.js +21 -9
- package/dist/es/logger/logger.js.map +1 -1
- package/dist/es/logger/rollbar.d.ts.map +1 -1
- package/dist/es/logger/rollbar.js +21 -8
- package/dist/es/logger/rollbar.js.map +1 -1
- package/dist/es/map/map.d.ts +298 -0
- package/dist/es/map/map.d.ts.map +1 -1
- package/dist/es/map/map.js +447 -29
- package/dist/es/map/map.js.map +1 -1
- package/dist/es/map/mapInteractionOptions.d.ts +37 -0
- package/dist/es/map/mapInteractionOptions.d.ts.map +1 -0
- package/dist/es/map/mapInteractionOptions.js +51 -0
- package/dist/es/map/mapInteractionOptions.js.map +1 -0
- package/dist/es/repository/repository.d.ts +0 -1
- package/dist/es/repository/repository.d.ts.map +1 -1
- package/dist/es/repository/repository.js +25 -26
- package/dist/es/repository/repository.js.map +1 -1
- package/dist/es/repository/requester.d.ts +12 -2
- package/dist/es/repository/requester.d.ts.map +1 -1
- package/dist/es/repository/requester.js +71 -91
- package/dist/es/repository/requester.js.map +1 -1
- package/dist/es/sdk.d.ts +2 -0
- package/dist/es/sdk.d.ts.map +1 -1
- package/dist/es/sdk.js +18 -1
- package/dist/es/sdk.js.map +1 -1
- package/dist/es/utils/preconnect.d.ts +45 -0
- package/dist/es/utils/preconnect.d.ts.map +1 -0
- package/dist/es/utils/preconnect.js +127 -0
- package/dist/es/utils/preconnect.js.map +1 -0
- package/dist/es/utils/semaphore.d.ts +70 -0
- package/dist/es/utils/semaphore.d.ts.map +1 -0
- package/dist/es/utils/semaphore.js +139 -0
- package/dist/es/utils/semaphore.js.map +1 -0
- package/dist/umd/index.js +1968 -669
- package/dist/umd/index.js.map +1 -1
- package/dist/umd/styles.css +32 -14
- package/dist/umd/styles.css.map +1 -1
- package/package.json +63 -49
- package/dist/cjs/assets/route_animation_icon.svg +0 -15
- package/dist/cjs/assets/user-dot-icon.svg +0 -3
- package/dist/es/assets/route_animation_icon.svg +0 -15
- package/dist/es/assets/user-dot-icon.svg +0 -3
|
@@ -1,20 +1,32 @@
|
|
|
1
1
|
// Category.ts
|
|
2
2
|
/**
|
|
3
|
-
* Checks if the category
|
|
4
|
-
*
|
|
5
|
-
* @param category
|
|
6
|
-
* @returns
|
|
3
|
+
* Checks if the category carries a logo image.
|
|
4
|
+
* @group Utils
|
|
5
|
+
* @param category - The category to inspect.
|
|
6
|
+
* @returns `true` if the category exposes a non-empty `logo` URL, narrowing it to {@link BasicWithLogo}.
|
|
7
7
|
*/
|
|
8
8
|
export function isBasicWithLogo(category) {
|
|
9
|
-
|
|
9
|
+
const input = category;
|
|
10
|
+
return input.logo != null && input.logo !== "";
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
|
-
* Checks if the category
|
|
13
|
+
* Checks if the category carries a Font Awesome icon.
|
|
13
14
|
* @group Utils
|
|
14
|
-
* @param category
|
|
15
|
-
* @returns
|
|
15
|
+
* @param category - The category to inspect.
|
|
16
|
+
* @returns `true` if the category exposes a non-empty `icon` name, narrowing it to {@link BasicWithIcon}.
|
|
16
17
|
*/
|
|
17
18
|
export function isBasicWithIcon(category) {
|
|
18
|
-
|
|
19
|
+
const input = category;
|
|
20
|
+
return input.icon != null && input.icon !== "";
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Checks if the category carries an image URL.
|
|
24
|
+
* @group Utils
|
|
25
|
+
* @param category - The category to inspect.
|
|
26
|
+
* @returns `true` if the category exposes a non-empty `imageUrl`, narrowing it to {@link BasicWithImageUrl}.
|
|
27
|
+
*/
|
|
28
|
+
export function isBasicWithImageUrl(category) {
|
|
29
|
+
const input = category;
|
|
30
|
+
return input.imageUrl != null && input.imageUrl !== "";
|
|
19
31
|
}
|
|
20
32
|
//# sourceMappingURL=categories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"categories.js","sourceRoot":"","sources":["../../../../src/domain/models/categories.ts"],"names":[],"mappings":"AAAA,cAAc;
|
|
1
|
+
{"version":3,"file":"categories.js","sourceRoot":"","sources":["../../../../src/domain/models/categories.ts"],"names":[],"mappings":"AAAA,cAAc;AA0Ld;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,QAAuB;IACrD,MAAM,KAAK,GAAG,QAAyB,CAAA;IACvC,OAAO,KAAK,CAAC,IAAI,IAAI,IAAI,IAAI,KAAK,CAAC,IAAI,KAAK,EAAE,CAAA;AAChD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,QAAuB;IACrD,MAAM,KAAK,GAAG,QAAyB,CAAA;IACvC,OAAO,KAAK,CAAC,IAAI,IAAI,IAAI,IAAI,KAAK,CAAC,IAAI,KAAK,EAAE,CAAA;AAChD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAuB;IACzD,MAAM,KAAK,GAAG,QAA6B,CAAA;IAC3C,OAAO,KAAK,CAAC,QAAQ,IAAI,IAAI,IAAI,KAAK,CAAC,QAAQ,KAAK,EAAE,CAAA;AACxD,CAAC"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { type LatLng } from "./latLng";
|
|
2
|
+
/**
|
|
3
|
+
* MapVX brand color used as the default for circle styling and other
|
|
4
|
+
* SDK-drawn overlays (colored places, borders).
|
|
5
|
+
*
|
|
6
|
+
* @group Circles
|
|
7
|
+
*/
|
|
8
|
+
export declare const MAPVX_BRAND_COLOR = "#276EF1";
|
|
9
|
+
/**
|
|
10
|
+
* Where a circle renders relative to the other map layers.
|
|
11
|
+
*
|
|
12
|
+
* - `"aboveBasemap"` (default): above every basemap geometry layer —
|
|
13
|
+
* including indoor floor-plate and building polygons — but below the
|
|
14
|
+
* labels that follow them. A circle is never occluded by basemap fills.
|
|
15
|
+
* - `"belowLabels"`: below the first symbol (label) layer of the style.
|
|
16
|
+
* On indoor styles, floor-plate polygons ordered after that layer will
|
|
17
|
+
* paint over the circle.
|
|
18
|
+
* - `"top"`: above everything, including labels and markers drawn in
|
|
19
|
+
* style layers.
|
|
20
|
+
*
|
|
21
|
+
* @group Circles
|
|
22
|
+
*/
|
|
23
|
+
export type CircleRenderOrder = "aboveBasemap" | "belowLabels" | "top";
|
|
24
|
+
/**
|
|
25
|
+
* Valid values for {@link CircleRenderOrder}, in rendering order.
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export declare const CIRCLE_RENDER_ORDERS: readonly CircleRenderOrder[];
|
|
29
|
+
/**
|
|
30
|
+
* Default styling values applied to a circle when the corresponding
|
|
31
|
+
* {@link CircleConfig} fields are omitted.
|
|
32
|
+
*
|
|
33
|
+
* @group Circles
|
|
34
|
+
*/
|
|
35
|
+
export declare const CIRCLE_DEFAULTS: {
|
|
36
|
+
readonly fillColor: "#276EF1";
|
|
37
|
+
readonly fillOpacity: 0.14;
|
|
38
|
+
readonly strokeColor: "#276EF1";
|
|
39
|
+
readonly strokeWidth: 2;
|
|
40
|
+
readonly strokeOpacity: 0.65;
|
|
41
|
+
readonly renderOrder: CircleRenderOrder;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Represents the configuration for the creation of a metric radius circle on a map.
|
|
45
|
+
* The radius is expressed in meters (geographic), so the drawn circle stays
|
|
46
|
+
* metrically accurate at every zoom level.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* const circleConfig: CircleConfig = {
|
|
51
|
+
* id: "geofence-1",
|
|
52
|
+
* coordinate: { lat: 40.7128, lng: -74.0060 },
|
|
53
|
+
* radiusMeters: 150,
|
|
54
|
+
* fillOpacity: 0.2,
|
|
55
|
+
* };
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @group Circles
|
|
59
|
+
*/
|
|
60
|
+
export interface CircleConfig {
|
|
61
|
+
/**
|
|
62
|
+
* Unique identifier for the circle.
|
|
63
|
+
* If not provided, a hexadecimal key will be generated automatically.
|
|
64
|
+
*/
|
|
65
|
+
id?: string;
|
|
66
|
+
/**
|
|
67
|
+
* The geographic coordinates of the circle center.
|
|
68
|
+
* Latitude must be between -90 and 90; longitude between -180 and 180.
|
|
69
|
+
* @see {@link LatLng} for coordinate structure
|
|
70
|
+
* @throws Error if coordinates are out of bounds.
|
|
71
|
+
*/
|
|
72
|
+
coordinate: LatLng;
|
|
73
|
+
/**
|
|
74
|
+
* Radius of the circle in meters (geographic, not pixels).
|
|
75
|
+
* Must be a positive finite number. The circle keeps its metric size at every zoom level.
|
|
76
|
+
* @throws Error if radiusMeters is ≤ 0 or non-finite.
|
|
77
|
+
*/
|
|
78
|
+
radiusMeters: number;
|
|
79
|
+
/**
|
|
80
|
+
* Fill color of the circle in any valid CSS color format.
|
|
81
|
+
* @defaultValue {@link MAPVX_BRAND_COLOR}
|
|
82
|
+
*/
|
|
83
|
+
fillColor?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Opacity of the circle fill, between 0 and 1.
|
|
86
|
+
* Values outside this range are automatically clamped.
|
|
87
|
+
* @defaultValue 0.14
|
|
88
|
+
*/
|
|
89
|
+
fillOpacity?: number;
|
|
90
|
+
/**
|
|
91
|
+
* Stroke (outline) color of the circle in any valid CSS color format.
|
|
92
|
+
* @defaultValue {@link MAPVX_BRAND_COLOR}
|
|
93
|
+
*/
|
|
94
|
+
strokeColor?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Width of the circle outline in pixels.
|
|
97
|
+
* @defaultValue 2
|
|
98
|
+
*/
|
|
99
|
+
strokeWidth?: number;
|
|
100
|
+
/**
|
|
101
|
+
* Opacity of the circle outline, between 0 and 1.
|
|
102
|
+
* Values outside this range are automatically clamped.
|
|
103
|
+
* @defaultValue 0.65
|
|
104
|
+
*/
|
|
105
|
+
strokeOpacity?: number;
|
|
106
|
+
/**
|
|
107
|
+
* Identifier for the floor on which the circle is located.
|
|
108
|
+
* A circle with a floor is shown only while that floor is displayed.
|
|
109
|
+
* A circle without a floor is shown only in outdoor contexts,
|
|
110
|
+
* matching the visibility semantics of {@link MarkerConfig.floorId}.
|
|
111
|
+
*/
|
|
112
|
+
floorId?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Where the circle renders relative to other map layers.
|
|
115
|
+
* @see {@link CircleRenderOrder} for the available placements.
|
|
116
|
+
* @defaultValue "aboveBasemap"
|
|
117
|
+
*/
|
|
118
|
+
renderOrder?: CircleRenderOrder;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Internal resolved representation of a circle kept by the map.
|
|
122
|
+
* Holds the full configuration with defaults applied, plus visibility state.
|
|
123
|
+
*
|
|
124
|
+
* Unlike markers, the hidden flag persists across floor changes and map
|
|
125
|
+
* restyles: a circle hidden via `hideCircle` stays hidden until `showCircle`.
|
|
126
|
+
*/
|
|
127
|
+
export interface CircleRecord {
|
|
128
|
+
id: string;
|
|
129
|
+
coordinate: LatLng;
|
|
130
|
+
radiusMeters: number;
|
|
131
|
+
fillColor: string;
|
|
132
|
+
fillOpacity: number;
|
|
133
|
+
strokeColor: string;
|
|
134
|
+
strokeWidth: number;
|
|
135
|
+
strokeOpacity: number;
|
|
136
|
+
floorId?: string;
|
|
137
|
+
renderOrder: CircleRenderOrder;
|
|
138
|
+
hidden: boolean;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Returns a deep copy of a {@link CircleRecord}, including the nested
|
|
142
|
+
* coordinate. Used by the map accessors so callers can't mutate internal
|
|
143
|
+
* circle state by writing to a returned record.
|
|
144
|
+
*
|
|
145
|
+
* @param record The circle record to clone.
|
|
146
|
+
* @returns An independent copy of the record.
|
|
147
|
+
*
|
|
148
|
+
* @group Circles
|
|
149
|
+
*/
|
|
150
|
+
export declare function cloneCircleRecord(record: CircleRecord): CircleRecord;
|
|
151
|
+
/**
|
|
152
|
+
* Type guard for validating circle configurations without throwing.
|
|
153
|
+
* Returns true if the configuration is valid and can be added to the map.
|
|
154
|
+
*
|
|
155
|
+
* @param config Configuration to validate.
|
|
156
|
+
* @returns True if config is a valid CircleConfig, false otherwise.
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```typescript
|
|
160
|
+
* if (isValidCircleConfig(userInput)) {
|
|
161
|
+
* map.addCircle(userInput);
|
|
162
|
+
* } else {
|
|
163
|
+
* console.error('Invalid circle configuration');
|
|
164
|
+
* }
|
|
165
|
+
* ```
|
|
166
|
+
*
|
|
167
|
+
* @group Circles
|
|
168
|
+
*/
|
|
169
|
+
export declare function isValidCircleConfig(config: unknown): config is CircleConfig;
|
|
170
|
+
/**
|
|
171
|
+
* Resolves a {@link CircleConfig} into a {@link CircleRecord}, applying
|
|
172
|
+
* default styling, generating an id when one is not provided, and validating inputs.
|
|
173
|
+
*
|
|
174
|
+
* @param config Circle configuration provided by the SDK consumer.
|
|
175
|
+
* @param hidden Initial hidden state, defaults to visible.
|
|
176
|
+
* @returns The resolved circle record ready to be stored and rendered.
|
|
177
|
+
* @throws {Error} If radiusMeters is ≤ 0, not finite, or coordinates are invalid.
|
|
178
|
+
*
|
|
179
|
+
* @group Circles
|
|
180
|
+
*/
|
|
181
|
+
export declare function resolveCircleConfig(config: CircleConfig, hidden?: boolean): CircleRecord;
|
|
182
|
+
/**
|
|
183
|
+
* Builds a closed GeoJSON polygon ring approximating a geographic circle.
|
|
184
|
+
*
|
|
185
|
+
* The ring is computed with an equirectangular approximation: meters are
|
|
186
|
+
* converted to degrees independently per axis, with the longitude scale
|
|
187
|
+
* corrected by the cosine of the latitude. For the radii the SDK works with
|
|
188
|
+
* (tens to hundreds of meters) the metric error is negligible (≤1%) at any latitude
|
|
189
|
+
* where the projection is defined. At extreme polar latitudes, the approximation
|
|
190
|
+
* breaks down, so circles near poles (|lat| > 85°) should be used with caution.
|
|
191
|
+
*
|
|
192
|
+
* @param lng Longitude of the circle center in degrees.
|
|
193
|
+
* @param lat Latitude of the circle center in degrees.
|
|
194
|
+
* @param radiusMeters Radius of the circle in meters. Must be positive and finite.
|
|
195
|
+
* @param points Number of segments in the ring. Defaults to 64. Non-integer
|
|
196
|
+
* values are floored and the count is clamped to a minimum of 3,
|
|
197
|
+
* the smallest valid GeoJSON linear ring; non-finite values fall
|
|
198
|
+
* back to the default.
|
|
199
|
+
* @returns A closed ring of `[lng, lat]` positions (first equals last).
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```typescript
|
|
203
|
+
* import { circleRing } from '@mapvx/web-js';
|
|
204
|
+
*
|
|
205
|
+
* // Create a 150-meter radius circle ring
|
|
206
|
+
* const ring = circleRing(-74.0060, 40.7128, 150);
|
|
207
|
+
* const polygon = { type: "Polygon", coordinates: [ring] };
|
|
208
|
+
*
|
|
209
|
+
* // Custom segments (32 instead of 64) for lower resolution
|
|
210
|
+
* const coarseRing = circleRing(-74.0060, 40.7128, 150, 32);
|
|
211
|
+
* ```
|
|
212
|
+
*
|
|
213
|
+
* @note Equirectangular approximation is accurate for radii up to ~500 km and
|
|
214
|
+
* latitudes between approximately ±80°. Beyond these limits, visual
|
|
215
|
+
* distortion may occur near the poles.
|
|
216
|
+
* @note Generated rings do not account for geographic obstacles, walls, or
|
|
217
|
+
* buildings. For complex geofencing, consider server-side validation.
|
|
218
|
+
*
|
|
219
|
+
* @group Circles
|
|
220
|
+
*/
|
|
221
|
+
export declare function circleRing(lng: number, lat: number, radiusMeters: number, points?: number): [number, number][];
|
|
222
|
+
//# sourceMappingURL=circle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circle.d.ts","sourceRoot":"","sources":["../../../../src/domain/models/circle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAA;AAEtC;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,YAAY,CAAA;AAE1C;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,iBAAiB,GAAG,cAAc,GAAG,aAAa,GAAG,KAAK,CAAA;AAEtE;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,iBAAiB,EAInD,CAAA;AAEV;;;;;GAKG;AACH,eAAO,MAAM,eAAe;;;;;;;CAOlB,CAAA;AAEV;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IAEX;;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EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,MAAM,EACpB,MAAM,GAAE,MAAW,GAClB,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAiBpB"}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { generateHexadecimalKey } from "../../utils/utils";
|
|
2
|
+
/**
|
|
3
|
+
* MapVX brand color used as the default for circle styling and other
|
|
4
|
+
* SDK-drawn overlays (colored places, borders).
|
|
5
|
+
*
|
|
6
|
+
* @group Circles
|
|
7
|
+
*/
|
|
8
|
+
export const MAPVX_BRAND_COLOR = "#276EF1";
|
|
9
|
+
/**
|
|
10
|
+
* Valid values for {@link CircleRenderOrder}, in rendering order.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export const CIRCLE_RENDER_ORDERS = [
|
|
14
|
+
"belowLabels",
|
|
15
|
+
"aboveBasemap",
|
|
16
|
+
"top",
|
|
17
|
+
];
|
|
18
|
+
/**
|
|
19
|
+
* Default styling values applied to a circle when the corresponding
|
|
20
|
+
* {@link CircleConfig} fields are omitted.
|
|
21
|
+
*
|
|
22
|
+
* @group Circles
|
|
23
|
+
*/
|
|
24
|
+
export const CIRCLE_DEFAULTS = {
|
|
25
|
+
fillColor: MAPVX_BRAND_COLOR,
|
|
26
|
+
fillOpacity: 0.14,
|
|
27
|
+
strokeColor: MAPVX_BRAND_COLOR,
|
|
28
|
+
strokeWidth: 2,
|
|
29
|
+
strokeOpacity: 0.65,
|
|
30
|
+
renderOrder: "aboveBasemap",
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Returns a deep copy of a {@link CircleRecord}, including the nested
|
|
34
|
+
* coordinate. Used by the map accessors so callers can't mutate internal
|
|
35
|
+
* circle state by writing to a returned record.
|
|
36
|
+
*
|
|
37
|
+
* @param record The circle record to clone.
|
|
38
|
+
* @returns An independent copy of the record.
|
|
39
|
+
*
|
|
40
|
+
* @group Circles
|
|
41
|
+
*/
|
|
42
|
+
export function cloneCircleRecord(record) {
|
|
43
|
+
return Object.assign(Object.assign({}, record), { coordinate: Object.assign({}, record.coordinate) });
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Validates that a radius in meters is positive and finite.
|
|
47
|
+
* @param radius The radius value to validate.
|
|
48
|
+
* @throws {Error} If radius is ≤ 0 or not finite (NaN/Infinity).
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
function validateRadiusMeters(radius) {
|
|
52
|
+
if (!Number.isFinite(radius) || radius <= 0) {
|
|
53
|
+
throw new Error(`Invalid radiusMeters: ${radius}. Must be a positive finite number.`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Validates that a coordinate is within valid geographic bounds.
|
|
58
|
+
* @param coord The coordinate to validate.
|
|
59
|
+
* @throws {Error} If latitude is outside [-90, 90] or longitude outside [-180, 180], or not finite.
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
function validateCoordinate(coord) {
|
|
63
|
+
if (coord == null || typeof coord !== "object") {
|
|
64
|
+
throw new Error("Invalid coordinate: expected an object with lat and lng properties.");
|
|
65
|
+
}
|
|
66
|
+
if (!Number.isFinite(coord.lat) ||
|
|
67
|
+
!Number.isFinite(coord.lng) ||
|
|
68
|
+
coord.lat < -90 ||
|
|
69
|
+
coord.lat > 90 ||
|
|
70
|
+
coord.lng < -180 ||
|
|
71
|
+
coord.lng > 180) {
|
|
72
|
+
throw new Error(`Invalid coordinate: lat=${coord.lat}, lng=${coord.lng}. ` +
|
|
73
|
+
`latitude must be in [-90, 90], longitude in [-180, 180], and both finite.`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Clamps an opacity value to the valid range [0, 1].
|
|
78
|
+
* @param opacity The opacity value to clamp.
|
|
79
|
+
* @param defaultValue Value to use if opacity is not a finite number.
|
|
80
|
+
* @returns The clamped opacity value.
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
function clampOpacity(opacity, defaultValue) {
|
|
84
|
+
if (!Number.isFinite(opacity))
|
|
85
|
+
return defaultValue;
|
|
86
|
+
return Math.max(0, Math.min(1, opacity));
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Type guard for validating circle configurations without throwing.
|
|
90
|
+
* Returns true if the configuration is valid and can be added to the map.
|
|
91
|
+
*
|
|
92
|
+
* @param config Configuration to validate.
|
|
93
|
+
* @returns True if config is a valid CircleConfig, false otherwise.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```typescript
|
|
97
|
+
* if (isValidCircleConfig(userInput)) {
|
|
98
|
+
* map.addCircle(userInput);
|
|
99
|
+
* } else {
|
|
100
|
+
* console.error('Invalid circle configuration');
|
|
101
|
+
* }
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* @group Circles
|
|
105
|
+
*/
|
|
106
|
+
export function isValidCircleConfig(config) {
|
|
107
|
+
if (config === null || config === undefined || typeof config !== "object") {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
const c = config;
|
|
111
|
+
if (typeof c.coordinate !== "object" || c.coordinate === null)
|
|
112
|
+
return false;
|
|
113
|
+
const coord = c.coordinate;
|
|
114
|
+
if (typeof coord.lat !== "number" ||
|
|
115
|
+
typeof coord.lng !== "number" ||
|
|
116
|
+
!Number.isFinite(coord.lat) ||
|
|
117
|
+
!Number.isFinite(coord.lng) ||
|
|
118
|
+
coord.lat < -90 ||
|
|
119
|
+
coord.lat > 90 ||
|
|
120
|
+
coord.lng < -180 ||
|
|
121
|
+
coord.lng > 180) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
if (typeof c.radiusMeters !== "number" ||
|
|
125
|
+
!Number.isFinite(c.radiusMeters) ||
|
|
126
|
+
c.radiusMeters <= 0) {
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
if (c.id !== undefined && typeof c.id !== "string")
|
|
130
|
+
return false;
|
|
131
|
+
if (c.fillColor !== undefined && typeof c.fillColor !== "string")
|
|
132
|
+
return false;
|
|
133
|
+
if (c.fillOpacity !== undefined) {
|
|
134
|
+
if (typeof c.fillOpacity !== "number" || !Number.isFinite(c.fillOpacity))
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
if (c.strokeColor !== undefined && typeof c.strokeColor !== "string")
|
|
138
|
+
return false;
|
|
139
|
+
if (c.strokeWidth !== undefined) {
|
|
140
|
+
if (typeof c.strokeWidth !== "number" || !Number.isFinite(c.strokeWidth))
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
if (c.strokeOpacity !== undefined) {
|
|
144
|
+
if (typeof c.strokeOpacity !== "number" || !Number.isFinite(c.strokeOpacity))
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
if (c.floorId !== undefined && typeof c.floorId !== "string")
|
|
148
|
+
return false;
|
|
149
|
+
if (c.renderOrder !== undefined &&
|
|
150
|
+
!CIRCLE_RENDER_ORDERS.includes(c.renderOrder)) {
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Resolves a {@link CircleConfig} into a {@link CircleRecord}, applying
|
|
157
|
+
* default styling, generating an id when one is not provided, and validating inputs.
|
|
158
|
+
*
|
|
159
|
+
* @param config Circle configuration provided by the SDK consumer.
|
|
160
|
+
* @param hidden Initial hidden state, defaults to visible.
|
|
161
|
+
* @returns The resolved circle record ready to be stored and rendered.
|
|
162
|
+
* @throws {Error} If radiusMeters is ≤ 0, not finite, or coordinates are invalid.
|
|
163
|
+
*
|
|
164
|
+
* @group Circles
|
|
165
|
+
*/
|
|
166
|
+
export function resolveCircleConfig(config, hidden = false) {
|
|
167
|
+
var _a, _b, _c, _d, _e;
|
|
168
|
+
validateRadiusMeters(config.radiusMeters);
|
|
169
|
+
validateCoordinate(config.coordinate);
|
|
170
|
+
if (config.renderOrder !== undefined && !CIRCLE_RENDER_ORDERS.includes(config.renderOrder)) {
|
|
171
|
+
throw new Error(`Invalid renderOrder: ${String(config.renderOrder)}. ` +
|
|
172
|
+
`Must be one of: ${CIRCLE_RENDER_ORDERS.join(", ")}.`);
|
|
173
|
+
}
|
|
174
|
+
return {
|
|
175
|
+
id: (_a = config.id) !== null && _a !== void 0 ? _a : generateHexadecimalKey(),
|
|
176
|
+
// Copy the coordinate so later mutations of the caller's object
|
|
177
|
+
// can't change internal circle state
|
|
178
|
+
coordinate: { lat: config.coordinate.lat, lng: config.coordinate.lng },
|
|
179
|
+
radiusMeters: config.radiusMeters,
|
|
180
|
+
fillColor: (_b = config.fillColor) !== null && _b !== void 0 ? _b : CIRCLE_DEFAULTS.fillColor,
|
|
181
|
+
fillOpacity: clampOpacity(config.fillOpacity, CIRCLE_DEFAULTS.fillOpacity),
|
|
182
|
+
strokeColor: (_c = config.strokeColor) !== null && _c !== void 0 ? _c : CIRCLE_DEFAULTS.strokeColor,
|
|
183
|
+
strokeWidth: (_d = config.strokeWidth) !== null && _d !== void 0 ? _d : CIRCLE_DEFAULTS.strokeWidth,
|
|
184
|
+
strokeOpacity: clampOpacity(config.strokeOpacity, CIRCLE_DEFAULTS.strokeOpacity),
|
|
185
|
+
floorId: config.floorId,
|
|
186
|
+
renderOrder: (_e = config.renderOrder) !== null && _e !== void 0 ? _e : CIRCLE_DEFAULTS.renderOrder,
|
|
187
|
+
hidden,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Builds a closed GeoJSON polygon ring approximating a geographic circle.
|
|
192
|
+
*
|
|
193
|
+
* The ring is computed with an equirectangular approximation: meters are
|
|
194
|
+
* converted to degrees independently per axis, with the longitude scale
|
|
195
|
+
* corrected by the cosine of the latitude. For the radii the SDK works with
|
|
196
|
+
* (tens to hundreds of meters) the metric error is negligible (≤1%) at any latitude
|
|
197
|
+
* where the projection is defined. At extreme polar latitudes, the approximation
|
|
198
|
+
* breaks down, so circles near poles (|lat| > 85°) should be used with caution.
|
|
199
|
+
*
|
|
200
|
+
* @param lng Longitude of the circle center in degrees.
|
|
201
|
+
* @param lat Latitude of the circle center in degrees.
|
|
202
|
+
* @param radiusMeters Radius of the circle in meters. Must be positive and finite.
|
|
203
|
+
* @param points Number of segments in the ring. Defaults to 64. Non-integer
|
|
204
|
+
* values are floored and the count is clamped to a minimum of 3,
|
|
205
|
+
* the smallest valid GeoJSON linear ring; non-finite values fall
|
|
206
|
+
* back to the default.
|
|
207
|
+
* @returns A closed ring of `[lng, lat]` positions (first equals last).
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* ```typescript
|
|
211
|
+
* import { circleRing } from '@mapvx/web-js';
|
|
212
|
+
*
|
|
213
|
+
* // Create a 150-meter radius circle ring
|
|
214
|
+
* const ring = circleRing(-74.0060, 40.7128, 150);
|
|
215
|
+
* const polygon = { type: "Polygon", coordinates: [ring] };
|
|
216
|
+
*
|
|
217
|
+
* // Custom segments (32 instead of 64) for lower resolution
|
|
218
|
+
* const coarseRing = circleRing(-74.0060, 40.7128, 150, 32);
|
|
219
|
+
* ```
|
|
220
|
+
*
|
|
221
|
+
* @note Equirectangular approximation is accurate for radii up to ~500 km and
|
|
222
|
+
* latitudes between approximately ±80°. Beyond these limits, visual
|
|
223
|
+
* distortion may occur near the poles.
|
|
224
|
+
* @note Generated rings do not account for geographic obstacles, walls, or
|
|
225
|
+
* buildings. For complex geofencing, consider server-side validation.
|
|
226
|
+
*
|
|
227
|
+
* @group Circles
|
|
228
|
+
*/
|
|
229
|
+
export function circleRing(lng, lat, radiusMeters, points = 64) {
|
|
230
|
+
// A linear ring needs at least 3 distinct positions to be valid GeoJSON
|
|
231
|
+
const segments = Number.isFinite(points) ? Math.max(3, Math.floor(points)) : 64;
|
|
232
|
+
const ring = [];
|
|
233
|
+
const latRad = (lat * Math.PI) / 180;
|
|
234
|
+
const metersPerDegLat = 110574;
|
|
235
|
+
const metersPerDegLng = 111320 * Math.cos(latRad || 0.000001);
|
|
236
|
+
const latR = radiusMeters / metersPerDegLat;
|
|
237
|
+
const lngR = radiusMeters / (metersPerDegLng || 1);
|
|
238
|
+
for (let i = 0; i < segments; i += 1) {
|
|
239
|
+
const a = (i / segments) * Math.PI * 2;
|
|
240
|
+
ring.push([lng + lngR * Math.cos(a), lat + latR * Math.sin(a)]);
|
|
241
|
+
}
|
|
242
|
+
// Close the ring with an exact copy of the first position, as GeoJSON requires
|
|
243
|
+
ring.push([ring[0][0], ring[0][1]]);
|
|
244
|
+
return ring;
|
|
245
|
+
}
|
|
246
|
+
//# sourceMappingURL=circle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circle.js","sourceRoot":"","sources":["../../../../src/domain/models/circle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAG1D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAAA;AAkB1C;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAiC;IAChE,aAAa;IACb,cAAc;IACd,KAAK;CACG,CAAA;AAEV;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,SAAS,EAAE,iBAAiB;IAC5B,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,CAAC;IACd,aAAa,EAAE,IAAI;IACnB,WAAW,EAAE,cAAmC;CACxC,CAAA;AA8GV;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAoB;IACpD,uCAAY,MAAM,KAAE,UAAU,oBAAO,MAAM,CAAC,UAAU,KAAI;AAC5D,CAAC;AAED;;;;;GAKG;AACH,SAAS,oBAAoB,CAAC,MAAc;IAC1C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,CAAC,EAAE;QAC3C,MAAM,IAAI,KAAK,CAAC,yBAAyB,MAA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AAC,eAAe,IAAI,CAAC,CAAC,CAAA;IAClD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE;QACpC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC,CAAA;QACtC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAChE;IACD,+EAA+E;IAC/E,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACnC,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -519,5 +519,13 @@ export interface Configuration {
|
|
|
519
519
|
* Parameter to control how long take the instruction to appear in screen
|
|
520
520
|
*/
|
|
521
521
|
instructionDurationMs?: number;
|
|
522
|
+
/**
|
|
523
|
+
* Parameter to control if the bearing on route is the same for all the route, or changes by the step
|
|
524
|
+
*/
|
|
525
|
+
keepBearing?: boolean;
|
|
526
|
+
/**
|
|
527
|
+
*
|
|
528
|
+
*/
|
|
529
|
+
routingUnitSystem?: string;
|
|
522
530
|
}
|
|
523
531
|
//# sourceMappingURL=configuration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../src/domain/models/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAA;AAEtC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,aA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AO,CAAA;IAEpB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE;QACb,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;QACb,MAAM,EAAE,MAAM,CAAA;QACd,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;IAED;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IAEzB;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEzB;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAE3B;;;;;;;;;;;OAWG;IACH,aAAa,CAAC,EAAE;QACd,sEAAsE;QACtE,MAAM,EAAE,OAAO,CAAA;QACf,sEAAsE;QACtE,MAAM,EAAE,MAAM,CAAA;KACf,CAAA;IAED;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../src/domain/models/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAA;AAEtC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;;;;;;;OAYG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;IAE9B;;;;;;;;;OASG;IACH,eAAe,EAAE,MAAM,CAAA;IAEvB;;;;;;;;OAQG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAE1B;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;IAE5C;;;;;;;;;;OAUG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB;;;;;;;;OA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