@mapvx/web-js 4.0.3-dev.1 → 4.0.3-dev.2
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/index.js +4 -2
- package/dist/es/assets/icons.d.ts +0 -1
- package/dist/es/assets/icons.js +0 -50
- package/dist/es/config/draco.d.ts +0 -1
- package/dist/es/config/draco.js +0 -10
- package/dist/es/config/sdkConfig.d.ts +0 -1
- package/dist/es/config/sdkConfig.js +0 -1
- package/dist/es/controllers/markerLayoutController.d.ts +0 -1
- package/dist/es/controllers/markerLayoutController.js +0 -103
- package/dist/es/controllers/routeController.d.ts +0 -1
- package/dist/es/controllers/routeController.js +1 -473
- package/dist/es/domain/models/_internal.d.ts +0 -1
- package/dist/es/domain/models/_internal.js +0 -8
- package/dist/es/domain/models/animation.d.ts +0 -1
- package/dist/es/domain/models/animation.js +0 -6
- package/dist/es/domain/models/banner.d.ts +0 -1
- package/dist/es/domain/models/banner.js +0 -10
- package/dist/es/domain/models/campaign.d.ts +0 -1
- package/dist/es/domain/models/campaign.js +0 -29
- package/dist/es/domain/models/categories.d.ts +0 -1
- package/dist/es/domain/models/categories.js +0 -20
- package/dist/es/domain/models/circle.d.ts +0 -1
- package/dist/es/domain/models/circle.js +0 -118
- package/dist/es/domain/models/cityFilterOption.d.ts +0 -1
- package/dist/es/domain/models/cityFilterOption.js +0 -1
- package/dist/es/domain/models/configuration.d.ts +0 -1
- package/dist/es/domain/models/configuration.js +0 -1
- package/dist/es/domain/models/cssCustomization.d.ts +0 -1
- package/dist/es/domain/models/cssCustomization.js +0 -1
- package/dist/es/domain/models/fitOptions.d.ts +0 -1
- package/dist/es/domain/models/fitOptions.js +0 -1
- package/dist/es/domain/models/innerFloors.d.ts +0 -1
- package/dist/es/domain/models/innerFloors.js +0 -1
- package/dist/es/domain/models/institution.d.ts +0 -1
- package/dist/es/domain/models/institution.js +0 -26
- package/dist/es/domain/models/latLng.d.ts +0 -1
- package/dist/es/domain/models/latLng.js +0 -1
- package/dist/es/domain/models/location.d.ts +0 -1
- package/dist/es/domain/models/location.js +0 -1
- package/dist/es/domain/models/loggeable.d.ts +0 -1
- package/dist/es/domain/models/loggeable.js +0 -24
- package/dist/es/domain/models/mapCamera.d.ts +0 -1
- package/dist/es/domain/models/mapCamera.js +0 -1
- package/dist/es/domain/models/mapConfig.d.ts +0 -1
- package/dist/es/domain/models/mapConfig.js +1 -17
- package/dist/es/domain/models/marker.d.ts +0 -1
- package/dist/es/domain/models/marker.js +0 -292
- package/dist/es/domain/models/multilanguage.d.ts +0 -1
- package/dist/es/domain/models/multilanguage.js +0 -10
- package/dist/es/domain/models/openingHours.d.ts +0 -1
- package/dist/es/domain/models/openingHours.js +0 -1
- package/dist/es/domain/models/place.d.ts +0 -1
- package/dist/es/domain/models/place.js +0 -68
- package/dist/es/domain/models/platform.d.ts +0 -1
- package/dist/es/domain/models/platform.js +0 -1
- package/dist/es/domain/models/popover.d.ts +0 -1
- package/dist/es/domain/models/popover.js +0 -1
- package/dist/es/domain/models/product.d.ts +0 -1
- package/dist/es/domain/models/product.js +0 -1
- package/dist/es/domain/models/property.d.ts +0 -1
- package/dist/es/domain/models/property.js +0 -16
- package/dist/es/domain/models/route.d.ts +0 -1
- package/dist/es/domain/models/route.js +0 -71
- package/dist/es/domain/models/routeConfiguration.d.ts +0 -1
- package/dist/es/domain/models/routeConfiguration.js +0 -36
- package/dist/es/domain/models/routeInstance.d.ts +0 -1
- package/dist/es/domain/models/routeInstance.js +0 -8
- package/dist/es/domain/models/routeStyle.d.ts +0 -1
- package/dist/es/domain/models/routeStyle.js +0 -1
- package/dist/es/domain/models/scene3D.d.ts +0 -1
- package/dist/es/domain/models/scene3D.js +0 -1
- package/dist/es/domain/models/transport.d.ts +0 -1
- package/dist/es/domain/models/transport.js +0 -12
- package/dist/es/domain/ports/ICache.d.ts +0 -1
- package/dist/es/domain/ports/ICache.js +0 -1
- package/dist/es/domain/ports/IHttpClient.d.ts +0 -1
- package/dist/es/domain/ports/IHttpClient.js +0 -1
- package/dist/es/domain/ports/ILogger.d.ts +0 -1
- package/dist/es/domain/ports/ILogger.js +0 -9
- package/dist/es/domain/ports/index.d.ts +0 -1
- package/dist/es/domain/ports/index.js +0 -5
- package/dist/es/index.d.ts +0 -1
- package/dist/es/index.js +1 -28
- package/dist/es/infrastructure/cache/CacheManager.d.ts +0 -1
- package/dist/es/infrastructure/cache/CacheManager.js +0 -94
- package/dist/es/infrastructure/cache/LRUCache.d.ts +0 -1
- package/dist/es/infrastructure/cache/LRUCache.js +0 -57
- package/dist/es/infrastructure/cache/PersistentCache.d.ts +0 -1
- package/dist/es/infrastructure/cache/PersistentCache.js +0 -51
- package/dist/es/infrastructure/cache/cacheConfig.d.ts +0 -1
- package/dist/es/infrastructure/cache/cacheConfig.js +8 -27
- package/dist/es/infrastructure/http/FetchHttpClient.d.ts +0 -1
- package/dist/es/infrastructure/http/FetchHttpClient.js +0 -36
- package/dist/es/infrastructure/logging/MVXLogger.d.ts +0 -1
- package/dist/es/infrastructure/logging/MVXLogger.js +0 -37
- package/dist/es/interfaces/cache.d.ts +0 -1
- package/dist/es/interfaces/cache.js +0 -1
- package/dist/es/interfaces/healthResponse.d.ts +0 -1
- package/dist/es/interfaces/healthResponse.js +0 -1
- package/dist/es/interfaces/institutionResponse.d.ts +0 -1
- package/dist/es/interfaces/institutionResponse.js +0 -1
- package/dist/es/interfaces/metadata.d.ts +0 -1
- package/dist/es/interfaces/metadata.js +0 -1
- package/dist/es/interfaces/placeResponse.d.ts +0 -1
- package/dist/es/interfaces/placeResponse.js +0 -1
- package/dist/es/interfaces/routeCacheResponse.d.ts +0 -1
- package/dist/es/interfaces/routeCacheResponse.js +0 -1
- package/dist/es/interfaces/routeResponse.d.ts +0 -1
- package/dist/es/interfaces/routeResponse.js +0 -1
- package/dist/es/interfaces/styleResponse.d.ts +0 -1
- package/dist/es/interfaces/styleResponse.js +0 -1
- package/dist/es/logger/logger.d.ts +0 -1
- package/dist/es/logger/logger.js +0 -10
- package/dist/es/logger/sentry.d.ts +0 -1
- package/dist/es/logger/sentry.js +1 -39
- package/dist/es/map/fitCamera.d.ts +0 -1
- package/dist/es/map/fitCamera.js +0 -44
- package/dist/es/map/generated/maplibreWorkerSource.d.ts +0 -1
- package/dist/es/map/generated/maplibreWorkerSource.js +0 -12
- package/dist/es/map/installMapLibreWorker.d.ts +0 -1
- package/dist/es/map/installMapLibreWorker.js +0 -100
- package/dist/es/map/liveMapFitTransform.d.ts +0 -1
- package/dist/es/map/liveMapFitTransform.js +0 -82
- package/dist/es/map/map.d.ts +0 -1
- package/dist/es/map/map.js +4 -681
- package/dist/es/map/mapInteractionOptions.d.ts +0 -1
- package/dist/es/map/mapInteractionOptions.js +0 -35
- package/dist/es/map/scene3DController.d.ts +0 -1
- package/dist/es/map/scene3DController.js +0 -221
- package/dist/es/repository/repository.d.ts +0 -1
- package/dist/es/repository/repository.js +0 -56
- package/dist/es/repository/requester.d.ts +0 -1
- package/dist/es/repository/requester.js +0 -233
- package/dist/es/sdk.d.ts +0 -1
- package/dist/es/sdk.js +0 -35
- package/dist/es/utils/3d.d.ts +0 -1
- package/dist/es/utils/3d.js +0 -79
- package/dist/es/utils/deckLayers.d.ts +0 -1
- package/dist/es/utils/deckLayers.js +1 -27
- package/dist/es/utils/error.d.ts +0 -1
- package/dist/es/utils/error.js +0 -7
- package/dist/es/utils/images.d.ts +0 -1
- package/dist/es/utils/images.js +0 -7
- package/dist/es/utils/loadGlb.d.ts +0 -1
- package/dist/es/utils/loadGlb.js +2 -96
- package/dist/es/utils/mapvxHostname.d.ts +0 -1
- package/dist/es/utils/mapvxHostname.js +0 -11
- package/dist/es/utils/nav-functions.d.ts +0 -1
- package/dist/es/utils/nav-functions.js +0 -82
- package/dist/es/utils/opening-hours-helper.d.ts +0 -1
- package/dist/es/utils/opening-hours-helper.js +6 -382
- package/dist/es/utils/preconnect.d.ts +0 -1
- package/dist/es/utils/preconnect.js +0 -61
- package/dist/es/utils/route-utils.d.ts +0 -1
- package/dist/es/utils/route-utils.js +0 -25
- package/dist/es/utils/semaphore.d.ts +0 -1
- package/dist/es/utils/semaphore.js +0 -78
- package/dist/es/utils/three.d.ts +0 -1
- package/dist/es/utils/three.js +0 -43
- package/dist/es/utils/threeScene.d.ts +0 -1
- package/dist/es/utils/threeScene.js +0 -38
- package/dist/es/utils/update-css.d.ts +0 -1
- package/dist/es/utils/update-css.js +0 -26
- package/dist/es/utils/utils.d.ts +0 -1
- package/dist/es/utils/utils.js +0 -53
- package/dist/umd/index.js +4 -29240
- package/dist/umd/index.js.LICENSE.txt +1 -0
- package/dist/umd/styles.css +0 -1
- package/dist/umd/styles.js +3 -32
- package/package.json +11 -5
- package/dist/cjs/index.js.map +0 -1
- package/dist/es/assets/icons.d.ts.map +0 -1
- package/dist/es/assets/icons.js.map +0 -1
- package/dist/es/config/draco.d.ts.map +0 -1
- package/dist/es/config/draco.js.map +0 -1
- package/dist/es/config/sdkConfig.d.ts.map +0 -1
- package/dist/es/config/sdkConfig.js.map +0 -1
- package/dist/es/controllers/markerLayoutController.d.ts.map +0 -1
- package/dist/es/controllers/markerLayoutController.js.map +0 -1
- package/dist/es/controllers/routeController.d.ts.map +0 -1
- package/dist/es/controllers/routeController.js.map +0 -1
- package/dist/es/domain/models/_internal.d.ts.map +0 -1
- package/dist/es/domain/models/_internal.js.map +0 -1
- package/dist/es/domain/models/animation.d.ts.map +0 -1
- package/dist/es/domain/models/animation.js.map +0 -1
- package/dist/es/domain/models/banner.d.ts.map +0 -1
- package/dist/es/domain/models/banner.js.map +0 -1
- package/dist/es/domain/models/campaign.d.ts.map +0 -1
- package/dist/es/domain/models/campaign.js.map +0 -1
- package/dist/es/domain/models/categories.d.ts.map +0 -1
- package/dist/es/domain/models/categories.js.map +0 -1
- package/dist/es/domain/models/circle.d.ts.map +0 -1
- package/dist/es/domain/models/circle.js.map +0 -1
- package/dist/es/domain/models/cityFilterOption.d.ts.map +0 -1
- package/dist/es/domain/models/cityFilterOption.js.map +0 -1
- package/dist/es/domain/models/configuration.d.ts.map +0 -1
- package/dist/es/domain/models/configuration.js.map +0 -1
- package/dist/es/domain/models/cssCustomization.d.ts.map +0 -1
- package/dist/es/domain/models/cssCustomization.js.map +0 -1
- package/dist/es/domain/models/fitOptions.d.ts.map +0 -1
- package/dist/es/domain/models/fitOptions.js.map +0 -1
- package/dist/es/domain/models/innerFloors.d.ts.map +0 -1
- package/dist/es/domain/models/innerFloors.js.map +0 -1
- package/dist/es/domain/models/institution.d.ts.map +0 -1
- package/dist/es/domain/models/institution.js.map +0 -1
- package/dist/es/domain/models/latLng.d.ts.map +0 -1
- package/dist/es/domain/models/latLng.js.map +0 -1
- package/dist/es/domain/models/location.d.ts.map +0 -1
- package/dist/es/domain/models/location.js.map +0 -1
- package/dist/es/domain/models/loggeable.d.ts.map +0 -1
- package/dist/es/domain/models/loggeable.js.map +0 -1
- package/dist/es/domain/models/mapCamera.d.ts.map +0 -1
- package/dist/es/domain/models/mapCamera.js.map +0 -1
- package/dist/es/domain/models/mapConfig.d.ts.map +0 -1
- package/dist/es/domain/models/mapConfig.js.map +0 -1
- package/dist/es/domain/models/marker.d.ts.map +0 -1
- package/dist/es/domain/models/marker.js.map +0 -1
- package/dist/es/domain/models/multilanguage.d.ts.map +0 -1
- package/dist/es/domain/models/multilanguage.js.map +0 -1
- package/dist/es/domain/models/openingHours.d.ts.map +0 -1
- package/dist/es/domain/models/openingHours.js.map +0 -1
- package/dist/es/domain/models/place.d.ts.map +0 -1
- package/dist/es/domain/models/place.js.map +0 -1
- package/dist/es/domain/models/platform.d.ts.map +0 -1
- package/dist/es/domain/models/platform.js.map +0 -1
- package/dist/es/domain/models/popover.d.ts.map +0 -1
- package/dist/es/domain/models/popover.js.map +0 -1
- package/dist/es/domain/models/product.d.ts.map +0 -1
- package/dist/es/domain/models/product.js.map +0 -1
- package/dist/es/domain/models/property.d.ts.map +0 -1
- package/dist/es/domain/models/property.js.map +0 -1
- package/dist/es/domain/models/route.d.ts.map +0 -1
- package/dist/es/domain/models/route.js.map +0 -1
- package/dist/es/domain/models/routeConfiguration.d.ts.map +0 -1
- package/dist/es/domain/models/routeConfiguration.js.map +0 -1
- package/dist/es/domain/models/routeInstance.d.ts.map +0 -1
- package/dist/es/domain/models/routeInstance.js.map +0 -1
- package/dist/es/domain/models/routeStyle.d.ts.map +0 -1
- package/dist/es/domain/models/routeStyle.js.map +0 -1
- package/dist/es/domain/models/scene3D.d.ts.map +0 -1
- package/dist/es/domain/models/scene3D.js.map +0 -1
- package/dist/es/domain/models/transport.d.ts.map +0 -1
- package/dist/es/domain/models/transport.js.map +0 -1
- package/dist/es/domain/ports/ICache.d.ts.map +0 -1
- package/dist/es/domain/ports/ICache.js.map +0 -1
- package/dist/es/domain/ports/IHttpClient.d.ts.map +0 -1
- package/dist/es/domain/ports/IHttpClient.js.map +0 -1
- package/dist/es/domain/ports/ILogger.d.ts.map +0 -1
- package/dist/es/domain/ports/ILogger.js.map +0 -1
- package/dist/es/domain/ports/index.d.ts.map +0 -1
- package/dist/es/domain/ports/index.js.map +0 -1
- package/dist/es/index.d.ts.map +0 -1
- package/dist/es/index.js.map +0 -1
- package/dist/es/infrastructure/cache/CacheManager.d.ts.map +0 -1
- package/dist/es/infrastructure/cache/CacheManager.js.map +0 -1
- package/dist/es/infrastructure/cache/LRUCache.d.ts.map +0 -1
- package/dist/es/infrastructure/cache/LRUCache.js.map +0 -1
- package/dist/es/infrastructure/cache/PersistentCache.d.ts.map +0 -1
- package/dist/es/infrastructure/cache/PersistentCache.js.map +0 -1
- package/dist/es/infrastructure/cache/cacheConfig.d.ts.map +0 -1
- package/dist/es/infrastructure/cache/cacheConfig.js.map +0 -1
- package/dist/es/infrastructure/http/FetchHttpClient.d.ts.map +0 -1
- package/dist/es/infrastructure/http/FetchHttpClient.js.map +0 -1
- package/dist/es/infrastructure/logging/MVXLogger.d.ts.map +0 -1
- package/dist/es/infrastructure/logging/MVXLogger.js.map +0 -1
- package/dist/es/interfaces/cache.d.ts.map +0 -1
- package/dist/es/interfaces/cache.js.map +0 -1
- package/dist/es/interfaces/healthResponse.d.ts.map +0 -1
- package/dist/es/interfaces/healthResponse.js.map +0 -1
- package/dist/es/interfaces/institutionResponse.d.ts.map +0 -1
- package/dist/es/interfaces/institutionResponse.js.map +0 -1
- package/dist/es/interfaces/metadata.d.ts.map +0 -1
- package/dist/es/interfaces/metadata.js.map +0 -1
- package/dist/es/interfaces/placeResponse.d.ts.map +0 -1
- package/dist/es/interfaces/placeResponse.js.map +0 -1
- package/dist/es/interfaces/routeCacheResponse.d.ts.map +0 -1
- package/dist/es/interfaces/routeCacheResponse.js.map +0 -1
- package/dist/es/interfaces/routeResponse.d.ts.map +0 -1
- package/dist/es/interfaces/routeResponse.js.map +0 -1
- package/dist/es/interfaces/styleResponse.d.ts.map +0 -1
- package/dist/es/interfaces/styleResponse.js.map +0 -1
- package/dist/es/logger/logger.d.ts.map +0 -1
- package/dist/es/logger/logger.js.map +0 -1
- package/dist/es/logger/sentry.d.ts.map +0 -1
- package/dist/es/logger/sentry.js.map +0 -1
- package/dist/es/map/fitCamera.d.ts.map +0 -1
- package/dist/es/map/fitCamera.js.map +0 -1
- package/dist/es/map/generated/maplibreWorkerSource.d.ts.map +0 -1
- package/dist/es/map/generated/maplibreWorkerSource.js.map +0 -1
- package/dist/es/map/installMapLibreWorker.d.ts.map +0 -1
- package/dist/es/map/installMapLibreWorker.js.map +0 -1
- package/dist/es/map/liveMapFitTransform.d.ts.map +0 -1
- package/dist/es/map/liveMapFitTransform.js.map +0 -1
- package/dist/es/map/map.d.ts.map +0 -1
- package/dist/es/map/map.js.map +0 -1
- package/dist/es/map/mapInteractionOptions.d.ts.map +0 -1
- package/dist/es/map/mapInteractionOptions.js.map +0 -1
- package/dist/es/map/scene3DController.d.ts.map +0 -1
- package/dist/es/map/scene3DController.js.map +0 -1
- package/dist/es/repository/repository.d.ts.map +0 -1
- package/dist/es/repository/repository.js.map +0 -1
- package/dist/es/repository/requester.d.ts.map +0 -1
- package/dist/es/repository/requester.js.map +0 -1
- package/dist/es/sdk.d.ts.map +0 -1
- package/dist/es/sdk.js.map +0 -1
- package/dist/es/utils/3d.d.ts.map +0 -1
- package/dist/es/utils/3d.js.map +0 -1
- package/dist/es/utils/deckLayers.d.ts.map +0 -1
- package/dist/es/utils/deckLayers.js.map +0 -1
- package/dist/es/utils/error.d.ts.map +0 -1
- package/dist/es/utils/error.js.map +0 -1
- package/dist/es/utils/images.d.ts.map +0 -1
- package/dist/es/utils/images.js.map +0 -1
- package/dist/es/utils/loadGlb.d.ts.map +0 -1
- package/dist/es/utils/loadGlb.js.map +0 -1
- package/dist/es/utils/mapvxHostname.d.ts.map +0 -1
- package/dist/es/utils/mapvxHostname.js.map +0 -1
- package/dist/es/utils/nav-functions.d.ts.map +0 -1
- package/dist/es/utils/nav-functions.js.map +0 -1
- package/dist/es/utils/opening-hours-helper.d.ts.map +0 -1
- package/dist/es/utils/opening-hours-helper.js.map +0 -1
- package/dist/es/utils/preconnect.d.ts.map +0 -1
- package/dist/es/utils/preconnect.js.map +0 -1
- package/dist/es/utils/route-utils.d.ts.map +0 -1
- package/dist/es/utils/route-utils.js.map +0 -1
- package/dist/es/utils/semaphore.d.ts.map +0 -1
- package/dist/es/utils/semaphore.js.map +0 -1
- package/dist/es/utils/three.d.ts.map +0 -1
- package/dist/es/utils/three.js.map +0 -1
- package/dist/es/utils/threeScene.d.ts.map +0 -1
- package/dist/es/utils/threeScene.js.map +0 -1
- package/dist/es/utils/update-css.d.ts.map +0 -1
- package/dist/es/utils/update-css.js.map +0 -1
- package/dist/es/utils/utils.d.ts.map +0 -1
- package/dist/es/utils/utils.js.map +0 -1
- package/dist/umd/index.js.map +0 -1
- package/dist/umd/styles.css.map +0 -1
- package/dist/umd/styles.js.map +0 -1
package/dist/es/assets/icons.js
CHANGED
|
@@ -1,38 +1,4 @@
|
|
|
1
1
|
export const userLocationDataUrl = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20aria-hidden%3D%22false%22%20role%3D%22img%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%226%22%20fill%3D%22var(--icon-fill%2C%20%23007aff)%22%20stroke%3D%22var(--icon-stroke%2C%20%23ffffff)%22%20stroke-width%3D%222%22/%3E%3C/svg%3E";
|
|
2
|
-
/**
|
|
3
|
-
* Generates a data URL for the route animation icon SVG with customizable appearance.
|
|
4
|
-
*
|
|
5
|
-
* @param config - Optional configuration for the icon appearance.
|
|
6
|
-
* @param config.backgroundColor - The background color of the circle (default: "#276EF1").
|
|
7
|
-
* @param config.arrowColor - The color of the arrow (default: "#FFFFFF").
|
|
8
|
-
* @param config.arrowWidth - The stroke width of the arrow path in pixels (default: 0).
|
|
9
|
-
* @param config.borderWidth - The border width of the circle in pixels (default: 0).
|
|
10
|
-
* @param config.borderColor - The border color of the circle (default: "#000000").
|
|
11
|
-
* @param config.blur - The blur radius in pixels to apply to the icon (default: 0).
|
|
12
|
-
* @returns A data URL string that can be used as the `src` attribute of an `<img>` element.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```typescript
|
|
16
|
-
* // Use default appearance (blue background, white arrow)
|
|
17
|
-
* const defaultIcon = createRouteAnimationIconDataUrl()
|
|
18
|
-
*
|
|
19
|
-
* // Customize colors
|
|
20
|
-
* const customIcon = createRouteAnimationIconDataUrl({
|
|
21
|
-
* backgroundColor: "#FF5733",
|
|
22
|
-
* arrowColor: "#000000"
|
|
23
|
-
* })
|
|
24
|
-
*
|
|
25
|
-
* // Add border and blur
|
|
26
|
-
* const styledIcon = createRouteAnimationIconDataUrl({
|
|
27
|
-
* backgroundColor: "#0076B6",
|
|
28
|
-
* arrowColor: "#FFFFFF",
|
|
29
|
-
* borderWidth: 2,
|
|
30
|
-
* borderColor: "#000000",
|
|
31
|
-
* blur: 1
|
|
32
|
-
* })
|
|
33
|
-
* ```
|
|
34
|
-
* @group Assets
|
|
35
|
-
*/
|
|
36
2
|
export function createRouteAnimationIconDataUrl(config) {
|
|
37
3
|
var _a, _b, _c, _d, _e, _f;
|
|
38
4
|
const backgroundColor = (_a = config === null || config === void 0 ? void 0 : config.backgroundColor) !== null && _a !== void 0 ? _a : "#276EF1";
|
|
@@ -41,13 +7,10 @@ export function createRouteAnimationIconDataUrl(config) {
|
|
|
41
7
|
const borderWidth = (_d = config === null || config === void 0 ? void 0 : config.borderWidth) !== null && _d !== void 0 ? _d : 0;
|
|
42
8
|
const borderColor = (_e = config === null || config === void 0 ? void 0 : config.borderColor) !== null && _e !== void 0 ? _e : "#000000";
|
|
43
9
|
const blur = (_f = config === null || config === void 0 ? void 0 : config.blur) !== null && _f !== void 0 ? _f : 0;
|
|
44
|
-
// Build circle style with optional border
|
|
45
10
|
const circleStyle = `fill:${backgroundColor};`;
|
|
46
11
|
const circleStroke = borderWidth > 0 ? `stroke:${borderColor};stroke-width:${borderWidth};` : "";
|
|
47
|
-
// Build arrow style with optional stroke
|
|
48
12
|
const arrowStyle = `fill:${arrowColor};`;
|
|
49
13
|
const arrowStroke = arrowWidth > 0 ? `stroke:${arrowColor};stroke-width:${arrowWidth};` : "";
|
|
50
|
-
// Build filter for blur if needed
|
|
51
14
|
const filterId = blur > 0 ? "blurFilter" : "";
|
|
52
15
|
const filterDef = blur > 0
|
|
53
16
|
? `<defs><filter id="${filterId}"><feGaussianBlur in="SourceGraphic" stdDeviation="${blur}"/></filter></defs>`
|
|
@@ -62,20 +25,7 @@ ${filterDef}
|
|
|
62
25
|
<path style="${arrowStyle}${arrowStroke}" d="M16.4471 7.26386C16.2568 6.80696 15.808 6.51052 15.3131 6.51052C14.8181 6.51052 14.3693 6.80696 14.179 7.26386L8.52211 20.7533C8.29366 21.2972 8.48404 21.9227 8.97085 22.2518C9.45767 22.5809 10.1104 22.5156 10.5265 22.0995L15.3131 17.3129L20.0996 22.0995C20.5157 22.5156 21.1657 22.5782 21.6553 22.2518C22.1448 21.9254 22.3325 21.2972 22.104 20.7533L16.4471 7.26386Z"/>
|
|
63
26
|
</g>
|
|
64
27
|
</svg>`;
|
|
65
|
-
// Encode the SVG as a data URL
|
|
66
28
|
const encodedSvg = encodeURIComponent(svg);
|
|
67
29
|
return `data:image/svg+xml,${encodedSvg}`;
|
|
68
30
|
}
|
|
69
|
-
/**
|
|
70
|
-
* Default route animation icon data URL with blue background (#276EF1) and white arrow (#FFFFFF).
|
|
71
|
-
* This constant is maintained for backward compatibility.
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* ```typescript
|
|
75
|
-
* const image = new Image(40, 40)
|
|
76
|
-
* image.src = routeAnimationDataUrl
|
|
77
|
-
* ```
|
|
78
|
-
* @group Assets
|
|
79
|
-
*/
|
|
80
31
|
export const routeAnimationDataUrl = createRouteAnimationIconDataUrl();
|
|
81
|
-
//# sourceMappingURL=icons.js.map
|
|
@@ -9,4 +9,3 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export declare const DEFAULT_DRACO_DECODER_PATH = "https://mapvx-glb-assets.s3.us-east-1.amazonaws.com/decoders/draco/";
|
|
11
11
|
export declare const DEFAULT_KTX2_TRANSCODER_PATH = "https://mapvx-glb-assets.s3.us-east-1.amazonaws.com/decoders/transcoder/";
|
|
12
|
-
//# sourceMappingURL=draco.d.ts.map
|
package/dist/es/config/draco.js
CHANGED
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base URL for Three.js Draco decoders (glTF build from `three/examples/jsm/libs/draco/gltf`).
|
|
3
|
-
* Trailing slash is required by {@link https://threejs.org/docs/#examples/en/loaders/DRACOLoader | DRACOLoader}.
|
|
4
|
-
*
|
|
5
|
-
* Hosted files: `draco_wasm_wrapper.js`, `draco_decoder.wasm` (and optionally `draco_decoder.js`).
|
|
6
|
-
* The bucket must allow CORS for application origins that load 3D maps.
|
|
7
|
-
*
|
|
8
|
-
* @group Configuration
|
|
9
|
-
*/
|
|
10
1
|
export const DEFAULT_DRACO_DECODER_PATH = "https://mapvx-glb-assets.s3.us-east-1.amazonaws.com/decoders/draco/";
|
|
11
2
|
export const DEFAULT_KTX2_TRANSCODER_PATH = "https://mapvx-glb-assets.s3.us-east-1.amazonaws.com/decoders/transcoder/";
|
|
12
|
-
//# sourceMappingURL=draco.js.map
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import { MarkerUtils, TextPosition } from "../domain/models/marker";
|
|
2
|
-
/**
|
|
3
|
-
* Fraction of the icon's own box, along each axis, that MapLibre's Marker
|
|
4
|
-
* anchor math (`translate(-x%, -y%)`) aligns to the geodetic point. Mirrors
|
|
5
|
-
* MapLibre's own `anchorTranslate` table so the collision math agrees with
|
|
6
|
-
* what's actually on screen.
|
|
7
|
-
*/
|
|
8
2
|
export const ANCHOR_FRACTIONS = {
|
|
9
3
|
center: { fx: 0.5, fy: 0.5 },
|
|
10
4
|
top: { fx: 0.5, fy: 0 },
|
|
@@ -16,14 +10,12 @@ export const ANCHOR_FRACTIONS = {
|
|
|
16
10
|
"bottom-left": { fx: 0, fy: 1 },
|
|
17
11
|
"bottom-right": { fx: 1, fy: 1 },
|
|
18
12
|
};
|
|
19
|
-
/** Candidate order tried when a marker's preferred side is unavailable. */
|
|
20
13
|
export const FALLBACK_ORDER = [
|
|
21
14
|
TextPosition.right,
|
|
22
15
|
TextPosition.top,
|
|
23
16
|
TextPosition.left,
|
|
24
17
|
TextPosition.bottom,
|
|
25
18
|
];
|
|
26
|
-
/** Builds the icon's on-screen rect from its projected point, size and anchor. */
|
|
27
19
|
export function computeIconRect(screen, iconSize, anchor) {
|
|
28
20
|
var _a;
|
|
29
21
|
const { fx, fy } = (_a = ANCHOR_FRACTIONS[anchor]) !== null && _a !== void 0 ? _a : ANCHOR_FRACTIONS.center;
|
|
@@ -34,11 +26,6 @@ export function computeIconRect(screen, iconSize, anchor) {
|
|
|
34
26
|
height: iconSize.height,
|
|
35
27
|
};
|
|
36
28
|
}
|
|
37
|
-
/**
|
|
38
|
-
* Builds a candidate label rect for one side of an icon. Mirrors the CSS in
|
|
39
|
-
* `styles.css` (`.text-container.right/left/top/bottom`) exactly, so a
|
|
40
|
-
* position the algorithm picks as collision-free renders collision-free.
|
|
41
|
-
*/
|
|
42
29
|
export function computeCandidateRect(iconRect, labelSize, position, gapPx, verticalGapPx) {
|
|
43
30
|
switch (position) {
|
|
44
31
|
case TextPosition.left:
|
|
@@ -72,7 +59,6 @@ export function computeCandidateRect(iconRect, labelSize, position, gapPx, verti
|
|
|
72
59
|
};
|
|
73
60
|
}
|
|
74
61
|
}
|
|
75
|
-
/** Expands a rect by `padding` on every side. */
|
|
76
62
|
export function expandRect(rect, padding) {
|
|
77
63
|
return {
|
|
78
64
|
left: rect.left - padding,
|
|
@@ -81,23 +67,12 @@ export function expandRect(rect, padding) {
|
|
|
81
67
|
height: rect.height + 2 * padding,
|
|
82
68
|
};
|
|
83
69
|
}
|
|
84
|
-
/** Standard AABB intersection test. */
|
|
85
70
|
export function rectsIntersect(a, b) {
|
|
86
71
|
return (a.left < b.left + b.width &&
|
|
87
72
|
a.left + a.width > b.left &&
|
|
88
73
|
a.top < b.top + b.height &&
|
|
89
74
|
a.top + a.height > b.top);
|
|
90
75
|
}
|
|
91
|
-
/**
|
|
92
|
-
* Automatic collision avoidance for marker text labels: keeps a marker's
|
|
93
|
-
* icon fixed while moving (or hiding) its label to avoid overlapping
|
|
94
|
-
* neighboring markers' icons/labels, similar to Google Maps' label
|
|
95
|
-
* placement. Below `minZoomForLabels` it withholds every label instead, so
|
|
96
|
-
* a zoomed-out map shows pins only. See {@link MarkerLayoutConfig}.
|
|
97
|
-
*
|
|
98
|
-
* Not part of the public SDK surface — owned and driven entirely by
|
|
99
|
-
* {@link InternalMapVXMap}, mirroring `RouteController`.
|
|
100
|
-
*/
|
|
101
76
|
export class MarkerLayoutController {
|
|
102
77
|
constructor(map, config) {
|
|
103
78
|
this.labelSizeCache = new WeakMap();
|
|
@@ -111,11 +86,6 @@ export class MarkerLayoutController {
|
|
|
111
86
|
get map() {
|
|
112
87
|
return this.mapvxMap.map;
|
|
113
88
|
}
|
|
114
|
-
/**
|
|
115
|
-
* Starts listening for camera movement. Safe to call once the underlying
|
|
116
|
-
* MapLibre `Map` instance exists; a single `"move"` listener covers pan,
|
|
117
|
-
* zoom, rotate, pitch and `resize()`.
|
|
118
|
-
*/
|
|
119
89
|
attach() {
|
|
120
90
|
if (this.attached)
|
|
121
91
|
return;
|
|
@@ -124,27 +94,11 @@ export class MarkerLayoutController {
|
|
|
124
94
|
this.remeasureWhenFontsLoad();
|
|
125
95
|
this.scheduleRelayout();
|
|
126
96
|
}
|
|
127
|
-
/**
|
|
128
|
-
* Publishes the configured gaps and label width cap as CSS custom
|
|
129
|
-
* properties, which `styles.css` reads to offset labels from their icon.
|
|
130
|
-
* Without this the stylesheet would keep its hardcoded defaults while the
|
|
131
|
-
* collision math used the configured values, so any custom `gapPx` /
|
|
132
|
-
* `verticalGapPx` would produce placements this controller believes are
|
|
133
|
-
* collision-free but that visibly overlap on screen.
|
|
134
|
-
*
|
|
135
|
-
* Called with the map's own container, so every marker MapLibre mounts
|
|
136
|
-
* inside it inherits the values.
|
|
137
|
-
*/
|
|
138
97
|
applyLayoutVariables(container) {
|
|
139
98
|
container.style.setProperty("--mapvx-label-gap", `${this.config.gapPx}px`);
|
|
140
99
|
container.style.setProperty("--mapvx-label-vertical-gap", `${this.config.verticalGapPx}px`);
|
|
141
100
|
container.style.setProperty("--mapvx-label-max-width", `${this.config.maxLabelWidthPx}px`);
|
|
142
101
|
}
|
|
143
|
-
/**
|
|
144
|
-
* A label measured before its web font finishes loading is measured in the
|
|
145
|
-
* fallback font, and that wrong footprint would otherwise be cached for
|
|
146
|
-
* the marker's lifetime. Drop every measurement once fonts settle.
|
|
147
|
-
*/
|
|
148
102
|
remeasureWhenFontsLoad() {
|
|
149
103
|
const fonts = document.fonts;
|
|
150
104
|
if (!fonts)
|
|
@@ -158,11 +112,8 @@ export class MarkerLayoutController {
|
|
|
158
112
|
this.scheduleRelayout();
|
|
159
113
|
})
|
|
160
114
|
.catch(() => {
|
|
161
|
-
// Font loading failing is not a layout error: the measurements
|
|
162
|
-
// already taken in the fallback font stay in effect.
|
|
163
115
|
});
|
|
164
116
|
}
|
|
165
|
-
/** Stops listening and cancels any pending layout pass. */
|
|
166
117
|
destroy() {
|
|
167
118
|
if (this.attached) {
|
|
168
119
|
this.map.off("move", this.boundOnMove);
|
|
@@ -173,22 +124,11 @@ export class MarkerLayoutController {
|
|
|
173
124
|
this.rafHandle = undefined;
|
|
174
125
|
}
|
|
175
126
|
}
|
|
176
|
-
/**
|
|
177
|
-
* Drops everything cached for a marker, e.g. after its text/content
|
|
178
|
-
* changed.
|
|
179
|
-
*
|
|
180
|
-
* The last applied decision has to go too: rebuilding a marker's DOM
|
|
181
|
-
* replaces its `.text-container` with a fresh one carrying the preferred
|
|
182
|
-
* side and no `visibility`, so a decision remembered from the old element
|
|
183
|
-
* would make {@link applyDecisions} short-circuit and leave the new label
|
|
184
|
-
* on the wrong side — or visible when it should be hidden.
|
|
185
|
-
*/
|
|
186
127
|
invalidateMarker(marker) {
|
|
187
128
|
this.labelSizeCache.delete(marker);
|
|
188
129
|
this.iconSizeCache.delete(marker);
|
|
189
130
|
this.lastAppliedState.delete(marker);
|
|
190
131
|
}
|
|
191
|
-
/** Coalesces repeated calls into a single layout pass per animation frame. */
|
|
192
132
|
scheduleRelayout() {
|
|
193
133
|
if (!this.config.enabled || this.rafHandle !== undefined)
|
|
194
134
|
return;
|
|
@@ -198,9 +138,6 @@ export class MarkerLayoutController {
|
|
|
198
138
|
});
|
|
199
139
|
}
|
|
200
140
|
performLayout() {
|
|
201
|
-
// Guards against a relayout firing before the underlying MapLibre `map`
|
|
202
|
-
// exists (e.g. a marker added before the "load" event) — `attach()`
|
|
203
|
-
// schedules its own initial pass once it's safe to touch `this.map`.
|
|
204
141
|
if (!this.attached)
|
|
205
142
|
return;
|
|
206
143
|
const markers = this.mapvxMap.getMarkers();
|
|
@@ -210,16 +147,11 @@ export class MarkerLayoutController {
|
|
|
210
147
|
const viewportWidth = container.clientWidth;
|
|
211
148
|
const viewportHeight = container.clientHeight;
|
|
212
149
|
const cullMargin = this.config.maxLabelWidthPx + Math.max(this.config.gapPx, this.config.verticalGapPx);
|
|
213
|
-
// A single `>=` per pass, evaluated here rather than in `attach()` so it
|
|
214
|
-
// tracks the live camera: the controller already relayouts on every
|
|
215
|
-
// "move", which fires continuously through a pan/pinch, so labels cross
|
|
216
|
-
// the threshold mid-gesture instead of snapping at its end.
|
|
217
150
|
const labelsAllowed = this.map.getZoom() >= this.config.minZoomForLabels;
|
|
218
151
|
const entries = this.readMarkers(markers, viewportWidth, viewportHeight, cullMargin);
|
|
219
152
|
const decisions = this.decidePlacements(entries, labelsAllowed);
|
|
220
153
|
this.applyDecisions(decisions);
|
|
221
154
|
}
|
|
222
|
-
/** Read phase: project + measure, no writes. Culls markers fully outside the viewport. */
|
|
223
155
|
readMarkers(markers, viewportWidth, viewportHeight, cullMargin) {
|
|
224
156
|
const entries = [];
|
|
225
157
|
for (const marker of markers) {
|
|
@@ -243,25 +175,12 @@ export class MarkerLayoutController {
|
|
|
243
175
|
return undefined;
|
|
244
176
|
return this.measureCached(this.labelSizeCache, marker, textEl);
|
|
245
177
|
}
|
|
246
|
-
/**
|
|
247
|
-
* The icon's box. Markers built from a caller-supplied `element` with no
|
|
248
|
-
* declared `iconProperties` are measured from the DOM, since their real
|
|
249
|
-
* size is whatever that element renders at; everyone else's box is exactly
|
|
250
|
-
* what `MarkerUtils.createMarkerElement` pinned it to.
|
|
251
|
-
*/
|
|
252
178
|
resolveIconSize(marker) {
|
|
253
179
|
var _a;
|
|
254
180
|
if (!marker.measureIconFromDom)
|
|
255
181
|
return marker.iconSize;
|
|
256
182
|
return (_a = this.measureCached(this.iconSizeCache, marker, marker.getElement())) !== null && _a !== void 0 ? _a : marker.iconSize;
|
|
257
183
|
}
|
|
258
|
-
/**
|
|
259
|
-
* Measures an element once and remembers it. A zero measurement is
|
|
260
|
-
* returned but never cached: it means the element isn't laid out yet (a
|
|
261
|
-
* `display: none` ancestor, a first pass before the web font loads), and
|
|
262
|
-
* caching it would freeze that marker's footprint at nothing for the rest
|
|
263
|
-
* of its life.
|
|
264
|
-
*/
|
|
265
184
|
measureCached(cache, marker, element) {
|
|
266
185
|
const cached = cache.get(marker);
|
|
267
186
|
if (cached)
|
|
@@ -272,14 +191,6 @@ export class MarkerLayoutController {
|
|
|
272
191
|
cache.set(marker, measured);
|
|
273
192
|
return measured;
|
|
274
193
|
}
|
|
275
|
-
/**
|
|
276
|
-
* Compute phase: pure, no DOM access. Icons always block; labels negotiate
|
|
277
|
-
* a side or hide.
|
|
278
|
-
*
|
|
279
|
-
* Below `minZoomForLabels` every label is hidden and none is placed, so no
|
|
280
|
-
* label ever becomes an obstacle for a neighbor at that zoom — a label the
|
|
281
|
-
* threshold withheld must not displace anything on its way out.
|
|
282
|
-
*/
|
|
283
194
|
decidePlacements(entries, labelsAllowed) {
|
|
284
195
|
const placedLabels = [];
|
|
285
196
|
const withLabel = entries.filter(hasLabelSize);
|
|
@@ -293,7 +204,6 @@ export class MarkerLayoutController {
|
|
|
293
204
|
}
|
|
294
205
|
return decisions;
|
|
295
206
|
}
|
|
296
|
-
// Stable sort (spec-guaranteed): equal priority keeps insertion order.
|
|
297
207
|
withLabel.sort((a, b) => b.marker.labelPriority - a.marker.labelPriority);
|
|
298
208
|
for (const entry of withLabel) {
|
|
299
209
|
const order = [
|
|
@@ -316,23 +226,11 @@ export class MarkerLayoutController {
|
|
|
316
226
|
}
|
|
317
227
|
return decisions;
|
|
318
228
|
}
|
|
319
|
-
/**
|
|
320
|
-
* Whether a candidate label rect clashes with any other marker's icon or
|
|
321
|
-
* with a label already placed this pass.
|
|
322
|
-
*
|
|
323
|
-
* A label's own icon is deliberately excluded: `gapPx`/`verticalGapPx`
|
|
324
|
-
* already define the spacing to it, and `paddingPx` is breathing room
|
|
325
|
-
* against *neighbors*. Counting the own icon here would make top/bottom
|
|
326
|
-
* impossible for every marker as soon as `paddingPx` exceeded
|
|
327
|
-
* `verticalGapPx` (4 vs 4 by default) — and at `paddingPx: 10` would hide
|
|
328
|
-
* every label on the map.
|
|
329
|
-
*/
|
|
330
229
|
collides(rect, self, entries, placedLabels) {
|
|
331
230
|
const padded = expandRect(rect, this.config.paddingPx);
|
|
332
231
|
return (entries.some((other) => other.marker !== self && rectsIntersect(padded, other.iconRect)) ||
|
|
333
232
|
placedLabels.some((label) => rectsIntersect(padded, label)));
|
|
334
233
|
}
|
|
335
|
-
/** Write phase: only touches the DOM for markers whose decision actually changed. */
|
|
336
234
|
applyDecisions(decisions) {
|
|
337
235
|
decisions.forEach((decision, marker) => {
|
|
338
236
|
const last = this.lastAppliedState.get(marker);
|
|
@@ -348,4 +246,3 @@ export class MarkerLayoutController {
|
|
|
348
246
|
function hasLabelSize(entry) {
|
|
349
247
|
return entry.labelSize !== undefined;
|
|
350
248
|
}
|
|
351
|
-
//# sourceMappingURL=markerLayoutController.js.map
|