@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
package/dist/es/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
export type {
|
|
1
|
+
export type { CacheStats, ICache } from "./domain/ports/ICache";
|
|
2
|
+
export type { HttpRequestOptions, HttpResponse, IHttpClient } from "./domain/ports/IHttpClient";
|
|
3
3
|
export type { ILogger } from "./domain/ports/ILogger";
|
|
4
|
+
export { DEFAULT_CACHE_CONFIGS, DEFAULT_MAX_STORAGE_BYTES, } from "./infrastructure/cache/cacheConfig";
|
|
5
|
+
export type { CacheConfig, CacheManagerConfig, CacheType } from "./infrastructure/cache/cacheConfig";
|
|
6
|
+
export { CacheManager } from "./infrastructure/cache/CacheManager";
|
|
4
7
|
export { LRUCache } from "./infrastructure/cache/LRUCache";
|
|
5
8
|
export { PersistentCache } from "./infrastructure/cache/PersistentCache";
|
|
6
|
-
export { CacheManager } from "./infrastructure/cache/CacheManager";
|
|
7
|
-
export type { CacheConfig, CacheManagerConfig, CacheType } from "./infrastructure/cache/cacheConfig";
|
|
8
|
-
export { DEFAULT_CACHE_CONFIGS, DEFAULT_MAX_STORAGE_BYTES, } from "./infrastructure/cache/cacheConfig";
|
|
9
9
|
export { FetchHttpClient } from "./infrastructure/http/FetchHttpClient";
|
|
10
10
|
export { CountlyLogger } from "./infrastructure/logging/CountlyLogger";
|
|
11
11
|
export type { MapVXMap } from "./map/map";
|
|
@@ -16,17 +16,20 @@ export type { AnimationConfig, AnimationDrawingConfig, AnimationStatus, } from "
|
|
|
16
16
|
export { createRouteAnimationIconDataUrl } from "./assets/icons";
|
|
17
17
|
export type { RouteAnimationIconConfig } from "./assets/icons";
|
|
18
18
|
export { Banner } from "./domain/models/banner";
|
|
19
|
-
export { isBasicWithIcon, isBasicWithLogo } from "./domain/models/categories";
|
|
20
|
-
export type { BasicCategory, BasicWithIcon, BasicWithLogo, Category, InternalLinkCategory, NestedCategory, PhoneCategory, PlaceCategory, ProductCategory, TextCategory, UrlCategory, } from "./domain/models/categories";
|
|
19
|
+
export { isBasicWithIcon, isBasicWithImageUrl, isBasicWithLogo } from "./domain/models/categories";
|
|
20
|
+
export type { BasicCategory, BasicWithIcon, BasicWithImageUrl, BasicWithLogo, Category, InternalLinkCategory, NestedCategory, PhoneCategory, PlaceCategory, ProductCategory, TextCategory, UrlCategory, } from "./domain/models/categories";
|
|
21
|
+
export { CIRCLE_DEFAULTS, circleRing, isValidCircleConfig, MAPVX_BRAND_COLOR, } from "./domain/models/circle";
|
|
22
|
+
export type { CircleConfig, CircleRecord, CircleRenderOrder } from "./domain/models/circle";
|
|
21
23
|
export type { CityFilterOption, InstitutionCityFilterOption, ParentPlaceCityFilterOption, } from "./domain/models/cityFilterOption";
|
|
22
24
|
export type { Configuration } from "./domain/models/configuration";
|
|
23
25
|
export type { CssComponent, CssCustomization, CssDefinitions, CssElement, CssScreen, CssTheme, } from "./domain/models/cssCustomization";
|
|
24
|
-
export type { FitOptions, FloorUpdateOptions,
|
|
26
|
+
export type { BoundsOptions, FitOptions, FloorUpdateOptions, PaddingOptions, PaddingValue, ZoomOptions, } from "./domain/models/fitOptions";
|
|
25
27
|
export type { InnerFloor } from "./domain/models/innerFloors";
|
|
26
28
|
export { Institution } from "./domain/models/institution";
|
|
27
29
|
export type { LatLng, PositionCallback } from "./domain/models/latLng";
|
|
28
30
|
export type { MVXLocation } from "./domain/models/location";
|
|
29
31
|
export type { CameraAnimation, MapCamera } from "./domain/models/mapCamera";
|
|
32
|
+
export { DEFAULT_TILE_CACHE_CONFIG, MAPLIBRE_MAX_TILE_CACHE_HARD_CAP, } from "./domain/models/mapConfig";
|
|
30
33
|
export type { MapConfig, MapTileCacheConfig } from "./domain/models/mapConfig";
|
|
31
34
|
export { TextPosition } from "./domain/models/marker";
|
|
32
35
|
export type { MarkerConfig, TextProperties } from "./domain/models/marker";
|
|
@@ -43,9 +46,10 @@ export type { RealtimeSchedule, Schedule } from "./domain/models/transport";
|
|
|
43
46
|
export type { HealthResponse } from "./interfaces/healthResponse";
|
|
44
47
|
export type { InstitutionResponse } from "./interfaces/institutionResponse";
|
|
45
48
|
export type { PlaceResponse } from "./interfaces/placeResponse";
|
|
46
|
-
export { loadCustomization } from "./utils/update-css";
|
|
47
|
-
export { OpeningHoursHelper } from "./utils/opening-hours-helper";
|
|
48
49
|
export { isMapVxRequestHostname } from "./utils/mapvxHostname";
|
|
50
|
+
export { OpeningHoursHelper } from "./utils/opening-hours-helper";
|
|
51
|
+
export { injectPreconnects, MAPVX_DEFAULT_PRECONNECT_HOSTS } from "./utils/preconnect";
|
|
52
|
+
export { loadCustomization } from "./utils/update-css";
|
|
49
53
|
/**
|
|
50
54
|
* Function to load default styles
|
|
51
55
|
* @group Utils
|
|
@@ -55,5 +59,5 @@ export declare const loadStyles: () => void;
|
|
|
55
59
|
* Re-export MapLibre GL JS types for convenience
|
|
56
60
|
* @group Utils
|
|
57
61
|
*/
|
|
58
|
-
export type { Map as MapLibreMap, Marker as MapLibreMarker,
|
|
62
|
+
export type { LngLatBoundsLike, LngLatLike, MapEventType, MapLayerEventType, Map as MapLibreMap, Marker as MapLibreMarker, MapOptions, PointLike, PositionAnchor, StyleSpecification, } from "maplibre-gl";
|
|
59
63
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/es/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC/D,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAC/F,YAAY,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAGrD,OAAO,EACL,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,oCAAoC,CAAA;AAC3C,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAA;AACpG,OAAO,EAAE,YAAY,EAAE,MAAM,qCA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AM,oCAAoC,CAAA;AAG3C,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAGvF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAG3E,YAAY,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AACjE,YAAY,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AAC3E,YAAY,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAG/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAA;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAEtD;;;GAGG;AACH,eAAO,MAAM,UAAU,QAAO,IAW7B,CAAA;AAED;;;GAGG;AACH,YAAY,EACV,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,GAAG,IAAI,WAAW,EAClB,MAAM,IAAI,cAAc,EACxB,UAAU,EACV,SAAS,EACT,cAAc,EACd,kBAAkB,GACnB,MAAM,aAAa,CAAA"}
|
package/dist/es/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// ─── Infrastructure: Cache ───────────────────────────────────────────────────
|
|
2
|
+
export { DEFAULT_CACHE_CONFIGS, DEFAULT_MAX_STORAGE_BYTES, } from "./infrastructure/cache/cacheConfig";
|
|
3
|
+
export { CacheManager } from "./infrastructure/cache/CacheManager";
|
|
2
4
|
export { LRUCache } from "./infrastructure/cache/LRUCache";
|
|
3
5
|
export { PersistentCache } from "./infrastructure/cache/PersistentCache";
|
|
4
|
-
export { CacheManager } from "./infrastructure/cache/CacheManager";
|
|
5
|
-
export { DEFAULT_CACHE_CONFIGS, DEFAULT_MAX_STORAGE_BYTES, } from "./infrastructure/cache/cacheConfig";
|
|
6
6
|
// ─── Infrastructure: HTTP ────────────────────────────────────────────────────
|
|
7
7
|
export { FetchHttpClient } from "./infrastructure/http/FetchHttpClient";
|
|
8
8
|
// ─── Infrastructure: Logging ─────────────────────────────────────────────────
|
|
@@ -14,9 +14,13 @@ export { createRouteAnimationIconDataUrl } from "./assets/icons";
|
|
|
14
14
|
// ─── Domain Models: Banner ───────────────────────────────────────────────────
|
|
15
15
|
export { Banner } from "./domain/models/banner";
|
|
16
16
|
// ─── Domain Models: Categories ───────────────────────────────────────────────
|
|
17
|
-
export { isBasicWithIcon, isBasicWithLogo } from "./domain/models/categories";
|
|
17
|
+
export { isBasicWithIcon, isBasicWithImageUrl, isBasicWithLogo } from "./domain/models/categories";
|
|
18
|
+
// ─── Domain Models: Circle ───────────────────────────────────────────────────
|
|
19
|
+
export { CIRCLE_DEFAULTS, circleRing, isValidCircleConfig, MAPVX_BRAND_COLOR, } from "./domain/models/circle";
|
|
18
20
|
// ─── Domain Models: Institution ──────────────────────────────────────────────
|
|
19
21
|
export { Institution } from "./domain/models/institution";
|
|
22
|
+
// ─── Domain Models: Map Config ───────────────────────────────────────────────
|
|
23
|
+
export { DEFAULT_TILE_CACHE_CONFIG, MAPLIBRE_MAX_TILE_CACHE_HARD_CAP, } from "./domain/models/mapConfig";
|
|
20
24
|
// ─── Domain Models: Marker ───────────────────────────────────────────────────
|
|
21
25
|
export { TextPosition } from "./domain/models/marker";
|
|
22
26
|
// ─── Domain Models: Place ────────────────────────────────────────────────────
|
|
@@ -28,9 +32,10 @@ export { AnnounceFormat, TransportationMode, UnitSystem } from "./domain/models/
|
|
|
28
32
|
// ─── Domain Models: Transport ────────────────────────────────────────────────
|
|
29
33
|
export { MVXTransport } from "./domain/models/transport";
|
|
30
34
|
// ─── Utils ───────────────────────────────────────────────────────────────────
|
|
31
|
-
export { loadCustomization } from "./utils/update-css";
|
|
32
|
-
export { OpeningHoursHelper } from "./utils/opening-hours-helper";
|
|
33
35
|
export { isMapVxRequestHostname } from "./utils/mapvxHostname";
|
|
36
|
+
export { OpeningHoursHelper } from "./utils/opening-hours-helper";
|
|
37
|
+
export { injectPreconnects, MAPVX_DEFAULT_PRECONNECT_HOSTS } from "./utils/preconnect";
|
|
38
|
+
export { loadCustomization } from "./utils/update-css";
|
|
34
39
|
/**
|
|
35
40
|
* Function to load default styles
|
|
36
41
|
* @group Utils
|
package/dist/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,gFAAgF;AAChF,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,gFAAgF;AAChF,OAAO,EACL,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,oCAAoC,CAAA;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAExE,gFAAgF;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AAEvE,gFAAgF;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAKtE,gFAAgF;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAarC,gFAAgF;AAChF,OAAO,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAA;AAGhE,gFAAgF;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAE/C,gFAAgF;AAChF,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAgBlG,gFAAgF;AAChF,OAAO,EACL,eAAe,EACf,UAAU,EACV,mBAA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AAW,CAAC,IAAI,CAAC,CAAA;AACjC,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routeCacheResponse.d.ts","sourceRoot":"","sources":["../../../src/interfaces/routeCacheResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"routeCacheResponse.d.ts","sourceRoot":"","sources":["../../../src/interfaces/routeCacheResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE;QAAE,CAAC,eAAe,EAAE,MAAM,GAAG,aAAa,EAAE,CAAA;KAAE,CAAA;IACtD,gBAAgB,EAAE;QAAE,CAAC,eAAe,EAAE,MAAM,GAAG,aAAa,EAAE,CAAA;KAAE,CAAA;CACjE;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAA;CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/logger/logger.ts"],"names":[],"mappings":"AACA,OAAgB,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/logger/logger.ts"],"names":[],"mappings":"AACA,OAAgB,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAA;AA8BnD,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAa;IAErC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;IAE7C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAQ;IAEhC,OAAO;WA8BO,WAAW,IAAI,MAAM;IAOnC,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAc5E,QAAQ,CAAC,GAAG,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI;IAMtC,UAAU,CAAC,GAAG,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI;IAMxC,QAAQ,CAAC,GAAG,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI;IAQtC,QAAQ,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE;CAG5B"}
|
package/dist/es/logger/logger.js
CHANGED
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
import Countly from "countly-sdk-web";
|
|
2
2
|
import Rollbar from "rollbar";
|
|
3
3
|
import { _rollbarConfig } from "./rollbar";
|
|
4
|
+
// DEBUG, VERSION and COUNTLY_KEY are webpack DefinePlugin constants,
|
|
5
|
+
// substituted only in the UMD bundle. The tsc-built ES/CJS outputs keep them
|
|
6
|
+
// as bare globals, so reading them directly throws ReferenceError in
|
|
7
|
+
// consumers of those builds. The typeof guards make the lookup safe
|
|
8
|
+
// everywhere; the version placeholder is replaced with the package version
|
|
9
|
+
// by scripts/inject-build-defines.js. The Countly key falls back to the
|
|
10
|
+
// MapVX key when none is injected at build time.
|
|
11
|
+
const IS_DEBUG = typeof DEBUG !== "undefined" ? DEBUG : false;
|
|
12
|
+
const SDK_VERSION = typeof VERSION !== "undefined" ? VERSION : "1.1.2-alpha.3";
|
|
13
|
+
const COUNTLY_API_KEY = typeof COUNTLY_KEY !== "undefined" && COUNTLY_KEY
|
|
14
|
+
? COUNTLY_KEY
|
|
15
|
+
: "f0c8d3b96d336e857a8628f49dd1baf7d7add0e9";
|
|
4
16
|
const countly = {
|
|
5
|
-
apiKey:
|
|
17
|
+
apiKey: COUNTLY_API_KEY,
|
|
6
18
|
url: "https://countly.lazarillo.app",
|
|
7
19
|
};
|
|
8
20
|
export class Logger {
|
|
9
21
|
constructor() {
|
|
10
22
|
var _a;
|
|
11
|
-
if (
|
|
23
|
+
if (IS_DEBUG) {
|
|
12
24
|
console.log("Initializing Countly");
|
|
13
25
|
this.countly = { q: [] };
|
|
14
26
|
}
|
|
@@ -17,9 +29,9 @@ export class Logger {
|
|
|
17
29
|
Countly.init({
|
|
18
30
|
app_key: countly.apiKey,
|
|
19
31
|
url: countly.url,
|
|
20
|
-
app_version:
|
|
32
|
+
app_version: SDK_VERSION,
|
|
21
33
|
session_update: 10,
|
|
22
|
-
debug:
|
|
34
|
+
debug: IS_DEBUG,
|
|
23
35
|
require_consent: false,
|
|
24
36
|
namespace: "SDK JS",
|
|
25
37
|
});
|
|
@@ -44,7 +56,7 @@ export class Logger {
|
|
|
44
56
|
return Logger.instance;
|
|
45
57
|
}
|
|
46
58
|
logEvent(eventName, eventSegmentation) {
|
|
47
|
-
if (
|
|
59
|
+
if (IS_DEBUG) {
|
|
48
60
|
console.log(eventName, eventSegmentation);
|
|
49
61
|
}
|
|
50
62
|
else {
|
|
@@ -58,18 +70,18 @@ export class Logger {
|
|
|
58
70
|
}
|
|
59
71
|
}
|
|
60
72
|
logDebug(...args) {
|
|
61
|
-
if (
|
|
73
|
+
if (IS_DEBUG) {
|
|
62
74
|
console.log(...args);
|
|
63
75
|
}
|
|
64
76
|
}
|
|
65
77
|
logWarning(...args) {
|
|
66
|
-
if (
|
|
78
|
+
if (IS_DEBUG) {
|
|
67
79
|
console.warn(...args);
|
|
68
80
|
}
|
|
69
81
|
}
|
|
70
82
|
logError(...args) {
|
|
71
83
|
var _a;
|
|
72
|
-
if (
|
|
84
|
+
if (IS_DEBUG) {
|
|
73
85
|
console.error(...args);
|
|
74
86
|
}
|
|
75
87
|
else {
|
|
@@ -77,7 +89,7 @@ export class Logger {
|
|
|
77
89
|
}
|
|
78
90
|
}
|
|
79
91
|
debugLog(...args) {
|
|
80
|
-
if (
|
|
92
|
+
if (IS_DEBUG)
|
|
81
93
|
console.log(...args);
|
|
82
94
|
}
|
|
83
95
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/logger/logger.ts"],"names":[],"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AAC,GAAG,IAAmB;;QAC7B,IAAI,QAAQ,EAAE;YACZ,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAA;SACvB;aAAM;YACL,MAAA,IAAI,CAAC,OAAO,0CAAE,KAAK,CAAC,GAAG,IAAI,CAAC,CAAA;SAC7B;IACH,CAAC;IAED,QAAQ,CAAC,GAAG,IAAe;QACzB,IAAI,QAAQ;YAAE,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAA;IACpC,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollbar.d.ts","sourceRoot":"","sources":["../../../src/logger/rollbar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"rollbar.d.ts","sourceRoot":"","sources":["../../../src/logger/rollbar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAiBzD,eAAO,MAAM,cAAc,EAAE,aAkB5B,CAAA;AAED,wBAAgB,UAAU,CAAC,GAAG,IAAI,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAE9E"}
|
|
@@ -1,15 +1,28 @@
|
|
|
1
|
+
// VERSION and ROLLBAR_ACCESS_TOKEN are webpack DefinePlugin constants,
|
|
2
|
+
// substituted only in the UMD bundle. The tsc-built ES/CJS outputs keep them
|
|
3
|
+
// as bare globals, so the typeof guards make the lookup safe everywhere; the
|
|
4
|
+
// version placeholder is replaced with the package version by
|
|
5
|
+
// scripts/inject-build-defines.js. The access token falls back to the MapVX
|
|
6
|
+
// SDK-web Rollbar project token when none is injected at build time.
|
|
7
|
+
const SDK_VERSION = typeof VERSION !== "undefined" ? VERSION : "1.1.2-alpha.3";
|
|
8
|
+
const ACCESS_TOKEN = typeof ROLLBAR_ACCESS_TOKEN !== "undefined" && ROLLBAR_ACCESS_TOKEN
|
|
9
|
+
? ROLLBAR_ACCESS_TOKEN
|
|
10
|
+
: "28279d52df43411ebd138c2bee0ab1df";
|
|
1
11
|
export const _rollbarConfig = {
|
|
2
|
-
accessToken:
|
|
3
|
-
|
|
4
|
-
|
|
12
|
+
accessToken: ACCESS_TOKEN,
|
|
13
|
+
// Only report what the SDK logs explicitly via logError. Capturing every
|
|
14
|
+
// uncaught error / unhandled rejection on the host page floods Rollbar
|
|
15
|
+
// with items from third-party code (e.g. Countly, the host app itself)
|
|
16
|
+
// that the SDK does not own.
|
|
17
|
+
captureUncaught: false,
|
|
18
|
+
captureUnhandledRejections: false,
|
|
19
|
+
// Drop anything below error level (debug/info/warning).
|
|
20
|
+
reportLevel: "error",
|
|
5
21
|
payload: {
|
|
6
|
-
environment: "
|
|
7
|
-
// context: 'rollbar/test'
|
|
22
|
+
environment: "production",
|
|
8
23
|
client: {
|
|
9
24
|
javascript: {
|
|
10
|
-
code_version:
|
|
11
|
-
// source_map_enabled: true,
|
|
12
|
-
// guess_uncaught_frames: true
|
|
25
|
+
code_version: SDK_VERSION,
|
|
13
26
|
},
|
|
14
27
|
},
|
|
15
28
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollbar.js","sourceRoot":"","sources":["../../../src/logger/rollbar.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rollbar.js","sourceRoot":"","sources":["../../../src/logger/rollbar.ts"],"names":[],"mappings":"AAKA,uEAAuE;AACvE,6EAA6E;AAC7E,6EAA6E;AAC7E,8DAA8D;AAC9D,4EAA4E;AAC5E,qEAAqE;AACrE,MAAM,WAAW,GAAW,OAAO,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAA;AACxF,MAAM,YAAY,GAChB,OAAO,oBAAoB,KAAK,WAAW,IAAI,oBAAoB;IACjE,CAAC,CAAC,oBAAoB;IACtB,CAAC,CAAC,kCAAkC,CAAA;AAExC,MAAM,CAAC,MAAM,cAAc,GAAkB;IAC3C,WAAW,EAAE,YAAY;IACzB,yEAAyE;IACzE,uEAAuE;IACvE,uEAAuE;IACvE,6BAA6B;IAC7B,eAAe,EAAE,KAAK;IACtB,0BAA0B,EAAE,KAAK;IACjC,wDAAwD;IACxD,WAAW,EAAE,OAAO;IACpB,OAAO,EAAE;QACP,WAAW,EAAE,YAAY;QACzB,MAAM,EAAE;YACN,UAAU,EAAE;gBACV,YAAY,EAAE,WAAW;aAC1B;SACF;KACF;CACF,CAAA;AAED,MAAM,UAAU,UAAU,CAAC,GAAG,IAAmB;IAC/C,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAA;AAC/D,CAAC"}
|
package/dist/es/map/map.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { type LatLng } from "../domain/models/latLng";
|
|
|
6
6
|
import { Loggeable } from "../domain/models/loggeable";
|
|
7
7
|
import { type CameraAnimation, type MapCamera } from "../domain/models/mapCamera";
|
|
8
8
|
import { type MapConfig } from "../domain/models/mapConfig";
|
|
9
|
+
import { type CircleConfig, type CircleRecord } from "../domain/models/circle";
|
|
9
10
|
import { type MarkerConfig } from "../domain/models/marker";
|
|
10
11
|
import { type MVXPlace } from "../domain/models/place";
|
|
11
12
|
import { type PopOverConfig } from "../domain/models/popover";
|
|
@@ -63,6 +64,170 @@ export interface MapVXMap {
|
|
|
63
64
|
* @param markerId - The ID of the marker to hide.
|
|
64
65
|
*/
|
|
65
66
|
hideMarker(markerId: string): void;
|
|
67
|
+
/**
|
|
68
|
+
* Adds a metric radius circle to the map and to the list of current circle references.
|
|
69
|
+
* The radius is expressed in meters, so the circle keeps its geographic size
|
|
70
|
+
* at every zoom level. If a circle with the same id already exists it is replaced.
|
|
71
|
+
* Circles survive style and floor changes; a circle with a `floorId` is shown
|
|
72
|
+
* only while that floor is displayed.
|
|
73
|
+
*
|
|
74
|
+
* @param circle Specifications for circle creation.
|
|
75
|
+
* @returns The added circle id.
|
|
76
|
+
* @throws {Error} If radiusMeters is non-positive or non-finite, or coordinates are out of bounds.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```typescript
|
|
80
|
+
* const circleId = map.addCircle({
|
|
81
|
+
* coordinate: { lat: 40.7128, lng: -74.0060 },
|
|
82
|
+
* radiusMeters: 150,
|
|
83
|
+
* fillColor: '#FF0000',
|
|
84
|
+
* fillOpacity: 0.2,
|
|
85
|
+
* });
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
addCircle(circle: CircleConfig): string;
|
|
89
|
+
/**
|
|
90
|
+
* Updates an existing circle, fully replacing its configuration by id.
|
|
91
|
+
* Fields omitted from the configuration fall back to their defaults.
|
|
92
|
+
* The hidden state of the circle is preserved.
|
|
93
|
+
*
|
|
94
|
+
* @param circle Specifications for the circle update, must include the id.
|
|
95
|
+
* @returns The updated circle id, or null when no circle with that id exists.
|
|
96
|
+
* @throws {Error} If radiusMeters is non-positive or non-finite, or coordinates are out of bounds.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```typescript
|
|
100
|
+
* const result = map.updateCircle({
|
|
101
|
+
* id: circleId,
|
|
102
|
+
* coordinate: { lat: 40.7128, lng: -74.0060 },
|
|
103
|
+
* radiusMeters: 200,
|
|
104
|
+
* });
|
|
105
|
+
* if (result === null) {
|
|
106
|
+
* console.error('Circle not found');
|
|
107
|
+
* }
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
updateCircle(circle: CircleConfig): string | null;
|
|
111
|
+
/**
|
|
112
|
+
* Updates the center, and optionally the radius, of a circle on the map.
|
|
113
|
+
* Styling and floor assignment are left untouched. Validates all inputs.
|
|
114
|
+
*
|
|
115
|
+
* @param circleId The id of the circle.
|
|
116
|
+
* @param center The new center of the circle.
|
|
117
|
+
* @param radiusMeters Optional new radius in meters. If omitted, radius stays unchanged.
|
|
118
|
+
* @returns True if the circle was found and updated, false otherwise.
|
|
119
|
+
* @throws {Error} If coordinates are out of bounds or radiusMeters (if provided) is invalid.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```typescript
|
|
123
|
+
* const success = map.updateCirclePosition(circleId, { lat: 40.7140, lng: -74.0070 }, 250);
|
|
124
|
+
* if (!success) {
|
|
125
|
+
* console.error('Circle not found');
|
|
126
|
+
* }
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
updateCirclePosition(circleId: string, center: LatLng, radiusMeters?: number): boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Updates the styling of an existing circle without recreating its geometry.
|
|
132
|
+
* This is efficient when only color, opacity, or stroke properties change.
|
|
133
|
+
* Unspecified styling properties preserve their current values.
|
|
134
|
+
*
|
|
135
|
+
* @param circleId The id of the circle to update.
|
|
136
|
+
* @param style Partial styling configuration (e.g., fillOpacity, strokeColor).
|
|
137
|
+
* @returns True if the circle was found and updated, false otherwise.
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```typescript
|
|
141
|
+
* map.updateCircleStyle(circleId, {
|
|
142
|
+
* fillOpacity: 0.3,
|
|
143
|
+
* strokeColor: '#00FF00',
|
|
144
|
+
* });
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
updateCircleStyle(circleId: string, style: Partial<CircleConfig>): boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Retrieves a circle by id from the map.
|
|
150
|
+
*
|
|
151
|
+
* @param circleId The id of the circle to retrieve.
|
|
152
|
+
* @returns A defensive copy of the circle record (mutations don't affect
|
|
153
|
+
* the map), or undefined if not found. Use the update methods to
|
|
154
|
+
* change a circle.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```typescript
|
|
158
|
+
* const circle = map.getCircle(circleId);
|
|
159
|
+
* if (circle) {
|
|
160
|
+
* console.log(`Circle radius: ${circle.radiusMeters}m`);
|
|
161
|
+
* }
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
getCircle(circleId: string): CircleRecord | undefined;
|
|
165
|
+
/**
|
|
166
|
+
* Retrieves all circles currently on the map.
|
|
167
|
+
*
|
|
168
|
+
* @returns A defensive copy of all circle records (mutations don't affect the map).
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* ```typescript
|
|
172
|
+
* const circles = map.getCircles();
|
|
173
|
+
* console.log(`Map has ${circles.length} circles`);
|
|
174
|
+
* ```
|
|
175
|
+
*/
|
|
176
|
+
getCircles(): CircleRecord[];
|
|
177
|
+
/**
|
|
178
|
+
* Checks if a circle with the given id exists on the map.
|
|
179
|
+
*
|
|
180
|
+
* @param circleId The id to check.
|
|
181
|
+
* @returns True if a circle with that id exists, false otherwise.
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```typescript
|
|
185
|
+
* if (map.hasCircle(circleId)) {
|
|
186
|
+
* map.removeCircle(circleId);
|
|
187
|
+
* }
|
|
188
|
+
* ```
|
|
189
|
+
*/
|
|
190
|
+
hasCircle(circleId: string): boolean;
|
|
191
|
+
/**
|
|
192
|
+
* Removes from the current map the circle that corresponds to the id provided.
|
|
193
|
+
* @param circleId The id of the circle to remove.
|
|
194
|
+
*/
|
|
195
|
+
removeCircle(circleId: string): void;
|
|
196
|
+
/**
|
|
197
|
+
* Removes all circles from the map.
|
|
198
|
+
*/
|
|
199
|
+
removeAllCircles(): void;
|
|
200
|
+
/**
|
|
201
|
+
* Shows the circle with the specified ID after it has been hidden.
|
|
202
|
+
* The circle remains subject to floor visibility rules.
|
|
203
|
+
*
|
|
204
|
+
* @param circleId - The ID of the circle to show.
|
|
205
|
+
* @returns True if the circle was found and shown, false if not found.
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* ```typescript
|
|
209
|
+
* if (!map.showCircle(circleId)) {
|
|
210
|
+
* console.error('Circle not found');
|
|
211
|
+
* }
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
showCircle(circleId: string): boolean;
|
|
215
|
+
/**
|
|
216
|
+
* Hides the circle with the specified ID without deleting it.
|
|
217
|
+
* Unlike markers, a hidden circle stays hidden across floor changes and
|
|
218
|
+
* map restyles until {@link showCircle} is called.
|
|
219
|
+
*
|
|
220
|
+
* @param circleId - The ID of the circle to hide.
|
|
221
|
+
* @returns True if the circle was found and hidden, false if not found.
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* ```typescript
|
|
225
|
+
* map.hideCircle(circleId);
|
|
226
|
+
* // Later...
|
|
227
|
+
* map.showCircle(circleId); // Circle is now visible again
|
|
228
|
+
* ```
|
|
229
|
+
*/
|
|
230
|
+
hideCircle(circleId: string): boolean;
|
|
66
231
|
/**
|
|
67
232
|
* Update the camera position on the map
|
|
68
233
|
* @param newCamera Options for camera update.
|
|
@@ -95,6 +260,78 @@ export interface MapVXMap {
|
|
|
95
260
|
* ```
|
|
96
261
|
*/
|
|
97
262
|
setMaxZoom(zoomLvl: number, options?: ZoomOptions): void;
|
|
263
|
+
/**
|
|
264
|
+
* Sets the map bearing (rotation) in degrees, measured clockwise from north.
|
|
265
|
+
* A bearing of `0` keeps north up, `90` puts east up, and so on.
|
|
266
|
+
*
|
|
267
|
+
* Useful to align the map with a fixed installation (e.g. a totem/kiosk) at
|
|
268
|
+
* runtime — for instance after the visitor picks which totem they are standing
|
|
269
|
+
* at. Works even when user rotation is disabled via
|
|
270
|
+
* {@link MapConfig.rotateEnabled} or {@link MapVXMap.setRotationEnabled}, since
|
|
271
|
+
* this is a programmatic change.
|
|
272
|
+
*
|
|
273
|
+
* @param degrees Target bearing in degrees. Non-finite values are ignored.
|
|
274
|
+
* @param options Optional behavior:
|
|
275
|
+
* - `animate`: when `true`, the camera eases to the new bearing instead of
|
|
276
|
+
* snapping to it. Defaults to `false`.
|
|
277
|
+
* - `onComplete`: callback invoked once the rotation has been applied (after
|
|
278
|
+
* the animation when `animate` is `true`).
|
|
279
|
+
*
|
|
280
|
+
* @example
|
|
281
|
+
* ```typescript
|
|
282
|
+
* // Snap the map so the selected totem faces up
|
|
283
|
+
* map.setBearing(135);
|
|
284
|
+
*
|
|
285
|
+
* // Animate the rotation and run a callback when it settles
|
|
286
|
+
* map.setBearing(135, { animate: true, onComplete: () => console.log('aligned') });
|
|
287
|
+
* ```
|
|
288
|
+
*
|
|
289
|
+
* @group Map
|
|
290
|
+
*/
|
|
291
|
+
setBearing(degrees: number, options?: {
|
|
292
|
+
animate?: boolean;
|
|
293
|
+
onComplete?: () => void;
|
|
294
|
+
}): void;
|
|
295
|
+
/**
|
|
296
|
+
* Enables or disables user rotation of the map at runtime.
|
|
297
|
+
*
|
|
298
|
+
* When disabled, drag-to-rotate, two-finger touch rotation and pitch-with-rotate
|
|
299
|
+
* are turned off while pinch-to-zoom keeps working. This is the runtime
|
|
300
|
+
* equivalent of {@link MapConfig.rotateEnabled} and is ideal for fixed
|
|
301
|
+
* installations that must stay locked to a configured {@link MapConfig.bearing}.
|
|
302
|
+
*
|
|
303
|
+
* @param enabled `true` to allow rotation, `false` to lock it.
|
|
304
|
+
*
|
|
305
|
+
* @example
|
|
306
|
+
* ```typescript
|
|
307
|
+
* // Lock the map to its current orientation
|
|
308
|
+
* map.setRotationEnabled(false);
|
|
309
|
+
* ```
|
|
310
|
+
*
|
|
311
|
+
* @group Map
|
|
312
|
+
*/
|
|
313
|
+
setRotationEnabled(enabled: boolean): void;
|
|
314
|
+
/**
|
|
315
|
+
* Enables or disables panning the map by dragging or swiping at runtime.
|
|
316
|
+
* Runtime equivalent of {@link MapConfig.dragPan}. Combine with
|
|
317
|
+
* {@link MapVXMap.setRotationEnabled} to build a static screen where only zoom
|
|
318
|
+
* in/out is allowed.
|
|
319
|
+
*
|
|
320
|
+
* @param enabled `true` to allow panning, `false` to lock the map position.
|
|
321
|
+
*
|
|
322
|
+
* @group Map
|
|
323
|
+
*/
|
|
324
|
+
setPanEnabled(enabled: boolean): void;
|
|
325
|
+
/**
|
|
326
|
+
* Enables or disables zooming with the scroll wheel / trackpad at runtime.
|
|
327
|
+
* Runtime equivalent of {@link MapConfig.scrollZoom}. Zoom buttons and
|
|
328
|
+
* pinch-to-zoom are unaffected.
|
|
329
|
+
*
|
|
330
|
+
* @param enabled `true` to allow scroll-wheel zoom, `false` to disable it.
|
|
331
|
+
*
|
|
332
|
+
* @group Map
|
|
333
|
+
*/
|
|
334
|
+
setScrollZoomEnabled(enabled: boolean): void;
|
|
98
335
|
/**
|
|
99
336
|
* Limits the movement of the map to a bounding box calculated with the coordinate array
|
|
100
337
|
* If the coordinates are less than 2, then the function does nothing.
|
|
@@ -446,6 +683,7 @@ export declare class InternalMapVXMap extends Loggeable implements MapVXMap {
|
|
|
446
683
|
private baseFilters;
|
|
447
684
|
map: Map;
|
|
448
685
|
private markers;
|
|
686
|
+
private circles;
|
|
449
687
|
private userLocationMarker;
|
|
450
688
|
private watchPositionID;
|
|
451
689
|
private readonly routeController;
|
|
@@ -529,6 +767,59 @@ export declare class InternalMapVXMap extends Loggeable implements MapVXMap {
|
|
|
529
767
|
hideMarker(markerId: string): void;
|
|
530
768
|
removeMarker(markerId: string): void;
|
|
531
769
|
removeAllMarkers(): void;
|
|
770
|
+
addCircle(circle: CircleConfig): string;
|
|
771
|
+
updateCircle(circleConfig: CircleConfig): string | null;
|
|
772
|
+
getCircle(circleId: string): CircleRecord | undefined;
|
|
773
|
+
getCircles(): CircleRecord[];
|
|
774
|
+
hasCircle(circleId: string): boolean;
|
|
775
|
+
updateCirclePosition(circleId: string, center: LatLng, radiusMeters?: number): boolean;
|
|
776
|
+
updateCircleStyle(circleId: string, style: Partial<Pick<CircleRecord, "fillColor" | "fillOpacity" | "strokeColor" | "strokeWidth" | "strokeOpacity">>): boolean;
|
|
777
|
+
removeCircle(circleId: string): void;
|
|
778
|
+
removeAllCircles(): void;
|
|
779
|
+
showCircle(circleId: string): boolean;
|
|
780
|
+
hideCircle(circleId: string): boolean;
|
|
781
|
+
/**
|
|
782
|
+
* Builds the GeoJSON FeatureCollection for every currently visible circle.
|
|
783
|
+
* Visibility mirrors marker semantics: a circle with a floor is shown only
|
|
784
|
+
* while that floor is displayed, and a circle without a floor is shown only
|
|
785
|
+
* in outdoor contexts. Hidden circles are always omitted.
|
|
786
|
+
*/
|
|
787
|
+
private circleFeatureCollection;
|
|
788
|
+
/**
|
|
789
|
+
* Idempotently adds the shared circle source and its fill/line layers.
|
|
790
|
+
* Layers are inserted below the first symbol layer so place labels and
|
|
791
|
+
* markers stay readable above the translucent fill. Safe to call at any
|
|
792
|
+
* time: a style that is still loading simply rejects the calls, and the
|
|
793
|
+
* styledata listener retries once the style is ready.
|
|
794
|
+
*/
|
|
795
|
+
/**
|
|
796
|
+
* Resolves the layer id to insert circle layers before, for one render
|
|
797
|
+
* order. `undefined` means "append on top".
|
|
798
|
+
*
|
|
799
|
+
* `aboveBasemap` finds the topmost non-symbol layer of the style and
|
|
800
|
+
* inserts before the first symbol layer that follows it. On indoor styles
|
|
801
|
+
* the floor-plate and building polygons are ordered after the first symbol
|
|
802
|
+
* layer, so anchoring on the topmost geometry layer — instead of the first
|
|
803
|
+
* symbol layer — guarantees circles are never occluded by basemap fills
|
|
804
|
+
* while still rendering below the labels that follow them.
|
|
805
|
+
*/
|
|
806
|
+
private circleBeforeIdFor;
|
|
807
|
+
/**
|
|
808
|
+
* Idempotently ensures the shared circle source and one fill/line layer
|
|
809
|
+
* pair per render order in use, at the placement that order requires.
|
|
810
|
+
* Placement is recomputed and re-asserted (via moveLayer) on every call,
|
|
811
|
+
* so circles regain their correct z-order after any style reload or
|
|
812
|
+
* floor/parent-place change. Safe to call at any time: a style that is
|
|
813
|
+
* still loading simply rejects the calls, and the styledata listener
|
|
814
|
+
* retries once the style is ready.
|
|
815
|
+
*/
|
|
816
|
+
private ensureCircleLayers;
|
|
817
|
+
/**
|
|
818
|
+
* Re-renders all circles: ensures the source and layers exist, then pushes
|
|
819
|
+
* the current FeatureCollection. Called after every mutation of the circle
|
|
820
|
+
* list, on floor changes, and when the map style reloads.
|
|
821
|
+
*/
|
|
822
|
+
private refreshCircles;
|
|
532
823
|
/**
|
|
533
824
|
* Use it to change the current layer
|
|
534
825
|
* @param floorKey floor id
|
|
@@ -546,6 +837,13 @@ export declare class InternalMapVXMap extends Loggeable implements MapVXMap {
|
|
|
546
837
|
updateCamera(newCamera: MapCamera & CameraAnimation, callback?: () => void): void;
|
|
547
838
|
setMaxZoom(zoomLvl: number, options?: ZoomOptions): void;
|
|
548
839
|
setMinZoom(zoomLvl: number, options?: ZoomOptions): void;
|
|
840
|
+
setBearing(degrees: number, options?: {
|
|
841
|
+
animate?: boolean;
|
|
842
|
+
onComplete?: () => void;
|
|
843
|
+
}): void;
|
|
844
|
+
setRotationEnabled(enabled: boolean): void;
|
|
845
|
+
setPanEnabled(enabled: boolean): void;
|
|
846
|
+
setScrollZoomEnabled(enabled: boolean): void;
|
|
549
847
|
isInsideBounds(point: LatLng): boolean;
|
|
550
848
|
setMaxBounds(coordinates: LatLng[], options?: BoundsOptions): void;
|
|
551
849
|
fitCoordinates(coordinates: LatLng[], options?: FitOptions): void;
|