@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.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { directionIcons, iconNameForStep } from './chunk-CH53LJR7.js';
|
|
2
|
+
export { directionIconSvg, directionIcons, iconNameForManeuver, iconNameForStep } from './chunk-CH53LJR7.js';
|
|
1
3
|
import maplibregl from 'maplibre-gl';
|
|
2
4
|
import { Protocol } from 'pmtiles';
|
|
3
5
|
|
|
4
|
-
// src/map.ts
|
|
5
|
-
|
|
6
6
|
// src/diagnostics.ts
|
|
7
7
|
var DOCS = "https://mapmap.ai/docs";
|
|
8
8
|
var reported = /* @__PURE__ */ new Set();
|
|
@@ -85,6 +85,14 @@ function watchForAuthFailures(map, apiKey) {
|
|
|
85
85
|
on.call(map, "error", (ev) => {
|
|
86
86
|
const status = ev?.error?.status;
|
|
87
87
|
const message = ev?.error?.message ?? "";
|
|
88
|
+
const basemapMissing = status === 404 && (ev?.sourceId === "territory" || /pmtiles|\.pmtiles/i.test(message));
|
|
89
|
+
if (basemapMissing) {
|
|
90
|
+
report(
|
|
91
|
+
"basemap-not-found",
|
|
92
|
+
`the basemap tiles returned HTTP 404, so the map renders blank. The territory tiles URL points at a file that does not exist. Check \`territoryTilesUrl\` (or your custom \`style\`) - the default MapMap tiles are served at the CDN root (e.g. https://tiles.mapmap.ai/planet.pmtiles), not under a /territories/ prefix. ${DOCS}#tiles`
|
|
93
|
+
);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
88
96
|
const unauthorised = status === 401 || /unauthori[sz]ed/i.test(message);
|
|
89
97
|
if (!unauthorised) return;
|
|
90
98
|
report(
|
|
@@ -454,7 +462,7 @@ function createRouteEffect(name, geometry, options) {
|
|
|
454
462
|
}
|
|
455
463
|
|
|
456
464
|
// src/logo.ts
|
|
457
|
-
var LOGO_SVG = '<svg xmlns="http://www.w3.org/2000/svg" width="84" 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="M146.965 19.2363C146.965 17.5281 146.64 16.2469 145.989 15.3927C145.358 14.5386 144.464 14.1115 143.304 14.1115C142.227 14.1115 141.352 14.5589 140.681 15.4537C140.03 16.3282 139.705 17.5382 139.705 19.0838V19.3889C139.705 20.9751 140.03 22.2055 140.681 23.08C141.352 23.9341 142.227 24.3612 143.304 24.3612C144.382 24.3612 145.257 23.924 145.928 23.0495C146.619 22.1547 146.965 20.8836 146.965 19.2363ZM150.778 19.2363C150.778 21.8598 150.188 23.8934 149.009 25.3373C147.85 26.7609 146.324 27.4727 144.433 27.4727C142.481 27.4727 140.925 26.7304 139.766 25.2458H139.705V33.8787H135.739V11.305H139.461L139.522 13.5319H139.583C140.803 11.844 142.42 11 144.433 11C146.406 11 147.951 11.7016 149.07 13.1048C150.209 14.5081 150.778 16.5519 150.778 19.2363Z" fill="#ffffff" stroke-width="3" paint-order="stroke"/><path d="M126.399 11C128.819 11 130.558 11.4779 131.615 12.4337C132.673 13.3692 133.202 14.8945 133.202 17.0095V22.8969C133.202 24.3409 133.354 25.7644 133.659 27.1676H129.907C129.785 26.4965 129.694 25.7136 129.633 24.8188H129.572C129.002 25.6526 128.229 26.3033 127.253 26.7711C126.297 27.2388 125.25 27.4727 124.111 27.4727C122.627 27.4727 121.437 27.066 120.542 26.2525C119.668 25.4187 119.23 24.2697 119.23 22.8054C119.23 21.0361 119.973 19.6227 121.457 18.5652C122.962 17.4874 125.118 16.9485 127.924 16.9485H129.236V16.857C129.236 15.7791 129.023 15.0267 128.596 14.5996C128.168 14.1725 127.406 13.959 126.308 13.959C124.315 13.959 122.433 14.4166 120.664 15.3317L120.085 12.3727C122.017 11.4576 124.121 11 126.399 11ZM122.952 22.5004C122.952 23.1512 123.145 23.6596 123.532 24.0256C123.918 24.3917 124.447 24.5747 125.118 24.5747C126.277 24.5747 127.253 24.1985 128.046 23.446C128.84 22.6936 129.236 21.7479 129.236 20.6091V19.5719H127.924C126.318 19.5719 125.087 19.8464 124.233 20.3955C123.379 20.9243 122.952 21.6259 122.952 22.5004Z" fill="#ffffff" stroke-width="3" paint-order="stroke"/><path d="M96.1152 11.305H99.7758L99.8673 13.4404H99.9284C101.108 11.8135 102.46 11 103.986 11C104.982 11 105.806 11.2034 106.456 11.6101C107.107 12.0168 107.666 12.6778 108.134 13.5929H108.195C109.517 11.8643 111.073 11 112.862 11C114.571 11 115.811 11.4779 116.584 12.4337C117.377 13.3692 117.774 14.9555 117.774 17.1925V27.1676H113.93V18.1077C113.93 16.5214 113.757 15.4537 113.412 14.9046C113.086 14.3555 112.496 14.081 111.642 14.081C110.91 14.081 110.27 14.4674 109.72 15.2402C109.171 16.013 108.897 16.9688 108.897 18.1077V27.1676H105.053V18.1077C105.053 16.5214 104.88 15.4537 104.535 14.9046C104.209 14.3555 103.619 14.081 102.765 14.081C102.033 14.081 101.393 14.4674 100.844 15.2402C100.294 16.013 100.02 16.9688 100.02 18.1077V27.1676H96.1152V11.305Z" fill="#ffffff" stroke-width="3" paint-order="stroke"/><path d="M90.8503 19.2363C90.8503 17.5281 90.525 16.2469 89.8742 15.3927C89.2438 14.5386 88.3489 14.1115 87.1898 14.1115C86.1119 14.1115 85.2374 14.5589 84.5663 15.4537C83.9155 16.3282 83.5902 17.5382 83.5902 19.0838V19.3889C83.5902 20.9751 83.9155 22.2055 84.5663 23.08C85.2374 23.9341 86.1119 24.3612 87.1898 24.3612C88.2676 24.3612 89.1421 23.924 89.8132 23.0495C90.5046 22.1547 90.8503 20.8836 90.8503 19.2363ZM94.6635 19.2363C94.6635 21.8598 94.0737 23.8934 92.8942 25.3373C91.735 26.7609 90.2097 27.4727 88.3184 27.4727C86.3661 27.4727 84.8104 26.7304 83.6512 25.2458H83.5902V33.8787H79.6245V11.305H83.3461L83.4071 13.5319H83.4681C84.6883 11.844 86.3051 11 88.3184 11C90.2911 11 91.8367 11.7016 92.9552 13.1048C94.094 14.5081 94.6635 16.5519 94.6635 19.2363Z" fill="#ffffff" stroke-width="3" paint-order="stroke"/><path d="M70.2844 11C72.7045 11 74.4432 11.4779 75.5008 12.4337C76.5583 13.3692 77.087 14.8945 77.087 17.0095V22.8969C77.087 24.3409 77.2395 25.7644 77.5446 27.1676H73.7925C73.6705 26.4965 73.5789 25.7136 73.5179 24.8188H73.4569C72.8875 25.6526 72.1147 26.3033 71.1385 26.7711C70.1827 27.2388 69.1354 27.4727 67.9965 27.4727C66.5119 27.4727 65.3223 27.066 64.4274 26.2525C63.553 25.4187 63.1157 24.2697 63.1157 22.8054C63.1157 21.0361 63.858 19.6227 65.3426 18.5652C66.8475 17.4874 69.0032 16.9485 71.8096 16.9485H73.1214V16.857C73.1214 15.7791 72.9078 15.0267 72.4808 14.5996C72.0537 14.1725 71.2911 13.959 70.1929 13.959C68.1999 13.959 66.3187 14.4166 64.5495 15.3317L63.9699 12.3727C65.9018 11.4576 68.0067 11 70.2844 11ZM66.8373 22.5004C66.8373 23.1512 67.0305 23.6596 67.4169 24.0256C67.8033 24.3917 68.3321 24.5747 69.0032 24.5747C70.1624 24.5747 71.1385 24.1985 71.9317 23.446C72.7248 22.6936 73.1214 21.7479 73.1214 20.6091V19.5719H71.8096C70.203 19.5719 68.9727 19.8464 68.1185 20.3955C67.2644 20.9243 66.8373 21.6259 66.8373 22.5004Z" fill="#ffffff" stroke-width="3" paint-order="stroke"/><path d="M40 11.3049H43.6606L43.7521 13.4403H43.8131C44.9927 11.8133 46.345 10.9999 47.8703 10.9999C48.8668 10.9999 49.6904 11.2032 50.3412 11.61C50.992 12.0167 51.5512 12.6777 52.019 13.5928H52.08C53.4019 11.8642 54.9576 10.9999 56.7472 10.9999C58.4555 10.9999 59.6961 11.4778 60.4689 12.4336C61.262 13.3691 61.6586 14.9554 61.6586 17.1924V27.1675H57.8149V18.1075C57.8149 16.5213 57.6421 15.4536 57.2963 14.9045C56.9709 14.3554 56.3812 14.0809 55.527 14.0809C54.7949 14.0809 54.1543 14.4673 53.6052 15.2401C53.0561 16.0129 52.7816 16.9687 52.7816 18.1075V27.1675H48.938V18.1075C48.938 16.5213 48.7651 15.4536 48.4194 14.9045C48.094 14.3554 47.5042 14.0809 46.6501 14.0809C45.918 14.0809 45.2774 14.4673 44.7283 15.2401C44.1792 16.0129 43.9046 16.9687 43.9046 18.1075V27.1675H40V11.3049Z" 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="M146.965 19.2363C146.965 17.5281 146.64 16.2469 145.989 15.3927C145.358 14.5386 144.464 14.1115 143.304 14.1115C142.227 14.1115 141.352 14.5589 140.681 15.4537C140.03 16.3282 139.705 17.5382 139.705 19.0838V19.3889C139.705 20.9751 140.03 22.2055 140.681 23.08C141.352 23.9341 142.227 24.3612 143.304 24.3612C144.382 24.3612 145.257 23.924 145.928 23.0495C146.619 22.1547 146.965 20.8836 146.965 19.2363ZM150.778 19.2363C150.778 21.8598 150.188 23.8934 149.009 25.3373C147.85 26.7609 146.324 27.4727 144.433 27.4727C142.481 27.4727 140.925 26.7304 139.766 25.2458H139.705V33.8787H135.739V11.305H139.461L139.522 13.5319H139.583C140.803 11.844 142.42 11 144.433 11C146.406 11 147.951 11.7016 149.07 13.1048C150.209 14.5081 150.778 16.5519 150.778 19.2363Z" fill="#26282A"/><path d="M126.399 11C128.819 11 130.558 11.4779 131.615 12.4337C132.673 13.3692 133.202 14.8945 133.202 17.0095V22.8969C133.202 24.3409 133.354 25.7644 133.659 27.1676H129.907C129.785 26.4965 129.694 25.7136 129.633 24.8188H129.572C129.002 25.6526 128.229 26.3033 127.253 26.7711C126.297 27.2388 125.25 27.4727 124.111 27.4727C122.627 27.4727 121.437 27.066 120.542 26.2525C119.668 25.4187 119.23 24.2697 119.23 22.8054C119.23 21.0361 119.973 19.6227 121.457 18.5652C122.962 17.4874 125.118 16.9485 127.924 16.9485H129.236V16.857C129.236 15.7791 129.023 15.0267 128.596 14.5996C128.168 14.1725 127.406 13.959 126.308 13.959C124.315 13.959 122.433 14.4166 120.664 15.3317L120.085 12.3727C122.017 11.4576 124.121 11 126.399 11ZM122.952 22.5004C122.952 23.1512 123.145 23.6596 123.532 24.0256C123.918 24.3917 124.447 24.5747 125.118 24.5747C126.277 24.5747 127.253 24.1985 128.046 23.446C128.84 22.6936 129.236 21.7479 129.236 20.6091V19.5719H127.924C126.318 19.5719 125.087 19.8464 124.233 20.3955C123.379 20.9243 122.952 21.6259 122.952 22.5004Z" fill="#26282A"/><path d="M96.1152 11.305H99.7758L99.8673 13.4404H99.9284C101.108 11.8135 102.46 11 103.986 11C104.982 11 105.806 11.2034 106.456 11.6101C107.107 12.0168 107.666 12.6778 108.134 13.5929H108.195C109.517 11.8643 111.073 11 112.862 11C114.571 11 115.811 11.4779 116.584 12.4337C117.377 13.3692 117.774 14.9555 117.774 17.1925V27.1676H113.93V18.1077C113.93 16.5214 113.757 15.4537 113.412 14.9046C113.086 14.3555 112.496 14.081 111.642 14.081C110.91 14.081 110.27 14.4674 109.72 15.2402C109.171 16.013 108.897 16.9688 108.897 18.1077V27.1676H105.053V18.1077C105.053 16.5214 104.88 15.4537 104.535 14.9046C104.209 14.3555 103.619 14.081 102.765 14.081C102.033 14.081 101.393 14.4674 100.844 15.2402C100.294 16.013 100.02 16.9688 100.02 18.1077V27.1676H96.1152V11.305Z" fill="#26282A"/><path d="M90.8503 19.2363C90.8503 17.5281 90.525 16.2469 89.8742 15.3927C89.2438 14.5386 88.3489 14.1115 87.1898 14.1115C86.1119 14.1115 85.2374 14.5589 84.5663 15.4537C83.9155 16.3282 83.5902 17.5382 83.5902 19.0838V19.3889C83.5902 20.9751 83.9155 22.2055 84.5663 23.08C85.2374 23.9341 86.1119 24.3612 87.1898 24.3612C88.2676 24.3612 89.1421 23.924 89.8132 23.0495C90.5046 22.1547 90.8503 20.8836 90.8503 19.2363ZM94.6635 19.2363C94.6635 21.8598 94.0737 23.8934 92.8942 25.3373C91.735 26.7609 90.2097 27.4727 88.3184 27.4727C86.3661 27.4727 84.8104 26.7304 83.6512 25.2458H83.5902V33.8787H79.6245V11.305H83.3461L83.4071 13.5319H83.4681C84.6883 11.844 86.3051 11 88.3184 11C90.2911 11 91.8367 11.7016 92.9552 13.1048C94.094 14.5081 94.6635 16.5519 94.6635 19.2363Z" fill="#26282A"/><path d="M70.2844 11C72.7045 11 74.4432 11.4779 75.5008 12.4337C76.5583 13.3692 77.087 14.8945 77.087 17.0095V22.8969C77.087 24.3409 77.2395 25.7644 77.5446 27.1676H73.7925C73.6705 26.4965 73.5789 25.7136 73.5179 24.8188H73.4569C72.8875 25.6526 72.1147 26.3033 71.1385 26.7711C70.1827 27.2388 69.1354 27.4727 67.9965 27.4727C66.5119 27.4727 65.3223 27.066 64.4274 26.2525C63.553 25.4187 63.1157 24.2697 63.1157 22.8054C63.1157 21.0361 63.858 19.6227 65.3426 18.5652C66.8475 17.4874 69.0032 16.9485 71.8096 16.9485H73.1214V16.857C73.1214 15.7791 72.9078 15.0267 72.4808 14.5996C72.0537 14.1725 71.2911 13.959 70.1929 13.959C68.1999 13.959 66.3187 14.4166 64.5495 15.3317L63.9699 12.3727C65.9018 11.4576 68.0067 11 70.2844 11ZM66.8373 22.5004C66.8373 23.1512 67.0305 23.6596 67.4169 24.0256C67.8033 24.3917 68.3321 24.5747 69.0032 24.5747C70.1624 24.5747 71.1385 24.1985 71.9317 23.446C72.7248 22.6936 73.1214 21.7479 73.1214 20.6091V19.5719H71.8096C70.203 19.5719 68.9727 19.8464 68.1185 20.3955C67.2644 20.9243 66.8373 21.6259 66.8373 22.5004Z" fill="#26282A"/><path d="M40 11.3049H43.6606L43.7521 13.4403H43.8131C44.9927 11.8133 46.345 10.9999 47.8703 10.9999C48.8668 10.9999 49.6904 11.2032 50.3412 11.61C50.992 12.0167 51.5512 12.6777 52.019 13.5928H52.08C53.4019 11.8642 54.9576 10.9999 56.7472 10.9999C58.4555 10.9999 59.6961 11.4778 60.4689 12.4336C61.262 13.3691 61.6586 14.9554 61.6586 17.1924V27.1675H57.8149V18.1075C57.8149 16.5213 57.6421 15.4536 57.2963 14.9045C56.9709 14.3554 56.3812 14.0809 55.527 14.0809C54.7949 14.0809 54.1543 14.4673 53.6052 15.2401C53.0561 16.0129 52.7816 16.9687 52.7816 18.1075V27.1675H48.938V18.1075C48.938 16.5213 48.7651 15.4536 48.4194 14.9045C48.094 14.3554 47.5042 14.0809 46.6501 14.0809C45.918 14.0809 45.2774 14.4673 44.7283 15.2401C44.1792 16.0129 43.9046 16.9687 43.9046 18.1075V27.1675H40V11.3049Z" 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>';
|
|
465
|
+
var 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>';
|
|
458
466
|
var DEFAULT_HREF = "https://mapmap.ai";
|
|
459
467
|
var LogoControl = class {
|
|
460
468
|
constructor(options = {}) {
|
|
@@ -487,6 +495,102 @@ var NAV_CAMERA_DEFAULTS = {
|
|
|
487
495
|
zoom: 17.5,
|
|
488
496
|
speedMps: 12
|
|
489
497
|
};
|
|
498
|
+
var NAV_CAMERA_KINDS = [
|
|
499
|
+
"fixed",
|
|
500
|
+
"average",
|
|
501
|
+
"red_light",
|
|
502
|
+
"mobile_site",
|
|
503
|
+
"unknown"
|
|
504
|
+
];
|
|
505
|
+
function navCameraKind(value) {
|
|
506
|
+
if (typeof value !== "string") return "unknown";
|
|
507
|
+
switch (value.trim().toLowerCase()) {
|
|
508
|
+
case "fixed":
|
|
509
|
+
case "permanent":
|
|
510
|
+
return "fixed";
|
|
511
|
+
case "average":
|
|
512
|
+
case "average_speed":
|
|
513
|
+
case "section":
|
|
514
|
+
case "section_control":
|
|
515
|
+
return "average";
|
|
516
|
+
case "red_light":
|
|
517
|
+
case "redlight":
|
|
518
|
+
case "traffic_signals":
|
|
519
|
+
return "red_light";
|
|
520
|
+
case "mobile":
|
|
521
|
+
case "mobile_site":
|
|
522
|
+
return "mobile_site";
|
|
523
|
+
default:
|
|
524
|
+
return "unknown";
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
var NAV_ALERT_ICON_SETS = ["european", "us", "minimal", "brand"];
|
|
528
|
+
var NAV_ALERT_MODES = ["always", "whenSpeeding", "never"];
|
|
529
|
+
var NAV_ALERT_AUDIO_MODES = ["off", "earcon", "earcon_and_speech"];
|
|
530
|
+
var NAV_ALERT_SOUNDS = [
|
|
531
|
+
"cameraCalm",
|
|
532
|
+
"cameraUrgent",
|
|
533
|
+
"overspeedSoft",
|
|
534
|
+
"zoneEnter",
|
|
535
|
+
"zoneClear"
|
|
536
|
+
];
|
|
537
|
+
var NAV_ALERT_SOUND_FILES = {
|
|
538
|
+
cameraCalm: "earcon-camera-calm.mp3",
|
|
539
|
+
cameraUrgent: "earcon-camera-urgent.mp3",
|
|
540
|
+
overspeedSoft: "earcon-overspeed-soft.mp3",
|
|
541
|
+
zoneEnter: "earcon-zone-enter.mp3",
|
|
542
|
+
zoneClear: "earcon-zone-clear.mp3"
|
|
543
|
+
};
|
|
544
|
+
var NAV_ALERT_SOUND_BASE_URL = "https://mapmap.ai/earcons/";
|
|
545
|
+
function navAlertSoundUrl(sound, baseUrl = NAV_ALERT_SOUND_BASE_URL) {
|
|
546
|
+
const name = NAV_ALERT_SOUNDS.includes(sound) ? sound : "cameraCalm";
|
|
547
|
+
return `${baseUrl.replace(/\/*$/, "/")}${NAV_ALERT_SOUND_FILES[name]}`;
|
|
548
|
+
}
|
|
549
|
+
var NAV_ALERT_LEAD_DISTANCES = ["short", "standard", "long"];
|
|
550
|
+
var NAV_ALERT_LEAD_DISTANCE_M = {
|
|
551
|
+
short: 150,
|
|
552
|
+
standard: 250,
|
|
553
|
+
long: 400
|
|
554
|
+
};
|
|
555
|
+
function navAlertLeadDistanceM(preset) {
|
|
556
|
+
return NAV_ALERT_LEAD_DISTANCE_M[NAV_ALERT_LEAD_DISTANCES.includes(preset) ? preset : "standard"];
|
|
557
|
+
}
|
|
558
|
+
var NAV_ALERT_CHIP_POSITIONS = ["aboveSpeed", "topLeading", "topTrailing"];
|
|
559
|
+
function defaultNavAlertsDesign() {
|
|
560
|
+
const alertingKind = (alertMode, audioMode, showInRoutePreview, alertWhileDriving = true) => ({
|
|
561
|
+
showOnMap: true,
|
|
562
|
+
showOnMapWhileNavigating: true,
|
|
563
|
+
alertWhileDriving,
|
|
564
|
+
showInRoutePreview,
|
|
565
|
+
alertMode,
|
|
566
|
+
audioMode
|
|
567
|
+
});
|
|
568
|
+
return {
|
|
569
|
+
background: "#101418",
|
|
570
|
+
textColor: "#ffffff",
|
|
571
|
+
outlineColor: "#ffffff",
|
|
572
|
+
cornerRadius: 10,
|
|
573
|
+
outlineWidth: 1.5,
|
|
574
|
+
escalatedBackground: "#c0392b",
|
|
575
|
+
escalatedTextColor: "#ffffff",
|
|
576
|
+
iconSet: "european",
|
|
577
|
+
alertSound: "cameraCalm",
|
|
578
|
+
escalatedSound: "cameraUrgent",
|
|
579
|
+
mapIconSize: 1,
|
|
580
|
+
mapMinZoom: 12,
|
|
581
|
+
leadDistance: "standard",
|
|
582
|
+
chipPosition: "aboveSpeed",
|
|
583
|
+
corridorColor: "#e05c6c",
|
|
584
|
+
corridorOpacity: 0.55,
|
|
585
|
+
kinds: {
|
|
586
|
+
fixed: alertingKind("always", "earcon", true),
|
|
587
|
+
average: alertingKind("always", "earcon_and_speech", true),
|
|
588
|
+
red_light: alertingKind("always", "earcon", true),
|
|
589
|
+
mobile_site: alertingKind("whenSpeeding", "earcon", false),
|
|
590
|
+
unknown: alertingKind("whenSpeeding", "off", false, false)
|
|
591
|
+
}
|
|
592
|
+
};
|
|
593
|
+
}
|
|
490
594
|
function defaultNavDesign() {
|
|
491
595
|
return {
|
|
492
596
|
version: 1,
|
|
@@ -519,10 +623,69 @@ function bool(v, fallback) {
|
|
|
519
623
|
return typeof v === "boolean" ? v : fallback;
|
|
520
624
|
}
|
|
521
625
|
function puckImageUrl(v) {
|
|
626
|
+
return assetUrl(v);
|
|
627
|
+
}
|
|
628
|
+
function iconUrl(v) {
|
|
629
|
+
return assetUrl(v);
|
|
630
|
+
}
|
|
631
|
+
function assetUrl(v) {
|
|
522
632
|
if (typeof v !== "string") return void 0;
|
|
523
633
|
const t = v.trim();
|
|
524
634
|
return /^(https:|data:)/i.test(t) ? t : void 0;
|
|
525
635
|
}
|
|
636
|
+
function oneOf(v, allowed, fallback) {
|
|
637
|
+
return typeof v === "string" && allowed.includes(v) ? v : fallback;
|
|
638
|
+
}
|
|
639
|
+
function parseNavAlertKind(value, d) {
|
|
640
|
+
const k = isRecord(value) ? value : {};
|
|
641
|
+
return {
|
|
642
|
+
showOnMap: bool(k.showOnMap, d.showOnMap),
|
|
643
|
+
showOnMapWhileNavigating: bool(k.showOnMapWhileNavigating, d.showOnMapWhileNavigating),
|
|
644
|
+
alertWhileDriving: bool(k.alertWhileDriving, d.alertWhileDriving),
|
|
645
|
+
showInRoutePreview: bool(k.showInRoutePreview, d.showInRoutePreview),
|
|
646
|
+
alertMode: oneOf(k.alertMode, NAV_ALERT_MODES, d.alertMode),
|
|
647
|
+
audioMode: oneOf(k.audioMode, NAV_ALERT_AUDIO_MODES, d.audioMode)
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
function parseNavAlertsDesign(value) {
|
|
651
|
+
const d = defaultNavAlertsDesign();
|
|
652
|
+
const a = isRecord(value) ? value : {};
|
|
653
|
+
const kindsIn = isRecord(a.kinds) ? a.kinds : {};
|
|
654
|
+
const kinds = {};
|
|
655
|
+
for (const kind of NAV_CAMERA_KINDS) {
|
|
656
|
+
kinds[kind] = parseNavAlertKind(kindsIn[kind], d.kinds[kind]);
|
|
657
|
+
}
|
|
658
|
+
const overridesIn = isRecord(a.iconUrlOverrides) ? a.iconUrlOverrides : {};
|
|
659
|
+
const iconUrlOverrides = {};
|
|
660
|
+
for (const kind of NAV_CAMERA_KINDS) {
|
|
661
|
+
const url = iconUrl(overridesIn[kind]);
|
|
662
|
+
if (url !== void 0) iconUrlOverrides[kind] = url;
|
|
663
|
+
}
|
|
664
|
+
const alertSoundUrl2 = assetUrl(a.alertSoundUrl);
|
|
665
|
+
const escalatedSoundUrl = assetUrl(a.escalatedSoundUrl);
|
|
666
|
+
return {
|
|
667
|
+
background: str(a.background, d.background),
|
|
668
|
+
textColor: str(a.textColor, d.textColor),
|
|
669
|
+
outlineColor: str(a.outlineColor, d.outlineColor),
|
|
670
|
+
cornerRadius: num(a.cornerRadius, d.cornerRadius, 0, 24),
|
|
671
|
+
outlineWidth: num(a.outlineWidth, d.outlineWidth, 0, 4),
|
|
672
|
+
escalatedBackground: str(a.escalatedBackground, d.escalatedBackground),
|
|
673
|
+
escalatedTextColor: str(a.escalatedTextColor, d.escalatedTextColor),
|
|
674
|
+
iconSet: oneOf(a.iconSet, NAV_ALERT_ICON_SETS, d.iconSet),
|
|
675
|
+
...Object.keys(iconUrlOverrides).length > 0 ? { iconUrlOverrides } : {},
|
|
676
|
+
alertSound: oneOf(a.alertSound, NAV_ALERT_SOUNDS, d.alertSound),
|
|
677
|
+
...alertSoundUrl2 !== void 0 ? { alertSoundUrl: alertSoundUrl2 } : {},
|
|
678
|
+
escalatedSound: oneOf(a.escalatedSound, NAV_ALERT_SOUNDS, d.escalatedSound),
|
|
679
|
+
...escalatedSoundUrl !== void 0 ? { escalatedSoundUrl } : {},
|
|
680
|
+
mapIconSize: num(a.mapIconSize, d.mapIconSize, 0.75, 1.5),
|
|
681
|
+
mapMinZoom: num(a.mapMinZoom, d.mapMinZoom, 9, 14),
|
|
682
|
+
leadDistance: oneOf(a.leadDistance, NAV_ALERT_LEAD_DISTANCES, d.leadDistance),
|
|
683
|
+
chipPosition: oneOf(a.chipPosition, NAV_ALERT_CHIP_POSITIONS, d.chipPosition),
|
|
684
|
+
corridorColor: str(a.corridorColor, d.corridorColor),
|
|
685
|
+
corridorOpacity: num(a.corridorOpacity, d.corridorOpacity, 0, 1),
|
|
686
|
+
kinds
|
|
687
|
+
};
|
|
688
|
+
}
|
|
526
689
|
function parseNavDesign(value) {
|
|
527
690
|
const d = defaultNavDesign();
|
|
528
691
|
if (!isRecord(value)) return d;
|
|
@@ -562,7 +725,13 @@ function parseNavDesign(value) {
|
|
|
562
725
|
zoom: optNum(value.camera.zoom, 14, 20),
|
|
563
726
|
speedMps: optNum(value.camera.speedMps, 2, 40)
|
|
564
727
|
}
|
|
565
|
-
} : {}
|
|
728
|
+
} : {},
|
|
729
|
+
// Alerts is optional since v1 on the same terms as camera: absent (or
|
|
730
|
+
// malformed) stays undefined so old themes round-trip byte-identical.
|
|
731
|
+
// Unlike camera, a PRESENT block always parses complete - every field
|
|
732
|
+
// filled from the defaults - because half an alert design is a safety
|
|
733
|
+
// defect, not a partial style.
|
|
734
|
+
...isRecord(value.alerts) ? { alerts: parseNavAlertsDesign(value.alerts) } : {}
|
|
566
735
|
};
|
|
567
736
|
}
|
|
568
737
|
function navDesignFromTheme(theme) {
|
|
@@ -753,7 +922,7 @@ var OSM_ATTRIBUTION = "\xA9 OpenStreetMap contributors";
|
|
|
753
922
|
var OPENMAPTILES_ATTRIBUTION = "\xA9 OpenMapTiles";
|
|
754
923
|
var FULL_ATTRIBUTION = "\xA9 OpenStreetMap contributors \xA9 OpenMapTiles";
|
|
755
924
|
var DEFAULT_GLYPHS_URL = "https://fonts.mapmap.ai/{fontstack}/{range}.pbf";
|
|
756
|
-
var DEFAULT_TERRITORY_TILES_URL = "pmtiles://https://tiles.mapmap.ai/
|
|
925
|
+
var DEFAULT_TERRITORY_TILES_URL = "pmtiles://https://tiles.mapmap.ai/planet.pmtiles";
|
|
757
926
|
var SOURCE_LAYERS = [
|
|
758
927
|
"aerodrome_label",
|
|
759
928
|
"aeroway",
|
|
@@ -1082,7 +1251,7 @@ function buildStyle(options = {}) {
|
|
|
1082
1251
|
const theme = typeof input === "string" ? { name: input, base: input } : input;
|
|
1083
1252
|
const palette = resolvePalette(theme);
|
|
1084
1253
|
const p = (slot) => palette[slot];
|
|
1085
|
-
const font = [theme.fonts?.regular ?? "
|
|
1254
|
+
const font = [theme.fonts?.regular ?? "MapMap Sans Regular"];
|
|
1086
1255
|
const nameField = nameFieldFor(options.labelLanguage);
|
|
1087
1256
|
const tilesUrl = toPmtilesUrl(
|
|
1088
1257
|
options.territoryTilesUrl ?? DEFAULT_TERRITORY_TILES_URL
|
|
@@ -1295,6 +1464,9 @@ function buildStyle(options = {}) {
|
|
|
1295
1464
|
// Road widths ramp all the way to z20. They previously ended at z16, so
|
|
1296
1465
|
// z17+ rendered frozen at z16 weights (4 px minor) against a 15-30 px
|
|
1297
1466
|
// reference — the "schematic lines" bug.
|
|
1467
|
+
// Fills take round caps/joins like their casings: with the default butt
|
|
1468
|
+
// caps, consecutive segments split at junction nodes leave wedge gaps
|
|
1469
|
+
// the casing shows through — a pale notch exactly where roads join.
|
|
1298
1470
|
{
|
|
1299
1471
|
id: "road-minor",
|
|
1300
1472
|
type: "line",
|
|
@@ -1313,6 +1485,7 @@ function buildStyle(options = {}) {
|
|
|
1313
1485
|
"pedestrian",
|
|
1314
1486
|
"ferry"
|
|
1315
1487
|
],
|
|
1488
|
+
layout: { "line-cap": "round", "line-join": "round" },
|
|
1316
1489
|
paint: {
|
|
1317
1490
|
"line-color": p("road"),
|
|
1318
1491
|
"line-width": [
|
|
@@ -1345,6 +1518,7 @@ function buildStyle(options = {}) {
|
|
|
1345
1518
|
source: "territory",
|
|
1346
1519
|
"source-layer": "transportation",
|
|
1347
1520
|
filter: ["in", "class", "motorway", "trunk", "primary"],
|
|
1521
|
+
layout: { "line-cap": "round", "line-join": "round" },
|
|
1348
1522
|
paint: {
|
|
1349
1523
|
"line-color": p("roadMajor"),
|
|
1350
1524
|
"line-width": [
|
|
@@ -1450,10 +1624,10 @@ function buildStyle(options = {}) {
|
|
|
1450
1624
|
// style - a text glyph needs only the glyph server the labels already use.
|
|
1451
1625
|
//
|
|
1452
1626
|
// The font is PINNED rather than following `theme.fonts`: U+2192 is absent
|
|
1453
|
-
// from 5 of the
|
|
1627
|
+
// from 5 of the bundled fontstacks (Barlow, Noto Serif, Nunito, Open
|
|
1454
1628
|
// Sans, Rubik - verified by decoding their 8448-8703 glyph ranges), so a
|
|
1455
|
-
// themed font would silently drop every arrow. "
|
|
1456
|
-
// default fontstack and
|
|
1629
|
+
// themed font would silently drop every arrow. "MapMap Sans Regular" is
|
|
1630
|
+
// the default fontstack and carries it (verified the same way).
|
|
1457
1631
|
//
|
|
1458
1632
|
// `text-keep-upright` MUST be false: left at its `true` default MapLibre
|
|
1459
1633
|
// flips glyphs on right-to-left line segments to keep them readable, which
|
|
@@ -1482,7 +1656,7 @@ function buildStyle(options = {}) {
|
|
|
1482
1656
|
"symbol-placement": "line",
|
|
1483
1657
|
"symbol-spacing": 200,
|
|
1484
1658
|
"text-field": "\u2192",
|
|
1485
|
-
"text-font": ["
|
|
1659
|
+
"text-font": ["MapMap Sans Regular"],
|
|
1486
1660
|
"text-size": ["interpolate", ["linear"], ["zoom"], 16, 8, 20, 12],
|
|
1487
1661
|
"text-rotation-alignment": "map",
|
|
1488
1662
|
"text-pitch-alignment": "map",
|
|
@@ -1982,6 +2156,8 @@ function numberOr(value, fallback) {
|
|
|
1982
2156
|
// src/route.ts
|
|
1983
2157
|
var SIGNAL_BLUE = "#3a86ff";
|
|
1984
2158
|
var CASING_COLOR = "#1f438a";
|
|
2159
|
+
var CORRIDOR_COLOR = "#e05c6c";
|
|
2160
|
+
var CORRIDOR_OPACITY = 0.55;
|
|
1985
2161
|
var PROGRESS_COLOR = "#b0b0b0";
|
|
1986
2162
|
function arrowImage() {
|
|
1987
2163
|
const size = 24;
|
|
@@ -2011,9 +2187,11 @@ function arrowImage() {
|
|
|
2011
2187
|
var RouteLayer = class {
|
|
2012
2188
|
constructor(map, options = {}) {
|
|
2013
2189
|
this.progress = 0;
|
|
2190
|
+
this.corridors = [];
|
|
2014
2191
|
this.handleStyleLoad = () => {
|
|
2015
2192
|
if (this.lastRoute) this.install(this.lastRoute);
|
|
2016
2193
|
else this.installManeuver();
|
|
2194
|
+
this.installCorridors();
|
|
2017
2195
|
};
|
|
2018
2196
|
if (map instanceof MapMapMap) {
|
|
2019
2197
|
this.map = map.map;
|
|
@@ -2021,6 +2199,7 @@ var RouteLayer = class {
|
|
|
2021
2199
|
this.baseUrl = (options.baseUrl ?? map.baseUrl).replace(/\/+$/, "");
|
|
2022
2200
|
this.apiKey = options.apiKey ?? map.apiKey;
|
|
2023
2201
|
this.design = options.design ?? map.navDesign?.route;
|
|
2202
|
+
this.alertsDesign = options.alertsDesign ?? map.navDesign?.alerts;
|
|
2024
2203
|
} else {
|
|
2025
2204
|
this.map = map;
|
|
2026
2205
|
if (!options.baseUrl) {
|
|
@@ -2029,6 +2208,7 @@ var RouteLayer = class {
|
|
|
2029
2208
|
this.baseUrl = options.baseUrl.replace(/\/+$/, "");
|
|
2030
2209
|
this.apiKey = options.apiKey;
|
|
2031
2210
|
this.design = options.design;
|
|
2211
|
+
this.alertsDesign = options.alertsDesign;
|
|
2032
2212
|
}
|
|
2033
2213
|
const id = options.id ?? "mapmap-route";
|
|
2034
2214
|
this.sourceId = `${id}-src`;
|
|
@@ -2037,6 +2217,8 @@ var RouteLayer = class {
|
|
|
2037
2217
|
this.maneuverSourceId = `${id}-maneuver-src`;
|
|
2038
2218
|
this.maneuverLayerId = `${id}-maneuver`;
|
|
2039
2219
|
this.arrowImageId = `${id}-arrow`;
|
|
2220
|
+
this.corridorSourceId = `${id}-corridor-src`;
|
|
2221
|
+
this.corridorLayerId = `${id}-corridor`;
|
|
2040
2222
|
this.progressColor = options.progressColor ?? PROGRESS_COLOR;
|
|
2041
2223
|
this.map.on("style.load", this.handleStyleLoad);
|
|
2042
2224
|
}
|
|
@@ -2206,9 +2388,79 @@ var RouteLayer = class {
|
|
|
2206
2388
|
this.map.setLayoutProperty(this.maneuverLayerId, "icon-rotate", ["get", "bearing"]);
|
|
2207
2389
|
}
|
|
2208
2390
|
}
|
|
2391
|
+
/**
|
|
2392
|
+
* Highlights average-speed enforcement corridors on the route line.
|
|
2393
|
+
*
|
|
2394
|
+
* A corridor is a stretch of the route between an entry and an exit
|
|
2395
|
+
* camera, so it is a property of the LINE, not a point alert: drawing it
|
|
2396
|
+
* as a tinted overlay above the route is what makes "you are inside a
|
|
2397
|
+
* section check right now" readable at a glance, and it is the only part
|
|
2398
|
+
* of the alert design that persists rather than firing once.
|
|
2399
|
+
*
|
|
2400
|
+
* Pass the corridor geometries (arrays of `[lng, lat]` along the route)
|
|
2401
|
+
* and, optionally, a Studio alerts design for the colour and opacity;
|
|
2402
|
+
* without one the layer uses the design carried by the owning map, then
|
|
2403
|
+
* a built-in tint. An empty array clears the highlight. Survives style
|
|
2404
|
+
* swaps like the route itself.
|
|
2405
|
+
*/
|
|
2406
|
+
setAlertCorridors(corridors, design) {
|
|
2407
|
+
if (design) this.alertsDesign = design;
|
|
2408
|
+
this.corridors = corridors.map((line) => line.map((p) => [p[0], p[1]]));
|
|
2409
|
+
if (this.corridors.length === 0) {
|
|
2410
|
+
this.clearAlertCorridors();
|
|
2411
|
+
return;
|
|
2412
|
+
}
|
|
2413
|
+
if (this.map.isStyleLoaded()) this.installCorridors();
|
|
2414
|
+
}
|
|
2415
|
+
/** Removes the corridor highlight (the route line itself is untouched). */
|
|
2416
|
+
clearAlertCorridors() {
|
|
2417
|
+
this.corridors = [];
|
|
2418
|
+
if (this.map.getLayer(this.corridorLayerId)) this.map.removeLayer(this.corridorLayerId);
|
|
2419
|
+
if (this.map.getSource(this.corridorSourceId)) this.map.removeSource(this.corridorSourceId);
|
|
2420
|
+
}
|
|
2421
|
+
/** Add-or-update the corridor source/layer for the current style. */
|
|
2422
|
+
installCorridors() {
|
|
2423
|
+
if (this.corridors.length === 0) return;
|
|
2424
|
+
const data = {
|
|
2425
|
+
type: "FeatureCollection",
|
|
2426
|
+
features: this.corridors.map((coordinates) => ({
|
|
2427
|
+
type: "Feature",
|
|
2428
|
+
properties: {},
|
|
2429
|
+
geometry: { type: "LineString", coordinates }
|
|
2430
|
+
}))
|
|
2431
|
+
};
|
|
2432
|
+
const source = this.map.getSource(this.corridorSourceId);
|
|
2433
|
+
if (source) {
|
|
2434
|
+
source.setData(data);
|
|
2435
|
+
} else {
|
|
2436
|
+
this.map.addSource(this.corridorSourceId, { type: "geojson", data });
|
|
2437
|
+
}
|
|
2438
|
+
const design = this.alertsDesign;
|
|
2439
|
+
const color = design?.corridorColor ?? CORRIDOR_COLOR;
|
|
2440
|
+
const opacity = design?.corridorOpacity ?? CORRIDOR_OPACITY;
|
|
2441
|
+
const width = (this.design?.width ?? 4.5) + 3;
|
|
2442
|
+
if (!this.map.getLayer(this.corridorLayerId)) {
|
|
2443
|
+
this.map.addLayer({
|
|
2444
|
+
id: this.corridorLayerId,
|
|
2445
|
+
type: "line",
|
|
2446
|
+
source: this.corridorSourceId,
|
|
2447
|
+
layout: { "line-cap": "round", "line-join": "round" },
|
|
2448
|
+
paint: {
|
|
2449
|
+
"line-color": color,
|
|
2450
|
+
"line-width": width,
|
|
2451
|
+
"line-opacity": opacity
|
|
2452
|
+
}
|
|
2453
|
+
});
|
|
2454
|
+
} else {
|
|
2455
|
+
this.map.setPaintProperty(this.corridorLayerId, "line-color", color);
|
|
2456
|
+
this.map.setPaintProperty(this.corridorLayerId, "line-opacity", opacity);
|
|
2457
|
+
this.map.setPaintProperty(this.corridorLayerId, "line-width", width);
|
|
2458
|
+
}
|
|
2459
|
+
}
|
|
2209
2460
|
/** Remove the route's layers and source from the map. */
|
|
2210
2461
|
clear() {
|
|
2211
2462
|
this.clearManeuver();
|
|
2463
|
+
this.clearAlertCorridors();
|
|
2212
2464
|
for (const layerId of [this.lineLayerId, this.casingLayerId]) {
|
|
2213
2465
|
if (this.map.getLayer(layerId)) this.map.removeLayer(layerId);
|
|
2214
2466
|
}
|
|
@@ -2226,6 +2478,57 @@ var RouteLayer = class {
|
|
|
2226
2478
|
this.clear();
|
|
2227
2479
|
}
|
|
2228
2480
|
};
|
|
2481
|
+
|
|
2482
|
+
// src/contrast.ts
|
|
2483
|
+
var ALERT_CONTRAST_MIN = 4.5;
|
|
2484
|
+
function parseHexColor(value) {
|
|
2485
|
+
if (typeof value !== "string") return void 0;
|
|
2486
|
+
const hex = value.trim().replace(/^#/, "");
|
|
2487
|
+
if (!/^[0-9a-f]+$/i.test(hex)) return void 0;
|
|
2488
|
+
const expanded = hex.length === 3 || hex.length === 4 ? hex.slice(0, 3).split("").map((c) => c + c).join("") : hex.length === 6 || hex.length === 8 ? hex.slice(0, 6) : void 0;
|
|
2489
|
+
if (expanded === void 0) return void 0;
|
|
2490
|
+
return [
|
|
2491
|
+
parseInt(expanded.slice(0, 2), 16),
|
|
2492
|
+
parseInt(expanded.slice(2, 4), 16),
|
|
2493
|
+
parseInt(expanded.slice(4, 6), 16)
|
|
2494
|
+
];
|
|
2495
|
+
}
|
|
2496
|
+
function relativeLuminance(rgb) {
|
|
2497
|
+
const [r, g, b] = rgb.map((channel) => {
|
|
2498
|
+
const c = channel / 255;
|
|
2499
|
+
return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
|
|
2500
|
+
});
|
|
2501
|
+
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
2502
|
+
}
|
|
2503
|
+
function contrastRatio(a, b) {
|
|
2504
|
+
const rgbA = parseHexColor(a);
|
|
2505
|
+
const rgbB = parseHexColor(b);
|
|
2506
|
+
if (!rgbA || !rgbB) return void 0;
|
|
2507
|
+
const lumA = relativeLuminance(rgbA);
|
|
2508
|
+
const lumB = relativeLuminance(rgbB);
|
|
2509
|
+
const lighter = Math.max(lumA, lumB);
|
|
2510
|
+
const darker = Math.min(lumA, lumB);
|
|
2511
|
+
return (lighter + 0.05) / (darker + 0.05);
|
|
2512
|
+
}
|
|
2513
|
+
function alertContrastIssues(design) {
|
|
2514
|
+
const pairs = [
|
|
2515
|
+
["calm", design.textColor, design.background],
|
|
2516
|
+
["escalated", design.escalatedTextColor, design.escalatedBackground]
|
|
2517
|
+
];
|
|
2518
|
+
const issues = [];
|
|
2519
|
+
for (const [state, textColor, background] of pairs) {
|
|
2520
|
+
const ratio = contrastRatio(textColor, background);
|
|
2521
|
+
if (ratio === void 0 || ratio >= ALERT_CONTRAST_MIN) continue;
|
|
2522
|
+
issues.push({
|
|
2523
|
+
state,
|
|
2524
|
+
textColor,
|
|
2525
|
+
background,
|
|
2526
|
+
ratio: Math.round(ratio * 100) / 100,
|
|
2527
|
+
minimum: ALERT_CONTRAST_MIN
|
|
2528
|
+
});
|
|
2529
|
+
}
|
|
2530
|
+
return issues;
|
|
2531
|
+
}
|
|
2229
2532
|
var MAX_PUCK_IMAGE_BYTES = 64 * 1024;
|
|
2230
2533
|
function dataUriBytes(uri) {
|
|
2231
2534
|
const comma = uri.indexOf(",");
|
|
@@ -2570,7 +2873,7 @@ function classifyStatus(status) {
|
|
|
2570
2873
|
return "rejected";
|
|
2571
2874
|
}
|
|
2572
2875
|
var EARTH_RADIUS_M2 = 63710088e-1;
|
|
2573
|
-
var CLUSTER_TEXT_FONT = "
|
|
2876
|
+
var CLUSTER_TEXT_FONT = "MapMap Sans Regular";
|
|
2574
2877
|
function placesFromGeoJSON(collection) {
|
|
2575
2878
|
const places = [];
|
|
2576
2879
|
collection.features.forEach((feature, index) => {
|
|
@@ -3633,6 +3936,16 @@ var AdrCheck = class {
|
|
|
3633
3936
|
};
|
|
3634
3937
|
|
|
3635
3938
|
// src/guidance.ts
|
|
3939
|
+
var CSS_COLOUR = /^(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color|color-mix|var)\((?:[\w\s.,%/#-]|\([\w\s.,%/#-]*\))*\)$/i;
|
|
3940
|
+
function safeColour(value, fallback) {
|
|
3941
|
+
const v = value.trim();
|
|
3942
|
+
if (v === "" || /[;{}]|url\(|\/\*/i.test(v)) return fallback;
|
|
3943
|
+
if (v.startsWith("#")) {
|
|
3944
|
+
return /^[0-9a-fA-F]+$/.test(v.slice(1)) && [3, 4, 6, 8].includes(v.length - 1) ? v : fallback;
|
|
3945
|
+
}
|
|
3946
|
+
if (/^[a-zA-Z][a-zA-Z-]*$/.test(v)) return v;
|
|
3947
|
+
return CSS_COLOUR.test(v) ? v : fallback;
|
|
3948
|
+
}
|
|
3636
3949
|
function extractGuidance(route) {
|
|
3637
3950
|
const legs = route.raw["legs"] ?? [];
|
|
3638
3951
|
const out = [];
|
|
@@ -3642,13 +3955,18 @@ function extractGuidance(route) {
|
|
|
3642
3955
|
for (const step of steps) {
|
|
3643
3956
|
const voice = step["voiceInstructions"] ?? [];
|
|
3644
3957
|
const banners = step["bannerInstructions"] ?? [];
|
|
3645
|
-
|
|
3958
|
+
const guidance = {
|
|
3646
3959
|
stepIndex: index,
|
|
3647
3960
|
distanceM: Number(step["distance"] ?? 0),
|
|
3648
3961
|
instruction: stepInstruction(step, voice, banners),
|
|
3649
3962
|
voice,
|
|
3650
3963
|
banners
|
|
3651
|
-
}
|
|
3964
|
+
};
|
|
3965
|
+
if (typeof step["mode"] === "string") guidance.mode = step["mode"];
|
|
3966
|
+
if (typeof step["driving_side"] === "string") {
|
|
3967
|
+
guidance.drivingSide = step["driving_side"];
|
|
3968
|
+
}
|
|
3969
|
+
out.push(guidance);
|
|
3652
3970
|
index += 1;
|
|
3653
3971
|
}
|
|
3654
3972
|
}
|
|
@@ -3678,10 +3996,11 @@ var XML_ENTITIES = {
|
|
|
3678
3996
|
"'": "'"
|
|
3679
3997
|
};
|
|
3680
3998
|
function ssmlToText(ssml) {
|
|
3681
|
-
return ssml.replace(/<[^>]+>/g, "").replace(
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3999
|
+
return ssml.replace(/<[^>]+>/g, "").replace(/&(?:amp|lt|gt|quot|apos);|&#(\d+);/g, (entity, decimal) => {
|
|
4000
|
+
if (decimal === void 0) return XML_ENTITIES[entity] ?? entity;
|
|
4001
|
+
const n = Number(decimal);
|
|
4002
|
+
return n <= 1114111 ? String.fromCodePoint(n) : entity;
|
|
4003
|
+
}).trim();
|
|
3685
4004
|
}
|
|
3686
4005
|
function bannerLanes(banner) {
|
|
3687
4006
|
const components = banner.sub?.components ?? [];
|
|
@@ -3737,11 +4056,17 @@ var GuidanceBanner = class {
|
|
|
3737
4056
|
this.design = design;
|
|
3738
4057
|
this.element = doc.createElement("div");
|
|
3739
4058
|
this.element.className = "mapmap-banner";
|
|
3740
|
-
this.element.style.cssText = design ? `display:none;align-items:center;box-sizing:border-box;gap:${Math.round((design.padding ?? 10) * 1.2)}px;padding:${design.padding ?? 10}px ${Math.round((design.padding ?? 10) * 1.4)}px;background:${design.background};color:${design.textColor};border-radius:${design.cornerRadius ?? 10}px;max-width:${design.maxWidth ?? 340}px;` + (design.height !== void 0 ? `min-height:${design.height}px;` : "") + `font:600 ${design.fontSize}px/1.3 system-ui,sans-serif` : "display:none;gap:12px;align-items:center;padding:10px 14px;background:#101418;color:#fff;border-radius:10px;font:600 16px/1.3 system-ui,sans-serif";
|
|
4059
|
+
this.element.style.cssText = design ? `display:none;align-items:center;box-sizing:border-box;gap:${Math.round((design.padding ?? 10) * 1.2)}px;padding:${design.padding ?? 10}px ${Math.round((design.padding ?? 10) * 1.4)}px;background:${safeColour(design.background, "#101418")};color:${safeColour(design.textColor, "#ffffff")};border-radius:${design.cornerRadius ?? 10}px;max-width:${design.maxWidth ?? 340}px;` + (design.height !== void 0 ? `min-height:${design.height}px;` : "") + `font:600 ${design.fontSize}px/1.3 system-ui,sans-serif` : "display:none;gap:12px;align-items:center;padding:10px 14px;background:#101418;color:#fff;border-radius:10px;font:600 16px/1.3 system-ui,sans-serif";
|
|
3741
4060
|
container?.appendChild(this.element);
|
|
3742
4061
|
}
|
|
3743
|
-
/**
|
|
3744
|
-
|
|
4062
|
+
/**
|
|
4063
|
+
* Renders a banner instruction (or hides the element with `null`).
|
|
4064
|
+
*
|
|
4065
|
+
* `step` is optional icon context — pass the step's {@link StepGuidance}
|
|
4066
|
+
* (or any `{ mode, drivingSide }`) so ferry legs render the ferry glyph
|
|
4067
|
+
* and u-turns point the correct way in left-hand-traffic regions.
|
|
4068
|
+
*/
|
|
4069
|
+
update(banner, step) {
|
|
3745
4070
|
if (!banner) {
|
|
3746
4071
|
this.element.style.display = "none";
|
|
3747
4072
|
this.element.replaceChildren();
|
|
@@ -3749,12 +4074,24 @@ var GuidanceBanner = class {
|
|
|
3749
4074
|
}
|
|
3750
4075
|
const doc = this.element.ownerDocument;
|
|
3751
4076
|
this.element.style.display = "flex";
|
|
3752
|
-
const
|
|
3753
|
-
|
|
3754
|
-
|
|
4077
|
+
const iconSize = this.design ? Math.round(this.design.fontSize * 1.4) : 22;
|
|
4078
|
+
const icon = doc.createElement("span");
|
|
4079
|
+
icon.className = "mapmap-banner-icon";
|
|
4080
|
+
icon.setAttribute("aria-hidden", "true");
|
|
4081
|
+
icon.style.cssText = `flex:none;display:inline-flex;width:${iconSize}px;height:${iconSize}px`;
|
|
4082
|
+
icon.innerHTML = directionIcons[iconNameForStep({
|
|
4083
|
+
maneuver: { type: banner.primary.type, modifier: banner.primary.modifier },
|
|
4084
|
+
mode: step?.mode,
|
|
4085
|
+
driving_side: step?.drivingSide
|
|
4086
|
+
})];
|
|
4087
|
+
const svg = icon.firstElementChild;
|
|
4088
|
+
if (svg) {
|
|
4089
|
+
svg.setAttribute("width", "100%");
|
|
4090
|
+
svg.setAttribute("height", "100%");
|
|
4091
|
+
}
|
|
3755
4092
|
const text = doc.createElement("span");
|
|
3756
4093
|
text.textContent = banner.primary.text;
|
|
3757
|
-
const children = [
|
|
4094
|
+
const children = [icon, text];
|
|
3758
4095
|
const lanes = this.design?.showLanes === false ? [] : bannerLanes(banner);
|
|
3759
4096
|
if (lanes.length > 0) {
|
|
3760
4097
|
const laneRow = doc.createElement("span");
|
|
@@ -3778,6 +4115,211 @@ var GuidanceBanner = class {
|
|
|
3778
4115
|
this.element.replaceChildren(...children);
|
|
3779
4116
|
}
|
|
3780
4117
|
};
|
|
4118
|
+
function alertPresentation(design, alert, state = {}) {
|
|
4119
|
+
const kind = navCameraKind(alert.kind);
|
|
4120
|
+
const rules = design.kinds[kind];
|
|
4121
|
+
const speeding = state.speeding === true;
|
|
4122
|
+
const audible = rules.audioMode !== "off" && rules.alertWhileDriving && (rules.alertMode === "always" || rules.alertMode === "whenSpeeding" && speeding);
|
|
4123
|
+
return {
|
|
4124
|
+
visible: rules.alertWhileDriving,
|
|
4125
|
+
escalated: speeding,
|
|
4126
|
+
audible,
|
|
4127
|
+
audioMode: rules.audioMode,
|
|
4128
|
+
soundUrl: alertSoundUrl(design, speeding),
|
|
4129
|
+
leadDistanceM: navAlertLeadDistanceM(design.leadDistance)
|
|
4130
|
+
};
|
|
4131
|
+
}
|
|
4132
|
+
function alertSoundUrl(design, escalated) {
|
|
4133
|
+
const override = escalated ? design.escalatedSoundUrl : design.alertSoundUrl;
|
|
4134
|
+
if (override !== void 0) return override;
|
|
4135
|
+
return navAlertSoundUrl(escalated ? design.escalatedSound : design.alertSound);
|
|
4136
|
+
}
|
|
4137
|
+
function cameraShownOnMap(design, kind, mode = "browse") {
|
|
4138
|
+
const rules = design.kinds[navCameraKind(kind)];
|
|
4139
|
+
return mode === "navigating" ? rules.showOnMapWhileNavigating : rules.showOnMap;
|
|
4140
|
+
}
|
|
4141
|
+
function cameraKindsShownOnMap(design, mode = "browse") {
|
|
4142
|
+
return NAV_CAMERA_KINDS.filter((kind) => cameraShownOnMap(design, kind, mode));
|
|
4143
|
+
}
|
|
4144
|
+
function cameraSymbolLayer(design, source, mode = "browse", variant = "dark", id = "safety-cameras") {
|
|
4145
|
+
const kinds = cameraKindsShownOnMap(design, mode);
|
|
4146
|
+
const iconImage = ["match", ["get", "kind"]];
|
|
4147
|
+
for (const kind of NAV_CAMERA_KINDS) {
|
|
4148
|
+
if (kind === "unknown") continue;
|
|
4149
|
+
const values = kind === "red_light" ? ["red_light", "redlight"] : [kind];
|
|
4150
|
+
iconImage.push(values.length === 1 ? values[0] : values, cameraSpriteName(kind, variant));
|
|
4151
|
+
}
|
|
4152
|
+
iconImage.push(cameraSpriteName("unknown", variant));
|
|
4153
|
+
return {
|
|
4154
|
+
id,
|
|
4155
|
+
type: "symbol",
|
|
4156
|
+
source,
|
|
4157
|
+
minzoom: design.mapMinZoom,
|
|
4158
|
+
filter: ["in", ["get", "kind"], ["literal", kinds]],
|
|
4159
|
+
layout: {
|
|
4160
|
+
"icon-image": iconImage,
|
|
4161
|
+
"icon-size": design.mapIconSize,
|
|
4162
|
+
"icon-allow-overlap": true,
|
|
4163
|
+
"icon-ignore-placement": false
|
|
4164
|
+
}
|
|
4165
|
+
};
|
|
4166
|
+
}
|
|
4167
|
+
function cameraSpriteName(kind, variant = "dark") {
|
|
4168
|
+
const normalised = navCameraKind(kind);
|
|
4169
|
+
const slug = normalised === "red_light" ? "redlight" : normalised.replace(/_/g, "-");
|
|
4170
|
+
return `camera-${slug}-${variant}`;
|
|
4171
|
+
}
|
|
4172
|
+
function cameraKindLabel(kind) {
|
|
4173
|
+
switch (navCameraKind(kind)) {
|
|
4174
|
+
case "fixed":
|
|
4175
|
+
return "Speed camera";
|
|
4176
|
+
case "average":
|
|
4177
|
+
return "Average speed check";
|
|
4178
|
+
case "red_light":
|
|
4179
|
+
return "Red light camera";
|
|
4180
|
+
case "mobile_site":
|
|
4181
|
+
return "Mobile camera site";
|
|
4182
|
+
default:
|
|
4183
|
+
return "Safety camera";
|
|
4184
|
+
}
|
|
4185
|
+
}
|
|
4186
|
+
var ALERT_KIND_GLYPHS = {
|
|
4187
|
+
fixed: '<rect x="3" y="8" width="13" height="9" rx="2"/><circle cx="9.5" cy="12.5" r="2.6" fill="none" stroke="currentColor" stroke-width="1.4"/><path d="M16 11.5 21 9v7l-5-2.5z"/>',
|
|
4188
|
+
average: '<rect x="2" y="9" width="7" height="7" rx="1.6"/><rect x="15" y="9" width="7" height="7" rx="1.6"/><path d="M9.8 12.5h4.4" stroke="currentColor" stroke-width="1.6" fill="none"/><path d="M13 10.9l1.9 1.6-1.9 1.6z"/>',
|
|
4189
|
+
red_light: '<rect x="8" y="2.5" width="8" height="19" rx="2.4" fill="none" stroke="currentColor" stroke-width="1.6"/><circle cx="12" cy="7" r="1.8"/><circle cx="12" cy="12" r="1.8" opacity="0.45"/><circle cx="12" cy="17" r="1.8" opacity="0.45"/>',
|
|
4190
|
+
mobile_site: '<rect x="4" y="4.5" width="12" height="8" rx="2" fill="none" stroke="currentColor" stroke-width="1.6" stroke-dasharray="3 2"/><circle cx="10" cy="8.5" r="2.2"/><path d="M10 12.5v3m0 0-4 5m4-5 4 5" stroke="currentColor" stroke-width="1.6" fill="none"/>',
|
|
4191
|
+
unknown: '<circle cx="12" cy="12" r="9" fill="none" stroke="currentColor" stroke-width="1.6"/><path d="M9.4 9.4a2.7 2.7 0 1 1 3.4 2.6v1.6" fill="none" stroke="currentColor" stroke-width="1.7"/><circle cx="12.4" cy="16.6" r="1.15"/>'
|
|
4192
|
+
};
|
|
4193
|
+
var ALERT_SET_FRAMES = {
|
|
4194
|
+
european: '<circle cx="12" cy="12" r="11" fill="none" stroke="currentColor" stroke-width="1.6" opacity="0.85"/>',
|
|
4195
|
+
us: '<rect x="1.4" y="1.4" width="21.2" height="21.2" rx="4.5" fill="none" stroke="currentColor" stroke-width="1.6" opacity="0.85"/>',
|
|
4196
|
+
minimal: "",
|
|
4197
|
+
brand: ""
|
|
4198
|
+
};
|
|
4199
|
+
function alertIconSvg(design, kind) {
|
|
4200
|
+
const normalised = navCameraKind(kind);
|
|
4201
|
+
const frame = ALERT_SET_FRAMES[design.iconSet] ?? "";
|
|
4202
|
+
const glyph = ALERT_KIND_GLYPHS[normalised];
|
|
4203
|
+
return `<svg viewBox="0 0 24 24" width="100%" height="100%" fill="currentColor" aria-hidden="true">${frame}${glyph}</svg>`;
|
|
4204
|
+
}
|
|
4205
|
+
function alertIconUrl(design, kind) {
|
|
4206
|
+
return design.iconUrlOverrides?.[navCameraKind(kind)];
|
|
4207
|
+
}
|
|
4208
|
+
function alertChipContent(design, alert) {
|
|
4209
|
+
const kind = navCameraKind(alert.kind);
|
|
4210
|
+
const parts = [];
|
|
4211
|
+
if (typeof alert.limitKph === "number" && Number.isFinite(alert.limitKph)) {
|
|
4212
|
+
parts.push(`${Math.round(alert.limitKph)} km/h`);
|
|
4213
|
+
}
|
|
4214
|
+
if (typeof alert.distanceM === "number" && Number.isFinite(alert.distanceM)) {
|
|
4215
|
+
const m = Math.max(0, Math.round(alert.distanceM));
|
|
4216
|
+
parts.push(m >= 1e3 ? `${(m / 1e3).toFixed(1)} km` : `${m} m`);
|
|
4217
|
+
}
|
|
4218
|
+
const iconUrl2 = alertIconUrl(design, kind);
|
|
4219
|
+
return {
|
|
4220
|
+
kind,
|
|
4221
|
+
title: cameraKindLabel(kind),
|
|
4222
|
+
subtitle: parts.join(" \xB7 "),
|
|
4223
|
+
...iconUrl2 !== void 0 ? { iconUrl: iconUrl2 } : {}
|
|
4224
|
+
};
|
|
4225
|
+
}
|
|
4226
|
+
function alertSpeedReadoutColor(design, escalated) {
|
|
4227
|
+
return escalated ? design.escalatedBackground : void 0;
|
|
4228
|
+
}
|
|
4229
|
+
var CHIP_SLOT_CSS = {
|
|
4230
|
+
// Directly above the speed pill: the chip's own bottom margin keeps it
|
|
4231
|
+
// clear of the readout rather than overlapping it.
|
|
4232
|
+
aboveSpeed: "align-self:center;margin-bottom:8px;",
|
|
4233
|
+
topLeading: "align-self:flex-start;",
|
|
4234
|
+
topTrailing: "align-self:flex-end;"
|
|
4235
|
+
};
|
|
4236
|
+
var CameraAlertChip = class {
|
|
4237
|
+
constructor(container, design) {
|
|
4238
|
+
this.escalated = false;
|
|
4239
|
+
const doc = globalThis.document;
|
|
4240
|
+
if (!doc) throw new Error("CameraAlertChip requires a DOM environment");
|
|
4241
|
+
this.design = design;
|
|
4242
|
+
this.element = doc.createElement("div");
|
|
4243
|
+
this.element.className = "mapmap-alert-chip";
|
|
4244
|
+
this.element.setAttribute("role", "status");
|
|
4245
|
+
if (design) this.element.dataset["position"] = design.chipPosition;
|
|
4246
|
+
this.applyStateStyles();
|
|
4247
|
+
container?.appendChild(this.element);
|
|
4248
|
+
}
|
|
4249
|
+
/** Whether the chip is currently in its escalated state. */
|
|
4250
|
+
get isEscalated() {
|
|
4251
|
+
return this.escalated;
|
|
4252
|
+
}
|
|
4253
|
+
/**
|
|
4254
|
+
* Renders an alert (or hides the chip with `null`). `state.speeding`
|
|
4255
|
+
* drives the escalated state; the chip itself shows regardless, because
|
|
4256
|
+
* the visual alert is unconditional.
|
|
4257
|
+
*
|
|
4258
|
+
* A kind whose design turns `alertWhileDriving` off hides the chip: the
|
|
4259
|
+
* customer chose not to surface that kind while driving.
|
|
4260
|
+
*/
|
|
4261
|
+
update(alert, state = {}) {
|
|
4262
|
+
if (!alert) {
|
|
4263
|
+
this.element.style.display = "none";
|
|
4264
|
+
this.element.replaceChildren();
|
|
4265
|
+
return;
|
|
4266
|
+
}
|
|
4267
|
+
const doc = this.element.ownerDocument;
|
|
4268
|
+
const design = this.design;
|
|
4269
|
+
if (design) {
|
|
4270
|
+
const presentation = alertPresentation(design, alert, state);
|
|
4271
|
+
if (!presentation.visible) {
|
|
4272
|
+
this.element.style.display = "none";
|
|
4273
|
+
this.element.replaceChildren();
|
|
4274
|
+
return;
|
|
4275
|
+
}
|
|
4276
|
+
this.escalated = presentation.escalated;
|
|
4277
|
+
} else {
|
|
4278
|
+
this.escalated = state.speeding === true;
|
|
4279
|
+
}
|
|
4280
|
+
this.applyStateStyles();
|
|
4281
|
+
this.element.style.display = "inline-flex";
|
|
4282
|
+
this.element.dataset["state"] = this.escalated ? "escalated" : "calm";
|
|
4283
|
+
const kind = navCameraKind(alert.kind);
|
|
4284
|
+
const content = design ? alertChipContent(design, alert) : { title: cameraKindLabel(kind), subtitle: ""};
|
|
4285
|
+
const icon = doc.createElement("span");
|
|
4286
|
+
icon.className = "mapmap-alert-chip-icon";
|
|
4287
|
+
icon.style.cssText = "display:inline-flex;width:20px;height:20px;flex:0 0 auto";
|
|
4288
|
+
const overrideUrl = design ? alertIconUrl(design, kind) : void 0;
|
|
4289
|
+
if (overrideUrl) {
|
|
4290
|
+
const img = doc.createElement("img");
|
|
4291
|
+
img.src = overrideUrl;
|
|
4292
|
+
img.alt = "";
|
|
4293
|
+
img.style.cssText = "width:100%;height:100%;object-fit:contain";
|
|
4294
|
+
icon.appendChild(img);
|
|
4295
|
+
} else if (design) {
|
|
4296
|
+
icon.innerHTML = alertIconSvg(design, kind);
|
|
4297
|
+
}
|
|
4298
|
+
const text = doc.createElement("span");
|
|
4299
|
+
text.textContent = content.title;
|
|
4300
|
+
const children = [icon, text];
|
|
4301
|
+
if (content.subtitle) {
|
|
4302
|
+
const detail = doc.createElement("span");
|
|
4303
|
+
detail.className = "mapmap-alert-chip-detail";
|
|
4304
|
+
detail.textContent = content.subtitle;
|
|
4305
|
+
detail.style.cssText = "opacity:0.85;font-weight:500";
|
|
4306
|
+
children.push(detail);
|
|
4307
|
+
}
|
|
4308
|
+
this.element.replaceChildren(...children);
|
|
4309
|
+
}
|
|
4310
|
+
/** Writes the calm/escalated tokens (and slot) onto the root element. */
|
|
4311
|
+
applyStateStyles() {
|
|
4312
|
+
const design = this.design;
|
|
4313
|
+
const shown = this.element.style.display !== "none" ? this.element.style.display : "none";
|
|
4314
|
+
if (!design) {
|
|
4315
|
+
this.element.style.cssText = `display:${shown};gap:8px;align-items:center;padding:8px 12px;background:${this.escalated ? "#c0392b" : "#101418"};color:#fff;border-radius:10px;font:600 15px/1.3 system-ui,sans-serif`;
|
|
4316
|
+
return;
|
|
4317
|
+
}
|
|
4318
|
+
const background = this.escalated ? safeColour(design.escalatedBackground, "#c0392b") : safeColour(design.background, "#101418");
|
|
4319
|
+
const color = this.escalated ? safeColour(design.escalatedTextColor, "#ffffff") : safeColour(design.textColor, "#ffffff");
|
|
4320
|
+
this.element.style.cssText = `display:${shown};gap:8px;align-items:center;box-sizing:border-box;padding:8px 12px;background:${background};color:${color};border-radius:${design.cornerRadius}px;` + (design.outlineWidth > 0 ? `border:${design.outlineWidth}px solid ${safeColour(design.outlineColor, "#ffffff")};` : "") + (CHIP_SLOT_CSS[design.chipPosition] ?? "") + "font:600 15px/1.3 system-ui,sans-serif";
|
|
4321
|
+
}
|
|
4322
|
+
};
|
|
3781
4323
|
|
|
3782
4324
|
// src/voice.ts
|
|
3783
4325
|
function severityProsody(severity, baseRate = 1) {
|
|
@@ -3884,6 +4426,6 @@ function clampVolume(volume) {
|
|
|
3884
4426
|
return Math.min(1, Math.max(0, volume));
|
|
3885
4427
|
}
|
|
3886
4428
|
|
|
3887
|
-
export { AdrCheck, DEFAULT_GLYPHS_URL, DEFAULT_TERRITORY_TILES_URL, EFFECTS_METADATA_KEY, FLOW_DEFAULTS, FULL_ATTRIBUTION, FlowRouteEffectLayer, GuidanceBanner, IsochroneLayer, LOGO_SVG, LogoControl, MAX_PUCK_IMAGE_BYTES, MapMapMap, NAV_CAMERA_DEFAULTS, NavigationCamera, OPENMAPTILES_ATTRIBUTION, OSM_ATTRIBUTION, PALETTE_SLOTS, POI_CATEGORY_COLORS, POI_CATEGORY_IDS, POI_CLASS_CATEGORIES, PlacesLayer, PositionPuck, RIBBON_FLOATS_PER_VERTEX, ROUTE_EFFECTS, RouteLayer, SIGNAL_BLUE, SOURCE_LAYERS, ThemeScheduler, VoiceGuidance, 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 };
|
|
4429
|
+
export { ALERT_CONTRAST_MIN, AdrCheck, CameraAlertChip, DEFAULT_GLYPHS_URL, DEFAULT_TERRITORY_TILES_URL, EFFECTS_METADATA_KEY, FLOW_DEFAULTS, FULL_ATTRIBUTION, FlowRouteEffectLayer, GuidanceBanner, IsochroneLayer, LOGO_SVG, LogoControl, MAX_PUCK_IMAGE_BYTES, MapMapMap, 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, NavigationCamera, OPENMAPTILES_ATTRIBUTION, OSM_ATTRIBUTION, PALETTE_SLOTS, POI_CATEGORY_COLORS, POI_CATEGORY_IDS, POI_CLASS_CATEGORIES, PlacesLayer, PositionPuck, RIBBON_FLOATS_PER_VERTEX, ROUTE_EFFECTS, RouteLayer, SIGNAL_BLUE, SOURCE_LAYERS, ThemeScheduler, VoiceGuidance, 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 };
|
|
3888
4430
|
//# sourceMappingURL=index.js.map
|
|
3889
4431
|
//# sourceMappingURL=index.js.map
|