@mapvx/web-js 1.1.1 → 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.
@@ -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,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC9C,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAA;KACvF;IACD,IACE,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC;QAC3B,CAAC,MAAM,CAAC,QAAQ,CAA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AAI,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"}
package/dist/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.loadStyles = exports.MAPVX_DEFAULT_PRECONNECT_HOSTS = exports.injectPreconnects = exports.isMapVxRequestHostname = exports.OpeningHoursHelper = exports.loadCustomization = exports.MVXTransport = exports.UnitSystem = exports.TransportationMode = exports.AnnounceFormat = exports.MVXRouteStep = exports.MVXRouteLeg = exports.MVXRoute = exports.MVXPlace = exports.TextPosition = exports.Institution = exports.isBasicWithLogo = exports.isBasicWithIcon = exports.Banner = exports.createRouteAnimationIconDataUrl = exports.initializeSDK = exports.CountlyLogger = exports.FetchHttpClient = exports.DEFAULT_MAX_STORAGE_BYTES = exports.DEFAULT_CACHE_CONFIGS = exports.CacheManager = exports.PersistentCache = exports.LRUCache = void 0;
3
+ exports.loadStyles = exports.MAPVX_DEFAULT_PRECONNECT_HOSTS = exports.injectPreconnects = exports.isMapVxRequestHostname = exports.OpeningHoursHelper = exports.loadCustomization = exports.MVXTransport = exports.UnitSystem = exports.TransportationMode = exports.AnnounceFormat = exports.MVXRouteStep = exports.MVXRouteLeg = exports.MVXRoute = exports.MVXPlace = exports.TextPosition = exports.Institution = exports.isValidCircleConfig = exports.MAPVX_BRAND_COLOR = exports.CIRCLE_DEFAULTS = exports.circleRing = exports.isBasicWithLogo = exports.isBasicWithIcon = exports.Banner = exports.createRouteAnimationIconDataUrl = exports.initializeSDK = exports.CountlyLogger = exports.FetchHttpClient = exports.DEFAULT_MAX_STORAGE_BYTES = exports.DEFAULT_CACHE_CONFIGS = exports.CacheManager = exports.PersistentCache = exports.LRUCache = void 0;
4
4
  // ─── Infrastructure: Cache ───────────────────────────────────────────────────
5
5
  var LRUCache_1 = require("./infrastructure/cache/LRUCache");
6
6
  Object.defineProperty(exports, "LRUCache", { enumerable: true, get: function () { return LRUCache_1.LRUCache; } });
@@ -30,6 +30,12 @@ Object.defineProperty(exports, "Banner", { enumerable: true, get: function () {
30
30
  var categories_1 = require("./domain/models/categories");
31
31
  Object.defineProperty(exports, "isBasicWithIcon", { enumerable: true, get: function () { return categories_1.isBasicWithIcon; } });
32
32
  Object.defineProperty(exports, "isBasicWithLogo", { enumerable: true, get: function () { return categories_1.isBasicWithLogo; } });
33
+ // ─── Domain Models: Circle ───────────────────────────────────────────────────
34
+ var circle_1 = require("./domain/models/circle");
35
+ Object.defineProperty(exports, "circleRing", { enumerable: true, get: function () { return circle_1.circleRing; } });
36
+ Object.defineProperty(exports, "CIRCLE_DEFAULTS", { enumerable: true, get: function () { return circle_1.CIRCLE_DEFAULTS; } });
37
+ Object.defineProperty(exports, "MAPVX_BRAND_COLOR", { enumerable: true, get: function () { return circle_1.MAPVX_BRAND_COLOR; } });
38
+ Object.defineProperty(exports, "isValidCircleConfig", { enumerable: true, get: function () { return circle_1.isValidCircleConfig; } });
33
39
  // ─── Domain Models: Institution ──────────────────────────────────────────────
34
40
  var institution_1 = require("./domain/models/institution");
35
41
  Object.defineProperty(exports, "Institution", { enumerable: true, get: function () { return institution_1.Institution; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAKA,gFAAgF;AAChF,4DAA0D;AAAjD,oGAAA,QAAQ,OAAA;AACjB,0EAAwE;AAA/D,kHAAA,eAAe,OAAA;AACxB,oEAAkE;AAAzD,4GAAA,YAAY,OAAA;AAErB,kEAG2C;AA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CAAgD;AAAvC,iGAAA,QAAQ,OAAA;AAKjB,gFAAgF;AAChF,+CAA2E;AAAlE,iGAAA,QAAQ,OAAA;AAAE,oGAAA,WAAW,OAAA;AAAE,qGAAA,YAAY,OAAA;AAE5C,gFAAgF;AAChF,yEAAmG;AAA1F,oHAAA,cAAc,OAAA;AAAE,wHAAA,kBAAkB,OAAA;AAAE,gHAAA,UAAU,OAAA;AAWvD,gFAAgF;AAChF,uDAAwD;AAA/C,yGAAA,YAAY,OAAA;AAQrB,gFAAgF;AAChF,iDAAsD;AAA7C,+GAAA,iBAAiB,OAAA;AAC1B,qEAAiE;AAAxD,0HAAA,kBAAkB,OAAA;AAC3B,uDAA8D;AAArD,uHAAA,sBAAsB,OAAA;AAC/B,iDAAsF;AAA7E,+GAAA,iBAAiB,OAAA;AAAE,4HAAA,8BAA8B,OAAA;AAE1D;;;GAGG;AACI,MAAM,UAAU,GAAG,GAAS,EAAE;IACnC,qCAAqC;IACrC,IAAI,QAAQ,CAAC,aAAa,CAAC,yBAAyB,CAAC,EAAE;QACrD,OAAM;KACP;IAED,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;IAC3C,IAAI,CAAC,GAAG,GAAG,YAAY,CAAA;IACvB,IAAI,CAAC,IAAI,GAAG,cAAc,CAAA,CAAC,wBAAwB;IACnD,IAAI,CAAC,YAAY,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAA;IAC9C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;AACjC,CAAC,CAAA;AAXY,QAAA,UAAU,cAWtB"}
@@ -17,7 +17,7 @@ const countly = {
17
17
  // The typeof guards make the lookup safe everywhere; the version placeholder
18
18
  // is replaced with the package version by scripts/inject-build-defines.js.
19
19
  const IS_DEBUG = typeof DEBUG !== "undefined" ? DEBUG : false;
20
- const SDK_VERSION = typeof VERSION !== "undefined" ? VERSION : "1.1.1";
20
+ const SDK_VERSION = typeof VERSION !== "undefined" ? VERSION : "1.2.1";
21
21
  class Logger {
22
22
  constructor() {
23
23
  var _a;
@@ -5,7 +5,7 @@ exports.argsToDict = exports._rollbarConfig = void 0;
5
5
  // bundle. The tsc-built ES/CJS outputs keep it as a bare global, so the
6
6
  // typeof guard makes the lookup safe everywhere; the version placeholder is
7
7
  // replaced with the package version by scripts/inject-build-defines.js.
8
- const SDK_VERSION = typeof VERSION !== "undefined" ? VERSION : "1.1.1";
8
+ const SDK_VERSION = typeof VERSION !== "undefined" ? VERSION : "1.2.1";
9
9
  exports._rollbarConfig = {
10
10
  accessToken: "28279d52df43411ebd138c2bee0ab1df",
11
11
  // Only report what the SDK logs explicitly via logError. Capturing every