@mapvx/web-js 1.1.1 → 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 +86 -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 +21 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/logger/logger.js +13 -8
- package/dist/cjs/logger/logger.js.map +1 -1
- package/dist/cjs/logger/rollbar.js +11 -6
- 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/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 +8 -0
- package/dist/es/domain/models/marker.d.ts.map +1 -1
- package/dist/es/domain/models/marker.js +86 -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 +14 -11
- package/dist/es/index.d.ts.map +1 -1
- package/dist/es/index.js +9 -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 +13 -8
- 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 +11 -6
- 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/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 +1792 -657
- 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
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.circleRing = exports.resolveCircleConfig = exports.isValidCircleConfig = exports.cloneCircleRecord = exports.CIRCLE_DEFAULTS = exports.CIRCLE_RENDER_ORDERS = exports.MAPVX_BRAND_COLOR = void 0;
|
|
4
|
+
const utils_1 = require("../../utils/utils");
|
|
5
|
+
/**
|
|
6
|
+
* MapVX brand color used as the default for circle styling and other
|
|
7
|
+
* SDK-drawn overlays (colored places, borders).
|
|
8
|
+
*
|
|
9
|
+
* @group Circles
|
|
10
|
+
*/
|
|
11
|
+
exports.MAPVX_BRAND_COLOR = "#276EF1";
|
|
12
|
+
/**
|
|
13
|
+
* Valid values for {@link CircleRenderOrder}, in rendering order.
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
exports.CIRCLE_RENDER_ORDERS = [
|
|
17
|
+
"belowLabels",
|
|
18
|
+
"aboveBasemap",
|
|
19
|
+
"top",
|
|
20
|
+
];
|
|
21
|
+
/**
|
|
22
|
+
* Default styling values applied to a circle when the corresponding
|
|
23
|
+
* {@link CircleConfig} fields are omitted.
|
|
24
|
+
*
|
|
25
|
+
* @group Circles
|
|
26
|
+
*/
|
|
27
|
+
exports.CIRCLE_DEFAULTS = {
|
|
28
|
+
fillColor: exports.MAPVX_BRAND_COLOR,
|
|
29
|
+
fillOpacity: 0.14,
|
|
30
|
+
strokeColor: exports.MAPVX_BRAND_COLOR,
|
|
31
|
+
strokeWidth: 2,
|
|
32
|
+
strokeOpacity: 0.65,
|
|
33
|
+
renderOrder: "aboveBasemap",
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Returns a deep copy of a {@link CircleRecord}, including the nested
|
|
37
|
+
* coordinate. Used by the map accessors so callers can't mutate internal
|
|
38
|
+
* circle state by writing to a returned record.
|
|
39
|
+
*
|
|
40
|
+
* @param record The circle record to clone.
|
|
41
|
+
* @returns An independent copy of the record.
|
|
42
|
+
*
|
|
43
|
+
* @group Circles
|
|
44
|
+
*/
|
|
45
|
+
function cloneCircleRecord(record) {
|
|
46
|
+
return Object.assign(Object.assign({}, record), { coordinate: Object.assign({}, record.coordinate) });
|
|
47
|
+
}
|
|
48
|
+
exports.cloneCircleRecord = cloneCircleRecord;
|
|
49
|
+
/**
|
|
50
|
+
* Validates that a radius in meters is positive and finite.
|
|
51
|
+
* @param radius The radius value to validate.
|
|
52
|
+
* @throws {Error} If radius is ≤ 0 or not finite (NaN/Infinity).
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
function validateRadiusMeters(radius) {
|
|
56
|
+
if (!Number.isFinite(radius) || radius <= 0) {
|
|
57
|
+
throw new Error(`Invalid radiusMeters: ${radius}. Must be a positive finite number.`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Validates that a coordinate is within valid geographic bounds.
|
|
62
|
+
* @param coord The coordinate to validate.
|
|
63
|
+
* @throws {Error} If latitude is outside [-90, 90] or longitude outside [-180, 180], or not finite.
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
function validateCoordinate(coord) {
|
|
67
|
+
if (coord == null || typeof coord !== "object") {
|
|
68
|
+
throw new Error("Invalid coordinate: expected an object with lat and lng properties.");
|
|
69
|
+
}
|
|
70
|
+
if (!Number.isFinite(coord.lat) ||
|
|
71
|
+
!Number.isFinite(coord.lng) ||
|
|
72
|
+
coord.lat < -90 ||
|
|
73
|
+
coord.lat > 90 ||
|
|
74
|
+
coord.lng < -180 ||
|
|
75
|
+
coord.lng > 180) {
|
|
76
|
+
throw new Error(`Invalid coordinate: lat=${coord.lat}, lng=${coord.lng}. ` +
|
|
77
|
+
`latitude must be in [-90, 90], longitude in [-180, 180], and both finite.`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Clamps an opacity value to the valid range [0, 1].
|
|
82
|
+
* @param opacity The opacity value to clamp.
|
|
83
|
+
* @param defaultValue Value to use if opacity is not a finite number.
|
|
84
|
+
* @returns The clamped opacity value.
|
|
85
|
+
* @internal
|
|
86
|
+
*/
|
|
87
|
+
function clampOpacity(opacity, defaultValue) {
|
|
88
|
+
if (!Number.isFinite(opacity))
|
|
89
|
+
return defaultValue;
|
|
90
|
+
return Math.max(0, Math.min(1, opacity));
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Type guard for validating circle configurations without throwing.
|
|
94
|
+
* Returns true if the configuration is valid and can be added to the map.
|
|
95
|
+
*
|
|
96
|
+
* @param config Configuration to validate.
|
|
97
|
+
* @returns True if config is a valid CircleConfig, false otherwise.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```typescript
|
|
101
|
+
* if (isValidCircleConfig(userInput)) {
|
|
102
|
+
* map.addCircle(userInput);
|
|
103
|
+
* } else {
|
|
104
|
+
* console.error('Invalid circle configuration');
|
|
105
|
+
* }
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* @group Circles
|
|
109
|
+
*/
|
|
110
|
+
function isValidCircleConfig(config) {
|
|
111
|
+
if (config === null || config === undefined || typeof config !== "object") {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
const c = config;
|
|
115
|
+
if (typeof c.coordinate !== "object" || c.coordinate === null)
|
|
116
|
+
return false;
|
|
117
|
+
const coord = c.coordinate;
|
|
118
|
+
if (typeof coord.lat !== "number" ||
|
|
119
|
+
typeof coord.lng !== "number" ||
|
|
120
|
+
!Number.isFinite(coord.lat) ||
|
|
121
|
+
!Number.isFinite(coord.lng) ||
|
|
122
|
+
coord.lat < -90 ||
|
|
123
|
+
coord.lat > 90 ||
|
|
124
|
+
coord.lng < -180 ||
|
|
125
|
+
coord.lng > 180) {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
if (typeof c.radiusMeters !== "number" ||
|
|
129
|
+
!Number.isFinite(c.radiusMeters) ||
|
|
130
|
+
c.radiusMeters <= 0) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
if (c.id !== undefined && typeof c.id !== "string")
|
|
134
|
+
return false;
|
|
135
|
+
if (c.fillColor !== undefined && typeof c.fillColor !== "string")
|
|
136
|
+
return false;
|
|
137
|
+
if (c.fillOpacity !== undefined) {
|
|
138
|
+
if (typeof c.fillOpacity !== "number" || !Number.isFinite(c.fillOpacity))
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
if (c.strokeColor !== undefined && typeof c.strokeColor !== "string")
|
|
142
|
+
return false;
|
|
143
|
+
if (c.strokeWidth !== undefined) {
|
|
144
|
+
if (typeof c.strokeWidth !== "number" || !Number.isFinite(c.strokeWidth))
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
if (c.strokeOpacity !== undefined) {
|
|
148
|
+
if (typeof c.strokeOpacity !== "number" || !Number.isFinite(c.strokeOpacity))
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
if (c.floorId !== undefined && typeof c.floorId !== "string")
|
|
152
|
+
return false;
|
|
153
|
+
if (c.renderOrder !== undefined &&
|
|
154
|
+
!exports.CIRCLE_RENDER_ORDERS.includes(c.renderOrder)) {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
exports.isValidCircleConfig = isValidCircleConfig;
|
|
160
|
+
/**
|
|
161
|
+
* Resolves a {@link CircleConfig} into a {@link CircleRecord}, applying
|
|
162
|
+
* default styling, generating an id when one is not provided, and validating inputs.
|
|
163
|
+
*
|
|
164
|
+
* @param config Circle configuration provided by the SDK consumer.
|
|
165
|
+
* @param hidden Initial hidden state, defaults to visible.
|
|
166
|
+
* @returns The resolved circle record ready to be stored and rendered.
|
|
167
|
+
* @throws {Error} If radiusMeters is ≤ 0, not finite, or coordinates are invalid.
|
|
168
|
+
*
|
|
169
|
+
* @group Circles
|
|
170
|
+
*/
|
|
171
|
+
function resolveCircleConfig(config, hidden = false) {
|
|
172
|
+
var _a, _b, _c, _d, _e;
|
|
173
|
+
validateRadiusMeters(config.radiusMeters);
|
|
174
|
+
validateCoordinate(config.coordinate);
|
|
175
|
+
if (config.renderOrder !== undefined && !exports.CIRCLE_RENDER_ORDERS.includes(config.renderOrder)) {
|
|
176
|
+
throw new Error(`Invalid renderOrder: ${String(config.renderOrder)}. ` +
|
|
177
|
+
`Must be one of: ${exports.CIRCLE_RENDER_ORDERS.join(", ")}.`);
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
id: (_a = config.id) !== null && _a !== void 0 ? _a : (0, utils_1.generateHexadecimalKey)(),
|
|
181
|
+
// Copy the coordinate so later mutations of the caller's object
|
|
182
|
+
// can't change internal circle state
|
|
183
|
+
coordinate: { lat: config.coordinate.lat, lng: config.coordinate.lng },
|
|
184
|
+
radiusMeters: config.radiusMeters,
|
|
185
|
+
fillColor: (_b = config.fillColor) !== null && _b !== void 0 ? _b : exports.CIRCLE_DEFAULTS.fillColor,
|
|
186
|
+
fillOpacity: clampOpacity(config.fillOpacity, exports.CIRCLE_DEFAULTS.fillOpacity),
|
|
187
|
+
strokeColor: (_c = config.strokeColor) !== null && _c !== void 0 ? _c : exports.CIRCLE_DEFAULTS.strokeColor,
|
|
188
|
+
strokeWidth: (_d = config.strokeWidth) !== null && _d !== void 0 ? _d : exports.CIRCLE_DEFAULTS.strokeWidth,
|
|
189
|
+
strokeOpacity: clampOpacity(config.strokeOpacity, exports.CIRCLE_DEFAULTS.strokeOpacity),
|
|
190
|
+
floorId: config.floorId,
|
|
191
|
+
renderOrder: (_e = config.renderOrder) !== null && _e !== void 0 ? _e : exports.CIRCLE_DEFAULTS.renderOrder,
|
|
192
|
+
hidden,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
exports.resolveCircleConfig = resolveCircleConfig;
|
|
196
|
+
/**
|
|
197
|
+
* Builds a closed GeoJSON polygon ring approximating a geographic circle.
|
|
198
|
+
*
|
|
199
|
+
* The ring is computed with an equirectangular approximation: meters are
|
|
200
|
+
* converted to degrees independently per axis, with the longitude scale
|
|
201
|
+
* corrected by the cosine of the latitude. For the radii the SDK works with
|
|
202
|
+
* (tens to hundreds of meters) the metric error is negligible (≤1%) at any latitude
|
|
203
|
+
* where the projection is defined. At extreme polar latitudes, the approximation
|
|
204
|
+
* breaks down, so circles near poles (|lat| > 85°) should be used with caution.
|
|
205
|
+
*
|
|
206
|
+
* @param lng Longitude of the circle center in degrees.
|
|
207
|
+
* @param lat Latitude of the circle center in degrees.
|
|
208
|
+
* @param radiusMeters Radius of the circle in meters. Must be positive and finite.
|
|
209
|
+
* @param points Number of segments in the ring. Defaults to 64. Non-integer
|
|
210
|
+
* values are floored and the count is clamped to a minimum of 3,
|
|
211
|
+
* the smallest valid GeoJSON linear ring; non-finite values fall
|
|
212
|
+
* back to the default.
|
|
213
|
+
* @returns A closed ring of `[lng, lat]` positions (first equals last).
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* ```typescript
|
|
217
|
+
* import { circleRing } from '@mapvx/web-js';
|
|
218
|
+
*
|
|
219
|
+
* // Create a 150-meter radius circle ring
|
|
220
|
+
* const ring = circleRing(-74.0060, 40.7128, 150);
|
|
221
|
+
* const polygon = { type: "Polygon", coordinates: [ring] };
|
|
222
|
+
*
|
|
223
|
+
* // Custom segments (32 instead of 64) for lower resolution
|
|
224
|
+
* const coarseRing = circleRing(-74.0060, 40.7128, 150, 32);
|
|
225
|
+
* ```
|
|
226
|
+
*
|
|
227
|
+
* @note Equirectangular approximation is accurate for radii up to ~500 km and
|
|
228
|
+
* latitudes between approximately ±80°. Beyond these limits, visual
|
|
229
|
+
* distortion may occur near the poles.
|
|
230
|
+
* @note Generated rings do not account for geographic obstacles, walls, or
|
|
231
|
+
* buildings. For complex geofencing, consider server-side validation.
|
|
232
|
+
*
|
|
233
|
+
* @group Circles
|
|
234
|
+
*/
|
|
235
|
+
function circleRing(lng, lat, radiusMeters, points = 64) {
|
|
236
|
+
// A linear ring needs at least 3 distinct positions to be valid GeoJSON
|
|
237
|
+
const segments = Number.isFinite(points) ? Math.max(3, Math.floor(points)) : 64;
|
|
238
|
+
const ring = [];
|
|
239
|
+
const latRad = (lat * Math.PI) / 180;
|
|
240
|
+
const metersPerDegLat = 110574;
|
|
241
|
+
const metersPerDegLng = 111320 * Math.cos(latRad || 0.000001);
|
|
242
|
+
const latR = radiusMeters / metersPerDegLat;
|
|
243
|
+
const lngR = radiusMeters / (metersPerDegLng || 1);
|
|
244
|
+
for (let i = 0; i < segments; i += 1) {
|
|
245
|
+
const a = (i / segments) * Math.PI * 2;
|
|
246
|
+
ring.push([lng + lngR * Math.cos(a), lat + latR * Math.sin(a)]);
|
|
247
|
+
}
|
|
248
|
+
// Close the ring with an exact copy of the first position, as GeoJSON requires
|
|
249
|
+
ring.push([ring[0][0], ring[0][1]]);
|
|
250
|
+
return ring;
|
|
251
|
+
}
|
|
252
|
+
exports.circleRing = circleRing;
|
|
253
|
+
//# sourceMappingURL=circle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circle.js","sourceRoot":"","sources":["../../../../src/domain/models/circle.ts"],"names":[],"mappings":";;;AAAA,6CAA0D;AAG1D;;;;;GAKG;AACU,QAAA,iBAAiB,GAAG,SAAS,CAAA;AAkB1C;;;GAGG;AACU,QAAA,oBAAoB,GAAiC;IAChE,aAAa;IACb,cAAc;IACd,KAAK;CACG,CAAA;AAEV;;;;;GAKG;AACU,QAAA,eAAe,GAAG;IAC7B,SAAS,EAAE,yBAAiB;IAC5B,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE,yBAAiB;IAC9B,WAAW,EAAE,CAAC;IACd,aAAa,EAAE,IAAI;IACnB,WAAW,EAAE,cAAmC;CACxC,CAAA;AA8GV;;;;;;;;;GASG;AACH,SAAgB,iBAAiB,CAAC,MAAoB;IACpD,uCAAY,MAAM,KAAE,UAAU,oBAAO,MAAM,CAAC,UAAU,KAAI;AAC5D,CAAC;AAFD,8CAEC;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,MAAM,qCAAqC,CAAC,CAAA;KACtF;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAS,kBAAkB,CAAC,KAAgC;IAC1D,IAAI,KA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AE,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;AAtBD,gCAsBC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_TILE_CACHE_CONFIG = void 0;
|
|
3
|
+
exports.MAPLIBRE_MAX_TILE_CACHE_HARD_CAP = exports.DEFAULT_TILE_CACHE_CONFIG = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Default values for tile cache configuration
|
|
6
6
|
* @internal
|
|
@@ -11,5 +11,14 @@ exports.DEFAULT_TILE_CACHE_CONFIG = {
|
|
|
11
11
|
ttlMs: 30 * 60 * 1000,
|
|
12
12
|
persistToServiceWorker: true,
|
|
13
13
|
preloadAdjacentZooms: false,
|
|
14
|
+
maxConcurrentTileFetches: 6,
|
|
14
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* Hard cap for {@link MapTileCacheConfig.maxTiles}.
|
|
18
|
+
* Configurations above this (e.g. millions) are clamped to avoid memory pressure
|
|
19
|
+
* and excessive interaction with the tile CDN / service worker.
|
|
20
|
+
*
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
exports.MAPLIBRE_MAX_TILE_CACHE_HARD_CAP = 100000;
|
|
15
24
|
//# sourceMappingURL=mapConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapConfig.js","sourceRoot":"","sources":["../../../../src/domain/models/mapConfig.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"mapConfig.js","sourceRoot":"","sources":["../../../../src/domain/models/mapConfig.ts"],"names":[],"mappings":";;;AAqEA;;;GAGG;AACU,QAAA,yBAAyB,GAAiC;IACrE,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,GAAG;IACb,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI;IACrB,sBAAsB,EAAE,IAAI;IAC5B,oBAAoB,EAAE,KAAK;IAC3B,wBAAwB,EAAE,CAAC;CAC5B,CAAA;AAED;;;;;;GAMG;AACU,QAAA,gCAAgC,GAAG,MAAO,CAAA"}
|
|
@@ -48,84 +48,88 @@ class MarkerUtils {
|
|
|
48
48
|
* ```
|
|
49
49
|
*/
|
|
50
50
|
static createMarkerElement(marker) {
|
|
51
|
-
var _a, _b, _c, _d;
|
|
52
51
|
const markerContainer = document.createElement("div");
|
|
53
|
-
// Configure specific marker dimensions
|
|
54
|
-
const iconWidth = (_b = (_a = marker.iconProperties) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : 40;
|
|
55
|
-
const iconHeight = (_d = (_c = marker.iconProperties) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : 40;
|
|
56
|
-
// Apply base class
|
|
57
52
|
markerContainer.className = "mapvx-marker";
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
53
|
+
this.applyContainerLayout(markerContainer, marker);
|
|
54
|
+
for (const child of this.createMarkerChildren(marker)) {
|
|
55
|
+
markerContainer.appendChild(child);
|
|
56
|
+
}
|
|
57
|
+
return markerContainer;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Applies the marker container's own classes and box size from a config.
|
|
61
|
+
* Shared by {@link createMarkerElement} and {@link MarkerAttribute.updateIcon}
|
|
62
|
+
* so create and update stay in sync (single source of truth for which state
|
|
63
|
+
* classes exist and how the anchored box is sized). It is idempotent, so it
|
|
64
|
+
* also resets stale state when reused to update an existing element.
|
|
65
|
+
*
|
|
66
|
+
* @param container - The `.mapvx-marker` element to configure
|
|
67
|
+
* @param marker - Marker configuration
|
|
68
|
+
*/
|
|
69
|
+
static applyContainerLayout(container, marker) {
|
|
70
|
+
var _a, _b, _c, _d;
|
|
71
|
+
// Reset the state classes we own (no-op on a fresh element).
|
|
72
|
+
container.classList.remove("no-text", "interactive");
|
|
73
|
+
// The container box equals the icon box so the out-of-flow label never
|
|
74
|
+
// displaces the icon from the coordinate MapLibre anchors. A caller-
|
|
75
|
+
// provided `element` owns its own size, so we let the box size to it.
|
|
76
|
+
if (marker.element) {
|
|
77
|
+
container.style.width = "";
|
|
78
|
+
container.style.height = "";
|
|
76
79
|
}
|
|
77
80
|
else {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
const iconWidth = (_b = (_a = marker.iconProperties) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : 40;
|
|
82
|
+
const iconHeight = (_d = (_c = marker.iconProperties) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : 40;
|
|
83
|
+
container.style.width = `${iconWidth}px`;
|
|
84
|
+
container.style.height = `${iconHeight}px`;
|
|
82
85
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
if (!marker.text) {
|
|
87
|
+
container.classList.add("no-text");
|
|
88
|
+
}
|
|
89
|
+
// Only flag the marker interactive when it actually handles clicks: this
|
|
90
|
+
// flips the out-of-flow label's pointer-events to auto (see styles.css)
|
|
91
|
+
// so the label is hit-testable, while non-clickable labels stay
|
|
92
|
+
// click-through and never block the map.
|
|
93
|
+
if (marker.onClick) {
|
|
94
|
+
container.classList.add("interactive");
|
|
90
95
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Builds the in-order children for a marker container: the icon (or the
|
|
99
|
+
* caller-provided element) followed by the optional out-of-flow label. DOM
|
|
100
|
+
* order is irrelevant for placement — the .text-container position classes
|
|
101
|
+
* (top/bottom/left/right) lay the label out around the icon.
|
|
102
|
+
*
|
|
103
|
+
* @param marker - Marker configuration
|
|
104
|
+
* @returns The child elements to append to the container
|
|
105
|
+
*/
|
|
106
|
+
static createMarkerChildren(marker) {
|
|
107
|
+
var _a, _b, _c, _d;
|
|
108
|
+
const children = [];
|
|
109
|
+
if (marker.element) {
|
|
110
|
+
children.push(marker.element);
|
|
103
111
|
}
|
|
104
112
|
else {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
113
|
+
const iconWidth = (_b = (_a = marker.iconProperties) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : 40;
|
|
114
|
+
const iconHeight = (_d = (_c = marker.iconProperties) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : 40;
|
|
115
|
+
children.push(this.createIconElement(marker, iconWidth, iconHeight));
|
|
108
116
|
}
|
|
109
|
-
|
|
117
|
+
if (marker.text) {
|
|
118
|
+
children.push(this.buildTextContainer(marker));
|
|
119
|
+
}
|
|
120
|
+
return children;
|
|
110
121
|
}
|
|
111
122
|
/**
|
|
112
|
-
*
|
|
123
|
+
* Builds the positioned label container for a marker.
|
|
113
124
|
*
|
|
114
|
-
* @param
|
|
115
|
-
* @
|
|
116
|
-
* @param iconHeight - Height of the icon for positioning calculations
|
|
117
|
-
* @param iconWidth - Width of the icon for positioning calculations
|
|
118
|
-
* @returns Container element with properly positioned text
|
|
125
|
+
* @param marker - Marker configuration; `text` is assumed to be set
|
|
126
|
+
* @returns The `.text-container` element ready to append
|
|
119
127
|
*/
|
|
120
|
-
static
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
const textContainer = this.createTextContainer(textElement, markerConfig.textPosition);
|
|
126
|
-
container.appendChild(textContainer);
|
|
127
|
-
}
|
|
128
|
-
return container;
|
|
128
|
+
static buildTextContainer(marker) {
|
|
129
|
+
const textElement = typeof marker.text === "string"
|
|
130
|
+
? this.createTextElement(marker.text, marker.textProperties)
|
|
131
|
+
: marker.text;
|
|
132
|
+
return this.createTextContainer(textElement, marker.textPosition);
|
|
129
133
|
}
|
|
130
134
|
/**
|
|
131
135
|
* Creates an icon element with proper styling.
|
|
@@ -158,7 +162,8 @@ class MarkerUtils {
|
|
|
158
162
|
}
|
|
159
163
|
/**
|
|
160
164
|
* Creates a text container with proper positioning using CSS classes.
|
|
161
|
-
*
|
|
165
|
+
* The container is absolutely positioned (out of flow) so the label
|
|
166
|
+
* never grows the marker's anchored box.
|
|
162
167
|
*
|
|
163
168
|
* @param textElement - The text element to contain
|
|
164
169
|
* @param textPosition - Desired position relative to the icon
|
|
@@ -280,6 +285,10 @@ class MarkerAttribute extends maplibre_gl_1.Marker {
|
|
|
280
285
|
anchor: (_a = markerConfig.anchor) !== null && _a !== void 0 ? _a : "center",
|
|
281
286
|
offset: [0, 0],
|
|
282
287
|
});
|
|
288
|
+
// Route clicks through an instance-level handler so the latest onClick is
|
|
289
|
+
// always invoked, even after updateIcon replaces the marker content.
|
|
290
|
+
this._userOnClick = markerConfig.onClick;
|
|
291
|
+
this._element.addEventListener("click", () => { var _a; return (_a = this._userOnClick) === null || _a === void 0 ? void 0 : _a.call(this); });
|
|
283
292
|
this.setLngLat([markerConfig.coordinate.lng, markerConfig.coordinate.lat]);
|
|
284
293
|
this.setRotationAlignment((_b = markerConfig.rotationAlignment) !== null && _b !== void 0 ? _b : "viewport");
|
|
285
294
|
this.setPitchAlignment("viewport");
|
|
@@ -320,20 +329,17 @@ class MarkerAttribute extends maplibre_gl_1.Marker {
|
|
|
320
329
|
* ```
|
|
321
330
|
*/
|
|
322
331
|
updateIcon(marker) {
|
|
323
|
-
var _a
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
this.setRotationAlignment((_b = marker.rotationAlignment) !== null && _b !== void 0 ? _b : "viewport");
|
|
332
|
+
var _a;
|
|
333
|
+
// Reconfigure the element MapLibre already holds in place, rather than
|
|
334
|
+
// building a throwaway element and grafting pieces of it. MapLibre owns the
|
|
335
|
+
// element's other classes and inline styles (transform, position), which
|
|
336
|
+
// must survive the update; we only reset our own classes/size and swap the
|
|
337
|
+
// children. Both create and update go through the same MarkerUtils helpers,
|
|
338
|
+
// so they cannot drift apart.
|
|
339
|
+
MarkerUtils.applyContainerLayout(this._element, marker);
|
|
340
|
+
this._element.replaceChildren(...MarkerUtils.createMarkerChildren(marker));
|
|
341
|
+
this._userOnClick = marker.onClick;
|
|
342
|
+
this.setRotationAlignment((_a = marker.rotationAlignment) !== null && _a !== void 0 ? _a : "viewport");
|
|
337
343
|
this.setPitchAlignment("viewport");
|
|
338
344
|
if (typeof marker.rotation === "number") {
|
|
339
345
|
this.setRotation(marker.rotation);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marker.js","sourceRoot":"","sources":["../../../../src/domain/models/marker.ts"],"names":[],"mappings":";;;AAAA,6CAAmE;AACnE,6CAA0D;AAG1D;;;;;;;;;;;;;;GAcG;AACH,IAAY,YASX;AATD,WAAY,YAAY;IACtB,8CAA8C;IAC9C,+CAAI,CAAA;IACJ,+CAA+C;IAC/C,iDAAK,CAAA;IACL,qCAAqC;IACrC,6CAAG,CAAA;IACH,qCAAqC;IACrC,mDAAM,CAAA;AACR,CAAC,EATW,YAAY,4BAAZ,YAAY,QASvB;
|
|
1
|
+
{"version":3,"file":"marker.js","sourceRoot":"","sources":["../../../../src/domain/models/marker.ts"],"names":[],"mappings":";;;AAAA,6CAAmE;AACnE,6CAA0D;AAG1D;;;;;;;;;;;;;;GAcG;AACH,IAAY,YASX;AATD,WAAY,YAAY;IACtB,8CAA8C;IAC9C,+CAAI,CAAA;IACJ,+CAA+C;IAC/C,iDAAK,CAAA;IACL,qCAAqC;IACrC,6CAAG,CAAA;IACH,qCAAqC;IACrC,mDAAM,CAAA;AACR,CAAC,EATW,YAAY,4BAAZ,YAAY,QASvB;AA4LD;;;GAGG;AACH,MAAM,WAAW;IACf;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,mBAAmB,CAAC,MAAoB;QAC7C,MAAM,eAAe,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;QACrD,eAAe,CAAC,SAAS,GAAG,cAAc,CAAA;QAC1C,IAAI,CAAC,oBAAoB,CAAC,eAAe,EAAE,MAAM,CAAC,CAAA;QAClD,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE;YACrD,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;SACnC;QACD,OAAO,eAAe,CAAA;IACxB,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,oBAAoB,CAAC,SAAsB,EAAE,MAAoB;;QACtE,6DAA6D;QAC7D,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA;QAEpD,uEAAuE;Q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,YAAqB,KAAK;QAClF,IAAI,OAAO,IAAI,IAAI,CAAC,OAAO,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;YAC3D,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;SACf;aAAM;YACL,IAAI,CAAC,IAAI,EAAE,CAAA;SACZ;IACH,CAAC;CACF;AA/KD,0CA+KC"}
|
|
@@ -45,15 +45,17 @@ class InternalGetRouteConfiguration {
|
|
|
45
45
|
* @param language The language for the instructions.
|
|
46
46
|
* @param unitSystem The unit system used for the distance.
|
|
47
47
|
* @param announceFormat The format used to announce directions in the instructions.
|
|
48
|
+
* @param userBearing The user's heading in degrees used as the reference direction for announcing turns.
|
|
48
49
|
*/
|
|
49
50
|
constructor(config) {
|
|
50
|
-
var _a, _b, _c, _d;
|
|
51
|
+
var _a, _b, _c, _d, _e;
|
|
51
52
|
this.initialLocation = config.initialLocation;
|
|
52
53
|
this.finalLocation = config.finalLocation;
|
|
53
54
|
this.preferAccessibleRoute = (_a = config.preferAccessibleRoute) !== null && _a !== void 0 ? _a : false;
|
|
54
55
|
this.language = (_b = config.language) !== null && _b !== void 0 ? _b : "en";
|
|
55
56
|
this.unitSystem = (_c = config.unitSystem) !== null && _c !== void 0 ? _c : UnitSystem.metric;
|
|
56
57
|
this.announceFormat = (_d = config.announceFormat) !== null && _d !== void 0 ? _d : AnnounceFormat.relative;
|
|
58
|
+
this.userBearing = (_e = config.userBearing) !== null && _e !== void 0 ? _e : 0;
|
|
57
59
|
}
|
|
58
60
|
}
|
|
59
61
|
exports.InternalGetRouteConfiguration = InternalGetRouteConfiguration;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routeConfiguration.js","sourceRoot":"","sources":["../../../../src/domain/models/routeConfiguration.ts"],"names":[],"mappings":";;;AAGA;;;GAGG;AACH,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,uCAAqB,CAAA;IACrB,iCAAe,CAAA;IACf,uCAAqB,CAAA;AACvB,CAAC,EAJW,cAAc,8BAAd,cAAc,QAIzB;AAED;;;GAGG;AACH,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,6BAAe,CAAA;AACjB,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB;AAED;;;GAGG;AACH,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,yCAAmB,CAAA;IACnB,6CAAuB,CAAA;IACvB,yCAAmB,CAAA;AACrB,CAAC,EALW,kBAAkB,kCAAlB,kBAAkB,QAK7B;
|
|
1
|
+
{"version":3,"file":"routeConfiguration.js","sourceRoot":"","sources":["../../../../src/domain/models/routeConfiguration.ts"],"names":[],"mappings":";;;AAGA;;;GAGG;AACH,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,uCAAqB,CAAA;IACrB,iCAAe,CAAA;IACf,uCAAqB,CAAA;AACvB,CAAC,EAJW,cAAc,8BAAd,cAAc,QAIzB;AAED;;;GAGG;AACH,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,mCAAqB,CAAA;IACrB,6BAAe,CAAA;AACjB,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB;AAED;;;GAGG;AACH,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,yCAAmB,CAAA;IACnB,6CAAuB,CAAA;IACvB,yCAAmB,CAAA;AACrB,CAAC,EALW,kBAAkB,kCAAlB,kBAAkB,QAK7B;AAiDD;;;GAGG;AACH,MAAa,6BAA6B;IASxC;;;;;;;;;OASG;IACH,YAAY,MAA6B;;QACvC,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAA;QAC7C,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAA;QACzC,IAAI,CAAC,qBAAqB,GAAG,MAAA,MAAM,CAAC,qBAAqB,mCAAI,KAAK,C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