@mountaya/elements 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +235 -0
- package/LICENCE.fr.txt +280 -0
- package/LICENSE.txt +262 -0
- package/README.md +1509 -2
- package/THIRD-PARTY-NOTICES.txt +103 -0
- package/dist/accentColor-GNKBD2CW.js +4 -0
- package/dist/accentColor-GNKBD2CW.js.map +1 -0
- package/dist/accentColor-VX2JSMGE.cjs +17 -0
- package/dist/accentColor-VX2JSMGE.cjs.map +1 -0
- package/dist/agent/index.cjs +1964 -0
- package/dist/agent/index.cjs.map +1 -0
- package/dist/agent/index.d.cts +2016 -0
- package/dist/agent/index.d.ts +2016 -0
- package/dist/agent/index.js +1937 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/amenities-B3-qAjxu.d.cts +160 -0
- package/dist/amenities-B3-qAjxu.d.ts +160 -0
- package/dist/bundle-Je5zsRFg.d.cts +222 -0
- package/dist/bundle-xYrrbJTH.d.ts +222 -0
- package/dist/camera/index.cjs +3477 -0
- package/dist/camera/index.cjs.map +1 -0
- package/dist/camera/index.d.cts +1751 -0
- package/dist/camera/index.d.ts +1751 -0
- package/dist/camera/index.js +3328 -0
- package/dist/camera/index.js.map +1 -0
- package/dist/camera-BrFLU1DH.d.cts +549 -0
- package/dist/camera-C48Ykaxv.d.ts +549 -0
- package/dist/chunk-23PFRRB6.js +3 -0
- package/dist/chunk-23PFRRB6.js.map +1 -0
- package/dist/chunk-2GI5SAH2.js +71 -0
- package/dist/chunk-2GI5SAH2.js.map +1 -0
- package/dist/chunk-2MQK6A74.js +39 -0
- package/dist/chunk-2MQK6A74.js.map +1 -0
- package/dist/chunk-2RE7R4LD.js +73 -0
- package/dist/chunk-2RE7R4LD.js.map +1 -0
- package/dist/chunk-3JZQKN4O.js +6 -0
- package/dist/chunk-3JZQKN4O.js.map +1 -0
- package/dist/chunk-3NDXVUUI.js +50 -0
- package/dist/chunk-3NDXVUUI.js.map +1 -0
- package/dist/chunk-3R4GFTUM.cjs +59 -0
- package/dist/chunk-3R4GFTUM.cjs.map +1 -0
- package/dist/chunk-3RVUQ6JN.cjs +22 -0
- package/dist/chunk-3RVUQ6JN.cjs.map +1 -0
- package/dist/chunk-4F6BJMJC.cjs +49 -0
- package/dist/chunk-4F6BJMJC.cjs.map +1 -0
- package/dist/chunk-4NWQD4BX.js +132 -0
- package/dist/chunk-4NWQD4BX.js.map +1 -0
- package/dist/chunk-5K2MH3R6.js +10 -0
- package/dist/chunk-5K2MH3R6.js.map +1 -0
- package/dist/chunk-6ACRNQQQ.cjs +8 -0
- package/dist/chunk-6ACRNQQQ.cjs.map +1 -0
- package/dist/chunk-6D26E3IA.js +66 -0
- package/dist/chunk-6D26E3IA.js.map +1 -0
- package/dist/chunk-6ESAW35P.cjs +80 -0
- package/dist/chunk-6ESAW35P.cjs.map +1 -0
- package/dist/chunk-6LIW2A5M.cjs +1176 -0
- package/dist/chunk-6LIW2A5M.cjs.map +1 -0
- package/dist/chunk-6OTTWVCA.js +57 -0
- package/dist/chunk-6OTTWVCA.js.map +1 -0
- package/dist/chunk-6VROJ4UG.js +862 -0
- package/dist/chunk-6VROJ4UG.js.map +1 -0
- package/dist/chunk-6Y7FTGO4.js +23 -0
- package/dist/chunk-6Y7FTGO4.js.map +1 -0
- package/dist/chunk-75I4CG64.js +104 -0
- package/dist/chunk-75I4CG64.js.map +1 -0
- package/dist/chunk-7CUBXHAH.cjs +14 -0
- package/dist/chunk-7CUBXHAH.cjs.map +1 -0
- package/dist/chunk-7GTCURVY.js +52 -0
- package/dist/chunk-7GTCURVY.js.map +1 -0
- package/dist/chunk-7IWOL6AM.cjs +100 -0
- package/dist/chunk-7IWOL6AM.cjs.map +1 -0
- package/dist/chunk-7QN7M667.cjs +151 -0
- package/dist/chunk-7QN7M667.cjs.map +1 -0
- package/dist/chunk-A6KQDKLM.cjs +1197 -0
- package/dist/chunk-A6KQDKLM.cjs.map +1 -0
- package/dist/chunk-A77EA67G.js +354 -0
- package/dist/chunk-A77EA67G.js.map +1 -0
- package/dist/chunk-AFKOABJ4.cjs +7194 -0
- package/dist/chunk-AFKOABJ4.cjs.map +1 -0
- package/dist/chunk-AG6JV5Z2.cjs +183 -0
- package/dist/chunk-AG6JV5Z2.cjs.map +1 -0
- package/dist/chunk-APBK7NMS.js +30 -0
- package/dist/chunk-APBK7NMS.js.map +1 -0
- package/dist/chunk-AWO5YA7A.cjs +33 -0
- package/dist/chunk-AWO5YA7A.cjs.map +1 -0
- package/dist/chunk-AZATU6QW.js +108 -0
- package/dist/chunk-AZATU6QW.js.map +1 -0
- package/dist/chunk-BD2U3WST.cjs +623 -0
- package/dist/chunk-BD2U3WST.cjs.map +1 -0
- package/dist/chunk-BHBEOU6L.cjs +65 -0
- package/dist/chunk-BHBEOU6L.cjs.map +1 -0
- package/dist/chunk-CNOSNYNE.js +8 -0
- package/dist/chunk-CNOSNYNE.js.map +1 -0
- package/dist/chunk-CW3EFR4O.js +12 -0
- package/dist/chunk-CW3EFR4O.js.map +1 -0
- package/dist/chunk-DASVRNBK.js +7187 -0
- package/dist/chunk-DASVRNBK.js.map +1 -0
- package/dist/chunk-DJ6LCKYP.js +42 -0
- package/dist/chunk-DJ6LCKYP.js.map +1 -0
- package/dist/chunk-E5FHQAIO.cjs +45 -0
- package/dist/chunk-E5FHQAIO.cjs.map +1 -0
- package/dist/chunk-EOML5OTY.cjs +360 -0
- package/dist/chunk-EOML5OTY.cjs.map +1 -0
- package/dist/chunk-EP5CASHL.js +613 -0
- package/dist/chunk-EP5CASHL.js.map +1 -0
- package/dist/chunk-EP5OEEVZ.cjs +14 -0
- package/dist/chunk-EP5OEEVZ.cjs.map +1 -0
- package/dist/chunk-EUXI3FGQ.js +150 -0
- package/dist/chunk-EUXI3FGQ.js.map +1 -0
- package/dist/chunk-EWFSHCOS.js +40 -0
- package/dist/chunk-EWFSHCOS.js.map +1 -0
- package/dist/chunk-EX2C5K2T.cjs +25 -0
- package/dist/chunk-EX2C5K2T.cjs.map +1 -0
- package/dist/chunk-FEXWDQIZ.cjs +8 -0
- package/dist/chunk-FEXWDQIZ.cjs.map +1 -0
- package/dist/chunk-FEYBFY7H.cjs +358 -0
- package/dist/chunk-FEYBFY7H.cjs.map +1 -0
- package/dist/chunk-FRGAV6N6.cjs +34 -0
- package/dist/chunk-FRGAV6N6.cjs.map +1 -0
- package/dist/chunk-G5DHP5VF.js +6 -0
- package/dist/chunk-G5DHP5VF.js.map +1 -0
- package/dist/chunk-G5W2UHV2.js +99 -0
- package/dist/chunk-G5W2UHV2.js.map +1 -0
- package/dist/chunk-G7OP7O2C.cjs +39 -0
- package/dist/chunk-G7OP7O2C.cjs.map +1 -0
- package/dist/chunk-GE6CFCAM.cjs +25 -0
- package/dist/chunk-GE6CFCAM.cjs.map +1 -0
- package/dist/chunk-GIFALLHI.cjs +111 -0
- package/dist/chunk-GIFALLHI.cjs.map +1 -0
- package/dist/chunk-GLFET5GM.js +129 -0
- package/dist/chunk-GLFET5GM.js.map +1 -0
- package/dist/chunk-GQ6UFPFM.js +22 -0
- package/dist/chunk-GQ6UFPFM.js.map +1 -0
- package/dist/chunk-GQJWVMXS.js +129 -0
- package/dist/chunk-GQJWVMXS.js.map +1 -0
- package/dist/chunk-GVVJPUKC.js +80 -0
- package/dist/chunk-GVVJPUKC.js.map +1 -0
- package/dist/chunk-GZ2HOCQ2.cjs +134 -0
- package/dist/chunk-GZ2HOCQ2.cjs.map +1 -0
- package/dist/chunk-HCBOHXWP.js +37 -0
- package/dist/chunk-HCBOHXWP.js.map +1 -0
- package/dist/chunk-IBQJDVHF.cjs +281 -0
- package/dist/chunk-IBQJDVHF.cjs.map +1 -0
- package/dist/chunk-ISLB6Y5Q.cjs +106 -0
- package/dist/chunk-ISLB6Y5Q.cjs.map +1 -0
- package/dist/chunk-J55CRR4F.js +105 -0
- package/dist/chunk-J55CRR4F.js.map +1 -0
- package/dist/chunk-JBG6Z6MQ.cjs +28 -0
- package/dist/chunk-JBG6Z6MQ.cjs.map +1 -0
- package/dist/chunk-K3RQOZRU.js +61 -0
- package/dist/chunk-K3RQOZRU.js.map +1 -0
- package/dist/chunk-KDJYS4GB.cjs +703 -0
- package/dist/chunk-KDJYS4GB.cjs.map +1 -0
- package/dist/chunk-KMCAHUZM.cjs +4 -0
- package/dist/chunk-KMCAHUZM.cjs.map +1 -0
- package/dist/chunk-KUCBNPC6.js +87 -0
- package/dist/chunk-KUCBNPC6.js.map +1 -0
- package/dist/chunk-KV6UE5A4.js +50 -0
- package/dist/chunk-KV6UE5A4.js.map +1 -0
- package/dist/chunk-L6TZ2HQR.cjs +18 -0
- package/dist/chunk-L6TZ2HQR.cjs.map +1 -0
- package/dist/chunk-L7QHHGG2.cjs +141 -0
- package/dist/chunk-L7QHHGG2.cjs.map +1 -0
- package/dist/chunk-LHK3Y2AL.js +271 -0
- package/dist/chunk-LHK3Y2AL.js.map +1 -0
- package/dist/chunk-LO5RYRBH.cjs +6317 -0
- package/dist/chunk-LO5RYRBH.cjs.map +1 -0
- package/dist/chunk-LS5SJMUO.cjs +194 -0
- package/dist/chunk-LS5SJMUO.cjs.map +1 -0
- package/dist/chunk-LUGTMZFN.cjs +42 -0
- package/dist/chunk-LUGTMZFN.cjs.map +1 -0
- package/dist/chunk-LVUQU6D5.js +32 -0
- package/dist/chunk-LVUQU6D5.js.map +1 -0
- package/dist/chunk-M2QRC2GZ.js +166 -0
- package/dist/chunk-M2QRC2GZ.js.map +1 -0
- package/dist/chunk-M6QJYQIM.cjs +53 -0
- package/dist/chunk-M6QJYQIM.cjs.map +1 -0
- package/dist/chunk-MGCPH5EO.js +12 -0
- package/dist/chunk-MGCPH5EO.js.map +1 -0
- package/dist/chunk-MLVUWEZR.cjs +474 -0
- package/dist/chunk-MLVUWEZR.cjs.map +1 -0
- package/dist/chunk-MTAMJMZL.cjs +707 -0
- package/dist/chunk-MTAMJMZL.cjs.map +1 -0
- package/dist/chunk-MXL5AT3N.js +48 -0
- package/dist/chunk-MXL5AT3N.js.map +1 -0
- package/dist/chunk-MYEQSESM.cjs +75 -0
- package/dist/chunk-MYEQSESM.cjs.map +1 -0
- package/dist/chunk-N3VPF6ZD.js +427 -0
- package/dist/chunk-N3VPF6ZD.js.map +1 -0
- package/dist/chunk-N6VUAIGI.js +7 -0
- package/dist/chunk-N6VUAIGI.js.map +1 -0
- package/dist/chunk-N6XRLUN6.js +6286 -0
- package/dist/chunk-N6XRLUN6.js.map +1 -0
- package/dist/chunk-NOGDOZIT.cjs +114 -0
- package/dist/chunk-NOGDOZIT.cjs.map +1 -0
- package/dist/chunk-NUWXEISH.cjs +10 -0
- package/dist/chunk-NUWXEISH.cjs.map +1 -0
- package/dist/chunk-NZCZHXYN.cjs +161 -0
- package/dist/chunk-NZCZHXYN.cjs.map +1 -0
- package/dist/chunk-ODROSWQX.cjs +53 -0
- package/dist/chunk-ODROSWQX.cjs.map +1 -0
- package/dist/chunk-OE36AYKG.cjs +82 -0
- package/dist/chunk-OE36AYKG.cjs.map +1 -0
- package/dist/chunk-OLON7MO6.cjs +437 -0
- package/dist/chunk-OLON7MO6.cjs.map +1 -0
- package/dist/chunk-PBUOR2IT.js +277 -0
- package/dist/chunk-PBUOR2IT.js.map +1 -0
- package/dist/chunk-PC2ELXFF.cjs +225 -0
- package/dist/chunk-PC2ELXFF.cjs.map +1 -0
- package/dist/chunk-PCSGXLOC.js +71 -0
- package/dist/chunk-PCSGXLOC.js.map +1 -0
- package/dist/chunk-PFNMP6FQ.js +56 -0
- package/dist/chunk-PFNMP6FQ.js.map +1 -0
- package/dist/chunk-PIWSZTIP.js +690 -0
- package/dist/chunk-PIWSZTIP.js.map +1 -0
- package/dist/chunk-PKWHJ2GI.js +136 -0
- package/dist/chunk-PKWHJ2GI.js.map +1 -0
- package/dist/chunk-PLMVBX2A.cjs +76 -0
- package/dist/chunk-PLMVBX2A.cjs.map +1 -0
- package/dist/chunk-PM3XCD2G.cjs +113 -0
- package/dist/chunk-PM3XCD2G.cjs.map +1 -0
- package/dist/chunk-QAL4GZO7.cjs +143 -0
- package/dist/chunk-QAL4GZO7.cjs.map +1 -0
- package/dist/chunk-QDB2SEA2.js +74 -0
- package/dist/chunk-QDB2SEA2.js.map +1 -0
- package/dist/chunk-QOV7UNUN.js +25 -0
- package/dist/chunk-QOV7UNUN.js.map +1 -0
- package/dist/chunk-QQUWYLSF.cjs +50 -0
- package/dist/chunk-QQUWYLSF.cjs.map +1 -0
- package/dist/chunk-QUMBH3U4.cjs +9 -0
- package/dist/chunk-QUMBH3U4.cjs.map +1 -0
- package/dist/chunk-R4KA7OFQ.js +12 -0
- package/dist/chunk-R4KA7OFQ.js.map +1 -0
- package/dist/chunk-RBSGAZQQ.js +17 -0
- package/dist/chunk-RBSGAZQQ.js.map +1 -0
- package/dist/chunk-RM5YJWZI.js +46 -0
- package/dist/chunk-RM5YJWZI.js.map +1 -0
- package/dist/chunk-ROKNKXA4.cjs +8 -0
- package/dist/chunk-ROKNKXA4.cjs.map +1 -0
- package/dist/chunk-RQG6D546.cjs +75 -0
- package/dist/chunk-RQG6D546.cjs.map +1 -0
- package/dist/chunk-SG4YDD5L.cjs +74 -0
- package/dist/chunk-SG4YDD5L.cjs.map +1 -0
- package/dist/chunk-SNRCA7EO.js +56 -0
- package/dist/chunk-SNRCA7EO.js.map +1 -0
- package/dist/chunk-SO75R4WW.cjs +22 -0
- package/dist/chunk-SO75R4WW.cjs.map +1 -0
- package/dist/chunk-SP34NHFI.js +45 -0
- package/dist/chunk-SP34NHFI.js.map +1 -0
- package/dist/chunk-SSKSSBWJ.cjs +179 -0
- package/dist/chunk-SSKSSBWJ.cjs.map +1 -0
- package/dist/chunk-TB5663C2.js +1108 -0
- package/dist/chunk-TB5663C2.js.map +1 -0
- package/dist/chunk-TGH4NRES.js +220 -0
- package/dist/chunk-TGH4NRES.js.map +1 -0
- package/dist/chunk-TJ6ZPNID.js +189 -0
- package/dist/chunk-TJ6ZPNID.js.map +1 -0
- package/dist/chunk-U45T35N2.cjs +90 -0
- package/dist/chunk-U45T35N2.cjs.map +1 -0
- package/dist/chunk-UKVOPEZ2.js +442 -0
- package/dist/chunk-UKVOPEZ2.js.map +1 -0
- package/dist/chunk-UTB4NROA.cjs +887 -0
- package/dist/chunk-UTB4NROA.cjs.map +1 -0
- package/dist/chunk-UTW33B5V.js +6 -0
- package/dist/chunk-UTW33B5V.js.map +1 -0
- package/dist/chunk-UYUBSD2V.cjs +33 -0
- package/dist/chunk-UYUBSD2V.cjs.map +1 -0
- package/dist/chunk-V3JEP5AG.cjs +59 -0
- package/dist/chunk-V3JEP5AG.cjs.map +1 -0
- package/dist/chunk-VFAGJXHR.js +18 -0
- package/dist/chunk-VFAGJXHR.js.map +1 -0
- package/dist/chunk-VMEE57E5.cjs +58 -0
- package/dist/chunk-VMEE57E5.cjs.map +1 -0
- package/dist/chunk-VQVBEX3Y.cjs +113 -0
- package/dist/chunk-VQVBEX3Y.cjs.map +1 -0
- package/dist/chunk-VZDXX7TT.cjs +64 -0
- package/dist/chunk-VZDXX7TT.cjs.map +1 -0
- package/dist/chunk-WE5ZTI4D.js +346 -0
- package/dist/chunk-WE5ZTI4D.js.map +1 -0
- package/dist/chunk-WEFUVABP.js +19 -0
- package/dist/chunk-WEFUVABP.js.map +1 -0
- package/dist/chunk-WMU4LRKC.js +28 -0
- package/dist/chunk-WMU4LRKC.js.map +1 -0
- package/dist/chunk-WQ24RRHL.cjs +354 -0
- package/dist/chunk-WQ24RRHL.cjs.map +1 -0
- package/dist/chunk-WW4CGS7G.cjs +26 -0
- package/dist/chunk-WW4CGS7G.cjs.map +1 -0
- package/dist/chunk-WXE5WCTM.js +1144 -0
- package/dist/chunk-WXE5WCTM.js.map +1 -0
- package/dist/chunk-X23BGIYA.cjs +37 -0
- package/dist/chunk-X23BGIYA.cjs.map +1 -0
- package/dist/chunk-XEW4FTR2.js +98 -0
- package/dist/chunk-XEW4FTR2.js.map +1 -0
- package/dist/chunk-XIOI4IYW.js +167 -0
- package/dist/chunk-XIOI4IYW.js.map +1 -0
- package/dist/chunk-XLVPJ37V.cjs +44 -0
- package/dist/chunk-XLVPJ37V.cjs.map +1 -0
- package/dist/chunk-XOHAXXZA.cjs +51 -0
- package/dist/chunk-XOHAXXZA.cjs.map +1 -0
- package/dist/chunk-Y4NRIHK6.cjs +313 -0
- package/dist/chunk-Y4NRIHK6.cjs.map +1 -0
- package/dist/chunk-Y4YMMKL3.js +23 -0
- package/dist/chunk-Y4YMMKL3.js.map +1 -0
- package/dist/chunk-YJNYBVE3.cjs +14 -0
- package/dist/chunk-YJNYBVE3.cjs.map +1 -0
- package/dist/chunk-Z762QNQP.cjs +60 -0
- package/dist/chunk-Z762QNQP.cjs.map +1 -0
- package/dist/chunk-ZG5KMBOF.js +669 -0
- package/dist/chunk-ZG5KMBOF.js.map +1 -0
- package/dist/chunk-ZKONQEFA.js +344 -0
- package/dist/chunk-ZKONQEFA.js.map +1 -0
- package/dist/chunk-ZR5X7QMH.js +39 -0
- package/dist/chunk-ZR5X7QMH.js.map +1 -0
- package/dist/chunk-ZW4BJQ26.js +84 -0
- package/dist/chunk-ZW4BJQ26.js.map +1 -0
- package/dist/climbs-BhlWuu0x.d.ts +70 -0
- package/dist/climbs-DgBFwySV.d.cts +70 -0
- package/dist/collab/index.cjs +1283 -0
- package/dist/collab/index.cjs.map +1 -0
- package/dist/collab/index.d.cts +850 -0
- package/dist/collab/index.d.ts +850 -0
- package/dist/collab/index.js +1274 -0
- package/dist/collab/index.js.map +1 -0
- package/dist/data/index.cjs +132 -0
- package/dist/data/index.cjs.map +1 -0
- package/dist/data/index.d.cts +468 -0
- package/dist/data/index.d.ts +468 -0
- package/dist/data/index.js +15 -0
- package/dist/data/index.js.map +1 -0
- package/dist/editor/index.cjs +4506 -0
- package/dist/editor/index.cjs.map +1 -0
- package/dist/editor/index.d.cts +59 -0
- package/dist/editor/index.d.ts +59 -0
- package/dist/editor/index.js +4486 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/elevationTiles-pmsb9wnU.d.cts +77 -0
- package/dist/elevationTiles-pmsb9wnU.d.ts +77 -0
- package/dist/errors/index.cjs +28 -0
- package/dist/errors/index.cjs.map +1 -0
- package/dist/errors/index.d.cts +125 -0
- package/dist/errors/index.d.ts +125 -0
- package/dist/errors/index.js +3 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/geo/index.cjs +232 -0
- package/dist/geo/index.cjs.map +1 -0
- package/dist/geo/index.d.cts +821 -0
- package/dist/geo/index.d.ts +821 -0
- package/dist/geo/index.js +15 -0
- package/dist/geo/index.js.map +1 -0
- package/dist/geodesy-543qXKtI.d.cts +78 -0
- package/dist/geodesy-543qXKtI.d.ts +78 -0
- package/dist/geolocation-DDkQdWMN.d.cts +106 -0
- package/dist/geolocation-DDkQdWMN.d.ts +106 -0
- package/dist/i18n/fr/index.cjs +338 -0
- package/dist/i18n/fr/index.cjs.map +1 -0
- package/dist/i18n/fr/index.d.cts +25 -0
- package/dist/i18n/fr/index.d.ts +25 -0
- package/dist/i18n/fr/index.js +336 -0
- package/dist/i18n/fr/index.js.map +1 -0
- package/dist/i18n/index.cjs +464 -0
- package/dist/i18n/index.cjs.map +1 -0
- package/dist/i18n/index.d.cts +227 -0
- package/dist/i18n/index.d.ts +227 -0
- package/dist/i18n/index.js +430 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/icons/index.cjs +116 -0
- package/dist/icons/index.cjs.map +1 -0
- package/dist/icons/index.d.cts +457 -0
- package/dist/icons/index.d.ts +457 -0
- package/dist/icons/index.js +11 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.cjs +1869 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +251 -0
- package/dist/index.d.ts +251 -0
- package/dist/index.js +67 -0
- package/dist/index.js.map +1 -0
- package/dist/itinerary-Dp2ZnqgD.d.cts +178 -0
- package/dist/itinerary-Dp2ZnqgD.d.ts +178 -0
- package/dist/language-CEWQ5uYw.d.cts +69 -0
- package/dist/language-CEWQ5uYw.d.ts +69 -0
- package/dist/layers/index.cjs +318 -0
- package/dist/layers/index.cjs.map +1 -0
- package/dist/layers/index.d.cts +1555 -0
- package/dist/layers/index.d.ts +1555 -0
- package/dist/layers/index.js +17 -0
- package/dist/layers/index.js.map +1 -0
- package/dist/map-client/index.cjs +4 -0
- package/dist/map-client/index.cjs.map +1 -0
- package/dist/map-client/index.d.cts +1856 -0
- package/dist/map-client/index.d.ts +1856 -0
- package/dist/map-client/index.js +3 -0
- package/dist/map-client/index.js.map +1 -0
- package/dist/maplibre-worker.mjs +12 -0
- package/dist/markerSprite-DGBQF6PO.cjs +49 -0
- package/dist/markerSprite-DGBQF6PO.cjs.map +1 -0
- package/dist/markerSprite-DZLTR6F6.js +8 -0
- package/dist/markerSprite-DZLTR6F6.js.map +1 -0
- package/dist/mountayaMap-C9mxRFib.d.cts +3277 -0
- package/dist/mountayaMap-DgnlQ2fE.d.ts +3277 -0
- package/dist/navigation/index.cjs +699 -0
- package/dist/navigation/index.cjs.map +1 -0
- package/dist/navigation/index.d.cts +632 -0
- package/dist/navigation/index.d.ts +632 -0
- package/dist/navigation/index.js +689 -0
- package/dist/navigation/index.js.map +1 -0
- package/dist/order-BLhsGsH8.d.ts +132 -0
- package/dist/order-BZkUwMou.d.cts +132 -0
- package/dist/paint-BgUcj8l7.d.cts +118 -0
- package/dist/paint-Dx_qGNE_.d.ts +118 -0
- package/dist/profile/index.cjs +675 -0
- package/dist/profile/index.cjs.map +1 -0
- package/dist/profile/index.d.cts +2086 -0
- package/dist/profile/index.d.ts +2086 -0
- package/dist/profile/index.js +18 -0
- package/dist/profile/index.js.map +1 -0
- package/dist/provider-DM71XnLX.d.cts +121 -0
- package/dist/provider-DM71XnLX.d.ts +121 -0
- package/dist/roadAccess-D_rOE4xW.d.cts +86 -0
- package/dist/roadAccess-D_rOE4xW.d.ts +86 -0
- package/dist/routeProfile-BKfSfxx6.d.ts +210 -0
- package/dist/routeProfile-BsSUABXv.d.cts +210 -0
- package/dist/seams/index.cjs +39 -0
- package/dist/seams/index.cjs.map +1 -0
- package/dist/seams/index.d.cts +254 -0
- package/dist/seams/index.d.ts +254 -0
- package/dist/seams/index.js +6 -0
- package/dist/seams/index.js.map +1 -0
- package/dist/search/index.cjs +147 -0
- package/dist/search/index.cjs.map +1 -0
- package/dist/search/index.d.cts +888 -0
- package/dist/search/index.d.ts +888 -0
- package/dist/search/index.js +14 -0
- package/dist/search/index.js.map +1 -0
- package/dist/searchHighlight-DFE7LVIL.cjs +33 -0
- package/dist/searchHighlight-DFE7LVIL.cjs.map +1 -0
- package/dist/searchHighlight-MHAQZVWG.js +12 -0
- package/dist/searchHighlight-MHAQZVWG.js.map +1 -0
- package/dist/searchLimits-j99-NTXR.d.cts +24 -0
- package/dist/searchLimits-j99-NTXR.d.ts +24 -0
- package/dist/sections-CVlc2Inr.d.cts +953 -0
- package/dist/sections-CmtaduLc.d.ts +953 -0
- package/dist/segmentRoute-C5UL_5bp.d.ts +172 -0
- package/dist/segmentRoute-CIo6dR8Y.d.cts +172 -0
- package/dist/strings-30RSdIat.d.cts +552 -0
- package/dist/strings-DPTIbzT5.d.ts +552 -0
- package/dist/stripeImage-CQUXM2YI.js +14 -0
- package/dist/stripeImage-CQUXM2YI.js.map +1 -0
- package/dist/stripeImage-R43OPA6U.cjs +39 -0
- package/dist/stripeImage-R43OPA6U.cjs.map +1 -0
- package/dist/style/index.cjs +116 -0
- package/dist/style/index.cjs.map +1 -0
- package/dist/style/index.d.cts +538 -0
- package/dist/style/index.d.ts +538 -0
- package/dist/style/index.js +11 -0
- package/dist/style/index.js.map +1 -0
- package/dist/styles.css +11 -0
- package/dist/testing/index.cjs +629 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +265 -0
- package/dist/testing/index.d.ts +265 -0
- package/dist/testing/index.js +623 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/timezone/index.cjs +759 -0
- package/dist/timezone/index.cjs.map +1 -0
- package/dist/timezone/index.d.cts +53 -0
- package/dist/timezone/index.d.ts +53 -0
- package/dist/timezone/index.js +757 -0
- package/dist/timezone/index.js.map +1 -0
- package/dist/types-B034JMjl.d.ts +973 -0
- package/dist/types-B2NDLxQA.d.cts +21 -0
- package/dist/types-B2NDLxQA.d.ts +21 -0
- package/dist/types-BEv8V_8V.d.cts +55 -0
- package/dist/types-BEv8V_8V.d.ts +55 -0
- package/dist/types-C8aX5KMU.d.cts +973 -0
- package/dist/types-CTQwbSdA.d.cts +321 -0
- package/dist/types-nO2joeRk.d.ts +321 -0
- package/dist/units/index.cjs +99 -0
- package/dist/units/index.cjs.map +1 -0
- package/dist/units/index.d.cts +75 -0
- package/dist/units/index.d.ts +75 -0
- package/dist/units/index.js +6 -0
- package/dist/units/index.js.map +1 -0
- package/dist/units-D9mBrusY.d.cts +900 -0
- package/dist/units-D9mBrusY.d.ts +900 -0
- package/dist/video/index.cjs +2198 -0
- package/dist/video/index.cjs.map +1 -0
- package/dist/video/index.d.cts +873 -0
- package/dist/video/index.d.ts +873 -0
- package/dist/video/index.js +2173 -0
- package/dist/video/index.js.map +1 -0
- package/dist/videoOverlay-Dh_D5_Zs.d.cts +44 -0
- package/dist/videoOverlay-Dh_D5_Zs.d.ts +44 -0
- package/dist/view/index.cjs +43 -0
- package/dist/view/index.cjs.map +1 -0
- package/dist/view/index.d.cts +836 -0
- package/dist/view/index.d.ts +836 -0
- package/dist/view/index.js +34 -0
- package/dist/view/index.js.map +1 -0
- package/dist/zones-B05QA8fy.d.cts +75 -0
- package/dist/zones-B05QA8fy.d.ts +75 -0
- package/package.json +433 -4
- package/src/agent/engines/session.ts +2255 -0
- package/src/agent/index.ts +109 -0
- package/src/agent/rules/agentError.ts +128 -0
- package/src/agent/rules/boundedInputJson.ts +53 -0
- package/src/agent/rules/conversation.ts +629 -0
- package/src/agent/rules/conversationFaults.ts +349 -0
- package/src/agent/rules/conversationHost.ts +390 -0
- package/src/agent/rules/dispatcher.ts +102 -0
- package/src/agent/rules/errorCodes.ts +78 -0
- package/src/agent/rules/errorStatus.ts +65 -0
- package/src/agent/rules/scriptedTransport.ts +390 -0
- package/src/agent/rules/stickToBottom.ts +38 -0
- package/src/agent/rules/toolResultPayload.ts +197 -0
- package/src/auth/rules/clientHeader.ts +22 -0
- package/src/auth/rules/sentCredential.ts +76 -0
- package/src/auth/rules/transformRequest.ts +803 -0
- package/src/camera/engines/videoFlight.ts +1758 -0
- package/src/camera/index.ts +157 -0
- package/src/camera/rules/clearance.ts +1099 -0
- package/src/camera/rules/fit.ts +132 -0
- package/src/camera/rules/modes.ts +1023 -0
- package/src/camera/rules/plan.ts +478 -0
- package/src/camera/rules/planner.ts +129 -0
- package/src/camera/rules/poseRanges.ts +38 -0
- package/src/camera/rules/presets.ts +185 -0
- package/src/camera/rules/profileSamples.ts +243 -0
- package/src/camera/rules/route.ts +596 -0
- package/src/camera/rules/routeContent.ts +104 -0
- package/src/camera/rules/spline.ts +765 -0
- package/src/camera/rules/sweptViewports.ts +39 -0
- package/src/camera/rules/track.ts +1412 -0
- package/src/camera/rules/vocabulary.ts +130 -0
- package/src/camera/rules/zoom.ts +216 -0
- package/src/collab/engines/session.ts +1902 -0
- package/src/collab/engines/trailingThrottle.ts +151 -0
- package/src/collab/index.ts +56 -0
- package/src/collab/rules/dispatch.ts +143 -0
- package/src/collab/rules/peerNames.ts +51 -0
- package/src/collab/rules/scriptedTransport.ts +244 -0
- package/src/compose/engines/baseMapSwitch.ts +1136 -0
- package/src/compose/engines/events.ts +962 -0
- package/src/compose/engines/mountayaMap.ts +5674 -0
- package/src/compose/engines/sentCredentials.ts +146 -0
- package/src/compose/engines/slotRequests.ts +413 -0
- package/src/compose/rules/accessRefusal.ts +109 -0
- package/src/compose/rules/accessStanding.ts +75 -0
- package/src/compose/rules/analysisKinds.ts +331 -0
- package/src/compose/rules/analysisLayers.ts +176 -0
- package/src/compose/rules/cameraMoves.ts +38 -0
- package/src/compose/rules/carriedLayers.ts +87 -0
- package/src/compose/rules/developmentWarnings.ts +166 -0
- package/src/compose/rules/fitCamera.ts +54 -0
- package/src/compose/rules/geoJsonSlot.ts +61 -0
- package/src/compose/rules/geometrySlots.ts +155 -0
- package/src/compose/rules/glyphNode.ts +62 -0
- package/src/compose/rules/layerKeys.ts +92 -0
- package/src/compose/rules/layerOrder.ts +85 -0
- package/src/compose/rules/layersManifest.ts +26 -0
- package/src/compose/rules/mapOptions.ts +300 -0
- package/src/compose/rules/maplibreWorkerVersion.gen.ts +8 -0
- package/src/compose/rules/markerPin.ts +122 -0
- package/src/compose/rules/markerRegistry.ts +85 -0
- package/src/compose/rules/markerSprite.ts +382 -0
- package/src/compose/rules/maxBounds.ts +120 -0
- package/src/compose/rules/overlayLookup.ts +49 -0
- package/src/compose/rules/paintDiff.ts +38 -0
- package/src/compose/rules/panLock.ts +77 -0
- package/src/compose/rules/patch.ts +124 -0
- package/src/compose/rules/queriedFeature.ts +55 -0
- package/src/compose/rules/queryLayers.ts +46 -0
- package/src/compose/rules/searchHighlight.ts +313 -0
- package/src/compose/rules/slotNames.ts +19 -0
- package/src/compose/rules/stripeImage.ts +253 -0
- package/src/compose/rules/swapMarker.ts +66 -0
- package/src/compose/rules/terrainVariant.ts +88 -0
- package/src/compose/rules/types.ts +566 -0
- package/src/compose/rules/urlHash.ts +19 -0
- package/src/compose/rules/viewOptions.ts +451 -0
- package/src/compose/rules/workerUrl.ts +96 -0
- package/src/data/engines/itineraryResource.ts +643 -0
- package/src/data/index.ts +78 -0
- package/src/data/rules/adapt.ts +473 -0
- package/src/data/rules/editModes.ts +51 -0
- package/src/data/rules/itinerary.ts +168 -0
- package/src/data/rules/nullable.ts +63 -0
- package/src/data/rules/roadAccess.ts +169 -0
- package/src/data/rules/segmentGroups.ts +309 -0
- package/src/data/rules/selectors.ts +95 -0
- package/src/data/rules/zones.ts +79 -0
- package/src/draw/engines/boundaryEngine.ts +1003 -0
- package/src/draw/engines/framedAdapter.ts +198 -0
- package/src/draw/engines/pointerCursor.ts +205 -0
- package/src/draw/engines/segmentEngine.ts +1405 -0
- package/src/draw/engines/snapIndex.ts +254 -0
- package/src/draw/engines/waypointEngine.ts +574 -0
- package/src/draw/engines/zoneEngine.ts +1137 -0
- package/src/draw/rules/drawFrame.ts +123 -0
- package/src/draw/rules/insertVertex.ts +226 -0
- package/src/draw/rules/screenSpace.ts +62 -0
- package/src/draw/rules/seeds.ts +185 -0
- package/src/draw/rules/snap.ts +115 -0
- package/src/draw/rules/snapCameraKey.ts +50 -0
- package/src/draw/rules/terraDrawShared.ts +214 -0
- package/src/draw/rules/zoneOutline.ts +213 -0
- package/src/editing/engines/cursor.ts +505 -0
- package/src/editing/engines/draftMarker.ts +149 -0
- package/src/editing/rules/accent.ts +11 -0
- package/src/editing/rules/engine.ts +286 -0
- package/src/editing/rules/placement.ts +22 -0
- package/src/editing/rules/positions.ts +89 -0
- package/src/editing/rules/sources.ts +9 -0
- package/src/editing/rules/types.ts +457 -0
- package/src/editing/rules/vocabulary.ts +10 -0
- package/src/editing/rules/waypointCursor.ts +228 -0
- package/src/editor/engines/directionArrows.ts +459 -0
- package/src/editor/engines/directions.ts +1383 -0
- package/src/editor/engines/editorClient.ts +134 -0
- package/src/editor/engines/eventScope.ts +59 -0
- package/src/editor/engines/frameLoop.ts +159 -0
- package/src/editor/engines/itineraryPreview.ts +272 -0
- package/src/editor/engines/mapLockGuard.ts +66 -0
- package/src/editor/engines/overlayRenderer.ts +2696 -0
- package/src/editor/engines/peerDraft.ts +760 -0
- package/src/editor/engines/poiPick.ts +305 -0
- package/src/editor/engines/pointPick.ts +84 -0
- package/src/editor/engines/roadAccessLine.ts +140 -0
- package/src/editor/engines/searchHighlight.ts +183 -0
- package/src/editor/engines/viewClient.ts +4083 -0
- package/src/editor/engines/zoneBadges.ts +503 -0
- package/src/editor/index.ts +97 -0
- package/src/editor/rules/accentColor.ts +116 -0
- package/src/editor/rules/camera.ts +121 -0
- package/src/editor/rules/contract.ts +125 -0
- package/src/editor/rules/icons.ts +825 -0
- package/src/editor/rules/markerElements.ts +244 -0
- package/src/editor/rules/style.ts +51 -0
- package/src/editor/rules/terrain.ts +98 -0
- package/src/editor/rules/tileWarm.ts +191 -0
- package/src/editor/rules/tilesReload.ts +158 -0
- package/src/editor/rules/zoneBadgePlacement.ts +1832 -0
- package/src/editor/rules/zoneTimeStyling.ts +119 -0
- package/src/errors/index.ts +25 -0
- package/src/errors/rules/errors.ts +157 -0
- package/src/errors/rules/print.ts +129 -0
- package/src/geo/index.ts +94 -0
- package/src/geo/rules/boundaries.ts +105 -0
- package/src/geo/rules/camera.ts +496 -0
- package/src/geo/rules/corridor.ts +242 -0
- package/src/geo/rules/elevationTiles.ts +269 -0
- package/src/geo/rules/formatLngLat.ts +63 -0
- package/src/geo/rules/geodesy.ts +125 -0
- package/src/geo/rules/geometry.ts +362 -0
- package/src/geo/rules/lineWalk.ts +77 -0
- package/src/geo/rules/longitude.ts +99 -0
- package/src/geo/rules/searchLimits.ts +22 -0
- package/src/geo/rules/segmentGeometry.ts +80 -0
- package/src/geo/rules/terrain.ts +107 -0
- package/src/geo/rules/tuples.ts +124 -0
- package/src/geo/rules/types.ts +54 -0
- package/src/geo/rules/webMercator.ts +57 -0
- package/src/i18n/fr/index.ts +17 -0
- package/src/i18n/fr/rules/fr.ts +85 -0
- package/src/i18n/fr/rules/words.gen.ts +277 -0
- package/src/i18n/index.ts +81 -0
- package/src/i18n/rules/bundle.ts +378 -0
- package/src/i18n/rules/config.ts +71 -0
- package/src/i18n/rules/endonyms.gen.ts +19 -0
- package/src/i18n/rules/language.ts +92 -0
- package/src/i18n/rules/localizedName.ts +33 -0
- package/src/i18n/rules/merge.ts +106 -0
- package/src/i18n/rules/scope.ts +127 -0
- package/src/i18n/rules/strings.ts +632 -0
- package/src/i18n/rules/videoOverlay.ts +121 -0
- package/src/i18n/rules/wordForms.ts +95 -0
- package/src/i18n/rules/words.gen.ts +277 -0
- package/src/icons/index.ts +54 -0
- package/src/icons/rules/activities.ts +40 -0
- package/src/icons/rules/amenities.ts +250 -0
- package/src/icons/rules/artwork.gen.ts +83 -0
- package/src/icons/rules/artwork.ts +47 -0
- package/src/icons/rules/fallback.ts +21 -0
- package/src/icons/rules/lucideMarkers.gen.ts +112 -0
- package/src/icons/rules/lucideUi.gen.ts +197 -0
- package/src/icons/rules/paint.ts +107 -0
- package/src/icons/rules/parse.ts +475 -0
- package/src/icons/rules/provider.ts +373 -0
- package/src/icons/rules/sprites.ts +54 -0
- package/src/icons/rules/ui.ts +348 -0
- package/src/icons/rules/waypoints.ts +215 -0
- package/src/index.ts +1012 -0
- package/src/layers/engines/layersSelection.ts +515 -0
- package/src/layers/engines/readoutEngine.ts +131 -0
- package/src/layers/index.ts +151 -0
- package/src/layers/rules/analysis.ts +135 -0
- package/src/layers/rules/enrichment.ts +30 -0
- package/src/layers/rules/geoJson.ts +270 -0
- package/src/layers/rules/hover.ts +67 -0
- package/src/layers/rules/itineraries.ts +182 -0
- package/src/layers/rules/layersPanel.ts +237 -0
- package/src/layers/rules/order.ts +194 -0
- package/src/layers/rules/overlayInstant.ts +49 -0
- package/src/layers/rules/overlays.ts +52 -0
- package/src/layers/rules/poiPanel.ts +119 -0
- package/src/layers/rules/pois.ts +114 -0
- package/src/layers/rules/readout.ts +340 -0
- package/src/layers/rules/streetView.ts +16 -0
- package/src/layers/rules/tileTimestamp.ts +146 -0
- package/src/layers/rules/timeSlider.ts +192 -0
- package/src/layers/rules/timeWindow.ts +123 -0
- package/src/layers/rules/zones.ts +43 -0
- package/src/layers/rules/zoom.ts +77 -0
- package/src/map-client/index.ts +71 -0
- package/src/map-client/rules/mapClient.ts +1943 -0
- package/src/navigation/engines/navigation.ts +493 -0
- package/src/navigation/index.ts +51 -0
- package/src/navigation/rules/followedRoute.ts +78 -0
- package/src/navigation/rules/instructions.ts +89 -0
- package/src/navigation/rules/itineraryRoute.ts +232 -0
- package/src/navigation/rules/offRoute.ts +41 -0
- package/src/navigation/rules/progress.ts +230 -0
- package/src/navigation/rules/prompts.ts +217 -0
- package/src/navigation/rules/routeRequest.ts +98 -0
- package/src/navigation/rules/status.ts +142 -0
- package/src/navigation/rules/steps.ts +234 -0
- package/src/navigation/rules/types.ts +83 -0
- package/src/profile/index.ts +307 -0
- package/src/profile/rules/amenityBadge.ts +35 -0
- package/src/profile/rules/amenityFilter.ts +74 -0
- package/src/profile/rules/amenityStacks.ts +66 -0
- package/src/profile/rules/axis.ts +89 -0
- package/src/profile/rules/axisCulling.ts +83 -0
- package/src/profile/rules/axisLookup.ts +180 -0
- package/src/profile/rules/climbs.ts +292 -0
- package/src/profile/rules/cursorMarker.ts +122 -0
- package/src/profile/rules/cursorReadout.ts +104 -0
- package/src/profile/rules/curvePlacement.ts +216 -0
- package/src/profile/rules/dock.ts +293 -0
- package/src/profile/rules/elevation.ts +1263 -0
- package/src/profile/rules/instant.ts +89 -0
- package/src/profile/rules/intl.ts +237 -0
- package/src/profile/rules/legEmphasis.ts +53 -0
- package/src/profile/rules/profileColors.ts +66 -0
- package/src/profile/rules/profileLayout.ts +59 -0
- package/src/profile/rules/profileSlices.ts +55 -0
- package/src/profile/rules/routeProfile.ts +475 -0
- package/src/profile/rules/rowMatch.ts +50 -0
- package/src/profile/rules/scale.ts +650 -0
- package/src/profile/rules/scaleFrame.ts +171 -0
- package/src/profile/rules/sectionChips.ts +83 -0
- package/src/profile/rules/sections.ts +923 -0
- package/src/profile/rules/slopeRamp.ts +160 -0
- package/src/profile/rules/statStrip.ts +103 -0
- package/src/profile/rules/steepness.ts +51 -0
- package/src/profile/rules/tableCells.ts +269 -0
- package/src/profile/rules/tableCursor.ts +87 -0
- package/src/profile/rules/unitPatterns.ts +335 -0
- package/src/profile/rules/units.ts +1025 -0
- package/src/profile/rules/waypointCard.ts +593 -0
- package/src/profile/rules/webAddress.ts +130 -0
- package/src/profile/rules/windowSpans.ts +65 -0
- package/src/rules/asciiFold.ts +17 -0
- package/src/rules/inDevelopment.ts +54 -0
- package/src/rules/listeners.ts +62 -0
- package/src/rules/timers.ts +9 -0
- package/src/rules/types.ts +22 -0
- package/src/rules/uuid.ts +87 -0
- package/src/seams/engines/geolocateControl.ts +286 -0
- package/src/seams/index.ts +50 -0
- package/src/seams/rules/clock.ts +169 -0
- package/src/seams/rules/geolocation.ts +165 -0
- package/src/seams/rules/segmentRoute.ts +187 -0
- package/src/search/engines/search.ts +1093 -0
- package/src/search/index.ts +114 -0
- package/src/search/rules/describe.ts +383 -0
- package/src/search/rules/filters.ts +195 -0
- package/src/search/rules/highlight.ts +270 -0
- package/src/search/rules/pick.ts +90 -0
- package/src/search/rules/rows.ts +258 -0
- package/src/search/rules/searchFocus.ts +27 -0
- package/src/search/rules/searchViewport.ts +44 -0
- package/src/search/rules/shown.ts +77 -0
- package/src/search/rules/types.ts +340 -0
- package/src/stream/rules/reconnectSchedule.ts +83 -0
- package/src/style/engines/organizationRead.ts +80 -0
- package/src/style/index.ts +63 -0
- package/src/style/rules/apply.ts +268 -0
- package/src/style/rules/attribution.ts +119 -0
- package/src/style/rules/itineraryLine.ts +142 -0
- package/src/style/rules/language.ts +668 -0
- package/src/style/rules/layout.gen.ts +27 -0
- package/src/style/rules/organization.ts +96 -0
- package/src/style/rules/paint.ts +143 -0
- package/src/style/rules/panelLayout.ts +51 -0
- package/src/style/rules/roadAccessColors.ts +29 -0
- package/src/style/rules/roadAccessLine.ts +267 -0
- package/src/style/rules/segmentColors.ts +207 -0
- package/src/testing/catalogs.ts +103 -0
- package/src/testing/index.ts +30 -0
- package/src/testing/mapClient.ts +241 -0
- package/src/testing/mountayaMap.ts +741 -0
- package/src/timezone/index.ts +14 -0
- package/src/timezone/rules/viewport.ts +875 -0
- package/src/units/index.ts +55 -0
- package/src/units/rules/conversions.ts +620 -0
- package/src/units/rules/preferenceChoices.ts +124 -0
- package/src/units/rules/preferences.ts +77 -0
- package/src/units/rules/rounding.ts +69 -0
- package/src/video/engines/videoRun.ts +654 -0
- package/src/video/engines/viewClient.ts +6 -0
- package/src/video/index.ts +83 -0
- package/src/video/profileOverlay/rules/contract.ts +212 -0
- package/src/video/profileOverlay/rules/curve.ts +216 -0
- package/src/video/profileOverlay/rules/draw.ts +410 -0
- package/src/video/profileOverlay/rules/fonts.ts +54 -0
- package/src/video/profileOverlay/rules/graphDesign.ts +690 -0
- package/src/video/profileOverlay/rules/minimalDesign.ts +144 -0
- package/src/video/profileOverlay/rules/registry.ts +23 -0
- package/src/video/profileOverlay/rules/staticLayer.ts +582 -0
- package/src/video/profileOverlay/rules/stripDesign.ts +327 -0
- package/src/video/profileOverlay/rules/types.ts +78 -0
- package/src/video/rules/videoConstants.ts +250 -0
- package/src/video/rules/videoEncoder.ts +277 -0
- package/src/video/rules/videoFrames.ts +99 -0
- package/src/video/rules/videoPreview.ts +185 -0
- package/src/video/rules/videoRecorder.ts +746 -0
- package/src/video/rules/videoWatermark.ts +155 -0
- package/src/video/rules/watermarkMark.ts +40 -0
- package/src/view/engines/viewClient.ts +6 -0
- package/src/view/index.ts +20 -0
|
@@ -0,0 +1,962 @@
|
|
|
1
|
+
import type { MapEventType, MapLayerEventType, Map as MapLibreMap } from "maplibre-gl";
|
|
2
|
+
|
|
3
|
+
import { MountayaElementsError } from "../../errors/rules/errors.js";
|
|
4
|
+
import { surfaceFault } from "../../rules/listeners.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A map event listener. The argument list is `never[]` so any concrete MapLibre event
|
|
8
|
+
* signature is assignable when registered through the typed helpers, which narrow the
|
|
9
|
+
* handler to the event before it reaches here.
|
|
10
|
+
*/
|
|
11
|
+
type Handler = (...args: never[]) => void;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A persistent listener held for the life of the map: the event type, the optional layer id
|
|
15
|
+
* it is scoped to, and the handler reference passed to `map.off()` when it is removed.
|
|
16
|
+
*/
|
|
17
|
+
interface PersistentListener {
|
|
18
|
+
readonly eventType: string;
|
|
19
|
+
readonly handler: Handler;
|
|
20
|
+
readonly layerId?: string | undefined;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** hasExtent reports whether a laid-out length measures anything. */
|
|
24
|
+
const hasExtent = (length: number): boolean => length > 0;
|
|
25
|
+
|
|
26
|
+
/** A box's two lengths, in CSS pixels. */
|
|
27
|
+
interface BoxSize {
|
|
28
|
+
readonly height: number;
|
|
29
|
+
readonly width: number;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* laidOutView is the window that lays the map's container out and shows it, or null while there
|
|
34
|
+
* is no frame to read: the container has no extent along either axis (a map mounted in a frame
|
|
35
|
+
* nobody shows yet, or a stand-in of the renderer that lays nothing out), or the page is hidden,
|
|
36
|
+
* as a tab in the background is, and runs no animation frame.
|
|
37
|
+
*/
|
|
38
|
+
const laidOutView = (map: MapLibreMap): Window | null => {
|
|
39
|
+
const container = map.getContainer();
|
|
40
|
+
if (!hasExtent(container.clientWidth) && !hasExtent(container.clientHeight)) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const { defaultView, visibilityState } = container.ownerDocument;
|
|
45
|
+
|
|
46
|
+
return visibilityState === "hidden" ? null : defaultView;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* holdsContainerSize reports whether the renderer's canvas holds the size the page lays its
|
|
51
|
+
* container out at. An axis the container has no extent along holds whatever the canvas
|
|
52
|
+
* measures, since the renderer gives the canvas a size of its own there and no resize changes it.
|
|
53
|
+
*/
|
|
54
|
+
const holdsContainerSize = (map: MapLibreMap): boolean => {
|
|
55
|
+
const { clientHeight, clientWidth } = map.getContainer();
|
|
56
|
+
const across = hasExtent(clientWidth);
|
|
57
|
+
const down = hasExtent(clientHeight);
|
|
58
|
+
if (!across && !down) {
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const canvas = map.getCanvas();
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
(!across || canvas.clientWidth === clientWidth) &&
|
|
66
|
+
(!down || canvas.clientHeight === clientHeight)
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* contentBoxOf measures the box the renderer's observer of the container watches, its content
|
|
72
|
+
* box: the client size less the padding.
|
|
73
|
+
*/
|
|
74
|
+
const contentBoxOf = (container: HTMLElement): BoxSize => {
|
|
75
|
+
const style = container.ownerDocument.defaultView?.getComputedStyle(container);
|
|
76
|
+
const pixels = (length: string | undefined): number => Number.parseFloat(length ?? "") || 0;
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
height: container.clientHeight - pixels(style?.paddingTop) - pixels(style?.paddingBottom),
|
|
80
|
+
width: container.clientWidth - pixels(style?.paddingLeft) - pixels(style?.paddingRight),
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* MapEvents is what a `MountayaMap` hands a consumer of its event engine (`map.events`): its
|
|
86
|
+
* listeners, typed by MapLibre's own events, and the deferral to the style a base-map switch
|
|
87
|
+
* brings in.
|
|
88
|
+
*
|
|
89
|
+
* The rest of {@link MapEventEngine} (announcing and cancelling a reload, the missing-image
|
|
90
|
+
* resolver, the teardown) belongs to the map that owns the engine, and is not reachable here: a
|
|
91
|
+
* reload announced from outside would hold every drawing of the map for a style it never asked
|
|
92
|
+
* for.
|
|
93
|
+
*/
|
|
94
|
+
export interface MapEvents {
|
|
95
|
+
/**
|
|
96
|
+
* on attaches a listener of one of MapLibre's map events, typed by the event's payload, until
|
|
97
|
+
* the map is destroyed or the returned unsubscribe is called. A listener attached this way
|
|
98
|
+
* outlives a base-map switch.
|
|
99
|
+
*
|
|
100
|
+
* @param eventType The MapLibre event, such as `"moveend"` or `"click"`.
|
|
101
|
+
* @param handler Called with the event's own payload.
|
|
102
|
+
* @returns An unsubscribe that detaches this listener and no other.
|
|
103
|
+
*/
|
|
104
|
+
on<T extends keyof MapEventType>(
|
|
105
|
+
eventType: T,
|
|
106
|
+
handler: (event: MapEventType[T]) => void,
|
|
107
|
+
): () => void;
|
|
108
|
+
/**
|
|
109
|
+
* on attaches a listener of one of MapLibre's layer events, scoped to one style layer.
|
|
110
|
+
*
|
|
111
|
+
* @param eventType The MapLibre layer event, such as `"mouseenter"`.
|
|
112
|
+
* @param handler Called with the event's own payload.
|
|
113
|
+
* @param layerId The style layer the listener is scoped to.
|
|
114
|
+
* @returns An unsubscribe that detaches this listener and no other.
|
|
115
|
+
*/
|
|
116
|
+
on<T extends keyof MapLayerEventType>(
|
|
117
|
+
eventType: T,
|
|
118
|
+
handler: (event: MapLayerEventType[T]) => void,
|
|
119
|
+
layerId: string,
|
|
120
|
+
): () => void;
|
|
121
|
+
/**
|
|
122
|
+
* once attaches a listener for the next firing of one of MapLibre's map events.
|
|
123
|
+
*
|
|
124
|
+
* @param eventType The MapLibre event.
|
|
125
|
+
* @param handler Called once, with the event's own payload.
|
|
126
|
+
* @returns An unsubscribe that detaches the listener before it fires, and does nothing after.
|
|
127
|
+
*/
|
|
128
|
+
once<T extends keyof MapEventType>(
|
|
129
|
+
eventType: T,
|
|
130
|
+
handler: (event: MapEventType[T]) => void,
|
|
131
|
+
): () => void;
|
|
132
|
+
/**
|
|
133
|
+
* afterStyleLoad runs `fn` once the style can take a source or a layer: at once on a settled
|
|
134
|
+
* style, and after the style a base-map switch brings in while one is on its way.
|
|
135
|
+
*/
|
|
136
|
+
afterStyleLoad(fn: () => void): void;
|
|
137
|
+
/**
|
|
138
|
+
* whenSettled resolves once the map has finished drawing what it was asked to draw, with no
|
|
139
|
+
* resize of the canvas on its way, as the next animation frame reads it. It never rejects, and
|
|
140
|
+
* it resolves as the map is destroyed. Padding of the container that changed alone, after the
|
|
141
|
+
* map first sized its canvas and before the first wait, holds every wait until the canvas is
|
|
142
|
+
* next resized (see {@link MapEventEngine.whenSettled}).
|
|
143
|
+
*/
|
|
144
|
+
whenSettled(): Promise<void>;
|
|
145
|
+
/** isStyleReloading reports whether a base-map switch is on its way. */
|
|
146
|
+
isStyleReloading(): boolean;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* MapEventEngine is the single owner of every listener attached to a map.
|
|
151
|
+
*
|
|
152
|
+
* It exists because **`setStyle()` replaces the style but leaves the listeners**: sources,
|
|
153
|
+
* layers, sprites and terrain all go, and a handler registered with `map.on()` keeps firing
|
|
154
|
+
* across a base-map switch. So this never detaches on a restyle; it holds each listener
|
|
155
|
+
* until `dispose()` and then calls `map.off()` for every one, deterministically, rather
|
|
156
|
+
* than leaving teardown to `map.remove()`.
|
|
157
|
+
*
|
|
158
|
+
* Three lifecycles:
|
|
159
|
+
*
|
|
160
|
+
* - **persistent** (`map.on`): map-level events (`move`, `contextmenu`, `styledata`) and
|
|
161
|
+
* layer-scoped ones. They live until `dispose()`.
|
|
162
|
+
* - **once** ({@link once}): a single firing (`load`, `style.load`). The listener is tracked
|
|
163
|
+
* like a persistent one until it fires, and detaches itself as it does.
|
|
164
|
+
* - **the missing-image resolver** (`map.setMissingStyleImageResolver`): not an event at
|
|
165
|
+
* all, but map-level state with a persistent listener's lifetime, so it is installed and
|
|
166
|
+
* cleared here rather than by the renderer that supplies the sprites. See
|
|
167
|
+
* {@link setMissingImageResolver}.
|
|
168
|
+
*
|
|
169
|
+
* Every persistent listener is tracked under a unique key so the same *reference* goes back
|
|
170
|
+
* to `map.off()`. An anonymous handler cannot be removed and would leak, which is the
|
|
171
|
+
* failure this class exists to make impossible rather than merely discouraged.
|
|
172
|
+
*
|
|
173
|
+
* It also owns the STYLE RELOAD, for the same reason: a `setStyle()` is the one moment when
|
|
174
|
+
* "is the map ready" has an answer no listener can read off the map itself, and work
|
|
175
|
+
* deferred against the wrong answer either lands on a style about to be wiped or waits for
|
|
176
|
+
* one that failed to arrive. See {@link beginStyleReload}.
|
|
177
|
+
*
|
|
178
|
+
* A consumer reaches it as {@link MapEvents}, through `MountayaMap.events`.
|
|
179
|
+
*/
|
|
180
|
+
export class MapEventEngine implements MapEvents {
|
|
181
|
+
private readonly persistent = new Map<string, PersistentListener>();
|
|
182
|
+
|
|
183
|
+
// A monotonically increasing counter so two subscriptions to the same event type (say
|
|
184
|
+
// several viewport readouts on "move") each track under a distinct key rather than
|
|
185
|
+
// overwriting one another.
|
|
186
|
+
private keySeq = 0;
|
|
187
|
+
|
|
188
|
+
// True between a setStyle() call (beginStyleReload) and the new style's "style.load". In
|
|
189
|
+
// that window map.isStyleLoaded() still reports the OLD style as loaded, so afterStyleLoad
|
|
190
|
+
// must defer rather than run work against the style being replaced: the incoming style
|
|
191
|
+
// would wipe any source or layer added to it.
|
|
192
|
+
private styleReloading = false;
|
|
193
|
+
|
|
194
|
+
// Which reload the flag above belongs to. Every listener a reload registers captures the
|
|
195
|
+
// number it was announced under and refuses to act on any other, so a signal arriving late
|
|
196
|
+
// from a reload that is already over cannot end the one that replaced it.
|
|
197
|
+
private reloadSeq = 0;
|
|
198
|
+
|
|
199
|
+
// Whether the style DOCUMENT has parsed, which is the only thing `addSource` and `addLayer`
|
|
200
|
+
// actually require. It is deliberately not `map.isStyleLoaded()`: that answers a much
|
|
201
|
+
// stronger question (document parsed AND no pending source updates AND every tile manager
|
|
202
|
+
// settled AND the sprite atlas complete), and readiness to ACCEPT content does not depend on
|
|
203
|
+
// any of the last three. Tracked as a level here because the transition is not reliably
|
|
204
|
+
// announced; see {@link afterStyleLoad}.
|
|
205
|
+
private styleDocumentReady = false;
|
|
206
|
+
|
|
207
|
+
// Whether the renderer holds a style that has loaded, read off a `style.load` or a style that
|
|
208
|
+
// reports loaded and never off an `idle`: MapLibre reports an idle over a style that failed to
|
|
209
|
+
// load as well. Lowered by {@link noteStyleDropped}. A reload over no loaded style ends on its
|
|
210
|
+
// first error ({@link beginStyleReload}).
|
|
211
|
+
private styleHasLoaded = false;
|
|
212
|
+
|
|
213
|
+
// Work held for the style a reload is bringing in. Kept here rather than on
|
|
214
|
+
// map.once("style.load") because a reload that never completes fires no style.load at all,
|
|
215
|
+
// and a queue this class owns can be released by the failure path below, where a listener
|
|
216
|
+
// parked on MapLibre's event could only wait.
|
|
217
|
+
private readonly deferredToStyleLoad: (() => void)[] = [];
|
|
218
|
+
|
|
219
|
+
// Unsubscribes for the listeners the in-flight reload registered. They go through `on`
|
|
220
|
+
// rather than `once` precisely because the interesting ones are those a swap that WORKS
|
|
221
|
+
// never fires: MapLibre keeps a one-shot listener until it fires, so an error listener
|
|
222
|
+
// armed per swap would sit on the map forever, one more for every base map the user tries.
|
|
223
|
+
private reloadListeners: (() => void)[] = [];
|
|
224
|
+
|
|
225
|
+
// Set by dispose(). Read by whenSettled, which has to settle rather than park when the
|
|
226
|
+
// map it was waiting on is gone.
|
|
227
|
+
private disposed_ = false;
|
|
228
|
+
|
|
229
|
+
// Callbacks to run at dispose, for waits that must SETTLE rather than be dropped. The
|
|
230
|
+
// deferred queue above is dropped instead, and the asymmetry is deliberate (see dispose()).
|
|
231
|
+
private readonly disposeHooks = new Set<() => void>();
|
|
232
|
+
|
|
233
|
+
// The container's content box as the renderer last sized the canvas for it, read by
|
|
234
|
+
// whenSettled from its first frame read on, through a listener of the renderer's `resize`.
|
|
235
|
+
// Null while that first read found the canvas at another size: a resize the engine was not
|
|
236
|
+
// there to date, which it takes to be on its way until the renderer's next one.
|
|
237
|
+
private sizedFor: BoxSize | null = null;
|
|
238
|
+
private followsRendererSize = false;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Builds the engine over one renderer. It attaches nothing until a member asks it to.
|
|
242
|
+
*
|
|
243
|
+
* @param map The renderer whose listeners, missing-image resolver and reloads this owns.
|
|
244
|
+
*/
|
|
245
|
+
constructor(private readonly map: MapLibreMap) {}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* on attaches a persistent listener and tracks it so `dispose()` can detach it by
|
|
249
|
+
* reference. The event name is one of MapLibre's, and the handler is typed by the payload
|
|
250
|
+
* MapLibre fires it with. A disposed engine attaches nothing.
|
|
251
|
+
*
|
|
252
|
+
* @param eventType The MapLibre event, such as `"moveend"`, or a layer event such as
|
|
253
|
+
* `"mouseenter"` where `layerId` is given.
|
|
254
|
+
* @param handler Called with the event's own payload.
|
|
255
|
+
* @param layerId The style layer the listener is scoped to; omitted, the listener is
|
|
256
|
+
* map-level.
|
|
257
|
+
* @returns An unsubscribe that detaches this exact listener, so a caller can remove its own
|
|
258
|
+
* without waiting for `dispose()`.
|
|
259
|
+
*/
|
|
260
|
+
on<T extends keyof MapEventType>(
|
|
261
|
+
eventType: T,
|
|
262
|
+
handler: (event: MapEventType[T]) => void,
|
|
263
|
+
): () => void;
|
|
264
|
+
on<T extends keyof MapLayerEventType>(
|
|
265
|
+
eventType: T,
|
|
266
|
+
handler: (event: MapLayerEventType[T]) => void,
|
|
267
|
+
layerId: string,
|
|
268
|
+
): () => void;
|
|
269
|
+
on(eventType: string, handler: Handler, layerId?: string): () => void {
|
|
270
|
+
// The map is gone: a listener attached now could never be detached by `dispose()`.
|
|
271
|
+
if (this.disposed) {
|
|
272
|
+
return () => {};
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
const key = `${eventType}#${this.keySeq++}`;
|
|
276
|
+
this.persistent.set(key, { eventType, handler, layerId });
|
|
277
|
+
|
|
278
|
+
// MapLibre types `on` and `off` by the literal name of each event and the payload that name
|
|
279
|
+
// carries. This registry holds every listener under one erased signature, so the pairing is
|
|
280
|
+
// the caller's, checked where the handler is written, and the casts here and in `detach`
|
|
281
|
+
// are where that erasure meets MapLibre's overloads.
|
|
282
|
+
if (layerId === undefined) {
|
|
283
|
+
this.map.on(eventType as never, handler as never);
|
|
284
|
+
} else {
|
|
285
|
+
this.map.on(eventType as never, layerId, handler as never);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
return () => {
|
|
289
|
+
this.detach(key);
|
|
290
|
+
this.persistent.delete(key);
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* once attaches a listener that runs for the next firing of an event and detaches itself as
|
|
296
|
+
* it does.
|
|
297
|
+
*
|
|
298
|
+
* Tracked as {@link on}'s listeners are, until it fires: an event that never comes would
|
|
299
|
+
* otherwise leave it on the map past `dispose()`, which detaches it by reference with the
|
|
300
|
+
* rest. A disposed engine attaches nothing.
|
|
301
|
+
*
|
|
302
|
+
* @param eventType The MapLibre event to listen for.
|
|
303
|
+
* @param handler Called once, with the event's own arguments.
|
|
304
|
+
* @returns An unsubscribe that detaches the listener before it fires, and does nothing after.
|
|
305
|
+
*/
|
|
306
|
+
once<T extends keyof MapEventType>(
|
|
307
|
+
eventType: T,
|
|
308
|
+
handler: (event: MapEventType[T]) => void,
|
|
309
|
+
): () => void {
|
|
310
|
+
let detach = (): void => {};
|
|
311
|
+
detach = this.on(eventType, (event: MapEventType[T]) => {
|
|
312
|
+
detach();
|
|
313
|
+
handler(event);
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
return detach;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* setMissingImageResolver installs the one callback MapLibre asks for an image the style
|
|
321
|
+
* references and the sprite sheet does not hold, and clears it on `dispose()`.
|
|
322
|
+
*
|
|
323
|
+
* It belongs here because it has a persistent listener's LIFETIME and none of its
|
|
324
|
+
* mechanics. MapLibre 6 reports `styleimagemissing` for notice only and takes the image from
|
|
325
|
+
* `Map#setMissingStyleImageResolver`, a SETTER holding one resolver rather than an event
|
|
326
|
+
* holding a list: there is no reference to hand back to `map.off()`, so teardown clears it
|
|
327
|
+
* instead of detaching it.
|
|
328
|
+
*
|
|
329
|
+
* Like a persistent listener it outlives a base-map switch: the resolver is held on the
|
|
330
|
+
* map, not on the style `setStyle()` replaces. And like one, exactly one owner installs it:
|
|
331
|
+
* a second caller REPLACES the first rather than stacking beside it, which is the
|
|
332
|
+
* difference from `on` that makes routing it through this class worth doing.
|
|
333
|
+
*
|
|
334
|
+
* @param resolver Called with the id of the image the style asks for; it answers by adding
|
|
335
|
+
* that image to the map.
|
|
336
|
+
*/
|
|
337
|
+
setMissingImageResolver(resolver: (id: string) => void | Promise<void>): void {
|
|
338
|
+
// `dispose()` cleared the resolver, and one installed afterwards would never be cleared.
|
|
339
|
+
if (this.disposed) {
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
this.map.setMissingStyleImageResolver(resolver);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* afterStyleLoad runs `fn` once the style is ready, distinguishing three states.
|
|
348
|
+
*
|
|
349
|
+
* The third is the one that is easy to miss and expensive to get wrong:
|
|
350
|
+
*
|
|
351
|
+
* - Loaded, no reload in flight: run immediately.
|
|
352
|
+
* - A `setStyle()` in flight: hold until the incoming style is ready. `isStyleLoaded()`
|
|
353
|
+
* still reports the OLD style as loaded here, so running now would add sources and
|
|
354
|
+
* layers to the style being replaced, which the incoming one then wipes. A swap that
|
|
355
|
+
* fails releases the hold too, rather than parking it forever (see
|
|
356
|
+
* {@link beginStyleReload}).
|
|
357
|
+
* - **The document has not parsed yet**: the genuine wait, and the only one left.
|
|
358
|
+
*
|
|
359
|
+
* **What this asks is whether the style can ACCEPT a source or a layer, not whether the map
|
|
360
|
+
* has finished drawing.** Under MapLibre 6 the two differ, and the distinction is the whole
|
|
361
|
+
* correctness of this method. `map.isStyleLoaded()` is four conditions in one (the document
|
|
362
|
+
* parsed, no pending source updates, every tile manager settled, and the sprite atlas
|
|
363
|
+
* complete), and `addSource` requires only the first.
|
|
364
|
+
*
|
|
365
|
+
* The strong form fails in a way only a real browser shows. Waiting on `idle` OR a `styledata`
|
|
366
|
+
* that finds `isStyleLoaded()` true both fail against a map holding a source whose tiles
|
|
367
|
+
* cannot load: `idle` never arrives at all, and the `styledata` storm ENDS while the style
|
|
368
|
+
* still reports unloaded, with the transition to loaded arriving afterwards announced by
|
|
369
|
+
* nothing. An edge-triggered release cannot observe a level that changes between edges.
|
|
370
|
+
*
|
|
371
|
+
* The stake: `MountayaMap.mount` awaits this and `OverlayRenderer` chains every slot write
|
|
372
|
+
* onto one promise, so ONE such wait would stall every subsequent mount and removal for the
|
|
373
|
+
* life of the map. An overlay, an enrichment or a zone layer added afterwards would silently
|
|
374
|
+
* never appear, with nothing raised anywhere: from
|
|
375
|
+
* `addTileSources([itinerarySource, overlaySource])`, the second source's mount would enter
|
|
376
|
+
* this wait and never leave it. And tiles do fail in production, most quietly when a tile
|
|
377
|
+
* credential is scoped to a different origin and every request 401s.
|
|
378
|
+
*
|
|
379
|
+
* So the condition is tracked as a LEVEL ({@link styleDocumentReady}) rather than sampled at
|
|
380
|
+
* an edge, and the level is the weak, correct one. The race below is only ever reached
|
|
381
|
+
* before the first `style.load` of a map's life, and keeps `idle` and `styledata` beside it
|
|
382
|
+
* so a document that parsed without the one-shot being observed still releases.
|
|
383
|
+
*
|
|
384
|
+
* A disposed engine drops `fn`.
|
|
385
|
+
*
|
|
386
|
+
* @param fn The work to run on a style that takes a source or a layer.
|
|
387
|
+
*/
|
|
388
|
+
afterStyleLoad(fn: () => void): void {
|
|
389
|
+
// Dropped, as the work `dispose()` found held is: it would add to the style of a map that is
|
|
390
|
+
// gone.
|
|
391
|
+
if (this.disposed) {
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
// `isStyleLoaded()` is sufficient for the document being parsed though far from necessary,
|
|
396
|
+
// so it may raise the level and may never lower it. Reading it here rather than in a
|
|
397
|
+
// listener keeps this engine free of any subscription it was not asked for.
|
|
398
|
+
if (this.map.isStyleLoaded() === true) {
|
|
399
|
+
this.styleDocumentReady = true;
|
|
400
|
+
this.styleHasLoaded = true;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
if (!this.styleReloading && this.styleDocumentReady) {
|
|
404
|
+
fn();
|
|
405
|
+
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
if (this.styleReloading) {
|
|
410
|
+
this.deferredToStyleLoad.push(fn);
|
|
411
|
+
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// Registered through `on` rather than `once` because each has to be able to remove the
|
|
416
|
+
// other: a one-shot listener MapLibre keeps until it fires would otherwise sit on the map
|
|
417
|
+
// for every wait that the other path settled.
|
|
418
|
+
let settled = false;
|
|
419
|
+
const detachers: (() => void)[] = [];
|
|
420
|
+
|
|
421
|
+
const release = (): void => {
|
|
422
|
+
if (settled) {
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
settled = true;
|
|
427
|
+
// Whatever released this wait proves the document has parsed, and the level is what
|
|
428
|
+
// spares every later caller from racing for the same fact, which matters because the
|
|
429
|
+
// signals that release it here are edges that may never come again.
|
|
430
|
+
this.styleDocumentReady = true;
|
|
431
|
+
for (const detach of detachers) {
|
|
432
|
+
detach();
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
fn();
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
detachers.push(
|
|
439
|
+
this.on("style.load", () => {
|
|
440
|
+
this.styleHasLoaded = true;
|
|
441
|
+
release();
|
|
442
|
+
}),
|
|
443
|
+
this.on("idle", release),
|
|
444
|
+
this.on("styledata", () => {
|
|
445
|
+
if (this.map.isStyleLoaded() === true) {
|
|
446
|
+
this.styleHasLoaded = true;
|
|
447
|
+
release();
|
|
448
|
+
}
|
|
449
|
+
}),
|
|
450
|
+
);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* whenSettled resolves once the map has finished drawing what it has been asked to draw: any
|
|
455
|
+
* style reload complete, the style itself reporting loaded, and no resize of the canvas on its
|
|
456
|
+
* way.
|
|
457
|
+
*
|
|
458
|
+
* The last is read again in the next animation frame, the frame the reader is shown. MapLibre
|
|
459
|
+
* resizes the canvas from its observer of the container, holds a resize back by a moment after an
|
|
460
|
+
* earlier one, and draws at once when it resizes, between two frames. A page that resizes the
|
|
461
|
+
* container at every frame (an animation, or a parent resizing the iframe the map is in) lays out
|
|
462
|
+
* the next size before that drawing is shown. So a drawing settles the wait only once the next
|
|
463
|
+
* frame still finds no resize on its way, and otherwise the wait goes on to the drawing after it:
|
|
464
|
+
* a caller that frames the view for the canvas it reads settles on the canvas the reader is
|
|
465
|
+
* shown, never on one a resize under way passed through. The read costs every wait over a shown
|
|
466
|
+
* container one frame, a map that has drawn everything included.
|
|
467
|
+
*
|
|
468
|
+
* The frame reads the size alone: a load begun after the drawing is work asked for after the wait
|
|
469
|
+
* was answered. A size the page sets later in that frame (from a `ResizeObserver` callback, or a
|
|
470
|
+
* render committed there) is read by no frame before the wait settles.
|
|
471
|
+
*
|
|
472
|
+
* A resize is on its way while the renderer follows its container (MapLibre's `trackResize`,
|
|
473
|
+
* on by default), the canvas does not hold the container's size, and the container's content
|
|
474
|
+
* box, the box the renderer observes, is not the one it last resized for. A canvas left at
|
|
475
|
+
* another size with no resize to come (`trackResize: false`, or padding that changed alone) is
|
|
476
|
+
* the size the reader is shown, and holds no wait. A container with no extent, or a page that
|
|
477
|
+
* is hidden and runs no frame, has no frame to read, and its wait settles on the drawing.
|
|
478
|
+
*
|
|
479
|
+
* The engine dates the renderer's resizes from the first wait on, since it attaches nothing
|
|
480
|
+
* until a member asks. A first wait that finds the canvas at another size than its container
|
|
481
|
+
* cannot tell a resize on its way from padding that changed alone, and takes it to be a resize:
|
|
482
|
+
* padding changed alone after the renderer's first resize and before the first wait holds every
|
|
483
|
+
* wait until the renderer next resizes the canvas, which any change of the container's content
|
|
484
|
+
* box brings. Dating the resizes from construction would close it, at the cost of a listener on
|
|
485
|
+
* every map whether or not anything ever waits on it.
|
|
486
|
+
*
|
|
487
|
+
* It lives here rather than beside a caller because the reload flag is the only honest
|
|
488
|
+
* answer to "is the map ready", and it is this class that holds it.
|
|
489
|
+
*
|
|
490
|
+
* Two hazards, both of which park a naive implementation forever:
|
|
491
|
+
*
|
|
492
|
+
* - **Check-then-register is not atomic.** The deferred queue drains synchronously inside
|
|
493
|
+
* the `style.load` handler, and `map.loaded()` is still false at that instant. So a wait
|
|
494
|
+
* that registered for `idle` there would be listening for an event the map may have
|
|
495
|
+
* already emitted, or may never emit, if the new style has nothing left to fetch. The
|
|
496
|
+
* microtask re-read closes it: by then MapLibre has finished the frame, and `loaded()`
|
|
497
|
+
* answers for the style that actually arrived. The `data` listener is the same re-read on
|
|
498
|
+
* a slower path, for a style that settles only after a source responds.
|
|
499
|
+
* - **Disposal.** A wait held behind a reload when the map is torn down would otherwise
|
|
500
|
+
* never settle in either direction. It resolves instead, as the engine is disposed or as the
|
|
501
|
+
* renderer is removed, whichever comes first: the caller asked whether the map
|
|
502
|
+
* had finished drawing, and a map that no longer exists is not going to draw anything
|
|
503
|
+
* else. Rejecting would turn every un-awaited `void map.events.whenSettled().then(…)` into
|
|
504
|
+
* an unhandled rejection at teardown, which is a worse answer to the same question.
|
|
505
|
+
*
|
|
506
|
+
* @returns A promise that never rejects.
|
|
507
|
+
*/
|
|
508
|
+
whenSettled(): Promise<void> {
|
|
509
|
+
if (this.disposed) {
|
|
510
|
+
return Promise.resolve();
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
return new Promise<void>((resolve) => {
|
|
514
|
+
let settled = false;
|
|
515
|
+
const detachers: (() => void)[] = [];
|
|
516
|
+
|
|
517
|
+
// The frame asked for to read the layout in, while one is: its window and its handle.
|
|
518
|
+
let frame: { handle: number; view: Window } | null = null;
|
|
519
|
+
|
|
520
|
+
const finish = () => {
|
|
521
|
+
if (settled) {
|
|
522
|
+
return;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
settled = true;
|
|
526
|
+
if (frame !== null) {
|
|
527
|
+
frame.view.cancelAnimationFrame(frame.handle);
|
|
528
|
+
frame = null;
|
|
529
|
+
}
|
|
530
|
+
for (const detach of detachers.splice(0)) {
|
|
531
|
+
detach();
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
this.disposeHooks.delete(finish);
|
|
535
|
+
resolve();
|
|
536
|
+
};
|
|
537
|
+
|
|
538
|
+
this.disposeHooks.add(finish);
|
|
539
|
+
// A renderer another owner removes never goes idle again, and its removal disposes no
|
|
540
|
+
// engine but the owner's.
|
|
541
|
+
detachers.push(this.on("remove", finish));
|
|
542
|
+
|
|
543
|
+
// A drawing with no resize on its way settles the wait once the frame the page lays out
|
|
544
|
+
// next still finds none. One read at a time: a drawing reported while it waits is read in
|
|
545
|
+
// the same frame.
|
|
546
|
+
const settleInNextFrame = () => {
|
|
547
|
+
if (settled || frame !== null) {
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
const view = laidOutView(this.map);
|
|
552
|
+
if (view === null) {
|
|
553
|
+
finish();
|
|
554
|
+
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
this.followRendererSize();
|
|
559
|
+
if (this.resizeOnItsWay()) {
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
const handle = view.requestAnimationFrame(() => {
|
|
564
|
+
frame = null;
|
|
565
|
+
if (!this.resizeOnItsWay()) {
|
|
566
|
+
finish();
|
|
567
|
+
}
|
|
568
|
+
});
|
|
569
|
+
frame = { handle, view };
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
// Resolves if the map is already there. Called once on entry and again on every
|
|
573
|
+
// re-read; it registers nothing but the frame its layout is read in.
|
|
574
|
+
const check = () => {
|
|
575
|
+
if (settled) {
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
if (this.disposed) {
|
|
580
|
+
finish();
|
|
581
|
+
} else if (this.map.loaded()) {
|
|
582
|
+
settleInNextFrame();
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
|
|
586
|
+
const watch = () => {
|
|
587
|
+
check();
|
|
588
|
+
if (settled) {
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
detachers.push(this.on("idle", settleInNextFrame));
|
|
593
|
+
detachers.push(this.on("data", check));
|
|
594
|
+
queueMicrotask(check);
|
|
595
|
+
};
|
|
596
|
+
|
|
597
|
+
if (this.isStyleReloading()) {
|
|
598
|
+
this.afterStyleLoad(watch);
|
|
599
|
+
} else {
|
|
600
|
+
watch();
|
|
601
|
+
}
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* followRendererSize starts keeping the content box the renderer last resized the canvas for,
|
|
607
|
+
* once per engine: read now when the canvas holds the container's size, and at every `resize`
|
|
608
|
+
* the renderer fires after it has resized the canvas.
|
|
609
|
+
*/
|
|
610
|
+
private followRendererSize(): void {
|
|
611
|
+
if (this.followsRendererSize) {
|
|
612
|
+
return;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
this.followsRendererSize = true;
|
|
616
|
+
if (holdsContainerSize(this.map)) {
|
|
617
|
+
this.sizedFor = contentBoxOf(this.map.getContainer());
|
|
618
|
+
}
|
|
619
|
+
this.on("resize", () => {
|
|
620
|
+
this.sizedFor = contentBoxOf(this.map.getContainer());
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* resizeOnItsWay reports whether the renderer has a resize of the canvas still to make: it
|
|
626
|
+
* follows its container, the canvas does not hold the container's size, and the container's
|
|
627
|
+
* content box is not the one the renderer last resized for.
|
|
628
|
+
*
|
|
629
|
+
* `_trackResize` is MapLibre's own record of its `trackResize` option, which it publishes no
|
|
630
|
+
* accessor for (`rendererPremises.test.ts` holds the field).
|
|
631
|
+
*/
|
|
632
|
+
private resizeOnItsWay(): boolean {
|
|
633
|
+
if (!this.map._trackResize || holdsContainerSize(this.map)) {
|
|
634
|
+
return false;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
const { sizedFor } = this;
|
|
638
|
+
if (sizedFor === null) {
|
|
639
|
+
return true;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
const now = contentBoxOf(this.map.getContainer());
|
|
643
|
+
|
|
644
|
+
return now.width !== sizedFor.width || now.height !== sizedFor.height;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* isStyleReloading reports whether a `setStyle()` is in flight.
|
|
649
|
+
*
|
|
650
|
+
* It distinguishes a base-map switch (where work must defer to the new style) from a
|
|
651
|
+
* plain source load, which also drops `isStyleLoaded()` to false but needs no style-load
|
|
652
|
+
* deferral. A readiness wait reads it so it defers only across a real reload, rather than
|
|
653
|
+
* parking on a `style.load` that a source load never re-fires.
|
|
654
|
+
*/
|
|
655
|
+
isStyleReloading(): boolean {
|
|
656
|
+
return this.styleReloading;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* beginStyleReload marks that a `setStyle()` is in flight so `afterStyleLoad` holds work
|
|
661
|
+
* for the NEW style. Call it immediately before `map.setStyle()`.
|
|
662
|
+
*
|
|
663
|
+
* Two signals end the reload, and the second one is the reason this is not four lines:
|
|
664
|
+
*
|
|
665
|
+
* - The incoming style's `style.load`: the ordinary path.
|
|
666
|
+
* - An `error` during this reload followed by the next `idle`: the failure path. A swap MapLibre
|
|
667
|
+
* cannot complete (an unreachable style document) fires no `style.load` at all, so without this
|
|
668
|
+
* the flag stays raised and every later readiness wait parks forever. The style on the map when
|
|
669
|
+
* that happens is the one that was already there, and it is loaded, so releasing the held work
|
|
670
|
+
* against it is safe: each layer re-resolves its own rank anchor on the way back in.
|
|
671
|
+
*
|
|
672
|
+
* Neither half of the failure pair releases on its own. `idle` fires whenever the map
|
|
673
|
+
* settles, including well before a slow style arrives; `error` fires for an unrelated 404
|
|
674
|
+
* on a tile while a perfectly good swap is in flight. Only an error belonging to THIS
|
|
675
|
+
* reload arms the idle that follows it, and the sequence number is what keeps a late
|
|
676
|
+
* signal from a reload that is already over out of the one that replaced it.
|
|
677
|
+
*
|
|
678
|
+
* Each error also asks the renderer for a frame. MapLibre reports `idle` from the end of a
|
|
679
|
+
* frame alone, and draws none of its own after a document it could not fetch or a tile the
|
|
680
|
+
* server failed on, so the idle that follows such an error would otherwise wait for whatever
|
|
681
|
+
* next asks for a frame: the reader moving the map. A fake of the renderer that answers no
|
|
682
|
+
* `triggerRepaint` is asked for none.
|
|
683
|
+
*
|
|
684
|
+
* Over a renderer that holds no loaded style (none has loaded yet, or the one that had is
|
|
685
|
+
* gone, {@link noteStyleDropped}), an error of the reload ends it at once. There is no style to
|
|
686
|
+
* protect, and MapLibre draws no frame over a style that never loaded, so the idle would never
|
|
687
|
+
* come. A sprite or a glyph that fails for the incoming style is reported after its
|
|
688
|
+
* `style.load`, which has already ended the reload.
|
|
689
|
+
*
|
|
690
|
+
* @param options `endsOnFailure: false` announces a reload that only its own `style.load` or
|
|
691
|
+
* {@link cancelStyleReload} ends: one held open for a style that is not on its way yet, such
|
|
692
|
+
* as a base-map switch that waits for a lost WebGL context to return, where an error and an
|
|
693
|
+
* idle say nothing of the style awaited. Defaults to `true`.
|
|
694
|
+
*/
|
|
695
|
+
beginStyleReload(options: { readonly endsOnFailure?: boolean | undefined } = {}): void {
|
|
696
|
+
if (this.disposed) {
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
const hadStyle = this.styleHasLoaded || this.map.isStyleLoaded() === true;
|
|
701
|
+
|
|
702
|
+
// A reload announced while one is still open supersedes it: its listeners can only
|
|
703
|
+
// answer for a sequence number that is no longer current, so they go now rather than
|
|
704
|
+
// waiting for an event that would find them stale.
|
|
705
|
+
this.dropReloadListeners();
|
|
706
|
+
|
|
707
|
+
this.styleReloading = true;
|
|
708
|
+
// The incoming style has not parsed yet, and the outgoing one is about to be discarded, so
|
|
709
|
+
// the level drops until the swap settles either way.
|
|
710
|
+
this.styleDocumentReady = false;
|
|
711
|
+
const seq = ++this.reloadSeq;
|
|
712
|
+
|
|
713
|
+
this.watchReload("style.load", () => {
|
|
714
|
+
this.styleHasLoaded = true;
|
|
715
|
+
this.endStyleReload(seq);
|
|
716
|
+
});
|
|
717
|
+
|
|
718
|
+
if (options.endsOnFailure === false) {
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
let armed = false;
|
|
723
|
+
this.watchReload("error", () => {
|
|
724
|
+
if (seq !== this.reloadSeq) {
|
|
725
|
+
return;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
if (!hadStyle) {
|
|
729
|
+
this.endStyleReload(seq);
|
|
730
|
+
|
|
731
|
+
return;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
if (!armed) {
|
|
735
|
+
armed = true;
|
|
736
|
+
this.watchReload("idle", () => {
|
|
737
|
+
this.endStyleReload(seq);
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
// A fake of the renderer that answers no `triggerRepaint` draws no frame to ask for, and
|
|
742
|
+
// reports its own `idle`.
|
|
743
|
+
if (typeof this.map.triggerRepaint === "function") {
|
|
744
|
+
this.map.triggerRepaint();
|
|
745
|
+
}
|
|
746
|
+
});
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* noteStyleDropped records that the renderer holds no loaded style any more, so the next reload
|
|
751
|
+
* ends on its first error ({@link beginStyleReload}) until a style loads again.
|
|
752
|
+
*
|
|
753
|
+
* MapLibre says nothing as a style goes without a load to follow, as one dropped with a lost
|
|
754
|
+
* WebGL context and not set again as the context returns does, so the switch that sees it go
|
|
755
|
+
* says so here.
|
|
756
|
+
*/
|
|
757
|
+
noteStyleDropped(): void {
|
|
758
|
+
this.styleHasLoaded = false;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
/**
|
|
762
|
+
* cancelStyleReload ends a reload that never started, so nothing waits on a style that is
|
|
763
|
+
* not coming.
|
|
764
|
+
*
|
|
765
|
+
* The synchronous half of the failure path above: `map.setStyle()` can throw before it
|
|
766
|
+
* fires anything at all (a style document it rejects outright), and the reload was
|
|
767
|
+
* announced a statement earlier. The map is left showing the style it already had, so the
|
|
768
|
+
* held work runs against that, exactly as the error-then-idle path does.
|
|
769
|
+
*/
|
|
770
|
+
cancelStyleReload(): void {
|
|
771
|
+
this.endStyleReload(this.reloadSeq);
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* dispose detaches every persistent listener by calling `map.off()` with the original
|
|
776
|
+
* reference, then forgets them.
|
|
777
|
+
*
|
|
778
|
+
* This is the only point listeners come off. A base-map switch leaves them attached, so
|
|
779
|
+
* teardown is deterministic here rather than left to `map.remove()`. A `once()` listener
|
|
780
|
+
* still waiting for its event is detached with the rest.
|
|
781
|
+
*
|
|
782
|
+
* Every call after it is inert: {@link on} and {@link once} attach nothing and hand back an
|
|
783
|
+
* unsubscribe that does nothing, {@link afterStyleLoad} drops the work it is handed,
|
|
784
|
+
* {@link setMissingImageResolver} installs nothing and a reload is neither announced nor
|
|
785
|
+
* cancelled. {@link whenSettled} resolves at once.
|
|
786
|
+
*/
|
|
787
|
+
dispose(): void {
|
|
788
|
+
this.disposed_ = true;
|
|
789
|
+
|
|
790
|
+
// Waits that must SETTLE. These run first, while their own detachers still resolve
|
|
791
|
+
// against a populated listener map, and each removes itself from the set as it goes.
|
|
792
|
+
for (const hook of [...this.disposeHooks]) {
|
|
793
|
+
hook();
|
|
794
|
+
}
|
|
795
|
+
this.disposeHooks.clear();
|
|
796
|
+
|
|
797
|
+
for (const key of this.persistent.keys()) {
|
|
798
|
+
this.detach(key);
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
this.persistent.clear();
|
|
802
|
+
// The missing-image resolver is a setter rather than a listener, so it is not in the map
|
|
803
|
+
// above and there is no reference to hand to `map.off()`. Clearing it is the same
|
|
804
|
+
// teardown the loop performs for everything that is, and it matters for the same
|
|
805
|
+
// reason: the resolver closes over the renderer that bakes the sprites, so leaving it
|
|
806
|
+
// installed keeps that renderer reachable from a map nobody is looking at.
|
|
807
|
+
this.map.setMissingStyleImageResolver(null);
|
|
808
|
+
// Work held for a style that will now never load, and the unsubscribes for listeners
|
|
809
|
+
// just detached. Dropping both is the same rule the listeners follow: nothing outlives
|
|
810
|
+
// the map it was queued against.
|
|
811
|
+
//
|
|
812
|
+
// The asymmetry with the dispose hooks above is deliberate. A deferred callback wants to
|
|
813
|
+
// ADD something to the style that is arriving, and running it against a map being torn
|
|
814
|
+
// down is worse than not running it. A promise-shaped wait wants an ANSWER, and never
|
|
815
|
+
// giving one strands the caller, so those settle and these are dropped.
|
|
816
|
+
this.deferredToStyleLoad.length = 0;
|
|
817
|
+
this.reloadListeners.length = 0;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
/** The number of listeners currently held. For diagnostics and for leak tests. */
|
|
821
|
+
get size(): number {
|
|
822
|
+
return this.persistent.size;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* Whether the map this engine belongs to has been torn down.
|
|
827
|
+
*
|
|
828
|
+
* Read by work that resumes after an await: {@link whenSettled} settles on dispose rather
|
|
829
|
+
* than stranding its caller, so a continuation that goes on to WRITE to the map has to ask
|
|
830
|
+
* whether there is still one to write to. Every member of the engine reads this, so an engine
|
|
831
|
+
* that answers it otherwise (a scope over a map another owner disposes) is inert from the
|
|
832
|
+
* moment it answers true.
|
|
833
|
+
*/
|
|
834
|
+
get disposed(): boolean {
|
|
835
|
+
return this.disposed_;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
* endStyleReload lowers the flag for one reload and runs what was held behind it.
|
|
840
|
+
*
|
|
841
|
+
* Idempotent, and current-reload only. Both matter: an incidental error arms an idle that
|
|
842
|
+
* may land after the reload has already ended normally, and a reload that failed can see
|
|
843
|
+
* its idle arrive after a newer `setStyle` has begun, where releasing would hand the
|
|
844
|
+
* queued work to the style being torn down.
|
|
845
|
+
*
|
|
846
|
+
* The flag drops BEFORE the queue drains, so work that re-enters `afterStyleLoad` runs
|
|
847
|
+
* rather than deferring a second time.
|
|
848
|
+
*/
|
|
849
|
+
private endStyleReload(seq: number): void {
|
|
850
|
+
if (seq !== this.reloadSeq || !this.styleReloading) {
|
|
851
|
+
return;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
this.styleReloading = false;
|
|
855
|
+
// Raised on BOTH paths this ends on. The success path has just seen `style.load`; the
|
|
856
|
+
// failure path leaves the map showing the style it already had, which is parsed. Either
|
|
857
|
+
// way the held work below is about to run against a style that can take it.
|
|
858
|
+
this.styleDocumentReady = true;
|
|
859
|
+
this.dropReloadListeners();
|
|
860
|
+
|
|
861
|
+
// Each piece of held work runs whatever the one before it did. This drain is called from
|
|
862
|
+
// inside MapLibre's own dispatch, and the queue holds the waits of every mount beside a
|
|
863
|
+
// caller's own callbacks, so one that throws is surfaced apart and the rest still run.
|
|
864
|
+
for (const fn of this.deferredToStyleLoad.splice(0)) {
|
|
865
|
+
try {
|
|
866
|
+
fn();
|
|
867
|
+
} catch (fault) {
|
|
868
|
+
surfaceFault(fault);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
/** watchReload attaches a listener that lives only as long as the reload that armed it. */
|
|
874
|
+
private watchReload(eventType: "error" | "idle" | "style.load", handler: () => void): void {
|
|
875
|
+
this.reloadListeners.push(this.on(eventType, handler));
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
/** dropReloadListeners detaches everything the reload sequence attached. */
|
|
879
|
+
private dropReloadListeners(): void {
|
|
880
|
+
for (const unsubscribe of this.reloadListeners.splice(0)) {
|
|
881
|
+
unsubscribe();
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
/** detach calls map.off() for one tracked listener, matching the form it was attached with. */
|
|
886
|
+
private detach(key: string): void {
|
|
887
|
+
const listener = this.persistent.get(key);
|
|
888
|
+
if (listener === undefined) {
|
|
889
|
+
return;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
if (listener.layerId === undefined) {
|
|
893
|
+
this.map.off(listener.eventType as never, listener.handler as never);
|
|
894
|
+
} else {
|
|
895
|
+
this.map.off(listener.eventType as never, listener.layerId, listener.handler as never);
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* mapEventEngineOf answers the event engine behind a map's `events`, for the package's own clients
|
|
902
|
+
* that build a scope of their own over it (`MapEventScopeEngine`), whose listeners and
|
|
903
|
+
* missing-image resolver they tear down as they are disposed, leaving the map's.
|
|
904
|
+
*
|
|
905
|
+
* A map publishes its engine as {@link MapEvents} alone, since a reload announced from outside
|
|
906
|
+
* would hold every drawing of the map. A double that stands in for a map holds an engine of its
|
|
907
|
+
* own, which is answered the same way. It is declared here, beside the engine, so a client reads
|
|
908
|
+
* it without loading the map that holds the engine.
|
|
909
|
+
*
|
|
910
|
+
* @param map The map, or a double of it.
|
|
911
|
+
* @returns The engine its `events` is.
|
|
912
|
+
* @throws {MountayaElementsError} When `events` is no `MapEventEngine`.
|
|
913
|
+
*/
|
|
914
|
+
export const mapEventEngineOf = (map: { readonly events: MapEvents }): MapEventEngine => {
|
|
915
|
+
const { events } = map;
|
|
916
|
+
if (events instanceof MapEventEngine) {
|
|
917
|
+
return events;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
throw new MountayaElementsError(
|
|
921
|
+
"The map's events are no MapEventEngine, so a client cannot share them. Hand the client a " +
|
|
922
|
+
"MountayaMap, or a double built by createMountayaMapDouble.",
|
|
923
|
+
);
|
|
924
|
+
};
|
|
925
|
+
|
|
926
|
+
/**
|
|
927
|
+
* The renderer's failures a map tells to nobody, by the value the renderer reported each with: a
|
|
928
|
+
* refusal of a credential the map has replaced since (`compose/rules/accessRefusal.ts`).
|
|
929
|
+
*
|
|
930
|
+
* A module-private table rather than a member of the engine, so the published engine names nothing
|
|
931
|
+
* of it, declared beside the engine for the reason {@link mapEventEngineOf} is.
|
|
932
|
+
*/
|
|
933
|
+
const failuresToldToNobody = new WeakSet<object>();
|
|
934
|
+
|
|
935
|
+
/**
|
|
936
|
+
* tellNobodyOf records that a map tells nobody of a failure the renderer reported, so a client
|
|
937
|
+
* over the map that hears the same failure tells nobody of it either.
|
|
938
|
+
*
|
|
939
|
+
* The renderer hands every listener of its `error` stream the one failure, and the map's own
|
|
940
|
+
* listener is attached as the map is built, ahead of any client's, so the map records a failure
|
|
941
|
+
* before a client reads it.
|
|
942
|
+
*
|
|
943
|
+
* @param failure The value the renderer reported the failure with, `ErrorEvent.error`. A refusal
|
|
944
|
+
* carries its status as a member, so it is an object; a value that is no object is recorded by
|
|
945
|
+
* nobody, and told.
|
|
946
|
+
*/
|
|
947
|
+
export const tellNobodyOf = (failure: unknown): void => {
|
|
948
|
+
if (typeof failure === "object" && failure !== null) {
|
|
949
|
+
failuresToldToNobody.add(failure);
|
|
950
|
+
}
|
|
951
|
+
};
|
|
952
|
+
|
|
953
|
+
/**
|
|
954
|
+
* isToldToNobody answers whether a map tells nobody of a failure the renderer reported
|
|
955
|
+
* ({@link tellNobodyOf}).
|
|
956
|
+
*
|
|
957
|
+
* @param failure The value the renderer reported the failure with, of any shape.
|
|
958
|
+
* @returns Whether the map tells nobody of it: false for every failure the map tells, and for a
|
|
959
|
+
* value that is no object.
|
|
960
|
+
*/
|
|
961
|
+
export const isToldToNobody = (failure: unknown): boolean =>
|
|
962
|
+
typeof failure === "object" && failure !== null && failuresToldToNobody.has(failure);
|