@mapmap/maps 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +109 -6
- package/dist/chunk-CH53LJR7.js +156 -0
- package/dist/chunk-CH53LJR7.js.map +1 -0
- package/dist/direction-icons.js +1 -154
- package/dist/direction-icons.js.map +1 -1
- package/dist/index.d.ts +584 -12
- package/dist/index.js +567 -25
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import maplibregl, { CustomLayerInterface, Map, StyleSpecification, MapOptions, ExpressionSpecification } from 'maplibre-gl';
|
|
2
|
+
export { DirectionIconName, DirectionIconStep, directionIconSvg, directionIcons, iconNameForManeuver, iconNameForStep } from './direction-icons.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Shared public types for @mapmap/maps.
|
|
@@ -280,7 +281,7 @@ interface LogoOptions {
|
|
|
280
281
|
* line-art route mark plus the dark wordmark — over a white halo stroke
|
|
281
282
|
* so it stays legible on any base map.
|
|
282
283
|
*/
|
|
283
|
-
declare const LOGO_SVG: string;
|
|
284
|
+
declare const LOGO_SVG = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"85\" height=\"20\" viewBox=\"0 0 156 37\" fill=\"none\" role=\"img\" aria-label=\"MapMap\"><g stroke=\"#ffffff\" stroke-linejoin=\"round\" stroke-linecap=\"round\"><path d=\"M138.576 33.2887V11.4951H142.24V14.1161H142.456C142.649 13.7308 142.92 13.3215 143.269 12.8881C143.619 12.4479 144.093 12.0729 144.69 11.7634C145.287 11.4469 146.048 11.2887 146.975 11.2887C148.196 11.2887 149.297 11.6017 150.279 12.2277C151.267 12.8469 152.049 13.7652 152.625 14.9829C153.209 16.1936 153.5 17.6796 153.5 19.4407C153.5 21.1811 153.215 22.6602 152.646 23.8778C152.076 25.0955 151.301 26.0242 150.32 26.6639C149.339 27.3037 148.227 27.6236 146.985 27.6236C146.079 27.6236 145.328 27.4722 144.731 27.1696C144.134 26.8669 143.654 26.5023 143.29 26.0757C142.933 25.6424 142.655 25.233 142.456 24.8478H142.302V33.2887H138.576ZM142.23 19.42C142.23 20.445 142.374 21.3428 142.662 22.1133C142.957 22.8838 143.379 23.4857 143.928 23.9191C144.484 24.3456 145.156 24.5589 145.946 24.5589C146.769 24.5589 147.458 24.3387 148.014 23.8985C148.57 23.4513 148.989 22.8425 149.27 22.072C149.558 21.2946 149.702 20.4106 149.702 19.42C149.702 18.4363 149.562 17.5626 149.28 16.799C148.999 16.0354 148.58 15.4369 148.025 15.0035C147.469 14.5701 146.776 14.3534 145.946 14.3534C145.15 14.3534 144.474 14.5632 143.918 14.9829C143.362 15.4025 142.94 15.9907 142.652 16.7474C142.371 17.5041 142.23 18.395 142.23 19.42Z\" fill=\"#ffffff\" stroke-width=\"3\" paint-order=\"stroke\"/><path d=\"M127.352 27.6649C126.35 27.6649 125.448 27.486 124.645 27.1283C123.849 26.7637 123.218 26.2271 122.751 25.5185C122.291 24.81 122.062 23.9363 122.062 22.8975C122.062 22.0032 122.226 21.2637 122.556 20.6789C122.885 20.0942 123.334 19.6264 123.904 19.2756C124.473 18.9247 125.115 18.6599 125.829 18.481C126.549 18.2953 127.293 18.1611 128.062 18.0786C128.988 17.9823 129.74 17.8963 130.316 17.8206C130.892 17.738 131.311 17.6142 131.572 17.4491C131.839 17.2771 131.973 17.0123 131.973 16.6545V16.5926C131.973 15.8153 131.743 15.2133 131.284 14.7868C130.824 14.3603 130.162 14.147 129.297 14.147C128.384 14.147 127.661 14.3465 127.125 14.7455C126.597 15.1445 126.24 15.6158 126.055 16.1592L122.576 15.6639C122.851 14.7008 123.303 13.896 123.935 13.2493C124.566 12.5958 125.338 12.1073 126.251 11.784C127.163 11.4538 128.172 11.2887 129.276 11.2887C130.038 11.2887 130.796 11.3781 131.551 11.557C132.306 11.7359 132.995 12.0317 133.62 12.4444C134.244 12.8503 134.745 13.4041 135.123 14.1058C135.507 14.8075 135.699 15.6846 135.699 16.7371V27.345H132.117V25.1677H131.994C131.767 25.608 131.448 26.0207 131.036 26.406C130.632 26.7843 130.12 27.0904 129.503 27.3243C128.892 27.5514 128.175 27.6649 127.352 27.6649ZM128.319 24.92C129.067 24.92 129.716 24.7721 130.265 24.4763C130.813 24.1736 131.235 23.7746 131.531 23.2793C131.832 22.784 131.983 22.244 131.983 21.6592V19.7915C131.867 19.8878 131.668 19.9773 131.386 20.0598C131.112 20.1424 130.803 20.2146 130.46 20.2765C130.117 20.3384 129.777 20.3934 129.441 20.4416C129.105 20.4898 128.813 20.531 128.566 20.5654C128.011 20.6411 127.513 20.7649 127.074 20.9369C126.635 21.1089 126.288 21.3497 126.034 21.6592C125.781 21.9619 125.654 22.354 125.654 22.8356C125.654 23.5235 125.904 24.0429 126.405 24.3938C126.906 24.7446 127.544 24.92 128.319 24.92Z\" fill=\"#ffffff\" stroke-width=\"3\" paint-order=\"stroke\"/><path d=\"M97.6602 27.345V11.4951H101.221V14.1883H101.407C101.736 13.2803 102.281 12.5717 103.043 12.0626C103.805 11.5467 104.714 11.2887 105.771 11.2887C106.841 11.2887 107.743 11.5501 108.477 12.0729C109.219 12.5889 109.74 13.294 110.042 14.1883H110.207C110.557 13.3078 111.147 12.6061 111.977 12.0833C112.814 11.5535 113.805 11.2887 114.951 11.2887C116.406 11.2887 117.593 11.7496 118.513 12.6714C119.432 13.5933 119.892 14.9382 119.892 16.7061V27.345H116.156V17.284C116.156 16.3003 115.895 15.5814 115.373 15.1273C114.852 14.6664 114.214 14.436 113.459 14.436C112.56 14.436 111.857 14.718 111.349 15.2821C110.848 15.8394 110.598 16.5651 110.598 17.4594V27.345H106.944V17.1292C106.944 16.3106 106.697 15.6571 106.203 15.1686C105.716 14.6802 105.078 14.436 104.288 14.436C103.753 14.436 103.266 14.5736 102.827 14.8487C102.388 15.117 102.038 15.4988 101.777 15.9941C101.516 16.4826 101.386 17.0535 101.386 17.7071V27.345H97.6602Z\" fill=\"#ffffff\" stroke-width=\"3\" paint-order=\"stroke\"/><path d=\"M80.416 33.2887V11.4951H84.0801V14.1161H84.2962C84.4884 13.7308 84.7594 13.3215 85.1093 12.8881C85.4593 12.4479 85.9327 12.0729 86.5297 11.7634C87.1267 11.4469 87.8883 11.2887 88.8146 11.2887C90.036 11.2887 91.1373 11.6017 92.1185 12.2277C93.1065 12.8469 93.8888 13.7652 94.4651 14.9829C95.0484 16.1936 95.34 17.6796 95.34 19.4407C95.34 21.1811 95.0552 22.6602 94.4857 23.8778C93.9162 25.0955 93.1408 26.0242 92.1596 26.6639C91.1784 27.3037 90.0668 27.6236 88.8249 27.6236C87.9192 27.6236 87.1678 27.4722 86.5709 27.1696C85.9739 26.8669 85.4936 26.5023 85.1299 26.0757C84.7731 25.6424 84.4952 25.233 84.2962 24.8478H84.1419V33.2887H80.416ZM84.0698 19.42C84.0698 20.445 84.2139 21.3428 84.5021 22.1133C84.7971 22.8838 85.2191 23.4857 85.7681 23.9191C86.3238 24.3456 86.9963 24.5589 87.7854 24.5589C88.6088 24.5589 89.2983 24.3387 89.8541 23.8985C90.4099 23.4513 90.8285 22.8425 91.1098 22.072C91.398 21.2946 91.5421 20.4106 91.5421 19.42C91.5421 18.4363 91.4014 17.5626 91.1201 16.799C90.8388 16.0354 90.4202 15.4369 89.8644 15.0035C89.3086 14.5701 88.6156 14.3534 87.7854 14.3534C86.9894 14.3534 86.3136 14.5632 85.7578 14.9829C85.202 15.4025 84.78 15.9907 84.4918 16.7474C84.2105 17.5041 84.0698 18.395 84.0698 19.42Z\" fill=\"#ffffff\" stroke-width=\"3\" paint-order=\"stroke\"/><path d=\"M69.1921 27.6649C68.1904 27.6649 67.2881 27.486 66.4852 27.1283C65.6893 26.7637 65.058 26.2271 64.5914 25.5185C64.1317 24.81 63.9019 23.9363 63.9019 22.8975C63.9019 22.0032 64.0665 21.2637 64.3959 20.6789C64.7252 20.0942 65.1747 19.6264 65.7442 19.2756C66.3137 18.9247 66.9553 18.6599 67.6689 18.481C68.3893 18.2953 69.1338 18.1611 69.9023 18.0786C70.8286 17.9823 71.58 17.8963 72.1564 17.8206C72.7327 17.738 73.1513 17.6142 73.412 17.4491C73.6796 17.2771 73.8134 17.0123 73.8134 16.6545V16.5926C73.8134 15.8153 73.5836 15.2133 73.1238 14.7868C72.6641 14.3603 72.002 14.147 71.1374 14.147C70.2248 14.147 69.5009 14.3465 68.9657 14.7455C68.4374 15.1445 68.0806 15.6158 67.8953 16.1592L64.4165 15.6639C64.6909 14.7008 65.1438 13.896 65.7751 13.2493C66.4063 12.5958 67.1783 12.1073 68.0909 11.784C69.0034 11.4538 70.0121 11.2887 71.1168 11.2887C71.8785 11.2887 72.6367 11.3781 73.3914 11.557C74.1462 11.7359 74.8358 12.0317 75.4602 12.4444C76.0846 12.8503 76.5855 13.4041 76.9629 14.1058C77.3471 14.8075 77.5393 15.6846 77.5393 16.7371V27.345H73.9575V25.1677H73.834C73.6076 25.608 73.2885 26.0207 72.8768 26.406C72.472 26.7843 71.9608 27.0904 71.3433 27.3243C70.7326 27.5514 70.0155 27.6649 69.1921 27.6649ZM70.1596 24.92C70.9075 24.92 71.556 24.7721 72.1049 24.4763C72.6538 24.1736 73.0758 23.7746 73.3709 23.2793C73.6728 22.784 73.8237 22.244 73.8237 21.6592V19.7915C73.7071 19.8878 73.5081 19.9773 73.2268 20.0598C72.9523 20.1424 72.6435 20.2146 72.3004 20.2765C71.9574 20.3384 71.6177 20.3934 71.2815 20.4416C70.9453 20.4898 70.6537 20.531 70.4066 20.5654C69.8509 20.6411 69.3534 20.7649 68.9143 20.9369C68.4751 21.1089 68.1286 21.3497 67.8747 21.6592C67.6208 21.9619 67.4939 22.354 67.4939 22.8356C67.4939 23.5235 67.7443 24.0429 68.2452 24.3938C68.7461 24.7446 69.3843 24.92 70.1596 24.92Z\" fill=\"#ffffff\" stroke-width=\"3\" paint-order=\"stroke\"/><path d=\"M39.5 27.345V11.4951H43.0612V14.1883H43.2464C43.5758 13.2803 44.1213 12.5717 44.8829 12.0626C45.6446 11.5467 46.5537 11.2887 47.6104 11.2887C48.6808 11.2887 49.5831 11.5501 50.3173 12.0729C51.0584 12.5889 51.5798 13.294 51.8817 14.1883H52.0464C52.3964 13.3078 52.9865 12.6061 53.8167 12.0833C54.6538 11.5535 55.6453 11.2887 56.7912 11.2887C58.2459 11.2887 59.4329 11.7496 60.3524 12.6714C61.2718 13.5933 61.7316 14.9382 61.7316 16.7061V27.345H57.9954V17.284C57.9954 16.3003 57.7347 15.5814 57.2132 15.1273C56.6917 14.6664 56.0536 14.436 55.2988 14.436C54.3999 14.436 53.6966 14.718 53.1889 15.2821C52.688 15.8394 52.4375 16.5651 52.4375 17.4594V27.345H48.7837V17.1292C48.7837 16.3106 48.5367 15.6571 48.0427 15.1686C47.5555 14.6802 46.9174 14.436 46.1283 14.436C45.5931 14.436 45.1059 14.5736 44.6668 14.8487C44.2276 15.117 43.8777 15.4988 43.617 15.9941C43.3562 16.4826 43.2258 17.0535 43.2258 17.7071V27.345H39.5Z\" fill=\"#ffffff\" stroke-width=\"3\" paint-order=\"stroke\"/><path d=\"M27.3847 25.9178C28.8081 23.5868 30.5287 21.3029 30.9562 18.5589C31.9911 11.9172 26.9381 5.71447 19.956 5.30338C17.4904 5.15838 13.6449 5.12507 11.1992 5.30299C10.0552 5.38607 8.94122 5.89121 8.16887 6.70868C7.71694 7.18718 5.28183 11.1346 5.20651 11.6441C5.02777 12.8495 5.83228 13.8426 7.09035 13.9645C9.18143 14.1667 11.8763 13.9253 14.0309 13.9264C15.8964 13.9272 17.9989 13.8097 19.8339 13.9253C25.9341 14.3093 29.7128 20.5446 27.3249 25.9319L27.3847 25.9178Z\" stroke-width=\"4.96\"/><path d=\"M14.0302 13.9258L10.6029 19.6599C9.96327 20.8096 10.6737 22.3059 12.0613 22.4638C14.1002 22.6962 17.0133 22.4493 19.1606 22.4689C21.213 22.4877 23.197 22.146 24.8203 23.6246C26.1443 24.8308 26.5555 26.7091 25.9192 28.3472L27.3849 25.9175C29.7728 20.5302 25.9338 14.3083 19.8336 13.9246C17.9986 13.809 15.8961 13.927 14.0306 13.9258H14.0302Z\" stroke-width=\"4.96\"/><path d=\"M19.1603 22.469L15.6471 28.3947C15.2098 29.3278 15.7183 30.5509 16.7183 30.9134C17.4381 31.174 21.8747 31.1148 22.7354 30.9463C24.1038 30.6786 25.4299 29.6056 25.9188 28.3477C26.5548 26.7096 26.1436 24.8313 24.82 23.6251C23.1967 22.1461 21.1733 22.5542 19.1209 22.5354L19.1603 22.469Z\" stroke-width=\"4.96\"/></g><path d=\"M138.576 33.2887V11.4951H142.24V14.1161H142.456C142.649 13.7308 142.92 13.3215 143.269 12.8881C143.619 12.4479 144.093 12.0729 144.69 11.7634C145.287 11.4469 146.048 11.2887 146.975 11.2887C148.196 11.2887 149.297 11.6017 150.279 12.2277C151.267 12.8469 152.049 13.7652 152.625 14.9829C153.209 16.1936 153.5 17.6796 153.5 19.4407C153.5 21.1811 153.215 22.6602 152.646 23.8778C152.076 25.0955 151.301 26.0242 150.32 26.6639C149.339 27.3037 148.227 27.6236 146.985 27.6236C146.079 27.6236 145.328 27.4722 144.731 27.1696C144.134 26.8669 143.654 26.5023 143.29 26.0757C142.933 25.6424 142.655 25.233 142.456 24.8478H142.302V33.2887H138.576ZM142.23 19.42C142.23 20.445 142.374 21.3428 142.662 22.1133C142.957 22.8838 143.379 23.4857 143.928 23.9191C144.484 24.3456 145.156 24.5589 145.946 24.5589C146.769 24.5589 147.458 24.3387 148.014 23.8985C148.57 23.4513 148.989 22.8425 149.27 22.072C149.558 21.2946 149.702 20.4106 149.702 19.42C149.702 18.4363 149.562 17.5626 149.28 16.799C148.999 16.0354 148.58 15.4369 148.025 15.0035C147.469 14.5701 146.776 14.3534 145.946 14.3534C145.15 14.3534 144.474 14.5632 143.918 14.9829C143.362 15.4025 142.94 15.9907 142.652 16.7474C142.371 17.5041 142.23 18.395 142.23 19.42Z\" fill=\"#26282A\"/><path d=\"M127.352 27.6649C126.35 27.6649 125.448 27.486 124.645 27.1283C123.849 26.7637 123.218 26.2271 122.751 25.5185C122.291 24.81 122.062 23.9363 122.062 22.8975C122.062 22.0032 122.226 21.2637 122.556 20.6789C122.885 20.0942 123.334 19.6264 123.904 19.2756C124.473 18.9247 125.115 18.6599 125.829 18.481C126.549 18.2953 127.293 18.1611 128.062 18.0786C128.988 17.9823 129.74 17.8963 130.316 17.8206C130.892 17.738 131.311 17.6142 131.572 17.4491C131.839 17.2771 131.973 17.0123 131.973 16.6545V16.5926C131.973 15.8153 131.743 15.2133 131.284 14.7868C130.824 14.3603 130.162 14.147 129.297 14.147C128.384 14.147 127.661 14.3465 127.125 14.7455C126.597 15.1445 126.24 15.6158 126.055 16.1592L122.576 15.6639C122.851 14.7008 123.303 13.896 123.935 13.2493C124.566 12.5958 125.338 12.1073 126.251 11.784C127.163 11.4538 128.172 11.2887 129.276 11.2887C130.038 11.2887 130.796 11.3781 131.551 11.557C132.306 11.7359 132.995 12.0317 133.62 12.4444C134.244 12.8503 134.745 13.4041 135.123 14.1058C135.507 14.8075 135.699 15.6846 135.699 16.7371V27.345H132.117V25.1677H131.994C131.767 25.608 131.448 26.0207 131.036 26.406C130.632 26.7843 130.12 27.0904 129.503 27.3243C128.892 27.5514 128.175 27.6649 127.352 27.6649ZM128.319 24.92C129.067 24.92 129.716 24.7721 130.265 24.4763C130.813 24.1736 131.235 23.7746 131.531 23.2793C131.832 22.784 131.983 22.244 131.983 21.6592V19.7915C131.867 19.8878 131.668 19.9773 131.386 20.0598C131.112 20.1424 130.803 20.2146 130.46 20.2765C130.117 20.3384 129.777 20.3934 129.441 20.4416C129.105 20.4898 128.813 20.531 128.566 20.5654C128.011 20.6411 127.513 20.7649 127.074 20.9369C126.635 21.1089 126.288 21.3497 126.034 21.6592C125.781 21.9619 125.654 22.354 125.654 22.8356C125.654 23.5235 125.904 24.0429 126.405 24.3938C126.906 24.7446 127.544 24.92 128.319 24.92Z\" fill=\"#26282A\"/><path d=\"M97.6602 27.345V11.4951H101.221V14.1883H101.407C101.736 13.2803 102.281 12.5717 103.043 12.0626C103.805 11.5467 104.714 11.2887 105.771 11.2887C106.841 11.2887 107.743 11.5501 108.477 12.0729C109.219 12.5889 109.74 13.294 110.042 14.1883H110.207C110.557 13.3078 111.147 12.6061 111.977 12.0833C112.814 11.5535 113.805 11.2887 114.951 11.2887C116.406 11.2887 117.593 11.7496 118.513 12.6714C119.432 13.5933 119.892 14.9382 119.892 16.7061V27.345H116.156V17.284C116.156 16.3003 115.895 15.5814 115.373 15.1273C114.852 14.6664 114.214 14.436 113.459 14.436C112.56 14.436 111.857 14.718 111.349 15.2821C110.848 15.8394 110.598 16.5651 110.598 17.4594V27.345H106.944V17.1292C106.944 16.3106 106.697 15.6571 106.203 15.1686C105.716 14.6802 105.078 14.436 104.288 14.436C103.753 14.436 103.266 14.5736 102.827 14.8487C102.388 15.117 102.038 15.4988 101.777 15.9941C101.516 16.4826 101.386 17.0535 101.386 17.7071V27.345H97.6602Z\" fill=\"#26282A\"/><path d=\"M80.416 33.2887V11.4951H84.0801V14.1161H84.2962C84.4884 13.7308 84.7594 13.3215 85.1093 12.8881C85.4593 12.4479 85.9327 12.0729 86.5297 11.7634C87.1267 11.4469 87.8883 11.2887 88.8146 11.2887C90.036 11.2887 91.1373 11.6017 92.1185 12.2277C93.1065 12.8469 93.8888 13.7652 94.4651 14.9829C95.0484 16.1936 95.34 17.6796 95.34 19.4407C95.34 21.1811 95.0552 22.6602 94.4857 23.8778C93.9162 25.0955 93.1408 26.0242 92.1596 26.6639C91.1784 27.3037 90.0668 27.6236 88.8249 27.6236C87.9192 27.6236 87.1678 27.4722 86.5709 27.1696C85.9739 26.8669 85.4936 26.5023 85.1299 26.0757C84.7731 25.6424 84.4952 25.233 84.2962 24.8478H84.1419V33.2887H80.416ZM84.0698 19.42C84.0698 20.445 84.2139 21.3428 84.5021 22.1133C84.7971 22.8838 85.2191 23.4857 85.7681 23.9191C86.3238 24.3456 86.9963 24.5589 87.7854 24.5589C88.6088 24.5589 89.2983 24.3387 89.8541 23.8985C90.4099 23.4513 90.8285 22.8425 91.1098 22.072C91.398 21.2946 91.5421 20.4106 91.5421 19.42C91.5421 18.4363 91.4014 17.5626 91.1201 16.799C90.8388 16.0354 90.4202 15.4369 89.8644 15.0035C89.3086 14.5701 88.6156 14.3534 87.7854 14.3534C86.9894 14.3534 86.3136 14.5632 85.7578 14.9829C85.202 15.4025 84.78 15.9907 84.4918 16.7474C84.2105 17.5041 84.0698 18.395 84.0698 19.42Z\" fill=\"#26282A\"/><path d=\"M69.1921 27.6649C68.1904 27.6649 67.2881 27.486 66.4852 27.1283C65.6893 26.7637 65.058 26.2271 64.5914 25.5185C64.1317 24.81 63.9019 23.9363 63.9019 22.8975C63.9019 22.0032 64.0665 21.2637 64.3959 20.6789C64.7252 20.0942 65.1747 19.6264 65.7442 19.2756C66.3137 18.9247 66.9553 18.6599 67.6689 18.481C68.3893 18.2953 69.1338 18.1611 69.9023 18.0786C70.8286 17.9823 71.58 17.8963 72.1564 17.8206C72.7327 17.738 73.1513 17.6142 73.412 17.4491C73.6796 17.2771 73.8134 17.0123 73.8134 16.6545V16.5926C73.8134 15.8153 73.5836 15.2133 73.1238 14.7868C72.6641 14.3603 72.002 14.147 71.1374 14.147C70.2248 14.147 69.5009 14.3465 68.9657 14.7455C68.4374 15.1445 68.0806 15.6158 67.8953 16.1592L64.4165 15.6639C64.6909 14.7008 65.1438 13.896 65.7751 13.2493C66.4063 12.5958 67.1783 12.1073 68.0909 11.784C69.0034 11.4538 70.0121 11.2887 71.1168 11.2887C71.8785 11.2887 72.6367 11.3781 73.3914 11.557C74.1462 11.7359 74.8358 12.0317 75.4602 12.4444C76.0846 12.8503 76.5855 13.4041 76.9629 14.1058C77.3471 14.8075 77.5393 15.6846 77.5393 16.7371V27.345H73.9575V25.1677H73.834C73.6076 25.608 73.2885 26.0207 72.8768 26.406C72.472 26.7843 71.9608 27.0904 71.3433 27.3243C70.7326 27.5514 70.0155 27.6649 69.1921 27.6649ZM70.1596 24.92C70.9075 24.92 71.556 24.7721 72.1049 24.4763C72.6538 24.1736 73.0758 23.7746 73.3709 23.2793C73.6728 22.784 73.8237 22.244 73.8237 21.6592V19.7915C73.7071 19.8878 73.5081 19.9773 73.2268 20.0598C72.9523 20.1424 72.6435 20.2146 72.3004 20.2765C71.9574 20.3384 71.6177 20.3934 71.2815 20.4416C70.9453 20.4898 70.6537 20.531 70.4066 20.5654C69.8509 20.6411 69.3534 20.7649 68.9143 20.9369C68.4751 21.1089 68.1286 21.3497 67.8747 21.6592C67.6208 21.9619 67.4939 22.354 67.4939 22.8356C67.4939 23.5235 67.7443 24.0429 68.2452 24.3938C68.7461 24.7446 69.3843 24.92 70.1596 24.92Z\" fill=\"#26282A\"/><path d=\"M39.5 27.345V11.4951H43.0612V14.1883H43.2464C43.5758 13.2803 44.1213 12.5717 44.8829 12.0626C45.6446 11.5467 46.5537 11.2887 47.6104 11.2887C48.6808 11.2887 49.5831 11.5501 50.3173 12.0729C51.0584 12.5889 51.5798 13.294 51.8817 14.1883H52.0464C52.3964 13.3078 52.9865 12.6061 53.8167 12.0833C54.6538 11.5535 55.6453 11.2887 56.7912 11.2887C58.2459 11.2887 59.4329 11.7496 60.3524 12.6714C61.2718 13.5933 61.7316 14.9382 61.7316 16.7061V27.345H57.9954V17.284C57.9954 16.3003 57.7347 15.5814 57.2132 15.1273C56.6917 14.6664 56.0536 14.436 55.2988 14.436C54.3999 14.436 53.6966 14.718 53.1889 15.2821C52.688 15.8394 52.4375 16.5651 52.4375 17.4594V27.345H48.7837V17.1292C48.7837 16.3106 48.5367 15.6571 48.0427 15.1686C47.5555 14.6802 46.9174 14.436 46.1283 14.436C45.5931 14.436 45.1059 14.5736 44.6668 14.8487C44.2276 15.117 43.8777 15.4988 43.617 15.9941C43.3562 16.4826 43.2258 17.0535 43.2258 17.7071V27.345H39.5Z\" fill=\"#26282A\"/><path d=\"M27.3847 25.9178C28.8081 23.5868 30.5287 21.3029 30.9562 18.5589C31.9911 11.9172 26.9381 5.71447 19.956 5.30338C17.4904 5.15838 13.6449 5.12507 11.1992 5.30299C10.0552 5.38607 8.94122 5.89121 8.16887 6.70868C7.71694 7.18718 5.28183 11.1346 5.20651 11.6441C5.02777 12.8495 5.83228 13.8426 7.09035 13.9645C9.18143 14.1667 11.8763 13.9253 14.0309 13.9264C15.8964 13.9272 17.9989 13.8097 19.8339 13.9253C25.9341 14.3093 29.7128 20.5446 27.3249 25.9319L27.3847 25.9178Z\" stroke=\"#3A3838\" stroke-width=\"1.95943\" stroke-miterlimit=\"10\"/><path d=\"M14.0302 13.9258L10.6029 19.6599C9.96327 20.8096 10.6737 22.3059 12.0613 22.4638C14.1002 22.6962 17.0133 22.4493 19.1606 22.4689C21.213 22.4877 23.197 22.146 24.8203 23.6246C26.1443 24.8308 26.5555 26.7091 25.9192 28.3472L27.3849 25.9175C29.7728 20.5302 25.9338 14.3083 19.8336 13.9246C17.9986 13.809 15.8961 13.927 14.0306 13.9258H14.0302Z\" stroke=\"#3A3838\" stroke-width=\"1.95943\" stroke-miterlimit=\"10\"/><path d=\"M19.1603 22.469L15.6471 28.3947C15.2098 29.3278 15.7183 30.5509 16.7183 30.9134C17.4381 31.174 21.8747 31.1148 22.7354 30.9463C24.1038 30.6786 25.4299 29.6056 25.9188 28.3477C26.5548 26.7096 26.1436 24.8313 24.82 23.6251C23.1967 22.1461 21.1733 22.5542 19.1209 22.5354L19.1603 22.469Z\" stroke=\"#3A3838\" stroke-width=\"1.95943\" stroke-miterlimit=\"10\"/></svg>";
|
|
284
285
|
/**
|
|
285
286
|
* A MapLibre `IControl` rendering the MapMap wordmark. Typed structurally
|
|
286
287
|
* (`onAdd`/`onRemove`) so it needs no maplibre-gl import and works with
|
|
@@ -330,7 +331,7 @@ declare const FULL_ATTRIBUTION = "\u00A9 OpenStreetMap contributors \u00A9 OpenM
|
|
|
330
331
|
/** Default glyph endpoint (PBF fontstacks), mirroring `sn_style::DEFAULT_GLYPHS_URL`. */
|
|
331
332
|
declare const DEFAULT_GLYPHS_URL = "https://fonts.mapmap.ai/{fontstack}/{range}.pbf";
|
|
332
333
|
/** A sensible default territory tiles URL (overridable per map). */
|
|
333
|
-
declare const DEFAULT_TERRITORY_TILES_URL = "pmtiles://https://tiles.mapmap.ai/
|
|
334
|
+
declare const DEFAULT_TERRITORY_TILES_URL = "pmtiles://https://tiles.mapmap.ai/planet.pmtiles";
|
|
334
335
|
/**
|
|
335
336
|
* Every source-layer the Planetiler (OpenMapTiles-schema) tiles emit.
|
|
336
337
|
* The style skeleton covers all of them; extra layers referencing anything
|
|
@@ -403,7 +404,7 @@ interface Theme {
|
|
|
403
404
|
buildings_3d?: boolean;
|
|
404
405
|
/**
|
|
405
406
|
* Label fonts. Every fontstack must exist on the glyph server; until that
|
|
406
|
-
* ships (P2), leave this at its default (`"
|
|
407
|
+
* ships (P2), leave this at its default (`"MapMap Sans Regular"`).
|
|
407
408
|
*/
|
|
408
409
|
fonts?: {
|
|
409
410
|
regular?: string;
|
|
@@ -581,6 +582,224 @@ declare const NAV_CAMERA_DEFAULTS: {
|
|
|
581
582
|
readonly zoom: 17.5;
|
|
582
583
|
readonly speedMps: 12;
|
|
583
584
|
};
|
|
585
|
+
/**
|
|
586
|
+
* Safety-camera kinds a design can style, matching the kind the data model
|
|
587
|
+
* already carries per camera. LOCKSTEP: mirrors `NAV_CAMERA_KINDS` in
|
|
588
|
+
* `website/lib/studio-nav.ts`.
|
|
589
|
+
*
|
|
590
|
+
* WIRE NOTE: the gateway serialises `sn_safety::CameraKind` lowercase
|
|
591
|
+
* (`fixed` / `average` / `redlight` / `unknown`); `mobile_site` is a
|
|
592
|
+
* product-level kind a host may classify itself (the sidecar deliberately
|
|
593
|
+
* leaves an OSM `speed_camera=mobile` node as `unknown` rather than
|
|
594
|
+
* overclaiming a fixed installation). Normalise a wire value with
|
|
595
|
+
* {@link navCameraKind} before indexing a design.
|
|
596
|
+
*/
|
|
597
|
+
declare const NAV_CAMERA_KINDS: readonly ["fixed", "average", "red_light", "mobile_site", "unknown"];
|
|
598
|
+
/** One safety-camera kind. */
|
|
599
|
+
type NavCameraKind = (typeof NAV_CAMERA_KINDS)[number];
|
|
600
|
+
/**
|
|
601
|
+
* Normalises a camera kind from the wire (or any host classifier) onto a
|
|
602
|
+
* {@link NavCameraKind}. Unrecognised values become `"unknown"`, never a
|
|
603
|
+
* guess: a mislabelled camera would alert a driver about the wrong thing.
|
|
604
|
+
*/
|
|
605
|
+
declare function navCameraKind(value: unknown): NavCameraKind;
|
|
606
|
+
/** Curated icon sets a design can pick for the alert chip and map pins. */
|
|
607
|
+
declare const NAV_ALERT_ICON_SETS: readonly ["european", "us", "minimal", "brand"];
|
|
608
|
+
/** One curated icon set. `"brand"` means "use my `iconUrlOverrides`". */
|
|
609
|
+
type NavAlertIconSet = (typeof NAV_ALERT_ICON_SETS)[number];
|
|
610
|
+
/**
|
|
611
|
+
* When a kind alerts AUDIBLY while driving.
|
|
612
|
+
*
|
|
613
|
+
* The visual chip is governed by `alertWhileDriving` and is deliberately
|
|
614
|
+
* unconditional and calm; audio is the escalation channel (the shipping
|
|
615
|
+
* model: the pop-up always appears, the sound only when the driver is over
|
|
616
|
+
* the limit). UI labels must describe the behaviour - "Always alert",
|
|
617
|
+
* "Warn if speeding", "Never alert" - and must never say "Auto", which
|
|
618
|
+
* Organic Maps relabelled after users could not tell what it did.
|
|
619
|
+
*/
|
|
620
|
+
declare const NAV_ALERT_MODES: readonly ["always", "whenSpeeding", "never"];
|
|
621
|
+
/** One alert mode. */
|
|
622
|
+
type NavAlertMode = (typeof NAV_ALERT_MODES)[number];
|
|
623
|
+
/**
|
|
624
|
+
* Audio channel for a kind: silent, a non-verbal earcon, or an earcon
|
|
625
|
+
* followed by speech naming the kind. Kind is carried in the ICON and in
|
|
626
|
+
* SPEECH, never in the earcon's identity - urgency lives in timbre, so the
|
|
627
|
+
* escalated state is the same motif made more insistent, not a new sound.
|
|
628
|
+
*/
|
|
629
|
+
declare const NAV_ALERT_AUDIO_MODES: readonly ["off", "earcon", "earcon_and_speech"];
|
|
630
|
+
/** One audio mode. */
|
|
631
|
+
type NavAlertAudioMode = (typeof NAV_ALERT_AUDIO_MODES)[number];
|
|
632
|
+
/**
|
|
633
|
+
* The built-in earcon library, as a curated enum rather than a free URL.
|
|
634
|
+
*
|
|
635
|
+
* A design picks ONE sound for the calm alert and ONE for its escalated
|
|
636
|
+
* variant - never one per camera kind. Kind is carried by the icon and by
|
|
637
|
+
* speech; urgency is carried by timbre, so the escalated state is the same
|
|
638
|
+
* motif made more insistent. Per-kind sounds would ask a driver to learn
|
|
639
|
+
* five timbres at 70 mph, which no shipping product does.
|
|
640
|
+
*
|
|
641
|
+
* `zoneEnter` / `zoneClear` are the average-speed corridor pair a host
|
|
642
|
+
* plays at the entry and exit of a corridor. They are offered here too so
|
|
643
|
+
* a design can borrow their timbre, but the corridor itself always uses
|
|
644
|
+
* the pair - it is a boundary crossing, not a point alert.
|
|
645
|
+
*/
|
|
646
|
+
declare const NAV_ALERT_SOUNDS: readonly ["cameraCalm", "cameraUrgent", "overspeedSoft", "zoneEnter", "zoneClear"];
|
|
647
|
+
/** One built-in earcon. */
|
|
648
|
+
type NavAlertSound = (typeof NAV_ALERT_SOUNDS)[number];
|
|
649
|
+
/**
|
|
650
|
+
* File name of each built-in earcon, relative to
|
|
651
|
+
* {@link NAV_ALERT_SOUND_BASE_URL}. Mono, ~0.5-0.9 s, mixed dry with no
|
|
652
|
+
* reverb tail so they stay crisp over road noise and never trail into the
|
|
653
|
+
* spoken instruction that follows.
|
|
654
|
+
*/
|
|
655
|
+
declare const NAV_ALERT_SOUND_FILES: Record<NavAlertSound, string>;
|
|
656
|
+
/**
|
|
657
|
+
* Where the built-in earcons are hosted. Public, unmetered and immutable
|
|
658
|
+
* (the files are content-stable; a new sound gets a new name). Pass your
|
|
659
|
+
* own base to {@link navAlertSoundUrl} to self-host them - the SDK bundles
|
|
660
|
+
* no audio, exactly like `VoiceGuidance`'s earcon URLs.
|
|
661
|
+
*/
|
|
662
|
+
declare const NAV_ALERT_SOUND_BASE_URL = "https://mapmap.ai/earcons/";
|
|
663
|
+
/**
|
|
664
|
+
* Absolute URL for a built-in earcon. An unrecognised value falls back to
|
|
665
|
+
* `cameraCalm` rather than returning nothing: a missing alert sound is a
|
|
666
|
+
* silent failure a driver cannot see.
|
|
667
|
+
*/
|
|
668
|
+
declare function navAlertSoundUrl(sound: unknown, baseUrl?: string): string;
|
|
669
|
+
/** Lead-distance presets. Not a free number: see {@link NAV_ALERT_LEAD_DISTANCE_M}. */
|
|
670
|
+
declare const NAV_ALERT_LEAD_DISTANCES: readonly ["short", "standard", "long"];
|
|
671
|
+
/** One lead-distance preset. */
|
|
672
|
+
type NavAlertLeadDistance = (typeof NAV_ALERT_LEAD_DISTANCES)[number];
|
|
673
|
+
/**
|
|
674
|
+
* Metres before the camera at which the alert may first appear, per preset.
|
|
675
|
+
* These are FLOORS, not targets: a host may announce earlier (a motorway
|
|
676
|
+
* closing speed eats 400 m in nine seconds) but never later. Exposed as an
|
|
677
|
+
* enum rather than a numeric field precisely so no design can set a lead
|
|
678
|
+
* below the safety floor.
|
|
679
|
+
*/
|
|
680
|
+
declare const NAV_ALERT_LEAD_DISTANCE_M: Record<NavAlertLeadDistance, number>;
|
|
681
|
+
/** Metres of lead for a preset (garbage falls back to `standard`). */
|
|
682
|
+
declare function navAlertLeadDistanceM(preset: unknown): number;
|
|
683
|
+
/**
|
|
684
|
+
* Where the chip sits. Constrained slots, never free x/y: the chip must not
|
|
685
|
+
* occlude the current speed or the limit. Covering exactly the two numbers
|
|
686
|
+
* the alert is telling the driver to act on has been the single
|
|
687
|
+
* most-complained-about defect in the category since 2023, and a free
|
|
688
|
+
* position would let a customer reintroduce it.
|
|
689
|
+
*/
|
|
690
|
+
declare const NAV_ALERT_CHIP_POSITIONS: readonly ["aboveSpeed", "topLeading", "topTrailing"];
|
|
691
|
+
/** One chip position slot. */
|
|
692
|
+
type NavAlertChipPosition = (typeof NAV_ALERT_CHIP_POSITIONS)[number];
|
|
693
|
+
/**
|
|
694
|
+
* Per-kind surfaces and channels. The three booleans are orthogonal: a
|
|
695
|
+
* kind can appear on the map without alerting, alert without appearing on
|
|
696
|
+
* the map, or be listed in the route preview only.
|
|
697
|
+
*/
|
|
698
|
+
interface NavAlertKindDesign {
|
|
699
|
+
/**
|
|
700
|
+
* Draw a pin for this kind while BROWSING the map (no active guidance).
|
|
701
|
+
*
|
|
702
|
+
* Kept as the browse-mode field under its original name so themes saved
|
|
703
|
+
* before the browse/navigate split round-trip unchanged.
|
|
704
|
+
*/
|
|
705
|
+
showOnMap: boolean;
|
|
706
|
+
/**
|
|
707
|
+
* Draw a pin for this kind on the map DURING active navigation.
|
|
708
|
+
*
|
|
709
|
+
* Separate from {@link showOnMap} because the two are genuinely
|
|
710
|
+
* different decisions: a fleet product may want a clean driving map and
|
|
711
|
+
* a fully annotated planning map, or the reverse. Defaults to `true`,
|
|
712
|
+
* and absent in an older theme reads as `true` - the market shows
|
|
713
|
+
* cameras with or without a planned route, so gating map display behind
|
|
714
|
+
* guidance would be more restrictive than every product a driver has
|
|
715
|
+
* used.
|
|
716
|
+
*/
|
|
717
|
+
showOnMapWhileNavigating: boolean;
|
|
718
|
+
/** Show the alert chip for this kind while driving. */
|
|
719
|
+
alertWhileDriving: boolean;
|
|
720
|
+
/** List this kind in the pre-drive route preview. */
|
|
721
|
+
showInRoutePreview: boolean;
|
|
722
|
+
/** When the AUDIBLE alert fires. The chip itself follows `alertWhileDriving`. */
|
|
723
|
+
alertMode: NavAlertMode;
|
|
724
|
+
/** Which audio channel this kind uses. */
|
|
725
|
+
audioMode: NavAlertAudioMode;
|
|
726
|
+
}
|
|
727
|
+
/**
|
|
728
|
+
* Safety-alert tokens (`extra.nav.alerts`): the camera alert chip, its
|
|
729
|
+
* escalated state, per-kind icons and surfaces, and the average-speed
|
|
730
|
+
* corridor highlight.
|
|
731
|
+
*
|
|
732
|
+
* The whole block is optional since v1 - themes saved without it load
|
|
733
|
+
* unchanged and hosts keep their built-in look - but a block that IS
|
|
734
|
+
* present is always complete: every field, including both escalated
|
|
735
|
+
* tokens, parses to a value. The escalated state can be restyled, never
|
|
736
|
+
* removed.
|
|
737
|
+
*
|
|
738
|
+
* Two states only, calm and escalated. There is no amber tier: no shipping
|
|
739
|
+
* navigation product uses a three-colour alert state and drivers have no
|
|
740
|
+
* learned mapping for one.
|
|
741
|
+
*
|
|
742
|
+
* NOT STYLEABLE HERE: whether cameras may be shown at all. That is a
|
|
743
|
+
* server-side jurisdiction policy applied before any camera leaves the
|
|
744
|
+
* gateway. A design styles what the policy permits and nothing more.
|
|
745
|
+
*/
|
|
746
|
+
interface NavAlertsDesign {
|
|
747
|
+
/** Chip background in the calm (default) state. */
|
|
748
|
+
background: string;
|
|
749
|
+
/** Chip text and icon colour in the calm state. */
|
|
750
|
+
textColor: string;
|
|
751
|
+
/** Chip outline colour (both states). */
|
|
752
|
+
outlineColor: string;
|
|
753
|
+
/** Chip corner radius in px, 0-24. */
|
|
754
|
+
cornerRadius: number;
|
|
755
|
+
/** Chip outline width in px, 0-4. */
|
|
756
|
+
outlineWidth: number;
|
|
757
|
+
/** Chip background when escalated (driver over the limit). */
|
|
758
|
+
escalatedBackground: string;
|
|
759
|
+
/** Chip text and icon colour when escalated. */
|
|
760
|
+
escalatedTextColor: string;
|
|
761
|
+
/** Curated icon set for the chip and map pins. */
|
|
762
|
+
iconSet: NavAlertIconSet;
|
|
763
|
+
/**
|
|
764
|
+
* Per-kind icon overrides (`https:` or `data:` URIs only). Any kind left
|
|
765
|
+
* out keeps `iconSet`'s icon. Absent when no kind is overridden.
|
|
766
|
+
*/
|
|
767
|
+
iconUrlOverrides?: Partial<Record<NavCameraKind, string>>;
|
|
768
|
+
/**
|
|
769
|
+
* The earcon played for a calm alert. One sound for the whole design,
|
|
770
|
+
* never one per kind - see {@link NAV_ALERT_SOUNDS}.
|
|
771
|
+
*/
|
|
772
|
+
alertSound: NavAlertSound;
|
|
773
|
+
/**
|
|
774
|
+
* Optional replacement for the calm earcon (`https:` or `data:` URIs
|
|
775
|
+
* only, same rule as `iconUrlOverrides`). Absent = the built-in
|
|
776
|
+
* {@link alertSound}.
|
|
777
|
+
*/
|
|
778
|
+
alertSoundUrl?: string;
|
|
779
|
+
/**
|
|
780
|
+
* The earcon played when the driver is over the limit. The escalated
|
|
781
|
+
* state is not removable - it can be restyled and its sound chosen, but
|
|
782
|
+
* a design cannot silence the escalation itself (set the kind's
|
|
783
|
+
* `audioMode` to `off` if you want no audio at all).
|
|
784
|
+
*/
|
|
785
|
+
escalatedSound: NavAlertSound;
|
|
786
|
+
/** Optional replacement for the escalated earcon; same URL rule. */
|
|
787
|
+
escalatedSoundUrl?: string;
|
|
788
|
+
/** Map pin size as a multiplier of the default ramp, 0.75-1.5. */
|
|
789
|
+
mapIconSize: number;
|
|
790
|
+
/** Lowest zoom at which map pins are drawn, 9-14. */
|
|
791
|
+
mapMinZoom: number;
|
|
792
|
+
/** Lead-distance preset; see {@link NAV_ALERT_LEAD_DISTANCE_M}. */
|
|
793
|
+
leadDistance: NavAlertLeadDistance;
|
|
794
|
+
/** Which constrained slot the chip occupies. */
|
|
795
|
+
chipPosition: NavAlertChipPosition;
|
|
796
|
+
/** Colour of the average-speed corridor highlight on the route line. */
|
|
797
|
+
corridorColor: string;
|
|
798
|
+
/** Corridor highlight opacity, 0-1. */
|
|
799
|
+
corridorOpacity: number;
|
|
800
|
+
/** Per-kind surfaces and channels; always all five kinds. */
|
|
801
|
+
kinds: Record<NavCameraKind, NavAlertKindDesign>;
|
|
802
|
+
}
|
|
584
803
|
/** The `extra.nav` block: navigation design tokens for the SDKs. */
|
|
585
804
|
interface NavDesign {
|
|
586
805
|
/** Block schema version; currently always 1. */
|
|
@@ -593,12 +812,42 @@ interface NavDesign {
|
|
|
593
812
|
* means "SDK built-ins" - the block stays `version: 1` either way.
|
|
594
813
|
*/
|
|
595
814
|
camera?: NavCameraDesign;
|
|
815
|
+
/**
|
|
816
|
+
* Optional since v1: safety-alert chip, per-kind surfaces and corridor
|
|
817
|
+
* highlight. Absent means "SDK built-ins"; the block stays `version: 1`.
|
|
818
|
+
*/
|
|
819
|
+
alerts?: NavAlertsDesign;
|
|
596
820
|
}
|
|
821
|
+
/**
|
|
822
|
+
* Defaults for the optional `alerts` block. LOCKSTEP: mirrors
|
|
823
|
+
* `defaultNavAlertsDesign` in `website/lib/studio-nav.ts`.
|
|
824
|
+
*
|
|
825
|
+
* Calm chip = the banner's dark pill, so an unstyled alert already matches
|
|
826
|
+
* the rest of the guidance surface. Escalated = a red that clears 4.5:1
|
|
827
|
+
* against white text.
|
|
828
|
+
*
|
|
829
|
+
* Per-kind defaults follow the "visual always, audio conditional" rule:
|
|
830
|
+
* the three confidently classified kinds alert unconditionally, a mobile
|
|
831
|
+
* site (a location where enforcement sometimes happens, not a device)
|
|
832
|
+
* warns only if speeding, and an unclassified camera stays on the map but
|
|
833
|
+
* does not interrupt a drive.
|
|
834
|
+
*/
|
|
835
|
+
declare function defaultNavAlertsDesign(): NavAlertsDesign;
|
|
597
836
|
/**
|
|
598
837
|
* Defaults mirror what the SDK draws today with no design: `RouteLayer`'s
|
|
599
838
|
* signal-blue line over a dark casing, and `GuidanceBanner`'s dark pill.
|
|
600
839
|
*/
|
|
601
840
|
declare function defaultNavDesign(): NavDesign;
|
|
841
|
+
/**
|
|
842
|
+
* Lenient parse of an `extra.nav.alerts` value. Every numeric is clamped,
|
|
843
|
+
* every enum validated, and garbage falls back per field to the defaults -
|
|
844
|
+
* so a hand-edited or older theme can never produce an alert that is
|
|
845
|
+
* unreadable, positioned over the speed readout, or missing its escalated
|
|
846
|
+
* state. The escalated tokens in particular always come back set, even
|
|
847
|
+
* when the input omits or nulls them: a driver-facing escalation is not a
|
|
848
|
+
* removable feature.
|
|
849
|
+
*/
|
|
850
|
+
declare function parseNavAlertsDesign(value: unknown): NavAlertsDesign;
|
|
602
851
|
/**
|
|
603
852
|
* Lenient parse of an `extra.nav` value: unknown or malformed fields fall
|
|
604
853
|
* back to the defaults, so an imported theme never fails on its nav block.
|
|
@@ -929,6 +1178,13 @@ interface RouteLayerOptions {
|
|
|
929
1178
|
* without a design the layer keeps its built-in signal-blue look.
|
|
930
1179
|
*/
|
|
931
1180
|
design?: NavRouteDesign;
|
|
1181
|
+
/**
|
|
1182
|
+
* Studio safety-alert design (`extra.nav` `alerts` block), used for the
|
|
1183
|
+
* average-speed corridor highlight drawn by
|
|
1184
|
+
* {@link RouteLayer.setAlertCorridors}. Defaults to the map's
|
|
1185
|
+
* `navDesign.alerts` when given a `MapMapMap` whose theme carried one.
|
|
1186
|
+
*/
|
|
1187
|
+
alertsDesign?: NavAlertsDesign;
|
|
932
1188
|
/**
|
|
933
1189
|
* Colour of the already-travelled part of the line once
|
|
934
1190
|
* {@link RouteLayer.setProgress} is used (the Google-style "vanishing
|
|
@@ -950,11 +1206,15 @@ declare class RouteLayer {
|
|
|
950
1206
|
private readonly maneuverSourceId;
|
|
951
1207
|
private readonly maneuverLayerId;
|
|
952
1208
|
private readonly arrowImageId;
|
|
1209
|
+
private readonly corridorSourceId;
|
|
1210
|
+
private readonly corridorLayerId;
|
|
953
1211
|
private readonly design;
|
|
1212
|
+
private alertsDesign;
|
|
954
1213
|
private readonly progressColor;
|
|
955
1214
|
private lastRoute;
|
|
956
1215
|
private progress;
|
|
957
1216
|
private maneuver;
|
|
1217
|
+
private corridors;
|
|
958
1218
|
constructor(map: MapMapMap | Map, options?: RouteLayerOptions);
|
|
959
1219
|
private readonly handleStyleLoad;
|
|
960
1220
|
/**
|
|
@@ -995,6 +1255,26 @@ declare class RouteLayer {
|
|
|
995
1255
|
clearManeuver(): void;
|
|
996
1256
|
/** Add-or-update the manoeuvre arrow source/layer for the current style. */
|
|
997
1257
|
private installManeuver;
|
|
1258
|
+
/**
|
|
1259
|
+
* Highlights average-speed enforcement corridors on the route line.
|
|
1260
|
+
*
|
|
1261
|
+
* A corridor is a stretch of the route between an entry and an exit
|
|
1262
|
+
* camera, so it is a property of the LINE, not a point alert: drawing it
|
|
1263
|
+
* as a tinted overlay above the route is what makes "you are inside a
|
|
1264
|
+
* section check right now" readable at a glance, and it is the only part
|
|
1265
|
+
* of the alert design that persists rather than firing once.
|
|
1266
|
+
*
|
|
1267
|
+
* Pass the corridor geometries (arrays of `[lng, lat]` along the route)
|
|
1268
|
+
* and, optionally, a Studio alerts design for the colour and opacity;
|
|
1269
|
+
* without one the layer uses the design carried by the owning map, then
|
|
1270
|
+
* a built-in tint. An empty array clears the highlight. Survives style
|
|
1271
|
+
* swaps like the route itself.
|
|
1272
|
+
*/
|
|
1273
|
+
setAlertCorridors(corridors: readonly (readonly [number, number])[][], design?: NavAlertsDesign): void;
|
|
1274
|
+
/** Removes the corridor highlight (the route line itself is untouched). */
|
|
1275
|
+
clearAlertCorridors(): void;
|
|
1276
|
+
/** Add-or-update the corridor source/layer for the current style. */
|
|
1277
|
+
private installCorridors;
|
|
998
1278
|
/** Remove the route's layers and source from the map. */
|
|
999
1279
|
clear(): void;
|
|
1000
1280
|
/**
|
|
@@ -1004,6 +1284,76 @@ declare class RouteLayer {
|
|
|
1004
1284
|
destroy(): void;
|
|
1005
1285
|
}
|
|
1006
1286
|
|
|
1287
|
+
/**
|
|
1288
|
+
* WCAG relative-luminance contrast, and the legibility gate for the
|
|
1289
|
+
* safety-alert chip.
|
|
1290
|
+
*
|
|
1291
|
+
* WHY THIS IS A SAFETY CHECK, NOT A TASTE CHECK: NHTSA's visual-manual
|
|
1292
|
+
* driver-distraction guidelines are built around single glances of under
|
|
1293
|
+
* two seconds away from the road. An alert chip whose text does not
|
|
1294
|
+
* resolve inside one such glance either costs the driver a second glance
|
|
1295
|
+
* or is not read at all, so a low-contrast colour pair is a defect in the
|
|
1296
|
+
* alert, not a stylistic preference. Studio therefore warns on a failing
|
|
1297
|
+
* pair rather than silently accepting it.
|
|
1298
|
+
*
|
|
1299
|
+
* The threshold is WCAG 2.x AA for large text (3:1) raised to the
|
|
1300
|
+
* body-text floor (4.5:1) - a chip is glanced at, not read at leisure, and
|
|
1301
|
+
* the guidance surface already renders at banner sizes.
|
|
1302
|
+
*
|
|
1303
|
+
* DELIBERATELY NOT the Rust `sn_style::contrast` helper (nor the
|
|
1304
|
+
* `check_style_contrast` MCP tool): the web SDK does not link Rust, and
|
|
1305
|
+
* Studio needs this in the browser as the customer drags a colour picker.
|
|
1306
|
+
* Same formula (WCAG 2.x `(L1 + 0.05) / (L2 + 0.05)` over sRGB
|
|
1307
|
+
* relative luminance), independently implemented and unit-tested.
|
|
1308
|
+
*
|
|
1309
|
+
* LOCKSTEP: mirrors the contrast helpers in `website/lib/studio-nav.ts`.
|
|
1310
|
+
*/
|
|
1311
|
+
|
|
1312
|
+
/** Minimum acceptable contrast ratio for alert-chip text on its background. */
|
|
1313
|
+
declare const ALERT_CONTRAST_MIN = 4.5;
|
|
1314
|
+
/**
|
|
1315
|
+
* Parses a CSS hex colour (`#rgb`, `#rrggbb`, `#rgba`, `#rrggbbaa`) into
|
|
1316
|
+
* 0-255 sRGB channels. Alpha is accepted and ignored - the chip composites
|
|
1317
|
+
* over an opaque background, so its alpha does not describe what the
|
|
1318
|
+
* driver sees. Returns `undefined` for any other notation (named colours,
|
|
1319
|
+
* `rgb()`, gradients): unparseable means "cannot judge", never "fails".
|
|
1320
|
+
*/
|
|
1321
|
+
declare function parseHexColor(value: unknown): [number, number, number] | undefined;
|
|
1322
|
+
/** WCAG 2.x relative luminance of an sRGB triple (channels 0-255). */
|
|
1323
|
+
declare function relativeLuminance(rgb: readonly [number, number, number]): number;
|
|
1324
|
+
/**
|
|
1325
|
+
* WCAG 2.x contrast ratio between two hex colours, from 1 (identical) to
|
|
1326
|
+
* 21 (black on white). Order-independent. Returns `undefined` when either
|
|
1327
|
+
* colour cannot be parsed, so callers can distinguish "not judgeable" from
|
|
1328
|
+
* "fails".
|
|
1329
|
+
*/
|
|
1330
|
+
declare function contrastRatio(a: unknown, b: unknown): number | undefined;
|
|
1331
|
+
/** A chip colour pair that falls below {@link ALERT_CONTRAST_MIN}. */
|
|
1332
|
+
interface AlertContrastIssue {
|
|
1333
|
+
/** Which chip state the pair belongs to. */
|
|
1334
|
+
state: "calm" | "escalated";
|
|
1335
|
+
/** The text colour of the failing pair. */
|
|
1336
|
+
textColor: string;
|
|
1337
|
+
/** The background colour of the failing pair. */
|
|
1338
|
+
background: string;
|
|
1339
|
+
/** The measured ratio, rounded to 2 dp. */
|
|
1340
|
+
ratio: number;
|
|
1341
|
+
/** The floor it failed to clear. */
|
|
1342
|
+
minimum: number;
|
|
1343
|
+
}
|
|
1344
|
+
/**
|
|
1345
|
+
* Every chip colour pair in `design` that fails the contrast floor, in
|
|
1346
|
+
* state order. An empty array means both states are legible (or, for
|
|
1347
|
+
* colours this module cannot parse, not judgeable - those are skipped
|
|
1348
|
+
* rather than reported as failures).
|
|
1349
|
+
*
|
|
1350
|
+
* Advisory by design: the parser stays lenient and never rejects a theme
|
|
1351
|
+
* on contrast. Studio surfaces these as warnings next to the pickers so a
|
|
1352
|
+
* designer sees the problem while choosing, which is the only moment the
|
|
1353
|
+
* warning can actually change the outcome.
|
|
1354
|
+
*/
|
|
1355
|
+
declare function alertContrastIssues(design: NavAlertsDesign): AlertContrastIssue[];
|
|
1356
|
+
|
|
1007
1357
|
/** Maximum accepted `data:` puck-image payload (matches Studio's upload cap). */
|
|
1008
1358
|
declare const MAX_PUCK_IMAGE_BYTES: number;
|
|
1009
1359
|
/**
|
|
@@ -1861,9 +2211,10 @@ declare class IsochroneLayer {
|
|
|
1861
2211
|
* micro-frontends - breaks the shared WebGL context and styles)
|
|
1862
2212
|
* - WebGL unavailable (headless browsers, blocked GPU, old devices)
|
|
1863
2213
|
* - missing/invalid API key (a 401 from the tile or routing endpoints)
|
|
2214
|
+
* - a basemap tiles URL that 404s (the map loads but renders blank)
|
|
1864
2215
|
*/
|
|
1865
2216
|
/** The distinct issues the diagnostics can report. */
|
|
1866
|
-
type DiagnosticIssue = "container-zero-height" | "container-detached" | "duplicate-maplibre" | "webgl-unavailable" | "invalid-api-key";
|
|
2217
|
+
type DiagnosticIssue = "container-zero-height" | "container-detached" | "duplicate-maplibre" | "webgl-unavailable" | "invalid-api-key" | "basemap-not-found";
|
|
1867
2218
|
/** Reset the once-per-page dedup - for tests (and hot-reload tooling). */
|
|
1868
2219
|
declare function resetDiagnostics(): void;
|
|
1869
2220
|
/** What `runMapDiagnostics` needs; everything optional and structural. */
|
|
@@ -2031,6 +2382,18 @@ interface StepGuidance {
|
|
|
2031
2382
|
voice: VoiceInstruction[];
|
|
2032
2383
|
/** Visual banners for the upcoming maneuver. */
|
|
2033
2384
|
banners: BannerInstruction[];
|
|
2385
|
+
/**
|
|
2386
|
+
* OSRM travel mode of the step (`driving`, `ferry`, …) where the server
|
|
2387
|
+
* emits it. Pass the guidance entry as {@link GuidanceBanner.update}'s
|
|
2388
|
+
* second argument so ferry legs render the ferry icon.
|
|
2389
|
+
*/
|
|
2390
|
+
mode?: string;
|
|
2391
|
+
/**
|
|
2392
|
+
* `left`/`right` where the server emits it (the MapMap gateway sets it on
|
|
2393
|
+
* u-turn steps), so u-turn icons point the correct way in left-hand-traffic
|
|
2394
|
+
* regions.
|
|
2395
|
+
*/
|
|
2396
|
+
drivingSide?: string;
|
|
2034
2397
|
}
|
|
2035
2398
|
/**
|
|
2036
2399
|
* Extracts per-step guidance from a parsed route (requires the route to
|
|
@@ -2079,19 +2442,228 @@ interface SpeakOptions {
|
|
|
2079
2442
|
*/
|
|
2080
2443
|
declare function speak(instruction: VoiceInstruction, options?: SpeakOptions): boolean;
|
|
2081
2444
|
/**
|
|
2082
|
-
* A minimal DOM banner: primary text with a maneuver
|
|
2083
|
-
*
|
|
2084
|
-
*
|
|
2085
|
-
*
|
|
2086
|
-
*
|
|
2445
|
+
* A minimal DOM banner: primary text with a maneuver icon from the platform
|
|
2446
|
+
* direction set (the same `direction-icons` glyphs the MapMap apps use —
|
|
2447
|
+
* ferry, roundabouts, forks, ramps and all), plus an optional lane row.
|
|
2448
|
+
* Style with the `mapmap-banner` / `mapmap-banner-lanes` /
|
|
2449
|
+
* `mapmap-banner-icon` classes, pass a Studio design (`extra.nav` `banner`
|
|
2450
|
+
* block, e.g. `map.navDesign?.banner`) to match a Studio theme, or read
|
|
2451
|
+
* {@link StepGuidance} yourself for fully custom UI. The icon's secondary
|
|
2452
|
+
* shapes retheme via the `--mm-icon-secondary` CSS custom property.
|
|
2087
2453
|
*/
|
|
2088
2454
|
declare class GuidanceBanner {
|
|
2089
2455
|
/** The banner root element; attach it wherever your UI needs it. */
|
|
2090
2456
|
readonly element: HTMLElement;
|
|
2091
2457
|
private readonly design;
|
|
2092
2458
|
constructor(container?: HTMLElement, design?: NavBannerDesign);
|
|
2093
|
-
/**
|
|
2094
|
-
|
|
2459
|
+
/**
|
|
2460
|
+
* Renders a banner instruction (or hides the element with `null`).
|
|
2461
|
+
*
|
|
2462
|
+
* `step` is optional icon context — pass the step's {@link StepGuidance}
|
|
2463
|
+
* (or any `{ mode, drivingSide }`) so ferry legs render the ferry glyph
|
|
2464
|
+
* and u-turns point the correct way in left-hand-traffic regions.
|
|
2465
|
+
*/
|
|
2466
|
+
update(banner: BannerInstruction | null, step?: Pick<StepGuidance, "mode" | "drivingSide">): void;
|
|
2467
|
+
}
|
|
2468
|
+
/**
|
|
2469
|
+
* One camera alert to present. `kind` is normalised through
|
|
2470
|
+
* {@link navCameraKind}, so a raw gateway value (`"redlight"`) is accepted.
|
|
2471
|
+
*
|
|
2472
|
+
* JURISDICTION: whether a camera reaches you at all is decided server-side
|
|
2473
|
+
* before the response leaves the gateway. Nothing in this module can widen
|
|
2474
|
+
* that; it styles what the policy already permitted.
|
|
2475
|
+
*/
|
|
2476
|
+
interface CameraAlert {
|
|
2477
|
+
/** Camera regime; wire values are normalised. */
|
|
2478
|
+
kind: NavCameraKind | string;
|
|
2479
|
+
/** Enforced limit in km/h, when known. */
|
|
2480
|
+
limitKph?: number;
|
|
2481
|
+
/** Metres to the camera, when known. */
|
|
2482
|
+
distanceM?: number;
|
|
2483
|
+
}
|
|
2484
|
+
/**
|
|
2485
|
+
* What a host should actually do with an alert, given the design and
|
|
2486
|
+
* whether the driver is currently over the limit.
|
|
2487
|
+
*
|
|
2488
|
+
* The rule this encodes, and the reason it is a pure function rather than
|
|
2489
|
+
* scattered branches in a renderer: the VISUAL alert is unconditional and
|
|
2490
|
+
* calm, and AUDIO is the escalation channel. A driver within the limit
|
|
2491
|
+
* still sees the chip; only the sound waits for speeding.
|
|
2492
|
+
*/
|
|
2493
|
+
interface AlertPresentation {
|
|
2494
|
+
/** Whether to show the chip at all. */
|
|
2495
|
+
visible: boolean;
|
|
2496
|
+
/** Whether the chip should render in its escalated state. */
|
|
2497
|
+
escalated: boolean;
|
|
2498
|
+
/** Whether audio should fire now. */
|
|
2499
|
+
audible: boolean;
|
|
2500
|
+
/** Which audio channel to use when `audible`. */
|
|
2501
|
+
audioMode: NavAlertAudioMode;
|
|
2502
|
+
/**
|
|
2503
|
+
* The earcon to play for THIS state: the design's calm sound, or its
|
|
2504
|
+
* escalated variant when `escalated`. Always set (even when `audible` is
|
|
2505
|
+
* false) so a host can pre-load it; play it only when `audible`.
|
|
2506
|
+
*/
|
|
2507
|
+
soundUrl: string;
|
|
2508
|
+
/** Metres of lead this design guarantees before the camera. */
|
|
2509
|
+
leadDistanceM: number;
|
|
2510
|
+
}
|
|
2511
|
+
/**
|
|
2512
|
+
* Resolves a design plus live state into what to present.
|
|
2513
|
+
*
|
|
2514
|
+
* Escalation is by INTENSITY, not identity: `escalated` restyles the same
|
|
2515
|
+
* chip and re-uses the same earcon motif more insistently. It never swaps
|
|
2516
|
+
* in a different icon or a different sound - kind is carried by the icon
|
|
2517
|
+
* and by speech, urgency by timbre, and mixing the two channels is how
|
|
2518
|
+
* drivers end up unable to tell "a camera" from "you are speeding".
|
|
2519
|
+
*/
|
|
2520
|
+
declare function alertPresentation(design: NavAlertsDesign, alert: CameraAlert, state?: {
|
|
2521
|
+
speeding?: boolean;
|
|
2522
|
+
}): AlertPresentation;
|
|
2523
|
+
/**
|
|
2524
|
+
* The earcon URL for a design in the calm or escalated state.
|
|
2525
|
+
*
|
|
2526
|
+
* A design-level `alertSoundUrl` / `escalatedSoundUrl` override wins;
|
|
2527
|
+
* otherwise the chosen built-in resolves against the hosted earcon
|
|
2528
|
+
* library. There is deliberately no per-kind sound: kind travels in the
|
|
2529
|
+
* icon and in speech, urgency travels in timbre.
|
|
2530
|
+
*/
|
|
2531
|
+
declare function alertSoundUrl(design: NavAlertsDesign, escalated: boolean): string;
|
|
2532
|
+
/** Whether the map is being browsed or actively navigated. */
|
|
2533
|
+
type MapDisplayMode = "browse" | "navigating";
|
|
2534
|
+
/**
|
|
2535
|
+
* Whether a kind's pin should be drawn on the map in the given mode.
|
|
2536
|
+
*
|
|
2537
|
+
* Browsing and navigating are separate switches because they are separate
|
|
2538
|
+
* decisions - the market warns with or without a planned route, so a
|
|
2539
|
+
* design that shows a camera on the planning map is not thereby committed
|
|
2540
|
+
* to a cluttered driving map, nor the reverse.
|
|
2541
|
+
*/
|
|
2542
|
+
declare function cameraShownOnMap(design: NavAlertsDesign, kind: NavCameraKind | string, mode?: MapDisplayMode): boolean;
|
|
2543
|
+
/**
|
|
2544
|
+
* The camera kinds a style should draw in the given mode, in the canonical
|
|
2545
|
+
* kind order. Feed it straight into a MapLibre `filter` (see
|
|
2546
|
+
* {@link cameraSymbolLayer}); an empty array means "draw nothing", which
|
|
2547
|
+
* a caller must honour by removing or hiding the layer.
|
|
2548
|
+
*/
|
|
2549
|
+
declare function cameraKindsShownOnMap(design: NavAlertsDesign, mode?: MapDisplayMode): NavCameraKind[];
|
|
2550
|
+
/**
|
|
2551
|
+
* A MapLibre symbol layer that draws camera POIs from the sprite sheet.
|
|
2552
|
+
*
|
|
2553
|
+
* Additive by design: the style compiler is untouched and ships no camera
|
|
2554
|
+
* layer of its own, because cameras arrive as host data (the gateway's
|
|
2555
|
+
* `POST /v1/cameras/along`, projected into a GeoJSON source) rather than
|
|
2556
|
+
* in the vector tiles. Point this at that source and the sprite icons
|
|
2557
|
+
* built from `map-assets/icons/cameras` render at the design's size, zoom
|
|
2558
|
+
* floor and per-mode visibility.
|
|
2559
|
+
*
|
|
2560
|
+
* The features must carry a `kind` property holding one of
|
|
2561
|
+
* {@link NAV_CAMERA_KINDS} (or the gateway's `redlight` spelling); an
|
|
2562
|
+
* unrecognised value falls back to the `unknown` icon, never to a guess at
|
|
2563
|
+
* a specific camera type.
|
|
2564
|
+
*
|
|
2565
|
+
* @param source GeoJSON source id holding the camera features.
|
|
2566
|
+
* @param variant Sprite variant to draw: `"light"` icons read on a dark
|
|
2567
|
+
* basemap, `"dark"` icons on a light one.
|
|
2568
|
+
*/
|
|
2569
|
+
declare function cameraSymbolLayer(design: NavAlertsDesign, source: string, mode?: MapDisplayMode, variant?: "light" | "dark", id?: string): Record<string, unknown>;
|
|
2570
|
+
/**
|
|
2571
|
+
* Sprite image id for a camera kind, as built into the published sprite
|
|
2572
|
+
* sheet by `map-assets/icons/cameras/generate.mjs`.
|
|
2573
|
+
*
|
|
2574
|
+
* LOCKSTEP: the file names in `map-assets/sprites/svg/camera-*.svg` are
|
|
2575
|
+
* exactly these ids — spreet names each image after its file.
|
|
2576
|
+
*/
|
|
2577
|
+
declare function cameraSpriteName(kind: NavCameraKind | string, variant?: "light" | "dark"): string;
|
|
2578
|
+
/**
|
|
2579
|
+
* Human-readable name for a camera kind, used in the chip's text and in
|
|
2580
|
+
* the spoken announcement. Kind lives here and in the icon, never in the
|
|
2581
|
+
* earcon.
|
|
2582
|
+
*/
|
|
2583
|
+
declare function cameraKindLabel(kind: NavCameraKind | string): string;
|
|
2584
|
+
/**
|
|
2585
|
+
* The icon for a kind under a design, as a complete inline SVG string.
|
|
2586
|
+
*
|
|
2587
|
+
* `iconSet` chooses the frame (a European circular plate, a US rounded
|
|
2588
|
+
* plate, or no frame); the glyph inside always encodes the KIND, because
|
|
2589
|
+
* that is the channel kind is allowed to travel on. `"brand"` draws the
|
|
2590
|
+
* unframed glyph as its fallback - it expects an `iconUrlOverrides` entry,
|
|
2591
|
+
* and {@link alertIconUrl} is what actually resolves one.
|
|
2592
|
+
*/
|
|
2593
|
+
declare function alertIconSvg(design: NavAlertsDesign, kind: NavCameraKind | string): string;
|
|
2594
|
+
/**
|
|
2595
|
+
* The override URL for a kind, if the design sets one. Overrides win over
|
|
2596
|
+
* `iconSet` for that kind only; every other kind keeps the curated icon.
|
|
2597
|
+
*/
|
|
2598
|
+
declare function alertIconUrl(design: NavAlertsDesign, kind: NavCameraKind | string): string | undefined;
|
|
2599
|
+
/**
|
|
2600
|
+
* Template-shaped content for an alert: the fields a head unit can
|
|
2601
|
+
* actually render.
|
|
2602
|
+
*
|
|
2603
|
+
* CarPlay's `CPNavigationAlert` and Android Auto's `Alert` inside a
|
|
2604
|
+
* `NavigationTemplate` take a title, a subtitle and an image - the system
|
|
2605
|
+
* draws them, and none of the chip's colour, radius or position tokens
|
|
2606
|
+
* survive the trip. Hosts targeting a head unit should read this instead
|
|
2607
|
+
* of the DOM chip, so styling degrades gracefully rather than being
|
|
2608
|
+
* assumed to render.
|
|
2609
|
+
*/
|
|
2610
|
+
interface AlertChipContent {
|
|
2611
|
+
kind: NavCameraKind;
|
|
2612
|
+
/** Primary line, e.g. "Average speed check". */
|
|
2613
|
+
title: string;
|
|
2614
|
+
/** Secondary line: limit and distance when known, else empty. */
|
|
2615
|
+
subtitle: string;
|
|
2616
|
+
/** Override icon URL when the design sets one for this kind. */
|
|
2617
|
+
iconUrl?: string;
|
|
2618
|
+
}
|
|
2619
|
+
/** The text/icon content of an alert chip, free of any styling tokens. */
|
|
2620
|
+
declare function alertChipContent(design: NavAlertsDesign, alert: CameraAlert): AlertChipContent;
|
|
2621
|
+
/**
|
|
2622
|
+
* The colour a host should paint the SPEED readout, given a design and
|
|
2623
|
+
* whether the driver is speeding.
|
|
2624
|
+
*
|
|
2625
|
+
* Deliberate division of labour: the escalation the driver reads is the
|
|
2626
|
+
* speed number turning the escalated colour, while the alert chip stays
|
|
2627
|
+
* legible in its own escalated tokens. Colouring the card and leaving the
|
|
2628
|
+
* speed untouched puts the urgency on the wrong element - the driver has
|
|
2629
|
+
* to act on the speed, so the speed is what changes. Returns `undefined`
|
|
2630
|
+
* when calm, meaning "leave the readout in its normal colour".
|
|
2631
|
+
*/
|
|
2632
|
+
declare function alertSpeedReadoutColor(design: NavAlertsDesign, escalated: boolean): string | undefined;
|
|
2633
|
+
/**
|
|
2634
|
+
* A minimal DOM safety-alert chip: kind icon, kind label and (when known)
|
|
2635
|
+
* the limit and distance, in a calm or escalated state.
|
|
2636
|
+
*
|
|
2637
|
+
* Style with the `mapmap-alert-chip` class, or pass a Studio design
|
|
2638
|
+
* (`extra.nav` `alerts` block, e.g. `map.navDesign?.alerts`) to match a
|
|
2639
|
+
* Studio theme. Framework-free and DOM-only, exactly like
|
|
2640
|
+
* {@link GuidanceBanner}; head units should read {@link alertChipContent}
|
|
2641
|
+
* instead.
|
|
2642
|
+
*
|
|
2643
|
+
* The chip NEVER overlaps the speed or the limit: its position comes from
|
|
2644
|
+
* a constrained slot enum, and `aboveSpeed` reserves its own clearance.
|
|
2645
|
+
*/
|
|
2646
|
+
declare class CameraAlertChip {
|
|
2647
|
+
/** The chip root element; attach it wherever your UI needs it. */
|
|
2648
|
+
readonly element: HTMLElement;
|
|
2649
|
+
private readonly design;
|
|
2650
|
+
private escalated;
|
|
2651
|
+
constructor(container?: HTMLElement, design?: NavAlertsDesign);
|
|
2652
|
+
/** Whether the chip is currently in its escalated state. */
|
|
2653
|
+
get isEscalated(): boolean;
|
|
2654
|
+
/**
|
|
2655
|
+
* Renders an alert (or hides the chip with `null`). `state.speeding`
|
|
2656
|
+
* drives the escalated state; the chip itself shows regardless, because
|
|
2657
|
+
* the visual alert is unconditional.
|
|
2658
|
+
*
|
|
2659
|
+
* A kind whose design turns `alertWhileDriving` off hides the chip: the
|
|
2660
|
+
* customer chose not to surface that kind while driving.
|
|
2661
|
+
*/
|
|
2662
|
+
update(alert: CameraAlert | null, state?: {
|
|
2663
|
+
speeding?: boolean;
|
|
2664
|
+
}): void;
|
|
2665
|
+
/** Writes the calm/escalated tokens (and slot) onto the root element. */
|
|
2666
|
+
private applyStateStyles;
|
|
2095
2667
|
}
|
|
2096
2668
|
|
|
2097
2669
|
/**
|
|
@@ -2211,4 +2783,4 @@ declare class VoiceGuidance {
|
|
|
2211
2783
|
private playEarcon;
|
|
2212
2784
|
}
|
|
2213
2785
|
|
|
2214
|
-
export { AdrCheck, type AdrCheckOptions, type AdrCheckRequest, type AdrCheckResult, type AdrDimensions, type AdrTunnelCategory, type BannerComponent, type BannerContent, type BannerInstruction, type BuildStyleOptions, type CameraFix, DEFAULT_GLYPHS_URL, DEFAULT_TERRITORY_TILES_URL, type DiagnosticIssue, EFFECTS_METADATA_KEY, FLOW_DEFAULTS, FULL_ATTRIBUTION, FlowRouteEffectLayer, type FlythroughController, type FlythroughOptions, type FlythroughPose, GuidanceBanner, type GuidanceSeverity, type GuidanceSpokenPrompt, type IsochroneFeatureCollection, IsochroneLayer, type IsochroneLayerOptions, LOGO_SVG, type LaneIndication, type LayerOverride, type LngLatLike, LogoControl, type LogoOptions, type LogoPosition, MAX_PUCK_IMAGE_BYTES, type MapDiagnosticsInput, MapMapMap, type MapMapOptions, type MapMapTheme, NAV_CAMERA_DEFAULTS, type NavBannerDesign, type NavCameraDesign, type NavDesign, type NavPuckDesign, type NavRouteDesign, NavigationCamera, type NavigationCameraMode, type NavigationCameraOptions, type NearestByDriveTimeOptions, OPENMAPTILES_ATTRIBUTION, OSM_ATTRIBUTION, PALETTE_SLOTS, POI_CATEGORY_COLORS, POI_CATEGORY_IDS, POI_CLASS_CATEGORIES, type ParsedRoute, type Place, type PlacePointFeature, type PlaceWithDistance, type PlaceWithDriveTime, type PlacesFeatureCollection, type PlacesIcon, type PlacesInput, PlacesLayer, type PlacesLayerIds, type PlacesLayerOptions, type PlacesSelectOptions, type PoiCategoryDesign, type PoiDesign, PositionPuck, type PositionPuckOptions, type ProbeUploadOutcome, RIBBON_FLOATS_PER_VERTEX, ROUTE_EFFECTS, type ReachabilityMode, type RibbonMesh, type RouteEffectLayer, type RouteEffectName, type RouteFlowOptions, type RouteGeometry, RouteLayer, type RouteLayerOptions, type RouteOptions, type RouteProfile, SIGNAL_BLUE, SOURCE_LAYERS, type SetRouteEffectOptions, type SeverityProsody, type ShowReachabilityOptions, type SpeakOptions, type StepGuidance, type SunTimes, type Theme, type ThemeEffects, ThemeScheduler, type ThemeSchedulerOptions, type TruckParams, type UploadProbeOptions, VoiceGuidance, type VoiceGuidanceOptions, type VoiceGuidanceUpdate, type VoiceInstruction, applyPoiDesign, bannerLanes, bearingBetween, bindFlythroughToScroll, buildAdrCheckBody, buildProbeUrl, buildRouteQuery, buildRouteUrl, buildStyle, builtInPoiColor, createMap, createRouteEffect, defaultNavDesign, defaultPoiDesign, directionArrow, effectsFromStyleMetadata, extractGuidance, flythrough, flythroughPose, formatCoord, formatCoords, haversineDistanceM, isNameTextField, languageTextField, lngLatToMercator, navDesignFromTheme, navDesignFromThemeUrl, parseCssColour, parseNavDesign, parseOsrmRoute, parsePoiDesign, placesFromGeoJSON, poiDesignFromTheme, poiDesignFromThemeUrl, poiDesignIsDefault, poiTextColorExpression, prefersReducedMotion, registerPmtilesProtocol, resetDiagnostics, resolveTheme, runMapDiagnostics, setMapLanguage, severityProsody, shortestArcDeg, shortestArcDelta, speak, ssmlToText, sunTimes, tessellateRouteRibbon, toLngLat, toPmtilesUrl, uploadProbeBatch };
|
|
2786
|
+
export { ALERT_CONTRAST_MIN, AdrCheck, type AdrCheckOptions, type AdrCheckRequest, type AdrCheckResult, type AdrDimensions, type AdrTunnelCategory, type AlertChipContent, type AlertContrastIssue, type AlertPresentation, type BannerComponent, type BannerContent, type BannerInstruction, type BuildStyleOptions, type CameraAlert, CameraAlertChip, type CameraFix, DEFAULT_GLYPHS_URL, DEFAULT_TERRITORY_TILES_URL, type DiagnosticIssue, EFFECTS_METADATA_KEY, FLOW_DEFAULTS, FULL_ATTRIBUTION, FlowRouteEffectLayer, type FlythroughController, type FlythroughOptions, type FlythroughPose, GuidanceBanner, type GuidanceSeverity, type GuidanceSpokenPrompt, type IsochroneFeatureCollection, IsochroneLayer, type IsochroneLayerOptions, LOGO_SVG, type LaneIndication, type LayerOverride, type LngLatLike, LogoControl, type LogoOptions, type LogoPosition, MAX_PUCK_IMAGE_BYTES, type MapDiagnosticsInput, type MapDisplayMode, MapMapMap, type MapMapOptions, type MapMapTheme, NAV_ALERT_AUDIO_MODES, NAV_ALERT_CHIP_POSITIONS, NAV_ALERT_ICON_SETS, NAV_ALERT_LEAD_DISTANCES, NAV_ALERT_LEAD_DISTANCE_M, NAV_ALERT_MODES, NAV_ALERT_SOUNDS, NAV_ALERT_SOUND_BASE_URL, NAV_ALERT_SOUND_FILES, NAV_CAMERA_DEFAULTS, NAV_CAMERA_KINDS, type NavAlertAudioMode, type NavAlertChipPosition, type NavAlertIconSet, type NavAlertKindDesign, type NavAlertLeadDistance, type NavAlertMode, type NavAlertSound, type NavAlertsDesign, type NavBannerDesign, type NavCameraDesign, type NavCameraKind, type NavDesign, type NavPuckDesign, type NavRouteDesign, NavigationCamera, type NavigationCameraMode, type NavigationCameraOptions, type NearestByDriveTimeOptions, OPENMAPTILES_ATTRIBUTION, OSM_ATTRIBUTION, PALETTE_SLOTS, POI_CATEGORY_COLORS, POI_CATEGORY_IDS, POI_CLASS_CATEGORIES, type ParsedRoute, type Place, type PlacePointFeature, type PlaceWithDistance, type PlaceWithDriveTime, type PlacesFeatureCollection, type PlacesIcon, type PlacesInput, PlacesLayer, type PlacesLayerIds, type PlacesLayerOptions, type PlacesSelectOptions, type PoiCategoryDesign, type PoiDesign, PositionPuck, type PositionPuckOptions, type ProbeUploadOutcome, RIBBON_FLOATS_PER_VERTEX, ROUTE_EFFECTS, type ReachabilityMode, type RibbonMesh, type RouteEffectLayer, type RouteEffectName, type RouteFlowOptions, type RouteGeometry, RouteLayer, type RouteLayerOptions, type RouteOptions, type RouteProfile, SIGNAL_BLUE, SOURCE_LAYERS, type SetRouteEffectOptions, type SeverityProsody, type ShowReachabilityOptions, type SpeakOptions, type StepGuidance, type SunTimes, type Theme, type ThemeEffects, ThemeScheduler, type ThemeSchedulerOptions, type TruckParams, type UploadProbeOptions, VoiceGuidance, type VoiceGuidanceOptions, type VoiceGuidanceUpdate, type VoiceInstruction, alertChipContent, alertContrastIssues, alertIconSvg, alertIconUrl, alertPresentation, alertSoundUrl, alertSpeedReadoutColor, applyPoiDesign, bannerLanes, bearingBetween, bindFlythroughToScroll, buildAdrCheckBody, buildProbeUrl, buildRouteQuery, buildRouteUrl, buildStyle, builtInPoiColor, cameraKindLabel, cameraKindsShownOnMap, cameraShownOnMap, cameraSpriteName, cameraSymbolLayer, contrastRatio, createMap, createRouteEffect, defaultNavAlertsDesign, defaultNavDesign, defaultPoiDesign, directionArrow, effectsFromStyleMetadata, extractGuidance, flythrough, flythroughPose, formatCoord, formatCoords, haversineDistanceM, isNameTextField, languageTextField, lngLatToMercator, navAlertLeadDistanceM, navAlertSoundUrl, navCameraKind, navDesignFromTheme, navDesignFromThemeUrl, parseCssColour, parseHexColor, parseNavAlertsDesign, parseNavDesign, parseOsrmRoute, parsePoiDesign, placesFromGeoJSON, poiDesignFromTheme, poiDesignFromThemeUrl, poiDesignIsDefault, poiTextColorExpression, prefersReducedMotion, registerPmtilesProtocol, relativeLuminance, resetDiagnostics, resolveTheme, runMapDiagnostics, setMapLanguage, severityProsody, shortestArcDeg, shortestArcDelta, speak, ssmlToText, sunTimes, tessellateRouteRibbon, toLngLat, toPmtilesUrl, uploadProbeBatch };
|