@mapvx/web-js 4.0.2 → 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.
Files changed (339) hide show
  1. package/README.md +7 -7
  2. package/dist/cjs/index.js +4 -2
  3. package/dist/es/assets/icons.d.ts +0 -1
  4. package/dist/es/assets/icons.js +0 -50
  5. package/dist/es/config/draco.d.ts +0 -1
  6. package/dist/es/config/draco.js +0 -10
  7. package/dist/es/config/sdkConfig.d.ts +0 -1
  8. package/dist/es/config/sdkConfig.js +0 -1
  9. package/dist/es/controllers/markerLayoutController.d.ts +0 -1
  10. package/dist/es/controllers/markerLayoutController.js +0 -103
  11. package/dist/es/controllers/routeController.d.ts +0 -1
  12. package/dist/es/controllers/routeController.js +1 -473
  13. package/dist/es/domain/models/_internal.d.ts +0 -1
  14. package/dist/es/domain/models/_internal.js +0 -8
  15. package/dist/es/domain/models/animation.d.ts +0 -1
  16. package/dist/es/domain/models/animation.js +0 -6
  17. package/dist/es/domain/models/banner.d.ts +0 -1
  18. package/dist/es/domain/models/banner.js +0 -10
  19. package/dist/es/domain/models/campaign.d.ts +0 -1
  20. package/dist/es/domain/models/campaign.js +0 -29
  21. package/dist/es/domain/models/categories.d.ts +0 -1
  22. package/dist/es/domain/models/categories.js +0 -20
  23. package/dist/es/domain/models/circle.d.ts +0 -1
  24. package/dist/es/domain/models/circle.js +0 -118
  25. package/dist/es/domain/models/cityFilterOption.d.ts +0 -1
  26. package/dist/es/domain/models/cityFilterOption.js +0 -1
  27. package/dist/es/domain/models/configuration.d.ts +0 -1
  28. package/dist/es/domain/models/configuration.js +0 -1
  29. package/dist/es/domain/models/cssCustomization.d.ts +0 -1
  30. package/dist/es/domain/models/cssCustomization.js +0 -1
  31. package/dist/es/domain/models/fitOptions.d.ts +0 -1
  32. package/dist/es/domain/models/fitOptions.js +0 -1
  33. package/dist/es/domain/models/innerFloors.d.ts +0 -1
  34. package/dist/es/domain/models/innerFloors.js +0 -1
  35. package/dist/es/domain/models/institution.d.ts +0 -1
  36. package/dist/es/domain/models/institution.js +0 -26
  37. package/dist/es/domain/models/latLng.d.ts +0 -1
  38. package/dist/es/domain/models/latLng.js +0 -1
  39. package/dist/es/domain/models/location.d.ts +0 -1
  40. package/dist/es/domain/models/location.js +0 -1
  41. package/dist/es/domain/models/loggeable.d.ts +0 -1
  42. package/dist/es/domain/models/loggeable.js +0 -24
  43. package/dist/es/domain/models/mapCamera.d.ts +0 -1
  44. package/dist/es/domain/models/mapCamera.js +0 -1
  45. package/dist/es/domain/models/mapConfig.d.ts +0 -1
  46. package/dist/es/domain/models/mapConfig.js +1 -17
  47. package/dist/es/domain/models/marker.d.ts +0 -1
  48. package/dist/es/domain/models/marker.js +0 -292
  49. package/dist/es/domain/models/multilanguage.d.ts +0 -1
  50. package/dist/es/domain/models/multilanguage.js +0 -10
  51. package/dist/es/domain/models/openingHours.d.ts +0 -1
  52. package/dist/es/domain/models/openingHours.js +0 -1
  53. package/dist/es/domain/models/place.d.ts +0 -1
  54. package/dist/es/domain/models/place.js +0 -68
  55. package/dist/es/domain/models/platform.d.ts +0 -1
  56. package/dist/es/domain/models/platform.js +0 -1
  57. package/dist/es/domain/models/popover.d.ts +0 -1
  58. package/dist/es/domain/models/popover.js +0 -1
  59. package/dist/es/domain/models/product.d.ts +0 -1
  60. package/dist/es/domain/models/product.js +0 -1
  61. package/dist/es/domain/models/property.d.ts +0 -1
  62. package/dist/es/domain/models/property.js +0 -16
  63. package/dist/es/domain/models/route.d.ts +0 -1
  64. package/dist/es/domain/models/route.js +0 -71
  65. package/dist/es/domain/models/routeConfiguration.d.ts +0 -1
  66. package/dist/es/domain/models/routeConfiguration.js +0 -36
  67. package/dist/es/domain/models/routeInstance.d.ts +0 -1
  68. package/dist/es/domain/models/routeInstance.js +0 -8
  69. package/dist/es/domain/models/routeStyle.d.ts +0 -1
  70. package/dist/es/domain/models/routeStyle.js +0 -1
  71. package/dist/es/domain/models/scene3D.d.ts +0 -1
  72. package/dist/es/domain/models/scene3D.js +0 -1
  73. package/dist/es/domain/models/transport.d.ts +0 -1
  74. package/dist/es/domain/models/transport.js +0 -12
  75. package/dist/es/domain/ports/ICache.d.ts +0 -1
  76. package/dist/es/domain/ports/ICache.js +0 -1
  77. package/dist/es/domain/ports/IHttpClient.d.ts +0 -1
  78. package/dist/es/domain/ports/IHttpClient.js +0 -1
  79. package/dist/es/domain/ports/ILogger.d.ts +0 -1
  80. package/dist/es/domain/ports/ILogger.js +0 -9
  81. package/dist/es/domain/ports/index.d.ts +0 -1
  82. package/dist/es/domain/ports/index.js +0 -5
  83. package/dist/es/index.d.ts +0 -1
  84. package/dist/es/index.js +1 -28
  85. package/dist/es/infrastructure/cache/CacheManager.d.ts +0 -1
  86. package/dist/es/infrastructure/cache/CacheManager.js +0 -94
  87. package/dist/es/infrastructure/cache/LRUCache.d.ts +0 -1
  88. package/dist/es/infrastructure/cache/LRUCache.js +0 -57
  89. package/dist/es/infrastructure/cache/PersistentCache.d.ts +0 -1
  90. package/dist/es/infrastructure/cache/PersistentCache.js +0 -51
  91. package/dist/es/infrastructure/cache/cacheConfig.d.ts +0 -1
  92. package/dist/es/infrastructure/cache/cacheConfig.js +8 -27
  93. package/dist/es/infrastructure/http/FetchHttpClient.d.ts +0 -1
  94. package/dist/es/infrastructure/http/FetchHttpClient.js +0 -36
  95. package/dist/es/infrastructure/logging/MVXLogger.d.ts +0 -1
  96. package/dist/es/infrastructure/logging/MVXLogger.js +0 -37
  97. package/dist/es/interfaces/cache.d.ts +0 -1
  98. package/dist/es/interfaces/cache.js +0 -1
  99. package/dist/es/interfaces/healthResponse.d.ts +0 -1
  100. package/dist/es/interfaces/healthResponse.js +0 -1
  101. package/dist/es/interfaces/institutionResponse.d.ts +0 -1
  102. package/dist/es/interfaces/institutionResponse.js +0 -1
  103. package/dist/es/interfaces/metadata.d.ts +0 -1
  104. package/dist/es/interfaces/metadata.js +0 -1
  105. package/dist/es/interfaces/placeResponse.d.ts +0 -1
  106. package/dist/es/interfaces/placeResponse.js +0 -1
  107. package/dist/es/interfaces/routeCacheResponse.d.ts +0 -1
  108. package/dist/es/interfaces/routeCacheResponse.js +0 -1
  109. package/dist/es/interfaces/routeResponse.d.ts +0 -1
  110. package/dist/es/interfaces/routeResponse.js +0 -1
  111. package/dist/es/interfaces/styleResponse.d.ts +0 -1
  112. package/dist/es/interfaces/styleResponse.js +0 -1
  113. package/dist/es/logger/logger.d.ts +0 -1
  114. package/dist/es/logger/logger.js +0 -10
  115. package/dist/es/logger/sentry.d.ts +0 -1
  116. package/dist/es/logger/sentry.js +1 -39
  117. package/dist/es/map/fitCamera.d.ts +0 -1
  118. package/dist/es/map/fitCamera.js +0 -44
  119. package/dist/es/map/generated/maplibreWorkerSource.d.ts +0 -1
  120. package/dist/es/map/generated/maplibreWorkerSource.js +0 -12
  121. package/dist/es/map/installMapLibreWorker.d.ts +0 -1
  122. package/dist/es/map/installMapLibreWorker.js +0 -100
  123. package/dist/es/map/liveMapFitTransform.d.ts +0 -1
  124. package/dist/es/map/liveMapFitTransform.js +0 -82
  125. package/dist/es/map/map.d.ts +0 -1
  126. package/dist/es/map/map.js +4 -681
  127. package/dist/es/map/mapInteractionOptions.d.ts +0 -1
  128. package/dist/es/map/mapInteractionOptions.js +0 -35
  129. package/dist/es/map/scene3DController.d.ts +0 -1
  130. package/dist/es/map/scene3DController.js +0 -221
  131. package/dist/es/repository/repository.d.ts +0 -1
  132. package/dist/es/repository/repository.js +0 -56
  133. package/dist/es/repository/requester.d.ts +0 -1
  134. package/dist/es/repository/requester.js +0 -233
  135. package/dist/es/sdk.d.ts +0 -1
  136. package/dist/es/sdk.js +0 -35
  137. package/dist/es/utils/3d.d.ts +0 -1
  138. package/dist/es/utils/3d.js +0 -79
  139. package/dist/es/utils/deckLayers.d.ts +0 -1
  140. package/dist/es/utils/deckLayers.js +1 -27
  141. package/dist/es/utils/error.d.ts +0 -1
  142. package/dist/es/utils/error.js +0 -7
  143. package/dist/es/utils/images.d.ts +0 -1
  144. package/dist/es/utils/images.js +0 -7
  145. package/dist/es/utils/loadGlb.d.ts +0 -1
  146. package/dist/es/utils/loadGlb.js +2 -96
  147. package/dist/es/utils/mapvxHostname.d.ts +0 -1
  148. package/dist/es/utils/mapvxHostname.js +0 -11
  149. package/dist/es/utils/nav-functions.d.ts +0 -1
  150. package/dist/es/utils/nav-functions.js +0 -82
  151. package/dist/es/utils/opening-hours-helper.d.ts +0 -1
  152. package/dist/es/utils/opening-hours-helper.js +6 -382
  153. package/dist/es/utils/preconnect.d.ts +0 -1
  154. package/dist/es/utils/preconnect.js +0 -61
  155. package/dist/es/utils/route-utils.d.ts +0 -1
  156. package/dist/es/utils/route-utils.js +0 -25
  157. package/dist/es/utils/semaphore.d.ts +0 -1
  158. package/dist/es/utils/semaphore.js +0 -78
  159. package/dist/es/utils/three.d.ts +0 -1
  160. package/dist/es/utils/three.js +0 -43
  161. package/dist/es/utils/threeScene.d.ts +0 -1
  162. package/dist/es/utils/threeScene.js +0 -38
  163. package/dist/es/utils/update-css.d.ts +0 -1
  164. package/dist/es/utils/update-css.js +0 -26
  165. package/dist/es/utils/utils.d.ts +0 -1
  166. package/dist/es/utils/utils.js +0 -53
  167. package/dist/umd/index.js +4 -29240
  168. package/dist/umd/index.js.LICENSE.txt +1 -0
  169. package/dist/umd/styles.css +0 -1
  170. package/dist/umd/styles.js +3 -32
  171. package/package.json +12 -6
  172. package/dist/cjs/index.js.map +0 -1
  173. package/dist/es/assets/icons.d.ts.map +0 -1
  174. package/dist/es/assets/icons.js.map +0 -1
  175. package/dist/es/config/draco.d.ts.map +0 -1
  176. package/dist/es/config/draco.js.map +0 -1
  177. package/dist/es/config/sdkConfig.d.ts.map +0 -1
  178. package/dist/es/config/sdkConfig.js.map +0 -1
  179. package/dist/es/controllers/markerLayoutController.d.ts.map +0 -1
  180. package/dist/es/controllers/markerLayoutController.js.map +0 -1
  181. package/dist/es/controllers/routeController.d.ts.map +0 -1
  182. package/dist/es/controllers/routeController.js.map +0 -1
  183. package/dist/es/domain/models/_internal.d.ts.map +0 -1
  184. package/dist/es/domain/models/_internal.js.map +0 -1
  185. package/dist/es/domain/models/animation.d.ts.map +0 -1
  186. package/dist/es/domain/models/animation.js.map +0 -1
  187. package/dist/es/domain/models/banner.d.ts.map +0 -1
  188. package/dist/es/domain/models/banner.js.map +0 -1
  189. package/dist/es/domain/models/campaign.d.ts.map +0 -1
  190. package/dist/es/domain/models/campaign.js.map +0 -1
  191. package/dist/es/domain/models/categories.d.ts.map +0 -1
  192. package/dist/es/domain/models/categories.js.map +0 -1
  193. package/dist/es/domain/models/circle.d.ts.map +0 -1
  194. package/dist/es/domain/models/circle.js.map +0 -1
  195. package/dist/es/domain/models/cityFilterOption.d.ts.map +0 -1
  196. package/dist/es/domain/models/cityFilterOption.js.map +0 -1
  197. package/dist/es/domain/models/configuration.d.ts.map +0 -1
  198. package/dist/es/domain/models/configuration.js.map +0 -1
  199. package/dist/es/domain/models/cssCustomization.d.ts.map +0 -1
  200. package/dist/es/domain/models/cssCustomization.js.map +0 -1
  201. package/dist/es/domain/models/fitOptions.d.ts.map +0 -1
  202. package/dist/es/domain/models/fitOptions.js.map +0 -1
  203. package/dist/es/domain/models/innerFloors.d.ts.map +0 -1
  204. package/dist/es/domain/models/innerFloors.js.map +0 -1
  205. package/dist/es/domain/models/institution.d.ts.map +0 -1
  206. package/dist/es/domain/models/institution.js.map +0 -1
  207. package/dist/es/domain/models/latLng.d.ts.map +0 -1
  208. package/dist/es/domain/models/latLng.js.map +0 -1
  209. package/dist/es/domain/models/location.d.ts.map +0 -1
  210. package/dist/es/domain/models/location.js.map +0 -1
  211. package/dist/es/domain/models/loggeable.d.ts.map +0 -1
  212. package/dist/es/domain/models/loggeable.js.map +0 -1
  213. package/dist/es/domain/models/mapCamera.d.ts.map +0 -1
  214. package/dist/es/domain/models/mapCamera.js.map +0 -1
  215. package/dist/es/domain/models/mapConfig.d.ts.map +0 -1
  216. package/dist/es/domain/models/mapConfig.js.map +0 -1
  217. package/dist/es/domain/models/marker.d.ts.map +0 -1
  218. package/dist/es/domain/models/marker.js.map +0 -1
  219. package/dist/es/domain/models/multilanguage.d.ts.map +0 -1
  220. package/dist/es/domain/models/multilanguage.js.map +0 -1
  221. package/dist/es/domain/models/openingHours.d.ts.map +0 -1
  222. package/dist/es/domain/models/openingHours.js.map +0 -1
  223. package/dist/es/domain/models/place.d.ts.map +0 -1
  224. package/dist/es/domain/models/place.js.map +0 -1
  225. package/dist/es/domain/models/platform.d.ts.map +0 -1
  226. package/dist/es/domain/models/platform.js.map +0 -1
  227. package/dist/es/domain/models/popover.d.ts.map +0 -1
  228. package/dist/es/domain/models/popover.js.map +0 -1
  229. package/dist/es/domain/models/product.d.ts.map +0 -1
  230. package/dist/es/domain/models/product.js.map +0 -1
  231. package/dist/es/domain/models/property.d.ts.map +0 -1
  232. package/dist/es/domain/models/property.js.map +0 -1
  233. package/dist/es/domain/models/route.d.ts.map +0 -1
  234. package/dist/es/domain/models/route.js.map +0 -1
  235. package/dist/es/domain/models/routeConfiguration.d.ts.map +0 -1
  236. package/dist/es/domain/models/routeConfiguration.js.map +0 -1
  237. package/dist/es/domain/models/routeInstance.d.ts.map +0 -1
  238. package/dist/es/domain/models/routeInstance.js.map +0 -1
  239. package/dist/es/domain/models/routeStyle.d.ts.map +0 -1
  240. package/dist/es/domain/models/routeStyle.js.map +0 -1
  241. package/dist/es/domain/models/scene3D.d.ts.map +0 -1
  242. package/dist/es/domain/models/scene3D.js.map +0 -1
  243. package/dist/es/domain/models/transport.d.ts.map +0 -1
  244. package/dist/es/domain/models/transport.js.map +0 -1
  245. package/dist/es/domain/ports/ICache.d.ts.map +0 -1
  246. package/dist/es/domain/ports/ICache.js.map +0 -1
  247. package/dist/es/domain/ports/IHttpClient.d.ts.map +0 -1
  248. package/dist/es/domain/ports/IHttpClient.js.map +0 -1
  249. package/dist/es/domain/ports/ILogger.d.ts.map +0 -1
  250. package/dist/es/domain/ports/ILogger.js.map +0 -1
  251. package/dist/es/domain/ports/index.d.ts.map +0 -1
  252. package/dist/es/domain/ports/index.js.map +0 -1
  253. package/dist/es/index.d.ts.map +0 -1
  254. package/dist/es/index.js.map +0 -1
  255. package/dist/es/infrastructure/cache/CacheManager.d.ts.map +0 -1
  256. package/dist/es/infrastructure/cache/CacheManager.js.map +0 -1
  257. package/dist/es/infrastructure/cache/LRUCache.d.ts.map +0 -1
  258. package/dist/es/infrastructure/cache/LRUCache.js.map +0 -1
  259. package/dist/es/infrastructure/cache/PersistentCache.d.ts.map +0 -1
  260. package/dist/es/infrastructure/cache/PersistentCache.js.map +0 -1
  261. package/dist/es/infrastructure/cache/cacheConfig.d.ts.map +0 -1
  262. package/dist/es/infrastructure/cache/cacheConfig.js.map +0 -1
  263. package/dist/es/infrastructure/http/FetchHttpClient.d.ts.map +0 -1
  264. package/dist/es/infrastructure/http/FetchHttpClient.js.map +0 -1
  265. package/dist/es/infrastructure/logging/MVXLogger.d.ts.map +0 -1
  266. package/dist/es/infrastructure/logging/MVXLogger.js.map +0 -1
  267. package/dist/es/interfaces/cache.d.ts.map +0 -1
  268. package/dist/es/interfaces/cache.js.map +0 -1
  269. package/dist/es/interfaces/healthResponse.d.ts.map +0 -1
  270. package/dist/es/interfaces/healthResponse.js.map +0 -1
  271. package/dist/es/interfaces/institutionResponse.d.ts.map +0 -1
  272. package/dist/es/interfaces/institutionResponse.js.map +0 -1
  273. package/dist/es/interfaces/metadata.d.ts.map +0 -1
  274. package/dist/es/interfaces/metadata.js.map +0 -1
  275. package/dist/es/interfaces/placeResponse.d.ts.map +0 -1
  276. package/dist/es/interfaces/placeResponse.js.map +0 -1
  277. package/dist/es/interfaces/routeCacheResponse.d.ts.map +0 -1
  278. package/dist/es/interfaces/routeCacheResponse.js.map +0 -1
  279. package/dist/es/interfaces/routeResponse.d.ts.map +0 -1
  280. package/dist/es/interfaces/routeResponse.js.map +0 -1
  281. package/dist/es/interfaces/styleResponse.d.ts.map +0 -1
  282. package/dist/es/interfaces/styleResponse.js.map +0 -1
  283. package/dist/es/logger/logger.d.ts.map +0 -1
  284. package/dist/es/logger/logger.js.map +0 -1
  285. package/dist/es/logger/sentry.d.ts.map +0 -1
  286. package/dist/es/logger/sentry.js.map +0 -1
  287. package/dist/es/map/fitCamera.d.ts.map +0 -1
  288. package/dist/es/map/fitCamera.js.map +0 -1
  289. package/dist/es/map/generated/maplibreWorkerSource.d.ts.map +0 -1
  290. package/dist/es/map/generated/maplibreWorkerSource.js.map +0 -1
  291. package/dist/es/map/installMapLibreWorker.d.ts.map +0 -1
  292. package/dist/es/map/installMapLibreWorker.js.map +0 -1
  293. package/dist/es/map/liveMapFitTransform.d.ts.map +0 -1
  294. package/dist/es/map/liveMapFitTransform.js.map +0 -1
  295. package/dist/es/map/map.d.ts.map +0 -1
  296. package/dist/es/map/map.js.map +0 -1
  297. package/dist/es/map/mapInteractionOptions.d.ts.map +0 -1
  298. package/dist/es/map/mapInteractionOptions.js.map +0 -1
  299. package/dist/es/map/scene3DController.d.ts.map +0 -1
  300. package/dist/es/map/scene3DController.js.map +0 -1
  301. package/dist/es/repository/repository.d.ts.map +0 -1
  302. package/dist/es/repository/repository.js.map +0 -1
  303. package/dist/es/repository/requester.d.ts.map +0 -1
  304. package/dist/es/repository/requester.js.map +0 -1
  305. package/dist/es/sdk.d.ts.map +0 -1
  306. package/dist/es/sdk.js.map +0 -1
  307. package/dist/es/utils/3d.d.ts.map +0 -1
  308. package/dist/es/utils/3d.js.map +0 -1
  309. package/dist/es/utils/deckLayers.d.ts.map +0 -1
  310. package/dist/es/utils/deckLayers.js.map +0 -1
  311. package/dist/es/utils/error.d.ts.map +0 -1
  312. package/dist/es/utils/error.js.map +0 -1
  313. package/dist/es/utils/images.d.ts.map +0 -1
  314. package/dist/es/utils/images.js.map +0 -1
  315. package/dist/es/utils/loadGlb.d.ts.map +0 -1
  316. package/dist/es/utils/loadGlb.js.map +0 -1
  317. package/dist/es/utils/mapvxHostname.d.ts.map +0 -1
  318. package/dist/es/utils/mapvxHostname.js.map +0 -1
  319. package/dist/es/utils/nav-functions.d.ts.map +0 -1
  320. package/dist/es/utils/nav-functions.js.map +0 -1
  321. package/dist/es/utils/opening-hours-helper.d.ts.map +0 -1
  322. package/dist/es/utils/opening-hours-helper.js.map +0 -1
  323. package/dist/es/utils/preconnect.d.ts.map +0 -1
  324. package/dist/es/utils/preconnect.js.map +0 -1
  325. package/dist/es/utils/route-utils.d.ts.map +0 -1
  326. package/dist/es/utils/route-utils.js.map +0 -1
  327. package/dist/es/utils/semaphore.d.ts.map +0 -1
  328. package/dist/es/utils/semaphore.js.map +0 -1
  329. package/dist/es/utils/three.d.ts.map +0 -1
  330. package/dist/es/utils/three.js.map +0 -1
  331. package/dist/es/utils/threeScene.d.ts.map +0 -1
  332. package/dist/es/utils/threeScene.js.map +0 -1
  333. package/dist/es/utils/update-css.d.ts.map +0 -1
  334. package/dist/es/utils/update-css.js.map +0 -1
  335. package/dist/es/utils/utils.d.ts.map +0 -1
  336. package/dist/es/utils/utils.js.map +0 -1
  337. package/dist/umd/index.js.map +0 -1
  338. package/dist/umd/styles.css.map +0 -1
  339. package/dist/umd/styles.js.map +0 -1
@@ -84,4 +84,3 @@ export declare function getMapLibreWorkerUrl(): string;
84
84
  * @internal
85
85
  */
86
86
  export declare function resetMapLibreWorkerInstallForTests(): void;
87
- //# sourceMappingURL=installMapLibreWorker.d.ts.map
@@ -1,134 +1,34 @@
1
1
  import { getVersion, getWorkerUrl, setWorkerUrl } from "maplibre-gl";
2
2
  import { MAPLIBRE_WORKER_SOURCE, MAPLIBRE_WORKER_VERSION } from "./generated/maplibreWorkerSource";
3
- /**
4
- * The blob URL this SDK created, or `null` while nothing has been installed yet. Kept so the
5
- * install is idempotent and so we can tell our own URL from one a consumer supplied.
6
- */
7
3
  let installedWorkerUrl = null;
8
- /**
9
- * Registers a self-contained MapLibre worker carried inside this bundle.
10
- *
11
- * MapLibre 6 no longer inlines its worker. It resolves it at runtime with
12
- * `new URL('./maplibre-gl-worker.mjs', import.meta.url)`, building the filename by concatenation
13
- * so no bundler can see it statically and none emit the file. Once a consumer bundles this SDK,
14
- * `import.meta.url` is the consumer's own chunk, the worker is requested from a path where nothing
15
- * exists — in a single-page app the request falls through to the app shell and the worker dies on
16
- * a `text/html` MIME error — and the map renders nothing at all. Handing MapLibre a `blob:` URL
17
- * removes that resolution from the picture entirely, so this holds regardless of the consumer's
18
- * bundler, base href, or whether the app is served from a subpath.
19
- *
20
- * Must run before anything touches MapLibre's global worker pool, which is earlier than it looks.
21
- * The pool is created by the first `Dispatcher` and the URL is read then, once, and not again
22
- * while a map is alive — so any MapLibre call that builds a Dispatcher ahead of this one wins
23
- * permanently. `new Map(...)` is the obvious one, but `prewarm()`, `importScriptInWorkers()` and
24
- * the now-removed `setRTLTextPlugin()` all do it too. Hence the very top of the map constructor,
25
- * rather than next to the map.
26
- *
27
- * Never called at module load: that would run `new Blob` and `URL.createObjectURL` during import,
28
- * which fails under SSR and in jsdom, and would hand MapLibre a worker URL for applications that
29
- * import this package without ever creating a map. It does not save memory — the worker string is
30
- * resident from the moment this module is imported either way.
31
- *
32
- * A consumer that installed its own worker URL is self-hosting on purpose — a strict
33
- * Content-Security-Policy without `worker-src blob:`, typically — and is left alone.
34
- *
35
- * Under such a policy with no URL set, the failure is silent from the application's side, and
36
- * measured rather than assumed: `createObjectURL` does not throw, `new Worker` does not throw
37
- * synchronously, and MapLibre fires no `error` event. The only signal is the browser's own
38
- * console message, *"Creating a worker from 'blob:…' violates the following Content Security
39
- * Policy directive"*, next to a map that never loads. That string is repeated here so searching
40
- * for it lands on this explanation and on `setMapLibreWorkerUrl`.
41
- *
42
- * @see setMapLibreWorkerUrl for the supported way to opt out.
43
- * @group Configuration
44
- */
45
4
  export function installMapLibreWorker() {
46
5
  if (installedWorkerUrl !== null)
47
6
  return;
48
- // `WORKER_URL` defaults to "", so a truthy value can only mean a consumer set one.
49
7
  if (getWorkerUrl())
50
8
  return;
51
9
  const runtimeVersion = getVersion();
52
10
  if (runtimeVersion !== MAPLIBRE_WORKER_VERSION) {
53
- // The bundled worker and the running MapLibre talk an internal, unversioned protocol. A skew
54
- // is only possible if the consumer forced a different maplibre-gl than this SDK pinned; it is
55
- // still better to install a slightly mismatched worker than to leave the map with none, so
56
- // this warns rather than bails.
57
11
  console.warn(`[MapVX] MapLibre version mismatch: the bundled worker is ${MAPLIBRE_WORKER_VERSION} but ` +
58
12
  `maplibre-gl ${runtimeVersion} is running. Install maplibre-gl@${MAPLIBRE_WORKER_VERSION} ` +
59
13
  `or call setMapLibreWorkerUrl() with a self-hosted worker of the matching version.`);
60
14
  }
61
15
  try {
62
16
  const blob = new Blob([MAPLIBRE_WORKER_SOURCE], { type: "text/javascript" });
63
- // Deliberately never revoked. MapLibre terminates its worker pool when the last map is
64
- // removed and reads this URL again when the next map is created, so revoking would break
65
- // every map after the first.
66
17
  installedWorkerUrl = URL.createObjectURL(blob);
67
18
  setWorkerUrl(installedWorkerUrl);
68
19
  }
69
20
  catch (error) {
70
- // Blob/createObjectURL are absent under SSR and in some test environments. Leaving MapLibre's
71
- // own resolution in place is the best remaining option: it works when the SDK is served
72
- // unbundled, which is exactly the situation where this path is reachable.
73
21
  installedWorkerUrl = null;
74
22
  console.warn("[MapVX] Could not install the bundled MapLibre worker:", error);
75
23
  }
76
24
  }
77
- /**
78
- * Points MapLibre at a worker script you host yourself, instead of the one bundled into this SDK.
79
- *
80
- * The bundled worker is delivered as a `blob:` URL, which a Content-Security-Policy without
81
- * `worker-src blob:` (or `child-src blob:`) will block. Self-hosting is the way out: copy
82
- * `maplibre-gl-worker.mjs` **and** `maplibre-gl-shared.mjs` from `maplibre-gl/dist` — the worker
83
- * imports the shared file at runtime, so both must be served from the same directory — and point
84
- * this at the first one. Use `npm ls maplibre-gl` to see which version this SDK resolved; the
85
- * files must come from that one.
86
- *
87
- * **The URL has to be same-origin.** A cross-origin one does not escape `blob:`: MapLibre wraps
88
- * any worker URL it considers cross-origin in a generated `blob:` worker that imports it, so a
89
- * CDN-hosted worker hits exactly the same Content-Security-Policy wall as the bundled one.
90
- *
91
- * Call it before creating any map. Once MapLibre's worker pool has spun up it does not re-read the
92
- * URL until every map has been removed.
93
- *
94
- * Exists so opting out does not force a direct `maplibre-gl` dependency on consumers that only
95
- * use this SDK.
96
- *
97
- * @param url - URL of the MapLibre worker script to load.
98
- * @example
99
- * ```ts
100
- * import { setMapLibreWorkerUrl, initializeSDK } from "@mapvx/web-js"
101
- *
102
- * setMapLibreWorkerUrl("/assets/maplibre-gl-worker.mjs")
103
- * const sdk = initializeSDK(token)
104
- * ```
105
- * @group Configuration
106
- */
107
25
  export function setMapLibreWorkerUrl(url) {
108
26
  setWorkerUrl(url);
109
- // Stop claiming ownership: the URL in play is now the consumer's, and ours (if any) must not be
110
- // revoked while a worker pool may still be using it.
111
27
  installedWorkerUrl = null;
112
28
  }
113
- /**
114
- * The worker URL MapLibre will use, or `""` when none has been set yet.
115
- *
116
- * Returns a `blob:` URL once the bundled worker has been installed, which happens when the first
117
- * map is created. Useful to assert in tests that the bundled worker is in play.
118
- *
119
- * @returns The current MapLibre worker URL.
120
- * @group Configuration
121
- */
122
29
  export function getMapLibreWorkerUrl() {
123
30
  return getWorkerUrl();
124
31
  }
125
- /**
126
- * Resets the module-level install state. Test seam only — the blob URL is intentionally never
127
- * revoked in production, so there is nothing to clean up outside tests.
128
- *
129
- * @internal
130
- */
131
32
  export function resetMapLibreWorkerInstallForTests() {
132
33
  installedWorkerUrl = null;
133
34
  }
134
- //# sourceMappingURL=installMapLibreWorker.js.map
@@ -101,4 +101,3 @@ export declare class LiveMapFitTransform implements FitTransform {
101
101
  /** Flush {@link pending} onto the map, but only when a projection actually needs it. */
102
102
  private sync;
103
103
  }
104
- //# sourceMappingURL=liveMapFitTransform.d.ts.map
@@ -1,63 +1,8 @@
1
1
  const DEG_TO_RAD = Math.PI / 180;
2
- /**
3
- * A {@link FitTransform} backed by a live MapLibre map and its public API.
4
- *
5
- * ## Why this exists
6
- *
7
- * {@link refineCameraForPitch} needs to project points through MapLibre's real perspective
8
- * projection for camera states the map is not actually in — it tries a candidate camera, measures
9
- * where the geometry lands, adjusts, and repeats. Until MapLibre v6 that was done on
10
- * `map.transform.clone()`, a detached copy of the internal transform.
11
- *
12
- * v6 removed `map.transform` and exposes no replacement: there is no exported `Camera`,
13
- * `Transform` or `MercatorTransform`, and the migration guide says only "use `Map`'s public API
14
- * instead". So the simulation moves onto the map itself.
15
- *
16
- * ## How it stays invisible
17
- *
18
- * The map is genuinely moved, but never painted mid-simulation: MapLibre renders on
19
- * `requestAnimationFrame`, and every mutation here happens inside one synchronous block that ends
20
- * with {@link restore}. No intermediate frame exists to be seen.
21
- *
22
- * Camera writes are also batched. Setters only record intent; the map is moved at most once per
23
- * refinement iteration, lazily, the first time a projection actually needs the new camera.
24
- *
25
- * ## What it costs
26
- *
27
- * `jumpTo` fires camera events, so listeners observe movement that no user caused. At the only
28
- * call site this is bounded — the refinement is immediately followed by a real `easeTo`, so the
29
- * map was going to move regardless, and the `moveend` handler that reports completion is attached
30
- * *after* refinement and so cannot see the simulation's events.
31
- *
32
- * @example
33
- * ```typescript
34
- * const transform = new LiveMapFitTransform(map)
35
- * try {
36
- * camera = refineCameraForPitch(transform, coordinates, camera, params)
37
- * } finally {
38
- * transform.restore()
39
- * }
40
- * ```
41
- *
42
- * @group Map
43
- */
44
2
  export class LiveMapFitTransform {
45
- /**
46
- * Capture the map's current camera so it can be restored, and seed the simulation with it.
47
- *
48
- * @param map The live map to simulate on.
49
- */
50
3
  constructor(map) {
51
4
  var _a, _b, _c, _d;
52
- /** Whether {@link pending} has diverged from what the map is currently showing. */
53
5
  this.dirty = false;
54
- /**
55
- * Whether the map was ever actually moved.
56
- *
57
- * Tracked separately from {@link dirty}, which {@link sync} clears the moment it flushes: keying
58
- * {@link restore} off `dirty` alone would make it a no-op right after a flush and strand the map
59
- * on a candidate camera.
60
- */
61
6
  this.moved = false;
62
7
  this.setCenter = (center) => {
63
8
  this.pending.center = center;
@@ -87,27 +32,9 @@ export class LiveMapFitTransform {
87
32
  this.sync();
88
33
  return this.map.unproject(p);
89
34
  };
90
- /**
91
- * Whether a screen point lies on the visible map surface rather than beyond the horizon.
92
- *
93
- * MapLibre exposes no public horizon test, so this derives the horizon line from the camera.
94
- * With `d` the camera-to-centre distance, the ground plane's vanishing line sits
95
- * `d / tan(pitch)` pixels above the centre of the viewport, and `d` itself follows from the
96
- * vertical field of view: `d = (height / 2) / tan(fov / 2)`.
97
- *
98
- * A round-trip through `unproject`/`project` looks like the obvious test and does not work: the
99
- * projection matrix is self-consistent on both sides of the horizon, so a sky point round-trips
100
- * to within 1e-8 px just as a ground point does. Measured in
101
- * `example/build-test/test-v6-render.html`, which also confirms this formula brackets the
102
- * horizon where `unproject` actually flips to the far side of the camera.
103
- *
104
- * @param p Screen point, as returned by {@link locationToScreenPoint}.
105
- * @returns `true` when the point is on the map surface.
106
- */
107
35
  this.isPointOnMapSurface = (p) => {
108
36
  this.sync();
109
37
  const pitchRad = this.map.getPitch() * DEG_TO_RAD;
110
- // Looking straight down there is no horizon: the whole viewport is ground.
111
38
  if (pitchRad <= 0) {
112
39
  return true;
113
40
  }
@@ -117,18 +44,11 @@ export class LiveMapFitTransform {
117
44
  }
118
45
  const fovRad = this.map.getVerticalFieldOfView() * DEG_TO_RAD;
119
46
  const cameraToCentreDistance = height / 2 / Math.tan(fovRad / 2);
120
- // Padding moves the projection centre, and with it the horizon.
121
47
  const { top, bottom } = this.pending.padding;
122
48
  const centreY = height / 2 + (top - bottom) / 2;
123
49
  const horizonY = centreY - cameraToCentreDistance / Math.tan(pitchRad);
124
50
  return p.y > horizonY;
125
51
  };
126
- /**
127
- * Put the camera back exactly as it was when this instance was constructed.
128
- *
129
- * Safe to call more than once, and safe to call when nothing was ever changed. Always call it
130
- * from a `finally` block so a throw mid-refinement cannot strand the map on a candidate camera.
131
- */
132
52
  this.restore = () => {
133
53
  if (!this.moved) {
134
54
  return;
@@ -166,7 +86,6 @@ export class LiveMapFitTransform {
166
86
  get zoom() {
167
87
  return this.pending.zoom;
168
88
  }
169
- /** Flush {@link pending} onto the map, but only when a projection actually needs it. */
170
89
  sync() {
171
90
  if (!this.dirty) {
172
91
  return;
@@ -182,4 +101,3 @@ export class LiveMapFitTransform {
182
101
  this.moved = true;
183
102
  }
184
103
  }
185
- //# sourceMappingURL=liveMapFitTransform.js.map
@@ -1259,4 +1259,3 @@ export declare class InternalMapVXMap extends Loggeable implements MapVXMap {
1259
1259
  private subscribeToFailedTiles;
1260
1260
  private unsubscribeFromFailedTiles;
1261
1261
  }
1262
- //# sourceMappingURL=map.d.ts.map