@mapvx/web-js 1.8.0 → 2.0.0
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/dist/cjs/config/draco.js +15 -0
- package/dist/cjs/config/draco.js.map +1 -0
- package/dist/cjs/domain/models/mapConfig.js.map +1 -1
- package/dist/cjs/domain/models/scene3D.js +3 -0
- package/dist/cjs/domain/models/scene3D.js.map +1 -0
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/infrastructure/logging/{CountlyLogger.js → MVXLogger.js} +15 -13
- package/dist/cjs/infrastructure/logging/MVXLogger.js.map +1 -0
- package/dist/cjs/logger/logger.js +30 -54
- package/dist/cjs/logger/logger.js.map +1 -1
- package/dist/cjs/logger/sentry.js +76 -0
- package/dist/cjs/logger/sentry.js.map +1 -0
- package/dist/cjs/map/map.js +40 -9
- package/dist/cjs/map/map.js.map +1 -1
- package/dist/cjs/map/scene3DController.js +443 -0
- package/dist/cjs/map/scene3DController.js.map +1 -0
- package/dist/cjs/utils/3d.js +133 -0
- package/dist/cjs/utils/3d.js.map +1 -0
- package/dist/cjs/utils/deckLayers.js +153 -0
- package/dist/cjs/utils/deckLayers.js.map +1 -0
- package/dist/cjs/utils/loadGlb.js +45 -0
- package/dist/cjs/utils/loadGlb.js.map +1 -0
- package/dist/cjs/utils/three.js +75 -0
- package/dist/cjs/utils/three.js.map +1 -0
- package/dist/cjs/utils/threeScene.js +45 -0
- package/dist/cjs/utils/threeScene.js.map +1 -0
- package/dist/es/config/draco.d.ts +12 -0
- package/dist/es/config/draco.d.ts.map +1 -0
- package/dist/es/config/draco.js +12 -0
- package/dist/es/config/draco.js.map +1 -0
- package/dist/es/domain/models/loggeable.d.ts +1 -1
- package/dist/es/domain/models/loggeable.d.ts.map +1 -1
- package/dist/es/domain/models/mapConfig.d.ts +23 -0
- package/dist/es/domain/models/mapConfig.d.ts.map +1 -1
- package/dist/es/domain/models/mapConfig.js.map +1 -1
- package/dist/es/domain/models/scene3D.d.ts +308 -0
- package/dist/es/domain/models/scene3D.d.ts.map +1 -0
- package/dist/es/domain/models/scene3D.js +2 -0
- package/dist/es/domain/models/scene3D.js.map +1 -0
- package/dist/es/domain/ports/ILogger.d.ts +2 -2
- package/dist/es/index.d.ts +2 -1
- package/dist/es/index.d.ts.map +1 -1
- package/dist/es/index.js +1 -1
- package/dist/es/index.js.map +1 -1
- package/dist/es/infrastructure/logging/{CountlyLogger.d.ts → MVXLogger.d.ts} +13 -11
- package/dist/es/infrastructure/logging/MVXLogger.d.ts.map +1 -0
- package/dist/es/infrastructure/logging/{CountlyLogger.js → MVXLogger.js} +13 -11
- package/dist/es/infrastructure/logging/MVXLogger.js.map +1 -0
- package/dist/es/logger/logger.d.ts +2 -3
- package/dist/es/logger/logger.d.ts.map +1 -1
- package/dist/es/logger/logger.js +30 -51
- package/dist/es/logger/logger.js.map +1 -1
- package/dist/es/logger/sentry.d.ts +26 -0
- package/dist/es/logger/sentry.d.ts.map +1 -0
- package/dist/es/logger/sentry.js +72 -0
- package/dist/es/logger/sentry.js.map +1 -0
- package/dist/es/map/map.d.ts +12 -0
- package/dist/es/map/map.d.ts.map +1 -1
- package/dist/es/map/map.js +40 -9
- package/dist/es/map/map.js.map +1 -1
- package/dist/es/map/scene3DController.d.ts +74 -0
- package/dist/es/map/scene3DController.d.ts.map +1 -0
- package/dist/es/map/scene3DController.js +439 -0
- package/dist/es/map/scene3DController.js.map +1 -0
- package/dist/es/utils/3d.d.ts +54 -0
- package/dist/es/utils/3d.d.ts.map +1 -0
- package/dist/es/utils/3d.js +120 -0
- package/dist/es/utils/3d.js.map +1 -0
- package/dist/es/utils/deckLayers.d.ts +51 -0
- package/dist/es/utils/deckLayers.d.ts.map +1 -0
- package/dist/es/utils/deckLayers.js +144 -0
- package/dist/es/utils/deckLayers.js.map +1 -0
- package/dist/es/utils/loadGlb.d.ts +11 -0
- package/dist/es/utils/loadGlb.d.ts.map +1 -0
- package/dist/es/utils/loadGlb.js +42 -0
- package/dist/es/utils/loadGlb.js.map +1 -0
- package/dist/es/utils/three.d.ts +51 -0
- package/dist/es/utils/three.d.ts.map +1 -0
- package/dist/es/utils/three.js +38 -0
- package/dist/es/utils/three.js.map +1 -0
- package/dist/es/utils/threeScene.d.ts +24 -0
- package/dist/es/utils/threeScene.d.ts.map +1 -0
- package/dist/es/utils/threeScene.js +41 -0
- package/dist/es/utils/threeScene.js.map +1 -0
- package/dist/umd/index.js +17848 -12587
- package/dist/umd/index.js.map +1 -1
- package/package.json +15 -5
- package/dist/cjs/infrastructure/logging/CountlyLogger.js.map +0 -1
- package/dist/cjs/logger/rollbar.js +0 -37
- package/dist/cjs/logger/rollbar.js.map +0 -1
- package/dist/es/infrastructure/logging/CountlyLogger.d.ts.map +0 -1
- package/dist/es/infrastructure/logging/CountlyLogger.js.map +0 -1
- package/dist/es/logger/rollbar.d.ts +0 -4
- package/dist/es/logger/rollbar.d.ts.map +0 -1
- package/dist/es/logger/rollbar.js +0 -33
- package/dist/es/logger/rollbar.js.map +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_KTX2_TRANSCODER_PATH = exports.DEFAULT_DRACO_DECODER_PATH = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Base URL for Three.js Draco decoders (glTF build from `three/examples/jsm/libs/draco/gltf`).
|
|
6
|
+
* Trailing slash is required by {@link https://threejs.org/docs/#examples/en/loaders/DRACOLoader | DRACOLoader}.
|
|
7
|
+
*
|
|
8
|
+
* Hosted files: `draco_wasm_wrapper.js`, `draco_decoder.wasm` (and optionally `draco_decoder.js`).
|
|
9
|
+
* The bucket must allow CORS for application origins that load 3D maps.
|
|
10
|
+
*
|
|
11
|
+
* @group Configuration
|
|
12
|
+
*/
|
|
13
|
+
exports.DEFAULT_DRACO_DECODER_PATH = "https://mapvx-glb-assets.s3.us-east-1.amazonaws.com/decoders/draco/";
|
|
14
|
+
exports.DEFAULT_KTX2_TRANSCODER_PATH = "https://mapvx-glb-assets.s3.us-east-1.amazonaws.com/decoders/transcoder/";
|
|
15
|
+
//# sourceMappingURL=draco.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draco.js","sourceRoot":"","sources":["../../../src/config/draco.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;GAQG;AACU,QAAA,0BAA0B,GACrC,qEAAqE,CAAA;AAE1D,QAAA,4BAA4B,GACvC,0EAA0E,CAAA"}
|
|
@@ -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":";;;AAsEA;;;GAGG;AACU,QAAA,yBAAyB,GAAiC;IACrE,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,GAAG;IACb,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,aAAa;IACpC,sBAAsB,EAAE,IAAI;IAC5B,oBAAoB,EAAE,KAAK;IAC3B,wBAAwB,EAAE,CAAC;CAC5B,CAAA;AAED;;;;;;GAMG;AACU,QAAA,gCAAgC,GAAG,MAAO,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene3D.js","sourceRoot":"","sources":["../../../../src/domain/models/scene3D.ts"],"names":[],"mappings":""}
|
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.MAPLIBRE_MAX_TILE_CACHE_HARD_CAP = exports.DEFAULT_TILE_CACHE_CONFIG = exports.Institution = exports.isValidCircleConfig = exports.MAPVX_BRAND_COLOR = exports.CIRCLE_DEFAULTS = exports.circleRing = exports.isBasicWithLogo = exports.isBasicWithImageUrl = exports.isBasicWithIcon = exports.Banner = exports.createRouteAnimationIconDataUrl = exports.initializeSDK = exports.
|
|
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.MAPLIBRE_MAX_TILE_CACHE_HARD_CAP = exports.DEFAULT_TILE_CACHE_CONFIG = exports.Institution = exports.isValidCircleConfig = exports.MAPVX_BRAND_COLOR = exports.CIRCLE_DEFAULTS = exports.circleRing = exports.isBasicWithLogo = exports.isBasicWithImageUrl = exports.isBasicWithIcon = exports.Banner = exports.createRouteAnimationIconDataUrl = exports.initializeSDK = exports.MVXLogger = 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; } });
|
|
@@ -15,8 +15,8 @@ Object.defineProperty(exports, "DEFAULT_MAX_STORAGE_BYTES", { enumerable: true,
|
|
|
15
15
|
var FetchHttpClient_1 = require("./infrastructure/http/FetchHttpClient");
|
|
16
16
|
Object.defineProperty(exports, "FetchHttpClient", { enumerable: true, get: function () { return FetchHttpClient_1.FetchHttpClient; } });
|
|
17
17
|
// ─── Infrastructure: Logging ─────────────────────────────────────────────────
|
|
18
|
-
var
|
|
19
|
-
Object.defineProperty(exports, "
|
|
18
|
+
var MVXLogger_1 = require("./infrastructure/logging/MVXLogger");
|
|
19
|
+
Object.defineProperty(exports, "MVXLogger", { enumerable: true, get: function () { return MVXLogger_1.MVXLogger; } });
|
|
20
20
|
// ─── SDK ─────────────────────────────────────────────────────────────────────
|
|
21
21
|
var sdk_1 = require("./sdk");
|
|
22
22
|
Object.defineProperty(exports, "initializeSDK", { enumerable: true, get: function () { return sdk_1.initializeSDK; } });
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -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;AAFzC,oHAAA,qBAAqB,OAAA;AACrB,wHAAA,yBAAyB,OAAA;AAG3B,gFAAgF;AAChF,yEAAuE;AAA9D,kHAAA,eAAe,OAAA;AAExB,gFAAgF;AAChF,
|
|
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;AAFzC,oHAAA,qBAAqB,OAAA;AACrB,wHAAA,yBAAyB,OAAA;AAG3B,gFAAgF;AAChF,yEAAuE;AAA9D,kHAAA,eAAe,OAAA;AAExB,gFAAgF;AAChF,gEAA8D;AAArD,sGAAA,SAAS,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AAqC;IACrC,IAAI,QAAQ,CAAC,aAAa,CAAC,yBAAyB,CAAC,EAAE,CAAC;QACtD,OAAM;IACR,CAAC;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"}
|
|
@@ -1,36 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.MVXLogger = void 0;
|
|
4
4
|
const logger_1 = require("../../logger/logger");
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* MapVX Logger Adapter
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* Default {@link ILogger} implementation for the SDK. Provider-agnostic by name
|
|
9
|
+
* so the underlying error-tracking backend can change without affecting the
|
|
10
|
+
* public API. It wraps the internal Logger singleton: errors are captured as
|
|
11
|
+
* exceptions and events/warnings are recorded as breadcrumbs (currently backed
|
|
12
|
+
* by Sentry).
|
|
11
13
|
*
|
|
12
14
|
* @group Utils
|
|
13
15
|
*
|
|
14
16
|
* @example
|
|
15
17
|
* ```typescript
|
|
16
|
-
* const logger: ILogger = new
|
|
18
|
+
* const logger: ILogger = new MVXLogger()
|
|
17
19
|
* logger.logEvent("user_action", { action: "click" })
|
|
18
20
|
* logger.logError(new Error("Something failed"))
|
|
19
21
|
* ```
|
|
20
22
|
*/
|
|
21
|
-
class
|
|
23
|
+
class MVXLogger {
|
|
22
24
|
constructor() {
|
|
23
25
|
this.logger = logger_1.Logger.getInstance();
|
|
24
26
|
}
|
|
25
27
|
/**
|
|
26
|
-
*
|
|
28
|
+
* Records an analytics-style event as a Sentry breadcrumb.
|
|
27
29
|
*/
|
|
28
30
|
logEvent(eventName, segmentation) {
|
|
29
31
|
const enrichedSegmentation = this.enrichSegmentation(segmentation);
|
|
30
32
|
this.logger.logEvent(eventName, enrichedSegmentation);
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
33
|
-
*
|
|
35
|
+
* Captures an error as a Sentry exception.
|
|
34
36
|
*/
|
|
35
37
|
logError(error, context) {
|
|
36
38
|
if (error instanceof Error) {
|
|
@@ -41,7 +43,7 @@ class CountlyLogger {
|
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
/**
|
|
44
|
-
*
|
|
46
|
+
* Records a warning as a Sentry breadcrumb.
|
|
45
47
|
*/
|
|
46
48
|
logWarning(error, context) {
|
|
47
49
|
if (error instanceof Error) {
|
|
@@ -58,7 +60,7 @@ class CountlyLogger {
|
|
|
58
60
|
this.logger.debugLog(...args);
|
|
59
61
|
}
|
|
60
62
|
/**
|
|
61
|
-
* Sets the API token
|
|
63
|
+
* Sets the API token used to enrich event segmentation.
|
|
62
64
|
*/
|
|
63
65
|
setToken(token) {
|
|
64
66
|
this.token = token;
|
|
@@ -74,5 +76,5 @@ class CountlyLogger {
|
|
|
74
76
|
return base;
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
|
-
exports.
|
|
78
|
-
//# sourceMappingURL=
|
|
79
|
+
exports.MVXLogger = MVXLogger;
|
|
80
|
+
//# sourceMappingURL=MVXLogger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MVXLogger.js","sourceRoot":"","sources":["../../../../src/infrastructure/logging/MVXLogger.ts"],"names":[],"mappings":";;;AACA,gDAA4C;AAE5C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAa,SAAS;IAIpB;QACE,IAAI,CAAC,MAAM,GAAG,eAAM,CAAC,WAA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,KAAK,EAAE,IAAI,CAAC,KAAK,IAClB;QACH,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAnED,8BAmEC"}
|
|
@@ -1,58 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.Logger = void 0;
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
// as bare globals, so reading them directly throws ReferenceError in
|
|
13
|
-
// consumers of those builds. The typeof guards make the lookup safe
|
|
14
|
-
// everywhere; the version placeholder is replaced with the package version
|
|
15
|
-
// by scripts/inject-build-defines.js. The Countly key falls back to the
|
|
16
|
-
// MapVX key when none is injected at build time.
|
|
4
|
+
const sentry_1 = require("./sentry");
|
|
5
|
+
// DEBUG is a webpack DefinePlugin constant, substituted only in the UMD bundle.
|
|
6
|
+
// The tsc-built ES/CJS outputs keep it as a bare global, so reading it directly
|
|
7
|
+
// throws ReferenceError in consumers of those builds. The typeof guard makes
|
|
8
|
+
// the lookup safe everywhere.
|
|
17
9
|
const IS_DEBUG = typeof DEBUG !== "undefined" ? DEBUG : false;
|
|
18
|
-
const SDK_VERSION = typeof VERSION !== "undefined" ? VERSION : "1.8.0";
|
|
19
|
-
const COUNTLY_API_KEY = typeof COUNTLY_KEY !== "undefined" && COUNTLY_KEY
|
|
20
|
-
? COUNTLY_KEY
|
|
21
|
-
: "f0c8d3b96d336e857a8628f49dd1baf7d7add0e9";
|
|
22
|
-
const countly = {
|
|
23
|
-
apiKey: COUNTLY_API_KEY,
|
|
24
|
-
url: "https://countly.lazarillo.app",
|
|
25
|
-
};
|
|
26
10
|
class Logger {
|
|
27
11
|
constructor() {
|
|
28
|
-
var _a;
|
|
29
12
|
if (IS_DEBUG) {
|
|
30
|
-
console.log("Initializing
|
|
31
|
-
this.countly = { q: [] };
|
|
13
|
+
console.log("Initializing logger (debug mode — Sentry disabled)");
|
|
32
14
|
}
|
|
33
15
|
else {
|
|
34
|
-
this.
|
|
35
|
-
countly_sdk_web_1.default.init({
|
|
36
|
-
app_key: countly.apiKey,
|
|
37
|
-
url: countly.url,
|
|
38
|
-
app_version: SDK_VERSION,
|
|
39
|
-
session_update: 10,
|
|
40
|
-
debug: IS_DEBUG,
|
|
41
|
-
require_consent: false,
|
|
42
|
-
namespace: "SDK JS",
|
|
43
|
-
});
|
|
44
|
-
this.countly = countly_sdk_web_1.default !== null && countly_sdk_web_1.default !== void 0 ? countly_sdk_web_1.default : {};
|
|
45
|
-
this.countly.q = (_a = countly_sdk_web_1.default.q) !== null && _a !== void 0 ? _a : [];
|
|
46
|
-
this.countly.q.push([
|
|
47
|
-
"track_sessions",
|
|
48
|
-
"track_pageview",
|
|
49
|
-
"track_clicks",
|
|
50
|
-
"track_scrolls",
|
|
51
|
-
"track_errors",
|
|
52
|
-
"track_links",
|
|
53
|
-
"track_forms",
|
|
54
|
-
"collect_from_forms",
|
|
55
|
-
]);
|
|
16
|
+
this.sentry = (0, sentry_1.createSentryScope)();
|
|
56
17
|
}
|
|
57
18
|
}
|
|
58
19
|
static getInstance() {
|
|
@@ -62,17 +23,20 @@ class Logger {
|
|
|
62
23
|
return Logger.instance;
|
|
63
24
|
}
|
|
64
25
|
logEvent(eventName, eventSegmentation) {
|
|
26
|
+
var _a;
|
|
65
27
|
if (IS_DEBUG) {
|
|
66
28
|
console.log(eventName, eventSegmentation);
|
|
67
29
|
}
|
|
68
30
|
else {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
31
|
+
// Sentry is an error-tracking service, not an analytics platform, so the
|
|
32
|
+
// former Countly analytics events are recorded as breadcrumbs. They carry
|
|
33
|
+
// no value on their own but add context to the next captured error.
|
|
34
|
+
(_a = this.sentry) === null || _a === void 0 ? void 0 : _a.addBreadcrumb({
|
|
35
|
+
category: "event",
|
|
36
|
+
message: eventName,
|
|
37
|
+
level: "info",
|
|
38
|
+
data: eventSegmentation,
|
|
39
|
+
});
|
|
76
40
|
}
|
|
77
41
|
}
|
|
78
42
|
logDebug(...args) {
|
|
@@ -81,9 +45,19 @@ class Logger {
|
|
|
81
45
|
}
|
|
82
46
|
}
|
|
83
47
|
logWarning(...args) {
|
|
48
|
+
var _a;
|
|
84
49
|
if (IS_DEBUG) {
|
|
85
50
|
console.warn(...args);
|
|
86
51
|
}
|
|
52
|
+
else {
|
|
53
|
+
// Warnings are not reported to Sentry on their own (matching the previous
|
|
54
|
+
// error-only report level) but are kept as breadcrumbs for context.
|
|
55
|
+
(_a = this.sentry) === null || _a === void 0 ? void 0 : _a.addBreadcrumb({
|
|
56
|
+
category: "warning",
|
|
57
|
+
level: "warning",
|
|
58
|
+
message: args.map(sentry_1.stringifyLogArgument).join(" "),
|
|
59
|
+
});
|
|
60
|
+
}
|
|
87
61
|
}
|
|
88
62
|
logError(...args) {
|
|
89
63
|
var _a;
|
|
@@ -91,7 +65,9 @@ class Logger {
|
|
|
91
65
|
console.error(...args);
|
|
92
66
|
}
|
|
93
67
|
else {
|
|
94
|
-
|
|
68
|
+
const [error, ...rest] = args;
|
|
69
|
+
const exception = error instanceof Error ? error : new Error((0, sentry_1.stringifyLogArgument)(error));
|
|
70
|
+
(_a = this.sentry) === null || _a === void 0 ? void 0 : _a.captureException(exception, rest.length > 0 ? { data: { args: rest } } : undefined);
|
|
95
71
|
}
|
|
96
72
|
}
|
|
97
73
|
debugLog(...args) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/logger/logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/logger/logger.ts"],"names":[],"mappings":";;;AACA,qCAAoF;AAIpF,gFA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C;YACN,0EAA0E;YAC1E,oEAAoE;YACpE,MAAA,IAAI,CAAC,MAAM,0CAAE,aAAa,CAAC;gBACzB,QAAQ,EAAE,SAAS;gBACnB,KAAK,EAAE,SAAS;gBAChB,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,6BAAoB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;aAClD,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IAED,QAAQ,CAAC,GAAG,IAAmB;;QAC7B,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAA;QACxB,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAA;YAC7B,MAAM,SAAS,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,IAAA,6BAAoB,EAAC,KAAK,CAAC,CAAC,CAAA;YACzF,MAAA,IAAI,CAAC,MAAM,0CAAE,gBAAgB,CAC3B,SAAS,EACT,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CACvD,CAAA;QACH,CAAC;IACH,CAAC;IAED,QAAQ,CAAC,GAAG,IAAe;QACzB,IAAI,QAAQ;YAAE,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAA;IACpC,CAAC;CACF;AAxED,wBAwEC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSentryScope = createSentryScope;
|
|
4
|
+
exports.stringifyLogArgument = stringifyLogArgument;
|
|
5
|
+
const browser_1 = require("@sentry/browser");
|
|
6
|
+
// SENTRY_DSN and VERSION are webpack DefinePlugin constants, substituted only
|
|
7
|
+
// in the UMD bundle. The tsc-built ES/CJS outputs keep them as bare globals, so
|
|
8
|
+
// the typeof guards make the lookup safe everywhere; the version placeholder is
|
|
9
|
+
// replaced with the package version by scripts/inject-build-defines.js. The DSN
|
|
10
|
+
// falls back to the public MapVX Sentry project DSN when none is injected at
|
|
11
|
+
// build time — a DSN's public key is safe to ship in the client bundle.
|
|
12
|
+
const SDK_VERSION = typeof VERSION !== "undefined" ? VERSION : "2.0.0";
|
|
13
|
+
const DSN = typeof SENTRY_DSN !== "undefined" && SENTRY_DSN
|
|
14
|
+
? SENTRY_DSN
|
|
15
|
+
: "https://872f598f020e3cd73a0933b562d24c81@sentry.mapvx.app/5";
|
|
16
|
+
/**
|
|
17
|
+
* Default integrations that hook into or mutate global browser state.
|
|
18
|
+
*
|
|
19
|
+
* A library must NOT install these: `GlobalHandlers` overrides
|
|
20
|
+
* `window.onerror`/`onunhandledrejection`, `BrowserApiErrors` wraps global
|
|
21
|
+
* timers/event handlers, `Breadcrumbs` patches `console`/`fetch`/history, and
|
|
22
|
+
* `BrowserSession` tracks page sessions. Enabling them would hijack the host
|
|
23
|
+
* application's own Sentry setup. Manual `scope.addBreadcrumb()` still works
|
|
24
|
+
* without the `Breadcrumbs` integration.
|
|
25
|
+
*/
|
|
26
|
+
const GLOBAL_STATE_INTEGRATIONS = [
|
|
27
|
+
"BrowserApiErrors",
|
|
28
|
+
"BrowserSession",
|
|
29
|
+
"Breadcrumbs",
|
|
30
|
+
"GlobalHandlers",
|
|
31
|
+
];
|
|
32
|
+
/**
|
|
33
|
+
* Creates an isolated Sentry scope + client for the SDK.
|
|
34
|
+
*
|
|
35
|
+
* Uses the library-safe pattern (a dedicated `BrowserClient` bound to its own
|
|
36
|
+
* `Scope`, initialised via `client.init()`) instead of the global
|
|
37
|
+
* `Sentry.init()`, so the SDK reports errors to its own project without
|
|
38
|
+
* touching the host application's Sentry configuration.
|
|
39
|
+
*
|
|
40
|
+
* @returns A scope whose `captureException`/`addBreadcrumb` calls route to the
|
|
41
|
+
* SDK's dedicated Sentry client.
|
|
42
|
+
*/
|
|
43
|
+
function createSentryScope() {
|
|
44
|
+
const integrations = (0, browser_1.getDefaultIntegrations)({}).filter((integration) => !GLOBAL_STATE_INTEGRATIONS.includes(integration.name));
|
|
45
|
+
const client = new browser_1.BrowserClient({
|
|
46
|
+
dsn: DSN,
|
|
47
|
+
transport: browser_1.makeFetchTransport,
|
|
48
|
+
stackParser: browser_1.defaultStackParser,
|
|
49
|
+
integrations,
|
|
50
|
+
release: `@mapvx/web-js@${SDK_VERSION}`,
|
|
51
|
+
environment: "production",
|
|
52
|
+
// Errors only — no performance tracing.
|
|
53
|
+
tracesSampleRate: 0,
|
|
54
|
+
});
|
|
55
|
+
const scope = new browser_1.Scope();
|
|
56
|
+
scope.setClient(client);
|
|
57
|
+
client.init();
|
|
58
|
+
return scope;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Converts an arbitrary log argument into a readable string for breadcrumb and
|
|
62
|
+
* error messages.
|
|
63
|
+
*/
|
|
64
|
+
function stringifyLogArgument(arg) {
|
|
65
|
+
if (typeof arg === "string")
|
|
66
|
+
return arg;
|
|
67
|
+
if (arg instanceof Error)
|
|
68
|
+
return arg.message;
|
|
69
|
+
try {
|
|
70
|
+
return JSON.stringify(arg);
|
|
71
|
+
}
|
|
72
|
+
catch (_a) {
|
|
73
|
+
return String(arg);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=sentry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentry.js","sourceRoot":"","sources":["../../../src/logger/sentry.ts"],"names":[],"mappings":";;AA2DA,8CAqBC;AAMD,oDAQC;AA9FD,6CAMwB;AAaxB,8EAA8E;AAC9E,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAChF,6EAA6E;AAC7E,wEAAwE;AACxE,MAAM,WAAW,GAAW,OAAO,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC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B,CAAC;AACH,CAAC"}
|
package/dist/cjs/map/map.js
CHANGED
|
@@ -176,6 +176,7 @@ const routeConfiguration_1 = require("../domain/models/routeConfiguration");
|
|
|
176
176
|
const repository_1 = require("../repository/repository");
|
|
177
177
|
const route_utils_1 = require("../utils/route-utils");
|
|
178
178
|
const utils_1 = require("../utils/utils");
|
|
179
|
+
const scene3DController_1 = require("./scene3DController");
|
|
179
180
|
const fitCamera_1 = require("./fitCamera");
|
|
180
181
|
const mapInteractionOptions_1 = require("./mapInteractionOptions");
|
|
181
182
|
/**
|
|
@@ -193,7 +194,7 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
193
194
|
* @returns A new instance of MapVXMap.
|
|
194
195
|
*/
|
|
195
196
|
constructor(mapConfig, container, token) {
|
|
196
|
-
var _a, _b;
|
|
197
|
+
var _a, _b, _c;
|
|
197
198
|
super();
|
|
198
199
|
/**
|
|
199
200
|
* Monotonic counter for {@link addLiveRoute} calls. Refreshes overlap (each one
|
|
@@ -213,6 +214,8 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
213
214
|
this.hoveredId = "unselected";
|
|
214
215
|
this.failedTiles = new Set();
|
|
215
216
|
this.geoLocation = navigator.geolocation;
|
|
217
|
+
/** Owns the deck.gl overlay + GLB scene; created on style load only when 3D is active. */
|
|
218
|
+
this.scene3D = undefined;
|
|
216
219
|
if (_rtl_1.rtlLanguages.includes((_a = mapConfig.lang) !== null && _a !== void 0 ? _a : "")) {
|
|
217
220
|
this.setRTLSupport();
|
|
218
221
|
}
|
|
@@ -224,6 +227,9 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
224
227
|
this.watchPositionID = undefined;
|
|
225
228
|
this.onFloorChange = mapConfig.onFloorChange;
|
|
226
229
|
this.onParentPlaceChange = mapConfig.onParentPlaceChange;
|
|
230
|
+
this.mode = (_c = mapConfig.mode) !== null && _c !== void 0 ? _c : "2D";
|
|
231
|
+
this.scene3DConfig = mapConfig.scene3D;
|
|
232
|
+
this.initialCenter = mapConfig.center;
|
|
227
233
|
this.tileCacheConfig = (() => {
|
|
228
234
|
const merged = Object.assign(Object.assign({}, mapConfig_1.DEFAULT_TILE_CACHE_CONFIG), mapConfig.tileCache);
|
|
229
235
|
merged.maxTiles = Math.min(merged.maxTiles, mapConfig_1.MAPLIBRE_MAX_TILE_CACHE_HARD_CAP);
|
|
@@ -345,6 +351,11 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
345
351
|
mapOptions.maxBounds = new maplibre_gl_1.LngLatBounds([boundingBox[0].lng, boundingBox[0].lat], [boundingBox[1].lng, boundingBox[1].lat]);
|
|
346
352
|
}
|
|
347
353
|
this.map = new maplibre_gl_1.Map(mapOptions);
|
|
354
|
+
// Create the 3D controller only when the map opts into 3D. All heavy WebGL / deck.gl work is
|
|
355
|
+
// owned by it; in 2D mode `this.scene3D` stays undefined and every hook below is a no-op.
|
|
356
|
+
if (this.is3DSceneActive() && this.scene3DConfig) {
|
|
357
|
+
this.scene3D = new scene3DController_1.Scene3DController(this.map, this.scene3DConfig, this.initialCenter);
|
|
358
|
+
}
|
|
348
359
|
// When rotation is disabled we still want pinch-to-zoom to work, so the
|
|
349
360
|
// two-finger rotation is turned off here instead of via the constructor.
|
|
350
361
|
if ((0, mapInteractionOptions_1.shouldDisableTouchRotation)(mapConfig)) {
|
|
@@ -355,11 +366,13 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
355
366
|
showZoom: mapConfig.showZoom !== undefined ? mapConfig.showZoom : true,
|
|
356
367
|
}), (_e = mapConfig.navigationPosition) !== null && _e !== void 0 ? _e : "top-right");
|
|
357
368
|
this.map.on("load", () => {
|
|
358
|
-
var _a;
|
|
369
|
+
var _a, _b;
|
|
370
|
+
// 3D libraries load asynchronously; the rest of the load flow does not wait on them.
|
|
371
|
+
void ((_a = this.scene3D) === null || _a === void 0 ? void 0 : _a.onMapLoad());
|
|
359
372
|
this.whenStyleUpdates(style);
|
|
360
373
|
if (mapConfig.lang)
|
|
361
374
|
this.setLayersForLanguage(mapConfig.lang);
|
|
362
|
-
(
|
|
375
|
+
(_b = mapConfig.onMapReady) === null || _b === void 0 ? void 0 : _b.call(mapConfig);
|
|
363
376
|
this.onHover();
|
|
364
377
|
this.subscribeToFailedTiles();
|
|
365
378
|
});
|
|
@@ -369,6 +382,10 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
369
382
|
if (this.circles.length > 0)
|
|
370
383
|
this.ensureCircleLayers();
|
|
371
384
|
});
|
|
385
|
+
this.map.on("zoom", () => {
|
|
386
|
+
var _a;
|
|
387
|
+
(_a = this.scene3D) === null || _a === void 0 ? void 0 : _a.onZoom();
|
|
388
|
+
});
|
|
372
389
|
this.map.on("zoomend", () => {
|
|
373
390
|
var _a;
|
|
374
391
|
(_a = mapConfig.onZoomEnd) === null || _a === void 0 ? void 0 : _a.call(mapConfig, this.getZoomLevel());
|
|
@@ -378,7 +395,6 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
378
395
|
(_a = mapConfig.onRotate) === null || _a === void 0 ? void 0 : _a.call(mapConfig, this.map.getBearing());
|
|
379
396
|
});
|
|
380
397
|
this.defaultClickListener();
|
|
381
|
-
return this.map;
|
|
382
398
|
}
|
|
383
399
|
setBaseFilters(style) {
|
|
384
400
|
if (!style)
|
|
@@ -507,6 +523,16 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
507
523
|
// Tile cache clear may fail if cache doesn't exist
|
|
508
524
|
}
|
|
509
525
|
}
|
|
526
|
+
/**
|
|
527
|
+
* Whether 3D scene features (deck.gl overlay, declarative GLB custom layer, etc.) are active.
|
|
528
|
+
* Requires {@link MapConfig.mode} `"3D"` and {@link Scene3DConfig.enabled} not `false`.
|
|
529
|
+
* The heavy WebGL / deck.gl work lives in {@link Scene3DController}; this only decides whether one
|
|
530
|
+
* is created and wired up. When `scene3D` is omitted, 3D features remain available.
|
|
531
|
+
*/
|
|
532
|
+
is3DSceneActive() {
|
|
533
|
+
var _a;
|
|
534
|
+
return this.mode === "3D" && ((_a = this.scene3DConfig) === null || _a === void 0 ? void 0 : _a.enabled) !== false;
|
|
535
|
+
}
|
|
510
536
|
getCurrentFloor() {
|
|
511
537
|
var _a;
|
|
512
538
|
return (_a = this.currentFloor) !== null && _a !== void 0 ? _a : "";
|
|
@@ -517,7 +543,7 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
517
543
|
* @param updateStyle defines if new parent place style must be set
|
|
518
544
|
*/
|
|
519
545
|
changeParentPlaceTo(place, updateStyle = false, onStyleReady) {
|
|
520
|
-
var _a, _b, _c, _d, _e, _f;
|
|
546
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
521
547
|
this.parentPlace = place;
|
|
522
548
|
this.parentPlaceId = place === null || place === void 0 ? void 0 : place.mapvxId;
|
|
523
549
|
this.innerFloors = (_b = (_a = place === null || place === void 0 ? void 0 : place.innerFloors) === null || _a === void 0 ? void 0 : _a.sort((a, b) => a.index - b.index)) !== null && _b !== void 0 ? _b : [];
|
|
@@ -526,6 +552,7 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
526
552
|
if (place) {
|
|
527
553
|
this.subPlacesLoad(place.mapvxId);
|
|
528
554
|
}
|
|
555
|
+
(_g = this.scene3D) === null || _g === void 0 ? void 0 : _g.onFloorChange(this.currentFloor);
|
|
529
556
|
if (updateStyle) {
|
|
530
557
|
this.repository
|
|
531
558
|
.fetchAndParseMapStyle(place === null || place === void 0 ? void 0 : place.mapvxId)
|
|
@@ -547,13 +574,14 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
547
574
|
* @throws A error if the parent place is not one of the allowed places to show.
|
|
548
575
|
*/
|
|
549
576
|
updatePlaceAndFloor(parentPlaceId, floorId) {
|
|
550
|
-
var _a, _b, _c, _d, _e;
|
|
577
|
+
var _a, _b, _c, _d, _e, _f;
|
|
551
578
|
const place = this.potentialParentPlaces.find((place) => place.mapvxId === parentPlaceId);
|
|
552
579
|
this.parentPlace = place;
|
|
553
580
|
this.parentPlaceId = place === null || place === void 0 ? void 0 : place.mapvxId;
|
|
554
581
|
this.innerFloors = (_a = place === null || place === void 0 ? void 0 : place.innerFloors.sort((a, b) => a.index - b.index)) !== null && _a !== void 0 ? _a : [];
|
|
555
582
|
this.currentFloor =
|
|
556
583
|
(_e = (_c = floorId !== null && floorId !== void 0 ? floorId : (_b = this.innerFloors.find((floor) => floor.defaultFloor)) === null || _b === void 0 ? void 0 : _b.key) !== null && _c !== void 0 ? _c : (_d = this.innerFloors[0]) === null || _d === void 0 ? void 0 : _d.key) !== null && _e !== void 0 ? _e : "";
|
|
584
|
+
(_f = this.scene3D) === null || _f === void 0 ? void 0 : _f.onFloorChange(this.currentFloor);
|
|
557
585
|
}
|
|
558
586
|
updateParentPlaceAndFloor(parentPlaceId, floorId, options) {
|
|
559
587
|
var _a, _b, _c, _d;
|
|
@@ -600,12 +628,14 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
600
628
|
* @param newStyle
|
|
601
629
|
*/
|
|
602
630
|
whenStyleUpdates(newStyle) {
|
|
631
|
+
var _a;
|
|
603
632
|
if (newStyle) {
|
|
604
633
|
this.setBaseFilters(newStyle);
|
|
605
634
|
}
|
|
606
635
|
this.routeController.addSourcesAndLayers();
|
|
607
636
|
this.refreshCircles();
|
|
608
637
|
this.filterByFloorKey(this.currentFloor);
|
|
638
|
+
(_a = this.scene3D) === null || _a === void 0 ? void 0 : _a.refreshOverlay(this.currentFloor);
|
|
609
639
|
}
|
|
610
640
|
addMarker(marker) {
|
|
611
641
|
var _a, _b;
|
|
@@ -1323,12 +1353,13 @@ class InternalMapVXMap extends loggeable_1.Loggeable {
|
|
|
1323
1353
|
return this.map.getZoom();
|
|
1324
1354
|
}
|
|
1325
1355
|
updateFloor(floorId, options) {
|
|
1326
|
-
var _a, _b;
|
|
1356
|
+
var _a, _b, _c;
|
|
1327
1357
|
try {
|
|
1328
1358
|
this.filterByFloorKey(floorId);
|
|
1329
|
-
(_a = this.
|
|
1359
|
+
(_a = this.scene3D) === null || _a === void 0 ? void 0 : _a.onFloorChange(this.currentFloor);
|
|
1360
|
+
(_b = this.onFloorChange) === null || _b === void 0 ? void 0 : _b.call(this, floorId);
|
|
1330
1361
|
this.logEvent("updateFloor", { floorId });
|
|
1331
|
-
(
|
|
1362
|
+
(_c = options === null || options === void 0 ? void 0 : options.onComplete) === null || _c === void 0 ? void 0 : _c.call(options);
|
|
1332
1363
|
}
|
|
1333
1364
|
catch (error) {
|
|
1334
1365
|
// Floor update may fail
|