Skip to content

Instantly share code, notes, and snippets.

@adamfranco
Last active February 7, 2022 20:33
Show Gist options
  • Save adamfranco/32f9d377bc8fe383eba7dd79aa136f48 to your computer and use it in GitHub Desktop.
Save adamfranco/32f9d377bc8fe383eba7dd79aa136f48 to your computer and use it in GitHub Desktop.
Maplibre fork for Americana build. Testing Parcel bundling of this customized version.
.mapboxgl-map,.maplibregl-map{-webkit-tap-highlight-color:rgba(0,0,0,0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.mapboxgl-canvas,.maplibregl-canvas{left:0;position:absolute;top:0}.mapboxgl-map:-webkit-full-screen,.maplibregl-map:-webkit-full-screen{height:100%;width:100%}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass,.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer,.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active,.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas,.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right,.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.mapboxgl-ctrl-top-left,.maplibregl-ctrl-top-left{left:0;top:0}.mapboxgl-ctrl-top-right,.maplibregl-ctrl-top-right{right:0;top:0}.mapboxgl-ctrl-bottom-left,.maplibregl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right,.maplibregl-ctrl-bottom-right{bottom:0;right:0}.mapboxgl-ctrl,.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl,.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.mapboxgl-ctrl-top-right .mapboxgl-ctrl,.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.mapboxgl-ctrl-group,.maplibregl-ctrl-group{background:#fff;border-radius:4px}.mapboxgl-ctrl-group:not(:empty),.maplibregl-ctrl-group:not(:empty){-moz-box-shadow:0 0 2px rgba(0,0,0,.1);-webkit-box-shadow:0 0 2px rgba(0,0,0,.1);box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty),.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button,.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.mapboxgl-ctrl-group button+button,.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon,.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon,.maplibregl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button,.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl button::-moz-focus-inner,.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus,.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled,.maplibregl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon,.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.mapboxgl-ctrl button:not(:disabled):hover,.maplibregl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible,.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible),.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl-group button:focus:first-child,.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child,.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child,.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E %3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E %3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E %3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E %3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E %3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E %3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E %3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E %3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E %3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E %3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E %3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E %3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E %3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E %3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E %3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E %3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E %3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E %3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E %3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E %3Cpath id='south' d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E %3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E %3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E %3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E %3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E %3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E %3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E %3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{-webkit-animation:maplibregl-spin 2s linear infinite;-moz-animation:maplibregl-spin 2s linear infinite;-o-animation:maplibregl-spin 2s linear infinite;-ms-animation:maplibregl-spin 2s linear infinite;animation:maplibregl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E %3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E %3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E %3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E %3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E %3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E %3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23000'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' display='none'/%3E %3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon,.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z' fill='%23f00'/%3E %3C/svg%3E")}}@-webkit-keyframes maplibregl-spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@-moz-keyframes maplibregl-spin{0%{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(1turn)}}@-o-keyframes maplibregl-spin{0%{-o-transform:rotate(0deg)}to{-o-transform:rotate(1turn)}}@-ms-keyframes maplibregl-spin{0%{-ms-transform:rotate(0deg)}to{-ms-transform:rotate(1turn)}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo,a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42l-.726 3.663a1.255 1.255 0 01-1.232 1.011h-1.827a1.255 1.255 0 01-1.229-1.509l2.501-12.095a1.255 1.255 0 011.23-1.001h.197a1.255 1.255 0 011.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 011.123-.695h.181a1.255 1.255 0 011.227.991l1.443 6.71a5.11 5.11 0 01.314-.787l.009-.016a4.623 4.623 0 011.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 011.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 011.212.925 1.255 1.255 0 011.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 011.255-1.255h1.86A1.255 1.255 0 0154.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 01-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 011.722-.674 2.43 2.43 0 011.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 011.255-1.255h1.744A1.255 1.255 0 0165.812 4.7v3.335a4.76 4.76 0 011.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 011.67 1.743v-.98a1.255 1.255 0 011.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 011.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 01.689 1.004 4.73 4.73 0 01.853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 01-.947 1.09l.408.952a1.255 1.255 0 01-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 01-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 01-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 01-1.256 1.256h-1.777a1.255 1.255 0 01-1.256-1.256v-1.103l-.032.057a4.778 4.778 0 01-1.86 1.833 5.04 5.04 0 01-2.484.634 4.47 4.47 0 01-1.935-.424 1.252 1.252 0 01-.764.258h-1.71a1.255 1.255 0 01-1.256-1.255V7.687a2.402 2.402 0 01-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 01-1.256 1.255h-1.843c-.35 0-.666-.142-.894-.373-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 01-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 01-1.782 1.884 4.767 4.767 0 01-2.485.67 5.6 5.6 0 01-1.485-.188l.009 2.764a1.255 1.255 0 01-1.255 1.259h-1.729a1.255 1.255 0 01-1.255-1.255v-3.537a1.255 1.255 0 01-1.167.793h-1.679a1.25 1.25 0 01-.77-.263 4.47 4.47 0 01-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 01-1.081-.836 1.255 1.255 0 01-1.254 1.312h-1.81a1.255 1.255 0 01-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 01-1.115.676h-.098a1.255 1.255 0 01-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 00-.668-.428l-.27-.12a3.293 3.293 0 00-1.235-.23c-.757 0-1.415.163-1.974.493-.56.329-.993.79-1.3 1.382-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 001.382 1.381 3.883 3.883 0 001.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 00.934-.19c.166-.076.323-.172.468-.29l.178-.161a2.163 2.163 0 00.397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 00-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 00-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 00-.353-.389.851.851 0 00-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 00.331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 001.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 00-.415.262l-.199.166a3.35 3.35 0 00-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 00-.284.136 1.99 1.99 0 00-.363.254 2.237 2.237 0 00-.46.569l-.082.162a2.56 2.56 0 00-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 00.367.385.937.937 0 00.476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 00-.503.135l-.012.007a.859.859 0 00-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 00.14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 00-.345-.79c-.231-.219-.51-.329-.84-.329-.34 0-.625.11-.855.33a1.053 1.053 0 00-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314l.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 00.316.224l.223.122c.436.215.916.322 1.44.322a3.785 3.785 0 001.875-.477 3.52 3.52 0 001.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 00-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 00-1.527.344l-.086.043-.165.09a3.412 3.412 0 00-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 00-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 00.566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 00.975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 00-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 00-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 00-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 00.367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 00-.545.063 2.086 2.086 0 00-.411.148c-.14.067-.273.15-.4.249a2.482 2.482 0 00-.485.499 2.659 2.659 0 00-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 01.466-.636 2.52 2.52 0 01.399-.253 2.19 2.19 0 01.224-.099zm9.784 2.656l.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 00-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 01-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256l-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 00-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333v-1.645zm7.103-5.908v7.553h-1.843V9.242h1.843z' fill='%23000' fill-opacity='.4' fill-rule='evenodd'/%3E%3Cpath d='M19.63 11.151l-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 01-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 011.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 011.234.231 3.341 3.341 0 01.97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 01-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 00-.807-.872 2.098 2.098 0 00-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 01-1.316 1.399 3.51 3.51 0 01-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 01-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z' fill='%23fff'/%3E%3Cpath d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 01-.856-.346 1.165 1.165 0 01-.346-.856 1.053 1.053 0 01.346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 01.345.79 1.159 1.159 0 01-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 01-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 011.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 011.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 01-1.382 1.366 3.785 3.785 0 01-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 00-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 00.807.872 2.1 2.1 0 001.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 011.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 01-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 011.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 00.938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z' fill='%23e1e3e9'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath d='M8.166 16.146l-.002.002a1.54 1.54 0 01-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 00-.659.659v1.84a.657.657 0 00.659.659h5.565a.657.657 0 00.659-.659v-1.84a.657.657 0 00-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 00.113.023.286.286 0 00.189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 00.074.047zm-2.52-.548a16.898 16.898 0 01-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 01-1.182 1.315h.15a1.912 1.912 0 011.914 1.914v1.84a1.912 1.912 0 01-1.914 1.914H4.377a1.912 1.912 0 01-1.914-1.914v-1.84a1.912 1.912 0 011.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z' fill='%23000' fill-opacity='.4'/%3E%3Cpath d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 01-.189.07.286.286 0 01-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z' fill='%23e1e3e9'/%3E%3Cpath d='M4.377 15.948a.657.657 0 00-.659.659v1.84a.657.657 0 00.659.659h5.565a.657.657 0 00.659-.659v-1.84a.657.657 0 00-.659-.659zm4.83 1.16H5.114v.838h4.093z' fill='%23fff'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.mapboxgl-ctrl-logo.mapboxgl-compact,a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo,a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42l-.726 3.663a1.255 1.255 0 01-1.232 1.011h-1.827a1.255 1.255 0 01-1.229-1.509l2.501-12.095a1.255 1.255 0 011.23-1.001h.197a1.255 1.255 0 011.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 011.123-.695h.181a1.255 1.255 0 011.227.991l1.443 6.71a5.11 5.11 0 01.314-.787l.009-.016a4.623 4.623 0 011.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 011.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 011.212.925 1.255 1.255 0 011.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 011.255-1.255h1.86A1.255 1.255 0 0154.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 01-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 011.722-.674 2.43 2.43 0 011.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 011.255-1.255h1.744A1.255 1.255 0 0165.812 4.7v3.335a4.76 4.76 0 011.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 011.67 1.743v-.98a1.255 1.255 0 011.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 011.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 01.689 1.004 4.73 4.73 0 01.853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 01-.947 1.09l.408.952a1.255 1.255 0 01-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 01-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 01-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 01-1.256 1.256h-1.777a1.255 1.255 0 01-1.256-1.256v-1.103l-.032.057a4.778 4.778 0 01-1.86 1.833 5.04 5.04 0 01-2.484.634 4.47 4.47 0 01-1.935-.424 1.252 1.252 0 01-.764.258h-1.71a1.255 1.255 0 01-1.256-1.255V7.687a2.402 2.402 0 01-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 01-1.256 1.255h-1.843c-.35 0-.666-.142-.894-.373-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 01-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 01-1.782 1.884 4.767 4.767 0 01-2.485.67 5.6 5.6 0 01-1.485-.188l.009 2.764a1.255 1.255 0 01-1.255 1.259h-1.729a1.255 1.255 0 01-1.255-1.255v-3.537a1.255 1.255 0 01-1.167.793h-1.679a1.25 1.25 0 01-.77-.263 4.47 4.47 0 01-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 01-1.081-.836 1.255 1.255 0 01-1.254 1.312h-1.81a1.255 1.255 0 01-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 01-1.115.676h-.098a1.255 1.255 0 01-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 00-.668-.428l-.27-.12a3.293 3.293 0 00-1.235-.23c-.757 0-1.415.163-1.974.493-.56.329-.993.79-1.3 1.382-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 001.382 1.381 3.883 3.883 0 001.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 00.934-.19c.166-.076.323-.172.468-.29l.178-.161a2.163 2.163 0 00.397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 00-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 00-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 00-.353-.389.851.851 0 00-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 00.331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 001.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 00-.415.262l-.199.166a3.35 3.35 0 00-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 00-.284.136 1.99 1.99 0 00-.363.254 2.237 2.237 0 00-.46.569l-.082.162a2.56 2.56 0 00-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 00.367.385.937.937 0 00.476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 00-.503.135l-.012.007a.859.859 0 00-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 00.14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 00-.345-.79c-.231-.219-.51-.329-.84-.329-.34 0-.625.11-.855.33a1.053 1.053 0 00-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314l.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 00.316.224l.223.122c.436.215.916.322 1.44.322a3.785 3.785 0 001.875-.477 3.52 3.52 0 001.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 00-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 00-1.527.344l-.086.043-.165.09a3.412 3.412 0 00-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 00-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 00.566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 00.975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 00-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 00-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 00-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 00.367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 00-.545.063 2.086 2.086 0 00-.411.148c-.14.067-.273.15-.4.249a2.482 2.482 0 00-.485.499 2.659 2.659 0 00-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 01.466-.636 2.52 2.52 0 01.399-.253 2.19 2.19 0 01.224-.099zm9.784 2.656l.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 00-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 01-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256l-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 00-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333v-1.645zm7.103-5.908v7.553h-1.843V9.242h1.843z' fill='%23000' fill-opacity='.4' fill-rule='evenodd'/%3E%3Cpath d='M19.63 11.151l-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 01-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 011.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 011.234.231 3.341 3.341 0 01.97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 01-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 00-.807-.872 2.098 2.098 0 00-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 01-1.316 1.399 3.51 3.51 0 01-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 01-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z' fill='%23fff'/%3E%3Cpath d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 01-.856-.346 1.165 1.165 0 01-.346-.856 1.053 1.053 0 01.346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 01.345.79 1.159 1.159 0 01-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 01-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 011.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 011.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 01-1.382 1.366 3.785 3.785 0 01-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 00-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 00.807.872 2.1 2.1 0 001.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 011.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 01-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 011.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 00.938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z' fill='%23e1e3e9'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath d='M8.166 16.146l-.002.002a1.54 1.54 0 01-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 00-.659.659v1.84a.657.657 0 00.659.659h5.565a.657.657 0 00.659-.659v-1.84a.657.657 0 00-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 00.113.023.286.286 0 00.189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 00.074.047zm-2.52-.548a16.898 16.898 0 01-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 01-1.182 1.315h.15a1.912 1.912 0 011.914 1.914v1.84a1.912 1.912 0 01-1.914 1.914H4.377a1.912 1.912 0 01-1.914-1.914v-1.84a1.912 1.912 0 011.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z' fill='%23000' fill-opacity='.4'/%3E%3Cpath d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 01-.189.07.286.286 0 01-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z' fill='%23e1e3e9'/%3E%3Cpath d='M4.377 15.948a.657.657 0 00-.659.659v1.84a.657.657 0 00.659.659h5.565a.657.657 0 00.659-.659v-1.84a.657.657 0 00-.659-.659zm4.83 1.16H5.114v.838h4.093z' fill='%23fff'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo,a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42l-.726 3.663a1.255 1.255 0 01-1.232 1.011h-1.827a1.255 1.255 0 01-1.229-1.509l2.501-12.095a1.255 1.255 0 011.23-1.001h.197a1.255 1.255 0 011.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 011.123-.695h.181a1.255 1.255 0 011.227.991l1.443 6.71a5.11 5.11 0 01.314-.787l.009-.016a4.623 4.623 0 011.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 011.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 011.212.925 1.255 1.255 0 011.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 011.255-1.255h1.86A1.255 1.255 0 0154.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 01-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 011.722-.674 2.43 2.43 0 011.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 011.255-1.255h1.744A1.255 1.255 0 0165.812 4.7v3.335a4.76 4.76 0 011.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 011.67 1.743v-.98a1.255 1.255 0 011.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 011.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 01.689 1.004 4.73 4.73 0 01.853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 01-.947 1.09l.408.952a1.255 1.255 0 01-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 01-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 01-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 01-1.256 1.256h-1.777a1.255 1.255 0 01-1.256-1.256v-1.103l-.032.057a4.778 4.778 0 01-1.86 1.833 5.04 5.04 0 01-2.484.634 4.47 4.47 0 01-1.935-.424 1.252 1.252 0 01-.764.258h-1.71a1.255 1.255 0 01-1.256-1.255V7.687a2.402 2.402 0 01-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 01-1.256 1.255h-1.843c-.35 0-.666-.142-.894-.373-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 01-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 01-1.782 1.884 4.767 4.767 0 01-2.485.67 5.6 5.6 0 01-1.485-.188l.009 2.764a1.255 1.255 0 01-1.255 1.259h-1.729a1.255 1.255 0 01-1.255-1.255v-3.537a1.255 1.255 0 01-1.167.793h-1.679a1.25 1.25 0 01-.77-.263 4.47 4.47 0 01-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 01-1.081-.836 1.255 1.255 0 01-1.254 1.312h-1.81a1.255 1.255 0 01-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 01-1.115.676h-.098a1.255 1.255 0 01-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 00-.668-.428l-.27-.12a3.293 3.293 0 00-1.235-.23c-.757 0-1.415.163-1.974.493-.56.329-.993.79-1.3 1.382-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 001.382 1.381 3.883 3.883 0 001.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 00.934-.19c.166-.076.323-.172.468-.29l.178-.161a2.163 2.163 0 00.397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 00-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 00-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 00-.353-.389.851.851 0 00-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 00.331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 001.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 00-.415.262l-.199.166a3.35 3.35 0 00-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 00-.284.136 1.99 1.99 0 00-.363.254 2.237 2.237 0 00-.46.569l-.082.162a2.56 2.56 0 00-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 00.367.385.937.937 0 00.476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 00-.503.135l-.012.007a.859.859 0 00-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 00.14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 00-.345-.79c-.231-.219-.51-.329-.84-.329-.34 0-.625.11-.855.33a1.053 1.053 0 00-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314l.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 00.316.224l.223.122c.436.215.916.322 1.44.322a3.785 3.785 0 001.875-.477 3.52 3.52 0 001.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 00-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 00-1.527.344l-.086.043-.165.09a3.412 3.412 0 00-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 00-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 00.566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 00.975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 00-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 00-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 00-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 00.367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 00-.545.063 2.086 2.086 0 00-.411.148c-.14.067-.273.15-.4.249a2.482 2.482 0 00-.485.499 2.659 2.659 0 00-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 01.466-.636 2.52 2.52 0 01.399-.253 2.19 2.19 0 01.224-.099zm9.784 2.656l.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 00-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 01-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256l-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 00-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333v-1.645zm7.103-5.908v7.553h-1.843V9.242h1.843z' fill='%23000' fill-opacity='.4' fill-rule='evenodd'/%3E%3Cpath d='M19.63 11.151l-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 01-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 011.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 011.234.231 3.341 3.341 0 01.97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 01-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 00-.807-.872 2.098 2.098 0 00-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 01-1.316 1.399 3.51 3.51 0 01-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 01-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z' fill='%23fff'/%3E%3Cpath d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 01-.856-.346 1.165 1.165 0 01-.346-.856 1.053 1.053 0 01.346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 01.345.79 1.159 1.159 0 01-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 01-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 011.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 011.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 01-1.382 1.366 3.785 3.785 0 01-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 00-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 00.807.872 2.1 2.1 0 001.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 011.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 01-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 011.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 00.938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z' fill='%23e1e3e9'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath d='M8.166 16.146l-.002.002a1.54 1.54 0 01-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 00-.659.659v1.84a.657.657 0 00.659.659h5.565a.657.657 0 00.659-.659v-1.84a.657.657 0 00-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 00.113.023.286.286 0 00.189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 00.074.047zm-2.52-.548a16.898 16.898 0 01-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 01-1.182 1.315h.15a1.912 1.912 0 011.914 1.914v1.84a1.912 1.912 0 01-1.914 1.914H4.377a1.912 1.912 0 01-1.914-1.914v-1.84a1.912 1.912 0 011.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z' fill='%23000' fill-opacity='.4'/%3E%3Cpath d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 01-.189.07.286.286 0 01-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z' fill='%23e1e3e9'/%3E%3Cpath d='M4.377 15.948a.657.657 0 00-.659.659v1.84a.657.657 0 00.659.659h5.565a.657.657 0 00.659-.659v-1.84a.657.657 0 00-.659-.659zm4.83 1.16H5.114v.838h4.093z' fill='%23fff'/%3E%3C/g%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib,.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact,.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner,.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button,.maplibregl-ctrl-attrib-button{background-color:hsla(0,0%,100%,.5);background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button,.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner,.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after,.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E")}}.mapboxgl-ctrl-attrib a,.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover,.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-attrib-empty,.maplibregl-attrib-empty{display:none}.mapboxgl-ctrl-scale,.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.mapboxgl-popup,.maplibregl-popup{display:-webkit-flex;display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right,.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{-webkit-flex-direction:column;flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right,.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{-webkit-flex-direction:column-reverse;flex-direction:column-reverse}.mapboxgl-popup-anchor-left,.maplibregl-popup-anchor-left{-webkit-flex-direction:row;flex-direction:row}.mapboxgl-popup-anchor-right,.maplibregl-popup-anchor-right{-webkit-flex-direction:row-reverse;flex-direction:row-reverse}.mapboxgl-popup-tip,.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip,.maplibregl-popup-anchor-top .maplibregl-popup-tip{-webkit-align-self:center;align-self:center;border-bottom-color:#fff;border-top:none}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip,.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip,.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip,.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{-webkit-align-self:center;align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip,.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip,.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip,.maplibregl-popup-anchor-left .maplibregl-popup-tip{-webkit-align-self:center;align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip,.maplibregl-popup-anchor-right .maplibregl-popup-tip{-webkit-align-self:center;align-self:center;border-left-color:#fff;border-right:none}.mapboxgl-popup-close-button,.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.mapboxgl-popup-close-button:hover,.maplibregl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content,.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto;position:relative}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content,.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content,.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content,.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content,.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer,.maplibregl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *,.maplibregl-popup-track-pointer *{pointer-events:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer,.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer,.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.mapboxgl-marker,.maplibregl-marker{left:0;position:absolute;top:0;will-change:transform}.mapboxgl-user-location-dot,.maplibregl-user-location-dot{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.mapboxgl-user-location-dot:before,.maplibregl-user-location-dot:before{-webkit-animation:maplibregl-user-location-dot-pulse 2s infinite;-moz-animation:maplibregl-user-location-dot-pulse 2s infinite;-ms-animation:maplibregl-user-location-dot-pulse 2s infinite;animation:maplibregl-user-location-dot-pulse 2s infinite;background-color:#1da1f2;border-radius:50%;content:"";height:15px;position:absolute;width:15px}.mapboxgl-user-location-dot:after,.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px rgba(0,0,0,.35);box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@-webkit-keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;-webkit-transform:scale(1)}70%{opacity:0;-webkit-transform:scale(3)}to{opacity:0;-webkit-transform:scale(1)}}@-ms-keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;-ms-transform:scale(1)}70%{opacity:0;-ms-transform:scale(3)}to{opacity:0;-ms-transform:scale(1)}}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.mapboxgl-user-location-dot-stale,.maplibregl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after,.maplibregl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle,.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active,.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom,.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}
// Generated by dts-bundle-generator v6.4.0
import Point from '@mapbox/point-geometry';
import TinySDF from '@mapbox/tiny-sdf';
import { VectorTileFeature, VectorTileLayer } from '@mapbox/vector-tile';
import { mat2, mat4 } from 'gl-matrix';
import { PotpackBox } from 'potpack';
export declare type Callback<T> = (error?: Error | null, result?: T | null) => void;
export declare type Cancelable = {
cancel: () => void;
};
export interface IResourceType {
Unknown: keyof this;
Style: keyof this;
Source: keyof this;
Tile: keyof this;
Glyphs: keyof this;
SpriteImage: keyof this;
SpriteJSON: keyof this;
Image: keyof this;
}
/**
* A `RequestParameters` object to be returned from Map.options.transformRequest callbacks.
* @typedef {Object} RequestParameters
* @property {string} url The URL to be requested.
* @property {Object} headers The headers to be sent with the request.
* @property {string} method Request method `'GET' | 'POST' | 'PUT'`.
* @property {string} body Request body.
* @property {string} type Response body type to be returned `'string' | 'json' | 'arrayBuffer'`.
* @property {string} credentials `'same-origin'|'include'` Use 'include' to send cookies with cross-origin requests.
* @property {boolean} collectResourceTiming If true, Resource Timing API information will be collected for these transformed requests and returned in a resourceTiming property of relevant data events.
* @example
* // use transformRequest to modify requests that begin with `http://myHost`
* transformRequest: function(url, resourceType) {
* if (resourceType === 'Source' && url.indexOf('http://myHost') > -1) {
* return {
* url: url.replace('http', 'https'),
* headers: { 'my-custom-header': true },
* credentials: 'include' // Include cookies for cross-origin requests
* }
* }
* }
*
*/
export declare type RequestParameters = {
url: string;
headers?: any;
method?: "GET" | "POST" | "PUT";
body?: string;
type?: "string" | "json" | "arrayBuffer";
credentials?: "same-origin" | "include";
collectResourceTiming?: boolean;
};
export declare type ResponseCallback<T> = (error?: Error | null, data?: T | null, cacheControl?: string | null, expires?: string | null) => void;
export declare type ResourceTypeEnum = keyof IResourceType;
export declare type RequestTransformFunction = (url: string, resourceType?: ResourceTypeEnum) => RequestParameters;
export declare class RequestManager {
_transformRequestFn: RequestTransformFunction;
constructor(transformRequestFn?: RequestTransformFunction);
transformRequest(url: string, type: ResourceTypeEnum): RequestParameters;
normalizeSpriteURL(url: string, format: string, extension: string): string;
setTransformRequest(transformRequest: RequestTransformFunction): void;
}
export declare type Listener = (a: any) => any;
export declare type Listeners = {
[_: string]: Array<Listener>;
};
export declare class Event {
readonly type: string;
constructor(type: string, data?: any);
}
export declare class Evented {
_listeners: Listeners;
_oneTimeListeners: Listeners;
_eventedParent: Evented;
_eventedParentData: any | (() => any);
/**
* Adds a listener to a specified event type.
*
* @param {string} type The event type to add a listen for.
* @param {Function} listener The function to be called when the event is fired.
* The listener function is called with the data object passed to `fire`,
* extended with `target` and `type` properties.
* @returns {Object} `this`
*/
on(type: string, listener: Listener): this;
/**
* Removes a previously registered event listener.
*
* @param {string} type The event type to remove listeners for.
* @param {Function} listener The listener function to remove.
* @returns {Object} `this`
*/
off(type: string, listener: Listener): this;
/**
* Adds a listener that will be called only once to a specified event type.
*
* The listener will be called first time the event fires after the listener is registered.
*
* @param {string} type The event type to listen for.
* @param {Function} listener The function to be called when the event is fired the first time.
* @returns {Object} `this`
*/
once(type: string, listener: Listener): this;
fire(event: Event | string, properties?: any): this;
/**
* Returns a true if this instance of Evented or any forwardeed instances of Evented have a listener for the specified type.
*
* @param {string} type The event type
* @returns {boolean} `true` if there is at least one registered listener for specified event type, `false` otherwise
* @private
*/
listens(type: string): any;
/**
* Bubble all events fired by this instance of Evented to this parent instance of Evented.
*
* @private
* @returns {Object} `this`
* @private
*/
setEventedParent(parent?: Evented | null, data?: any | (() => any)): this;
}
export declare class Color {
r: number;
g: number;
b: number;
a: number;
constructor(r: number, g: number, b: number, a?: number);
static black: Color;
static white: Color;
static transparent: Color;
static red: Color;
/**
* Parses valid CSS color strings and returns a `Color` instance.
* @returns A `Color` instance, or `undefined` if the input is not a valid color string.
*/
static parse(input?: string | Color | null): Color | void;
/**
* Returns an RGBA string representing the color value.
*
* @returns An RGBA string.
* @example
* var purple = new Color.parse('purple');
* purple.toString; // = "rgba(128,0,128,1)"
* var translucentGreen = new Color.parse('rgba(26, 207, 26, .73)');
* translucentGreen.toString(); // = "rgba(26,207,26,0.73)"
*/
toString(): string;
toArray(): [
number,
number,
number,
number
];
}
export declare class ZoomHistory {
lastZoom: number;
lastFloorZoom: number;
lastIntegerZoom: number;
lastIntegerZoomTime: number;
first: boolean;
constructor();
update(z: number, now: number): boolean;
}
export declare type ColorSpecification = string;
export declare type FormattedSpecification = string;
export declare type ResolvedImageSpecification = string;
export declare type PromoteIdSpecification = {
[_: string]: string;
} | string;
export declare type FilterSpecificationInputType = string | number | boolean;
export declare type FilterSpecification = [
"at",
number,
(number | string)[]
] | [
"get",
string,
Record<string, unknown>?
] | [
"has",
string,
Record<string, unknown>?
] | [
"in",
...FilterSpecificationInputType[],
FilterSpecificationInputType | FilterSpecificationInputType[]
] | [
"index-of",
FilterSpecificationInputType,
FilterSpecificationInputType | FilterSpecificationInputType[]
] | [
"length",
string | string[]
] | [
"slice",
string | string[],
number
] | [
"!",
FilterSpecification
] | [
"!=",
string | FilterSpecification,
FilterSpecificationInputType
] | [
"<",
string | FilterSpecification,
FilterSpecificationInputType
] | [
"<=",
string | FilterSpecification,
FilterSpecificationInputType
] | [
"==",
string | FilterSpecification,
FilterSpecificationInputType
] | [
">",
string | FilterSpecification,
FilterSpecificationInputType
] | [
">=",
string | FilterSpecification,
FilterSpecificationInputType
] | [
"all",
...FilterSpecification[],
FilterSpecificationInputType
] | [
"any",
...FilterSpecification[],
FilterSpecificationInputType
] | [
"case",
...FilterSpecification[],
FilterSpecificationInputType
] | [
"coalesce",
...FilterSpecification[],
FilterSpecificationInputType
] | [
"match",
...FilterSpecification[],
FilterSpecificationInputType
] | [
"within",
...FilterSpecification[],
FilterSpecificationInputType
] | [
"!in",
...FilterSpecification[],
FilterSpecificationInputType
] | [
"!has",
...FilterSpecification[],
FilterSpecificationInputType
] | [
"none",
...FilterSpecification[],
FilterSpecificationInputType
] | Array<string | FilterSpecification>;
export declare type TransitionSpecification = {
duration?: number;
delay?: number;
};
export declare type CameraFunctionSpecification<T> = {
type: "exponential";
stops: Array<[
number,
T
]>;
} | {
type: "interval";
stops: Array<[
number,
T
]>;
};
export declare type SourceFunctionSpecification<T> = {
type: "exponential";
stops: Array<[
number,
T
]>;
property: string;
default?: T;
} | {
type: "interval";
stops: Array<[
number,
T
]>;
property: string;
default?: T;
} | {
type: "categorical";
stops: Array<[
string | number | boolean,
T
]>;
property: string;
default?: T;
} | {
type: "identity";
property: string;
default?: T;
};
export declare type CompositeFunctionSpecification<T> = {
type: "exponential";
stops: Array<[
{
zoom: number;
value: number;
},
T
]>;
property: string;
default?: T;
} | {
type: "interval";
stops: Array<[
{
zoom: number;
value: number;
},
T
]>;
property: string;
default?: T;
} | {
type: "categorical";
stops: Array<[
{
zoom: number;
value: string | number | boolean;
},
T
]>;
property: string;
default?: T;
};
export declare type ExpressionSpecificationArray = Array<unknown>;
export declare type PropertyValueSpecification<T> = T | CameraFunctionSpecification<T> | ExpressionSpecificationArray;
export declare type DataDrivenPropertyValueSpecification<T> = T | CameraFunctionSpecification<T> | SourceFunctionSpecification<T> | CompositeFunctionSpecification<T> | ExpressionSpecificationArray;
export declare type StyleSpecification = {
"version": 8;
"name"?: string;
"metadata"?: unknown;
"center"?: Array<number>;
"zoom"?: number;
"bearing"?: number;
"pitch"?: number;
"light"?: LightSpecification;
"sources": {
[_: string]: SourceSpecification;
};
"sprite"?: string;
"glyphs"?: string;
"transition"?: TransitionSpecification;
"layers": Array<LayerSpecification>;
};
export declare type LightSpecification = {
"anchor"?: PropertyValueSpecification<"map" | "viewport">;
"position"?: PropertyValueSpecification<[
number,
number,
number
]>;
"color"?: PropertyValueSpecification<ColorSpecification>;
"intensity"?: PropertyValueSpecification<number>;
};
export declare type VectorSourceSpecification = {
"type": "vector";
"url"?: string;
"tiles"?: Array<string>;
"bounds"?: [
number,
number,
number,
number
];
"scheme"?: "xyz" | "tms";
"minzoom"?: number;
"maxzoom"?: number;
"attribution"?: string;
"promoteId"?: PromoteIdSpecification;
"volatile"?: boolean;
};
export declare type RasterSourceSpecification = {
"type": "raster";
"url"?: string;
"tiles"?: Array<string>;
"bounds"?: [
number,
number,
number,
number
];
"minzoom"?: number;
"maxzoom"?: number;
"tileSize"?: number;
"scheme"?: "xyz" | "tms";
"attribution"?: string;
"volatile"?: boolean;
};
export declare type RasterDEMSourceSpecification = {
"type": "raster-dem";
"url"?: string;
"tiles"?: Array<string>;
"bounds"?: [
number,
number,
number,
number
];
"minzoom"?: number;
"maxzoom"?: number;
"tileSize"?: number;
"attribution"?: string;
"encoding"?: "terrarium" | "mapbox";
"volatile"?: boolean;
};
export declare type GeoJSONSourceSpecification = {
"type": "geojson";
"data"?: unknown;
"maxzoom"?: number;
"attribution"?: string;
"buffer"?: number;
"filter"?: unknown;
"tolerance"?: number;
"cluster"?: boolean;
"clusterRadius"?: number;
"clusterMaxZoom"?: number;
"clusterMinPoints"?: number;
"clusterProperties"?: unknown;
"lineMetrics"?: boolean;
"generateId"?: boolean;
"promoteId"?: PromoteIdSpecification;
};
export declare type VideoSourceSpecification = {
"type": "video";
"urls": Array<string>;
"coordinates": [
[
number,
number
],
[
number,
number
],
[
number,
number
],
[
number,
number
]
];
};
export declare type ImageSourceSpecification = {
"type": "image";
"url": string;
"coordinates": [
[
number,
number
],
[
number,
number
],
[
number,
number
],
[
number,
number
]
];
};
export declare type SourceSpecification = VectorSourceSpecification | RasterSourceSpecification | RasterDEMSourceSpecification | GeoJSONSourceSpecification | VideoSourceSpecification | ImageSourceSpecification;
export declare type FillLayerSpecification = {
"id": string;
"type": "fill";
"metadata"?: unknown;
"source": string;
"source-layer"?: string;
"minzoom"?: number;
"maxzoom"?: number;
"filter"?: FilterSpecification;
"layout"?: {
"fill-sort-key"?: DataDrivenPropertyValueSpecification<number>;
"visibility"?: "visible" | "none";
};
"paint"?: {
"fill-antialias"?: PropertyValueSpecification<boolean>;
"fill-opacity"?: DataDrivenPropertyValueSpecification<number>;
"fill-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
"fill-outline-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
"fill-translate"?: PropertyValueSpecification<[
number,
number
]>;
"fill-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
"fill-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>;
};
};
export declare type LineLayerSpecification = {
"id": string;
"type": "line";
"metadata"?: unknown;
"source": string;
"source-layer"?: string;
"minzoom"?: number;
"maxzoom"?: number;
"filter"?: FilterSpecification;
"layout"?: {
"line-cap"?: PropertyValueSpecification<"butt" | "round" | "square">;
"line-join"?: DataDrivenPropertyValueSpecification<"bevel" | "round" | "miter">;
"line-miter-limit"?: PropertyValueSpecification<number>;
"line-round-limit"?: PropertyValueSpecification<number>;
"line-sort-key"?: DataDrivenPropertyValueSpecification<number>;
"visibility"?: "visible" | "none";
};
"paint"?: {
"line-opacity"?: DataDrivenPropertyValueSpecification<number>;
"line-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
"line-translate"?: PropertyValueSpecification<[
number,
number
]>;
"line-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
"line-width"?: DataDrivenPropertyValueSpecification<number>;
"line-gap-width"?: DataDrivenPropertyValueSpecification<number>;
"line-offset"?: DataDrivenPropertyValueSpecification<number>;
"line-blur"?: DataDrivenPropertyValueSpecification<number>;
"line-dasharray"?: PropertyValueSpecification<Array<number>>;
"line-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>;
"line-gradient"?: ExpressionSpecificationArray;
};
};
export declare type SymbolLayerSpecification = {
"id": string;
"type": "symbol";
"metadata"?: unknown;
"source": string;
"source-layer"?: string;
"minzoom"?: number;
"maxzoom"?: number;
"filter"?: FilterSpecification;
"layout"?: {
"symbol-placement"?: PropertyValueSpecification<"point" | "line" | "line-center">;
"symbol-spacing"?: PropertyValueSpecification<number>;
"symbol-avoid-edges"?: PropertyValueSpecification<boolean>;
"symbol-sort-key"?: DataDrivenPropertyValueSpecification<number>;
"symbol-z-order"?: PropertyValueSpecification<"auto" | "viewport-y" | "source">;
"icon-allow-overlap"?: PropertyValueSpecification<boolean>;
"icon-ignore-placement"?: PropertyValueSpecification<boolean>;
"icon-optional"?: PropertyValueSpecification<boolean>;
"icon-rotation-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">;
"icon-size"?: DataDrivenPropertyValueSpecification<number>;
"icon-text-fit"?: PropertyValueSpecification<"none" | "width" | "height" | "both">;
"icon-text-fit-padding"?: PropertyValueSpecification<[
number,
number,
number,
number
]>;
"icon-image"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>;
"icon-rotate"?: DataDrivenPropertyValueSpecification<number>;
"icon-padding"?: PropertyValueSpecification<number>;
"icon-keep-upright"?: PropertyValueSpecification<boolean>;
"icon-offset"?: DataDrivenPropertyValueSpecification<[
number,
number
]>;
"icon-anchor"?: DataDrivenPropertyValueSpecification<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">;
"icon-pitch-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">;
"text-pitch-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">;
"text-rotation-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">;
"text-field"?: DataDrivenPropertyValueSpecification<FormattedSpecification>;
"text-font"?: DataDrivenPropertyValueSpecification<Array<string>>;
"text-size"?: DataDrivenPropertyValueSpecification<number>;
"text-max-width"?: DataDrivenPropertyValueSpecification<number>;
"text-line-height"?: PropertyValueSpecification<number>;
"text-letter-spacing"?: DataDrivenPropertyValueSpecification<number>;
"text-justify"?: DataDrivenPropertyValueSpecification<"auto" | "left" | "center" | "right">;
"text-radial-offset"?: DataDrivenPropertyValueSpecification<number>;
"text-variable-anchor"?: PropertyValueSpecification<Array<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">>;
"text-anchor"?: DataDrivenPropertyValueSpecification<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">;
"text-max-angle"?: PropertyValueSpecification<number>;
"text-writing-mode"?: PropertyValueSpecification<Array<"horizontal" | "vertical">>;
"text-rotate"?: DataDrivenPropertyValueSpecification<number>;
"text-padding"?: PropertyValueSpecification<number>;
"text-keep-upright"?: PropertyValueSpecification<boolean>;
"text-rotate-to-line"?: PropertyValueSpecification<boolean>;
"text-transform"?: DataDrivenPropertyValueSpecification<"none" | "uppercase" | "lowercase">;
"text-offset"?: DataDrivenPropertyValueSpecification<[
number,
number
]>;
"text-allow-overlap"?: PropertyValueSpecification<boolean>;
"text-ignore-placement"?: PropertyValueSpecification<boolean>;
"text-optional"?: PropertyValueSpecification<boolean>;
"visibility"?: "visible" | "none";
};
"paint"?: {
"icon-opacity"?: DataDrivenPropertyValueSpecification<number>;
"icon-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
"icon-halo-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
"icon-halo-width"?: DataDrivenPropertyValueSpecification<number>;
"icon-halo-blur"?: DataDrivenPropertyValueSpecification<number>;
"icon-translate"?: PropertyValueSpecification<[
number,
number
]>;
"icon-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
"text-opacity"?: DataDrivenPropertyValueSpecification<number>;
"text-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
"text-halo-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
"text-halo-width"?: DataDrivenPropertyValueSpecification<number>;
"text-halo-blur"?: DataDrivenPropertyValueSpecification<number>;
"text-translate"?: PropertyValueSpecification<[
number,
number
]>;
"text-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
};
};
export declare type CircleLayerSpecification = {
"id": string;
"type": "circle";
"metadata"?: unknown;
"source": string;
"source-layer"?: string;
"minzoom"?: number;
"maxzoom"?: number;
"filter"?: FilterSpecification;
"layout"?: {
"circle-sort-key"?: DataDrivenPropertyValueSpecification<number>;
"visibility"?: "visible" | "none";
};
"paint"?: {
"circle-radius"?: DataDrivenPropertyValueSpecification<number>;
"circle-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
"circle-blur"?: DataDrivenPropertyValueSpecification<number>;
"circle-opacity"?: DataDrivenPropertyValueSpecification<number>;
"circle-translate"?: PropertyValueSpecification<[
number,
number
]>;
"circle-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
"circle-pitch-scale"?: PropertyValueSpecification<"map" | "viewport">;
"circle-pitch-alignment"?: PropertyValueSpecification<"map" | "viewport">;
"circle-stroke-width"?: DataDrivenPropertyValueSpecification<number>;
"circle-stroke-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
"circle-stroke-opacity"?: DataDrivenPropertyValueSpecification<number>;
};
};
export declare type HeatmapLayerSpecification = {
"id": string;
"type": "heatmap";
"metadata"?: unknown;
"source": string;
"source-layer"?: string;
"minzoom"?: number;
"maxzoom"?: number;
"filter"?: FilterSpecification;
"layout"?: {
"visibility"?: "visible" | "none";
};
"paint"?: {
"heatmap-radius"?: DataDrivenPropertyValueSpecification<number>;
"heatmap-weight"?: DataDrivenPropertyValueSpecification<number>;
"heatmap-intensity"?: PropertyValueSpecification<number>;
"heatmap-color"?: ExpressionSpecificationArray;
"heatmap-opacity"?: PropertyValueSpecification<number>;
};
};
export declare type FillExtrusionLayerSpecification = {
"id": string;
"type": "fill-extrusion";
"metadata"?: unknown;
"source": string;
"source-layer"?: string;
"minzoom"?: number;
"maxzoom"?: number;
"filter"?: FilterSpecification;
"layout"?: {
"visibility"?: "visible" | "none";
};
"paint"?: {
"fill-extrusion-opacity"?: PropertyValueSpecification<number>;
"fill-extrusion-color"?: DataDrivenPropertyValueSpecification<ColorSpecification>;
"fill-extrusion-translate"?: PropertyValueSpecification<[
number,
number
]>;
"fill-extrusion-translate-anchor"?: PropertyValueSpecification<"map" | "viewport">;
"fill-extrusion-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>;
"fill-extrusion-height"?: DataDrivenPropertyValueSpecification<number>;
"fill-extrusion-base"?: DataDrivenPropertyValueSpecification<number>;
"fill-extrusion-vertical-gradient"?: PropertyValueSpecification<boolean>;
};
};
export declare type RasterLayerSpecification = {
"id": string;
"type": "raster";
"metadata"?: unknown;
"source": string;
"source-layer"?: string;
"minzoom"?: number;
"maxzoom"?: number;
"filter"?: FilterSpecification;
"layout"?: {
"visibility"?: "visible" | "none";
};
"paint"?: {
"raster-opacity"?: PropertyValueSpecification<number>;
"raster-hue-rotate"?: PropertyValueSpecification<number>;
"raster-brightness-min"?: PropertyValueSpecification<number>;
"raster-brightness-max"?: PropertyValueSpecification<number>;
"raster-saturation"?: PropertyValueSpecification<number>;
"raster-contrast"?: PropertyValueSpecification<number>;
"raster-resampling"?: PropertyValueSpecification<"linear" | "nearest">;
"raster-fade-duration"?: PropertyValueSpecification<number>;
};
};
export declare type HillshadeLayerSpecification = {
"id": string;
"type": "hillshade";
"metadata"?: unknown;
"source": string;
"source-layer"?: string;
"minzoom"?: number;
"maxzoom"?: number;
"filter"?: FilterSpecification;
"layout"?: {
"visibility"?: "visible" | "none";
};
"paint"?: {
"hillshade-illumination-direction"?: PropertyValueSpecification<number>;
"hillshade-illumination-anchor"?: PropertyValueSpecification<"map" | "viewport">;
"hillshade-exaggeration"?: PropertyValueSpecification<number>;
"hillshade-shadow-color"?: PropertyValueSpecification<ColorSpecification>;
"hillshade-highlight-color"?: PropertyValueSpecification<ColorSpecification>;
"hillshade-accent-color"?: PropertyValueSpecification<ColorSpecification>;
};
};
export declare type BackgroundLayerSpecification = {
"id": string;
"type": "background";
"metadata"?: unknown;
"minzoom"?: number;
"maxzoom"?: number;
"layout"?: {
"visibility"?: "visible" | "none";
};
"paint"?: {
"background-color"?: PropertyValueSpecification<ColorSpecification>;
"background-pattern"?: PropertyValueSpecification<ResolvedImageSpecification>;
"background-opacity"?: PropertyValueSpecification<number>;
};
};
export declare type LayerSpecification = FillLayerSpecification | LineLayerSpecification | SymbolLayerSpecification | CircleLayerSpecification | HeatmapLayerSpecification | FillExtrusionLayerSpecification | RasterLayerSpecification | HillshadeLayerSpecification | BackgroundLayerSpecification;
export declare type CrossfadeParameters = {
fromScale: number;
toScale: number;
t: number;
};
export declare class EvaluationParameters {
zoom: number;
now: number;
fadeDuration: number;
zoomHistory: ZoomHistory;
transition: TransitionSpecification;
constructor(zoom: number, options?: any);
isSupportedScript(str: string): boolean;
crossFadingFactor(): number;
getCrossfadeParameters(): CrossfadeParameters;
}
export declare class LngLatBounds {
_ne: LngLat;
_sw: LngLat;
constructor(sw?: any, ne?: any);
/**
* Set the northeast corner of the bounding box
*
* @param {LngLatLike} ne a {@link LngLatLike} object describing the northeast corner of the bounding box.
* @returns {LngLatBounds} `this`
*/
setNorthEast(ne: LngLatLike): this;
/**
* Set the southwest corner of the bounding box
*
* @param {LngLatLike} sw a {@link LngLatLike} object describing the southwest corner of the bounding box.
* @returns {LngLatBounds} `this`
*/
setSouthWest(sw: LngLatLike): this;
/**
* Extend the bounds to include a given LngLatLike or LngLatBoundsLike.
*
* @param {LngLatLike|LngLatBoundsLike} obj object to extend to
* @returns {LngLatBounds} `this`
*/
extend(obj: LngLatLike | LngLatBoundsLike): any;
/**
* Returns the geographical coordinate equidistant from the bounding box's corners.
*
* @returns {LngLat} The bounding box's center.
* @example
* var llb = new maplibregl.LngLatBounds([-73.9876, 40.7661], [-73.9397, 40.8002]);
* llb.getCenter(); // = LngLat {lng: -73.96365, lat: 40.78315}
*/
getCenter(): LngLat;
/**
* Returns the southwest corner of the bounding box.
*
* @returns {LngLat} The southwest corner of the bounding box.
*/
getSouthWest(): LngLat;
/**
* Returns the northeast corner of the bounding box.
*
* @returns {LngLat} The northeast corner of the bounding box.
*/
getNorthEast(): LngLat;
/**
* Returns the northwest corner of the bounding box.
*
* @returns {LngLat} The northwest corner of the bounding box.
*/
getNorthWest(): LngLat;
/**
* Returns the southeast corner of the bounding box.
*
* @returns {LngLat} The southeast corner of the bounding box.
*/
getSouthEast(): LngLat;
/**
* Returns the west edge of the bounding box.
*
* @returns {number} The west edge of the bounding box.
*/
getWest(): number;
/**
* Returns the south edge of the bounding box.
*
* @returns {number} The south edge of the bounding box.
*/
getSouth(): number;
/**
* Returns the east edge of the bounding box.
*
* @returns {number} The east edge of the bounding box.
*/
getEast(): number;
/**
* Returns the north edge of the bounding box.
*
* @returns {number} The north edge of the bounding box.
*/
getNorth(): number;
/**
* Returns the bounding box represented as an array.
*
* @returns {Array<Array<number>>} The bounding box represented as an array, consisting of the
* southwest and northeast coordinates of the bounding represented as arrays of numbers.
* @example
* var llb = new maplibregl.LngLatBounds([-73.9876, 40.7661], [-73.9397, 40.8002]);
* llb.toArray(); // = [[-73.9876, 40.7661], [-73.9397, 40.8002]]
*/
toArray(): number[][];
/**
* Return the bounding box represented as a string.
*
* @returns {string} The bounding box represents as a string of the format
* `'LngLatBounds(LngLat(lng, lat), LngLat(lng, lat))'`.
* @example
* var llb = new maplibregl.LngLatBounds([-73.9876, 40.7661], [-73.9397, 40.8002]);
* llb.toString(); // = "LngLatBounds(LngLat(-73.9876, 40.7661), LngLat(-73.9397, 40.8002))"
*/
toString(): string;
/**
* Check if the bounding box is an empty/`null`-type box.
*
* @returns {boolean} True if bounds have been defined, otherwise false.
*/
isEmpty(): boolean;
/**
* Check if the point is within the bounding box.
*
* @param {LngLatLike} lnglat geographic point to check against.
* @returns {boolean} True if the point is within the bounding box.
* @example
* var llb = new maplibregl.LngLatBounds(
* new maplibregl.LngLat(-73.9876, 40.7661),
* new maplibregl.LngLat(-73.9397, 40.8002)
* );
*
* var ll = new maplibregl.LngLat(-73.9567, 40.7789);
*
* console.log(llb.contains(ll)); // = true
*/
contains(lnglat: LngLatLike): boolean;
/**
* Converts an array to a `LngLatBounds` object.
*
* If a `LngLatBounds` object is passed in, the function returns it unchanged.
*
* Internally, the function calls `LngLat#convert` to convert arrays to `LngLat` values.
*
* @param {LngLatBoundsLike} input An array of two coordinates to convert, or a `LngLatBounds` object to return.
* @returns {LngLatBounds} A new `LngLatBounds` object, if a conversion occurred, or the original `LngLatBounds` object.
* @example
* var arr = [[-73.9876, 40.7661], [-73.9397, 40.8002]];
* var llb = maplibregl.LngLatBounds.convert(arr);
* llb; // = LngLatBounds {_sw: LngLat {lng: -73.9876, lat: 40.7661}, _ne: LngLat {lng: -73.9397, lat: 40.8002}}
*/
static convert(input: LngLatBoundsLike): LngLatBounds;
}
/**
* A {@link LngLatBounds} object, an array of {@link LngLatLike} objects in [sw, ne] order,
* or an array of numbers in [west, south, east, north] order.
*
* @typedef {LngLatBounds | [LngLatLike, LngLatLike] | [number, number, number, number]} LngLatBoundsLike
* @example
* var v1 = new maplibregl.LngLatBounds(
* new maplibregl.LngLat(-73.9876, 40.7661),
* new maplibregl.LngLat(-73.9397, 40.8002)
* );
* var v2 = new maplibregl.LngLatBounds([-73.9876, 40.7661], [-73.9397, 40.8002])
* var v3 = [[-73.9876, 40.7661], [-73.9397, 40.8002]];
*/
export declare type LngLatBoundsLike = LngLatBounds | [
LngLatLike,
LngLatLike
] | [
number,
number,
number,
number
];
export declare class LngLat {
lng: number;
lat: number;
constructor(lng: number, lat: number);
/**
* Returns a new `LngLat` object whose longitude is wrapped to the range (-180, 180).
*
* @returns {LngLat} The wrapped `LngLat` object.
* @example
* var ll = new maplibregl.LngLat(286.0251, 40.7736);
* var wrapped = ll.wrap();
* wrapped.lng; // = -73.9749
*/
wrap(): LngLat;
/**
* Returns the coordinates represented as an array of two numbers.
*
* @returns {Array<number>} The coordinates represeted as an array of longitude and latitude.
* @example
* var ll = new maplibregl.LngLat(-73.9749, 40.7736);
* ll.toArray(); // = [-73.9749, 40.7736]
*/
toArray(): number[];
/**
* Returns the coordinates represent as a string.
*
* @returns {string} The coordinates represented as a string of the format `'LngLat(lng, lat)'`.
* @example
* var ll = new maplibregl.LngLat(-73.9749, 40.7736);
* ll.toString(); // = "LngLat(-73.9749, 40.7736)"
*/
toString(): string;
/**
* Returns the approximate distance between a pair of coordinates in meters
* Uses the Haversine Formula (from R.W. Sinnott, "Virtues of the Haversine", Sky and Telescope, vol. 68, no. 2, 1984, p. 159)
*
* @param {LngLat} lngLat coordinates to compute the distance to
* @returns {number} Distance in meters between the two coordinates.
* @example
* var new_york = new maplibregl.LngLat(-74.0060, 40.7128);
* var los_angeles = new maplibregl.LngLat(-118.2437, 34.0522);
* new_york.distanceTo(los_angeles); // = 3935751.690893987, "true distance" using a non-spherical approximation is ~3966km
*/
distanceTo(lngLat: LngLat): number;
/**
* Returns a `LngLatBounds` from the coordinates extended by a given `radius`. The returned `LngLatBounds` completely contains the `radius`.
*
* @param {number} [radius=0] Distance in meters from the coordinates to extend the bounds.
* @returns {LngLatBounds} A new `LngLatBounds` object representing the coordinates extended by the `radius`.
* @example
* var ll = new maplibregl.LngLat(-73.9749, 40.7736);
* ll.toBounds(100).toArray(); // = [[-73.97501862141328, 40.77351016847229], [-73.97478137858673, 40.77368983152771]]
*/
toBounds(radius?: number): LngLatBounds;
/**
* Converts an array of two numbers or an object with `lng` and `lat` or `lon` and `lat` properties
* to a `LngLat` object.
*
* If a `LngLat` object is passed in, the function returns it unchanged.
*
* @param {LngLatLike} input An array of two numbers or object to convert, or a `LngLat` object to return.
* @returns {LngLat} A new `LngLat` object, if a conversion occurred, or the original `LngLat` object.
* @example
* var arr = [-73.9749, 40.7736];
* var ll = maplibregl.LngLat.convert(arr);
* ll; // = LngLat {lng: -73.9749, lat: 40.7736}
*/
static convert(input: LngLatLike): LngLat;
}
/**
* A {@link LngLat} object, an array of two numbers representing longitude and latitude,
* or an object with `lng` and `lat` or `lon` and `lat` properties.
*
* @typedef {LngLat | {lng: number, lat: number} | {lon: number, lat: number} | [number, number]} LngLatLike
* @example
* var v1 = new maplibregl.LngLat(-122.420679, 37.772537);
* var v2 = [-122.420679, 37.772537];
* var v3 = {lon: -122.420679, lat: 37.772537};
*/
export declare type LngLatLike = LngLat | {
lng: number;
lat: number;
} | {
lon: number;
lat: number;
} | [
number,
number
];
export declare class MercatorCoordinate {
x: number;
y: number;
z: number;
constructor(x: number, y: number, z?: number);
/**
* Project a `LngLat` to a `MercatorCoordinate`.
*
* @param {LngLatLike} lngLatLike The location to project.
* @param {number} altitude The altitude in meters of the position.
* @returns {MercatorCoordinate} The projected mercator coordinate.
* @example
* var coord = maplibregl.MercatorCoordinate.fromLngLat({ lng: 0, lat: 0}, 0);
* coord; // MercatorCoordinate(0.5, 0.5, 0)
*/
static fromLngLat(lngLatLike: LngLatLike, altitude?: number): MercatorCoordinate;
/**
* Returns the `LngLat` for the coordinate.
*
* @returns {LngLat} The `LngLat` object.
* @example
* var coord = new maplibregl.MercatorCoordinate(0.5, 0.5, 0);
* var lngLat = coord.toLngLat(); // LngLat(0, 0)
*/
toLngLat(): LngLat;
/**
* Returns the altitude in meters of the coordinate.
*
* @returns {number} The altitude in meters.
* @example
* var coord = new maplibregl.MercatorCoordinate(0, 0, 0.02);
* coord.toAltitude(); // 6914.281956295339
*/
toAltitude(): number;
/**
* Returns the distance of 1 meter in `MercatorCoordinate` units at this latitude.
*
* For coordinates in real world units using meters, this naturally provides the scale
* to transform into `MercatorCoordinate`s.
*
* @returns {number} Distance of 1 meter in `MercatorCoordinate` units.
*/
meterInMercatorCoordinateUnits(): number;
}
export declare class CanonicalTileID {
z: number;
x: number;
y: number;
key: string;
constructor(z: number, x: number, y: number);
equals(id: CanonicalTileID): boolean;
url(urls: Array<string>, scheme?: string | null): string;
getTilePoint(coord: MercatorCoordinate): Point;
toString(): string;
}
export declare class UnwrappedTileID {
wrap: number;
canonical: CanonicalTileID;
key: string;
constructor(wrap: number, canonical: CanonicalTileID);
}
export declare class OverscaledTileID {
overscaledZ: number;
wrap: number;
canonical: CanonicalTileID;
key: string;
posMatrix: mat4;
constructor(overscaledZ: number, wrap: number, z: number, x: number, y: number);
equals(id: OverscaledTileID): boolean;
scaledTo(targetZ: number): OverscaledTileID;
calculateScaledKey(targetZ: number, withWrap: boolean): string;
isChildOf(parent: OverscaledTileID): boolean;
children(sourceMaxZoom: number): OverscaledTileID[];
isLessThan(rhs: OverscaledTileID): boolean;
wrapped(): OverscaledTileID;
unwrapTo(wrap: number): OverscaledTileID;
overscaleFactor(): number;
toUnwrapped(): UnwrappedTileID;
toString(): string;
getTilePoint(coord: MercatorCoordinate): Point;
}
export declare class Intl$Collator {
constructor(locales?: string | string[], options?: CollatorOptions);
compare(a: string, b: string): number;
resolvedOptions(): any;
}
export declare type CollatorOptions = {
localeMatcher?: "lookup" | "best fit";
usage?: "sort" | "search";
sensitivity?: "base" | "accent" | "case" | "variant";
ignorePunctuation?: boolean;
numeric?: boolean;
caseFirst?: "upper" | "lower" | "false";
};
export declare class Collator {
locale: string | null;
sensitivity: "base" | "accent" | "case" | "variant";
collator: Intl$Collator;
constructor(caseSensitive: boolean, diacriticSensitive: boolean, locale: string | null);
compare(lhs: string, rhs: string): number;
resolvedLocale(): string;
}
export declare type ResolvedImageOptions = {
name: string;
available: boolean;
};
export declare class ResolvedImage {
name: string;
available: boolean;
constructor(options: ResolvedImageOptions);
toString(): string;
static fromString(name: string): ResolvedImage | null;
serialize(): Array<string>;
}
export declare class FormattedSection {
text: string;
image: ResolvedImage | null;
scale: number | null;
fontStack: string | null;
textColor: Color | null;
constructor(text: string, image: ResolvedImage | null, scale: number | null, fontStack: string | null, textColor: Color | null);
}
export declare class Formatted {
sections: Array<FormattedSection>;
constructor(sections: Array<FormattedSection>);
static fromString(unformatted: string): Formatted;
isEmpty(): boolean;
static factory(text: Formatted | string): Formatted;
toString(): string;
serialize(): Array<unknown>;
}
export declare type Value = null | string | boolean | number | Color | Collator | Formatted | ResolvedImage | ReadonlyArray<Value> | {
readonly [x: string]: Value;
};
export declare type InterpolationType = {
name: "linear";
} | {
name: "exponential";
base: number;
} | {
name: "cubic-bezier";
controlPoints: [
number,
number,
number,
number
];
};
export declare type Feature = {
readonly type: 1 | 2 | 3 | "Unknown" | "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon";
readonly id?: any;
readonly properties: {
[_: string]: any;
};
readonly patterns?: {
[_: string]: {
"min": string;
"mid": string;
"max": string;
};
};
readonly geometry?: Array<Array<Point>>;
};
export declare type FeatureState = {
[_: string]: any;
};
export declare type GlobalProperties = Readonly<{
zoom: number;
heatmapDensity?: number;
lineProgress?: number;
isSupportedScript?: (_: string) => boolean;
accumulated?: Value;
}>;
export declare type ConstantExpression = {
kind: "constant";
readonly evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>) => any;
};
export declare type SourceExpression = {
kind: "source";
isStateDependent: boolean;
readonly evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>, formattedSection?: FormattedSection) => any;
};
export declare type CameraExpression = {
kind: "camera";
readonly evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>) => any;
readonly interpolationFactor: (input: number, lower: number, upper: number) => number;
zoomStops: Array<number>;
interpolationType: InterpolationType;
};
export declare type CompositeExpression = {
kind: "composite";
isStateDependent: boolean;
readonly evaluate: (globals: GlobalProperties, feature?: Feature, featureState?: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>, formattedSection?: FormattedSection) => any;
readonly interpolationFactor: (input: number, lower: number, upper: number) => number;
zoomStops: Array<number>;
interpolationType: InterpolationType;
};
export declare type StylePropertyExpression = ConstantExpression | SourceExpression | CameraExpression | CompositeExpression;
export declare type FilterExpression = (globalProperties: GlobalProperties, feature: Feature, canonical?: CanonicalTileID) => boolean;
export declare type FeatureFilter = {
filter: FilterExpression;
needGeometry: boolean;
};
export declare type ExpressionType = "data-driven" | "cross-faded" | "cross-faded-data-driven" | "color-ramp" | "data-constant" | "constant";
export declare type ExpressionParameters = Array<"zoom" | "feature" | "feature-state" | "heatmap-density" | "line-progress">;
export declare type ExpressionSpecification = {
interpolated: boolean;
parameters: ExpressionParameters;
};
export declare type StylePropertySpecification = {
type: "number";
"property-type": ExpressionType;
expression?: ExpressionSpecification;
transition: boolean;
default?: number;
} | {
type: "string";
"property-type": ExpressionType;
expression?: ExpressionSpecification;
transition: boolean;
default?: string;
tokens?: boolean;
} | {
type: "boolean";
"property-type": ExpressionType;
expression?: ExpressionSpecification;
transition: boolean;
default?: boolean;
} | {
type: "enum";
"property-type": ExpressionType;
expression?: ExpressionSpecification;
values: {
[_: string]: {};
};
transition: boolean;
default?: string;
} | {
type: "color";
"property-type": ExpressionType;
expression?: ExpressionSpecification;
transition: boolean;
default?: string;
overridable: boolean;
} | {
type: "array";
value: "number";
"property-type": ExpressionType;
expression?: ExpressionSpecification;
length?: number;
transition: boolean;
default?: Array<number>;
} | {
type: "array";
value: "string";
"property-type": ExpressionType;
expression?: ExpressionSpecification;
length?: number;
transition: boolean;
default?: Array<string>;
};
export declare type TimePoint = number;
export declare type CrossFaded<T> = {
to: T;
from: T;
};
/**
* Implements a number of classes that define state and behavior for paint and layout properties, most
* importantly their respective evaluation chains:
*
* Transitionable paint property value
* → Transitioning paint property value
* → Possibly evaluated paint property value
* → Fully evaluated paint property value
*
* Layout property value
* → Possibly evaluated layout property value
* → Fully evaluated layout property value
*
* @module
* @private
*/
/**
* Implementations of the `Property` interface:
*
* * Hold metadata about a property that's independent of any specific value: stuff like the type of the value,
* the default value, etc. This comes from the style specification JSON.
* * Define behavior that needs to be polymorphic across different properties: "possibly evaluating"
* an input value (see below), and interpolating between two possibly-evaluted values.
*
* The type `T` is the fully-evaluated value type (e.g. `number`, `string`, `Color`).
* The type `R` is the intermediate "possibly evaluated" value type. See below.
*
* There are two main implementations of the interface -- one for properties that allow data-driven values,
* and one for properties that don't. There are a few "special case" implementations as well: one for properties
* which cross-fade between two values rather than interpolating, one for `heatmap-color` and `line-gradient`,
* and one for `light-position`.
*
* @private
*/
export interface Property<T, R> {
specification: StylePropertySpecification;
possiblyEvaluate(value: PropertyValue<T, R>, parameters: EvaluationParameters, canonical?: CanonicalTileID, availableImages?: Array<string>): R;
interpolate(a: R, b: R, t: number): R;
}
export declare class PropertyValue<T, R> {
property: Property<T, R>;
value: PropertyValueSpecification<T> | void;
expression: StylePropertyExpression;
constructor(property: Property<T, R>, value: PropertyValueSpecification<T> | void);
isDataDriven(): boolean;
possiblyEvaluate(parameters: EvaluationParameters, canonical?: CanonicalTileID, availableImages?: Array<string>): R;
}
export declare type TransitionParameters = {
now: TimePoint;
transition: TransitionSpecification;
};
export declare class TransitionablePropertyValue<T, R> {
property: Property<T, R>;
value: PropertyValue<T, R>;
transition: TransitionSpecification | void;
constructor(property: Property<T, R>);
transitioned(parameters: TransitionParameters, prior: TransitioningPropertyValue<T, R>): TransitioningPropertyValue<T, R>;
untransitioned(): TransitioningPropertyValue<T, R>;
}
export declare class Transitionable<Props> {
_properties: Properties<Props>;
_values: {
[K in keyof Props]: TransitionablePropertyValue<any, unknown>;
};
constructor(properties: Properties<Props>);
getValue<S extends keyof Props, T>(name: S): PropertyValueSpecification<T> | void;
setValue<S extends keyof Props, T>(name: S, value: PropertyValueSpecification<T> | void): void;
getTransition<S extends keyof Props>(name: S): TransitionSpecification | void;
setTransition<S extends keyof Props>(name: S, value: TransitionSpecification | void): void;
serialize(): any;
transitioned(parameters: TransitionParameters, prior: Transitioning<Props>): Transitioning<Props>;
untransitioned(): Transitioning<Props>;
}
export declare class TransitioningPropertyValue<T, R> {
property: Property<T, R>;
value: PropertyValue<T, R>;
prior: TransitioningPropertyValue<T, R>;
begin: TimePoint;
end: TimePoint;
constructor(property: Property<T, R>, value: PropertyValue<T, R>, prior: TransitioningPropertyValue<T, R>, transition: TransitionSpecification, now: TimePoint);
possiblyEvaluate(parameters: EvaluationParameters, canonical: CanonicalTileID, availableImages: Array<string>): R;
}
export declare class Transitioning<Props> {
_properties: Properties<Props>;
_values: {
[K in keyof Props]: PossiblyEvaluatedPropertyValue<unknown>;
};
constructor(properties: Properties<Props>);
possiblyEvaluate(parameters: EvaluationParameters, canonical?: CanonicalTileID, availableImages?: Array<string>): PossiblyEvaluated<Props, any>;
hasTransition(): boolean;
}
export declare class Layout<Props> {
_properties: Properties<Props>;
_values: {
[K in keyof Props]: PropertyValue<any, PossiblyEvaluatedPropertyValue<any>>;
};
constructor(properties: Properties<Props>);
getValue<S extends keyof Props>(name: S): any;
setValue<S extends keyof Props>(name: S, value: any): void;
serialize(): any;
possiblyEvaluate(parameters: EvaluationParameters, canonical?: CanonicalTileID, availableImages?: Array<string>): PossiblyEvaluated<Props, any>;
}
/**
* "Possibly evaluated value" is an intermediate stage in the evaluation chain for both paint and layout property
* values. The purpose of this stage is to optimize away unnecessary recalculations for data-driven properties. Code
* which uses data-driven property values must assume that the value is dependent on feature data, and request that it
* be evaluated for each feature. But when that property value is in fact a constant or camera function, the calculation
* will not actually depend on the feature, and we can benefit from returning the prior result of having done the
* evaluation once, ahead of time, in an intermediate step whose inputs are just the value and "global" parameters
* such as current zoom level.
*
* `PossiblyEvaluatedValue` represents the three possible outcomes of this step: if the input value was a constant or
* camera expression, then the "possibly evaluated" result is a constant value. Otherwise, the input value was either
* a source or composite expression, and we must defer final evaluation until supplied a feature. We separate
* the source and composite cases because they are handled differently when generating GL attributes, buffers, and
* uniforms.
*
* Note that `PossiblyEvaluatedValue` (and `PossiblyEvaluatedPropertyValue`, below) are _not_ used for properties that
* do not allow data-driven values. For such properties, we know that the "possibly evaluated" result is always a constant
* scalar value. See below.
*
* @private
*/
export declare type PossiblyEvaluatedValue<T> = {
kind: "constant";
value: T;
} | SourceExpression | CompositeExpression;
export declare class PossiblyEvaluatedPropertyValue<T> {
property: DataDrivenProperty<T>;
value: PossiblyEvaluatedValue<T>;
parameters: EvaluationParameters;
constructor(property: DataDrivenProperty<T>, value: PossiblyEvaluatedValue<T>, parameters: EvaluationParameters);
isConstant(): boolean;
constantOr(value: T): T;
evaluate(feature: Feature, featureState: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>): T;
}
export declare class PossiblyEvaluated<Props, PossibleEvaluatedProps> {
_properties: Properties<Props>;
_values: PossibleEvaluatedProps;
constructor(properties: Properties<Props>);
get<S extends keyof PossibleEvaluatedProps>(name: S): PossibleEvaluatedProps[S];
}
export declare class DataConstantProperty<T> implements Property<T, T> {
specification: StylePropertySpecification;
constructor(specification: StylePropertySpecification);
possiblyEvaluate(value: PropertyValue<T, T>, parameters: EvaluationParameters): T;
interpolate(a: T, b: T, t: number): T;
}
export declare class DataDrivenProperty<T> implements Property<T, PossiblyEvaluatedPropertyValue<T>> {
specification: StylePropertySpecification;
overrides: any;
constructor(specification: StylePropertySpecification, overrides?: any);
possiblyEvaluate(value: PropertyValue<T, PossiblyEvaluatedPropertyValue<T>>, parameters: EvaluationParameters, canonical?: CanonicalTileID, availableImages?: Array<string>): PossiblyEvaluatedPropertyValue<T>;
interpolate(a: PossiblyEvaluatedPropertyValue<T>, b: PossiblyEvaluatedPropertyValue<T>, t: number): PossiblyEvaluatedPropertyValue<T>;
evaluate(value: PossiblyEvaluatedValue<T>, parameters: EvaluationParameters, feature: Feature, featureState: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>): T;
}
export declare class CrossFadedDataDrivenProperty<T> extends DataDrivenProperty<CrossFaded<T>> {
possiblyEvaluate(value: PropertyValue<CrossFaded<T>, PossiblyEvaluatedPropertyValue<CrossFaded<T>>>, parameters: EvaluationParameters, canonical?: CanonicalTileID, availableImages?: Array<string>): PossiblyEvaluatedPropertyValue<CrossFaded<T>>;
evaluate(value: PossiblyEvaluatedValue<CrossFaded<T>>, globals: EvaluationParameters, feature: Feature, featureState: FeatureState, canonical?: CanonicalTileID, availableImages?: Array<string>): CrossFaded<T>;
_calculate(min: T, mid: T, max: T, parameters: EvaluationParameters): CrossFaded<T>;
interpolate(a: PossiblyEvaluatedPropertyValue<CrossFaded<T>>): PossiblyEvaluatedPropertyValue<CrossFaded<T>>;
}
export declare class CrossFadedProperty<T> implements Property<T, CrossFaded<T>> {
specification: StylePropertySpecification;
constructor(specification: StylePropertySpecification);
possiblyEvaluate(value: PropertyValue<T, CrossFaded<T>>, parameters: EvaluationParameters, canonical?: CanonicalTileID, availableImages?: Array<string>): CrossFaded<T>;
_calculate(min: T, mid: T, max: T, parameters: EvaluationParameters): CrossFaded<T>;
interpolate(a?: CrossFaded<T> | null): CrossFaded<T>;
}
export declare class ColorRampProperty implements Property<Color, boolean> {
specification: StylePropertySpecification;
constructor(specification: StylePropertySpecification);
possiblyEvaluate(value: PropertyValue<Color, boolean>, parameters: EvaluationParameters, canonical?: CanonicalTileID, availableImages?: Array<string>): boolean;
interpolate(): boolean;
}
export declare class Properties<Props> {
properties: Props;
defaultPropertyValues: {
[K in keyof Props]: PropertyValue<unknown, any>;
};
defaultTransitionablePropertyValues: {
[K in keyof Props]: TransitionablePropertyValue<unknown, unknown>;
};
defaultTransitioningPropertyValues: {
[K in keyof Props]: TransitioningPropertyValue<unknown, unknown>;
};
defaultPossiblyEvaluatedValues: {
[K in keyof Props]: PossiblyEvaluatedPropertyValue<unknown>;
};
overridableProperties: Array<string>;
constructor(properties: Props);
}
export declare type Transferable = ArrayBuffer | MessagePort | ImageBitmap;
declare const viewTypes: {
Int8: Int8ArrayConstructor;
Uint8: Uint8ArrayConstructor;
Int16: Int16ArrayConstructor;
Uint16: Uint16ArrayConstructor;
Int32: Int32ArrayConstructor;
Uint32: Uint32ArrayConstructor;
Float32: Float32ArrayConstructor;
};
export declare type ViewType = keyof typeof viewTypes;
export declare class Struct {
_pos1: number;
_pos2: number;
_pos4: number;
_pos8: number;
readonly _structArray: StructArray;
size: number;
/**
* @param {StructArray} structArray The StructArray the struct is stored in
* @param {number} index The index of the struct in the StructArray.
* @private
*/
constructor(structArray: StructArray, index: number);
}
export declare type StructArrayMember = {
name: string;
type: ViewType;
components: number;
offset: number;
};
export declare type SerializedStructArray = {
length: number;
arrayBuffer: ArrayBuffer;
};
declare abstract class StructArray {
capacity: number;
length: number;
isTransferred: boolean;
arrayBuffer: ArrayBuffer;
uint8: Uint8Array;
members: Array<StructArrayMember>;
bytesPerElement: number;
abstract emplaceBack(...v: number[]): any;
abstract emplace(i: number, ...v: number[]): any;
constructor();
/**
* Serialize a StructArray instance. Serializes both the raw data and the
* metadata needed to reconstruct the StructArray base class during
* deserialization.
* @private
*/
static serialize(array: StructArray, transferables?: Array<Transferable>): SerializedStructArray;
static deserialize(input: SerializedStructArray): any;
/**
* Resize the array to discard unused capacity.
*/
_trim(): void;
/**
* Resets the the length of the array to 0 without de-allocating capcacity.
*/
clear(): void;
/**
* Resize the array.
* If `n` is greater than the current length then additional elements with undefined values are added.
* If `n` is less than the current length then the array will be reduced to the first `n` elements.
* @param {number} n The new size of the array.
*/
resize(n: number): void;
/**
* Indicate a planned increase in size, so that any necessary allocation may
* be done once, ahead of time.
* @param {number} n The expected size of the array.
*/
reserve(n: number): void;
/**
* Create TypedArray views for the current ArrayBuffer.
*/
_refreshViews(): void;
}
export declare class StructArrayLayout2i4 extends StructArray {
uint8: Uint8Array;
int16: Int16Array;
_refreshViews(): void;
emplaceBack(v0: number, v1: number): number;
emplace(i: number, v0: number, v1: number): number;
}
export declare class StructArrayLayout2i4i12 extends StructArray {
uint8: Uint8Array;
int16: Int16Array;
_refreshViews(): void;
emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number): number;
emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number): number;
}
export declare class StructArrayLayout2i4ub8 extends StructArray {
uint8: Uint8Array;
int16: Int16Array;
_refreshViews(): void;
emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number): number;
emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number): number;
}
export declare class StructArrayLayout2f8 extends StructArray {
uint8: Uint8Array;
float32: Float32Array;
_refreshViews(): void;
emplaceBack(v0: number, v1: number): number;
emplace(i: number, v0: number, v1: number): number;
}
export declare class StructArrayLayout4i4ui4i24 extends StructArray {
uint8: Uint8Array;
int16: Int16Array;
uint16: Uint16Array;
_refreshViews(): void;
emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number): number;
emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number): number;
}
export declare class StructArrayLayout3f12 extends StructArray {
uint8: Uint8Array;
float32: Float32Array;
_refreshViews(): void;
emplaceBack(v0: number, v1: number, v2: number): number;
emplace(i: number, v0: number, v1: number, v2: number): number;
}
export declare class StructArrayLayout1ul4 extends StructArray {
uint8: Uint8Array;
uint32: Uint32Array;
_refreshViews(): void;
emplaceBack(v0: number): number;
emplace(i: number, v0: number): number;
}
export declare class StructArrayLayout6i1ul2ui20 extends StructArray {
uint8: Uint8Array;
int16: Int16Array;
uint32: Uint32Array;
uint16: Uint16Array;
_refreshViews(): void;
emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number): number;
emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number): number;
}
export declare class StructArrayLayout2ub2f12 extends StructArray {
uint8: Uint8Array;
float32: Float32Array;
_refreshViews(): void;
emplaceBack(v0: number, v1: number, v2: number, v3: number): number;
emplace(i: number, v0: number, v1: number, v2: number, v3: number): number;
}
export declare class StructArrayLayout3ui6 extends StructArray {
uint8: Uint8Array;
uint16: Uint16Array;
_refreshViews(): void;
emplaceBack(v0: number, v1: number, v2: number): number;
emplace(i: number, v0: number, v1: number, v2: number): number;
}
export declare class StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48 extends StructArray {
uint8: Uint8Array;
int16: Int16Array;
uint16: Uint16Array;
uint32: Uint32Array;
float32: Float32Array;
_refreshViews(): void;
emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, v16: number): number;
emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, v16: number): number;
}
export declare class StructArrayLayout8i15ui1ul4f68 extends StructArray {
uint8: Uint8Array;
int16: Int16Array;
uint16: Uint16Array;
uint32: Uint32Array;
float32: Float32Array;
_refreshViews(): void;
emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, v16: number, v17: number, v18: number, v19: number, v20: number, v21: number, v22: number, v23: number, v24: number, v25: number, v26: number, v27: number): number;
emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, v16: number, v17: number, v18: number, v19: number, v20: number, v21: number, v22: number, v23: number, v24: number, v25: number, v26: number, v27: number): number;
}
export declare class StructArrayLayout1f4 extends StructArray {
uint8: Uint8Array;
float32: Float32Array;
_refreshViews(): void;
emplaceBack(v0: number): number;
emplace(i: number, v0: number): number;
}
export declare class StructArrayLayout3i6 extends StructArray {
uint8: Uint8Array;
int16: Int16Array;
_refreshViews(): void;
emplaceBack(v0: number, v1: number, v2: number): number;
emplace(i: number, v0: number, v1: number, v2: number): number;
}
export declare class StructArrayLayout1ul2ui8 extends StructArray {
uint8: Uint8Array;
uint32: Uint32Array;
uint16: Uint16Array;
_refreshViews(): void;
emplaceBack(v0: number, v1: number, v2: number): number;
emplace(i: number, v0: number, v1: number, v2: number): number;
}
export declare class StructArrayLayout2ui4 extends StructArray {
uint8: Uint8Array;
uint16: Uint16Array;
_refreshViews(): void;
emplaceBack(v0: number, v1: number): number;
emplace(i: number, v0: number, v1: number): number;
}
export declare class StructArrayLayout1ui2 extends StructArray {
uint8: Uint8Array;
uint16: Uint16Array;
_refreshViews(): void;
emplaceBack(v0: number): number;
emplace(i: number, v0: number): number;
}
export declare class CollisionBoxStruct extends Struct {
_structArray: CollisionBoxArray;
get anchorPointX(): number;
get anchorPointY(): number;
get x1(): number;
get y1(): number;
get x2(): number;
get y2(): number;
get featureIndex(): number;
get sourceLayerIndex(): number;
get bucketIndex(): number;
get anchorPoint(): Point;
}
export declare class CollisionBoxArray extends StructArrayLayout6i1ul2ui20 {
/**
* Return the CollisionBoxStruct at the given location in the array.
* @param {number} index The index of the element.
* @private
*/
get(index: number): CollisionBoxStruct;
}
export declare class PlacedSymbolStruct extends Struct {
_structArray: PlacedSymbolArray;
get anchorX(): number;
get anchorY(): number;
get glyphStartIndex(): number;
get numGlyphs(): number;
get vertexStartIndex(): number;
get lineStartIndex(): number;
get lineLength(): number;
get segment(): number;
get lowerSize(): number;
get upperSize(): number;
get lineOffsetX(): number;
get lineOffsetY(): number;
get writingMode(): number;
get placedOrientation(): number;
set placedOrientation(x: number);
get hidden(): number;
set hidden(x: number);
get crossTileID(): number;
set crossTileID(x: number);
get associatedIconIndex(): number;
}
export declare class PlacedSymbolArray extends StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48 {
/**
* Return the PlacedSymbolStruct at the given location in the array.
* @param {number} index The index of the element.
* @private
*/
get(index: number): PlacedSymbolStruct;
}
export declare class SymbolInstanceStruct extends Struct {
_structArray: SymbolInstanceArray;
get anchorX(): number;
get anchorY(): number;
get rightJustifiedTextSymbolIndex(): number;
get centerJustifiedTextSymbolIndex(): number;
get leftJustifiedTextSymbolIndex(): number;
get verticalPlacedTextSymbolIndex(): number;
get placedIconSymbolIndex(): number;
get verticalPlacedIconSymbolIndex(): number;
get key(): number;
get textBoxStartIndex(): number;
get textBoxEndIndex(): number;
get verticalTextBoxStartIndex(): number;
get verticalTextBoxEndIndex(): number;
get iconBoxStartIndex(): number;
get iconBoxEndIndex(): number;
get verticalIconBoxStartIndex(): number;
get verticalIconBoxEndIndex(): number;
get featureIndex(): number;
get numHorizontalGlyphVertices(): number;
get numVerticalGlyphVertices(): number;
get numIconVertices(): number;
get numVerticalIconVertices(): number;
get useRuntimeCollisionCircles(): number;
get crossTileID(): number;
set crossTileID(x: number);
get textBoxScale(): number;
get textOffset0(): number;
get textOffset1(): number;
get collisionCircleDiameter(): number;
}
export declare type SymbolInstance = SymbolInstanceStruct;
export declare class SymbolInstanceArray extends StructArrayLayout8i15ui1ul4f68 {
/**
* Return the SymbolInstanceStruct at the given location in the array.
* @param {number} index The index of the element.
* @private
*/
get(index: number): SymbolInstanceStruct;
}
export declare class GlyphOffsetArray extends StructArrayLayout1f4 {
getoffsetX(index: number): number;
}
export declare class SymbolLineVertexArray extends StructArrayLayout3i6 {
getx(index: number): number;
gety(index: number): number;
gettileUnitDistanceFromAnchor(index: number): number;
}
export declare class FeatureIndexStruct extends Struct {
_structArray: FeatureIndexArray;
get featureIndex(): number;
get sourceLayerIndex(): number;
get bucketIndex(): number;
}
export declare class FeatureIndexArray extends StructArrayLayout1ul2ui8 {
/**
* Return the FeatureIndexStruct at the given location in the array.
* @param {number} index The index of the element.
* @private
*/
get(index: number): FeatureIndexStruct;
}
export declare class CircleLayoutArray extends StructArrayLayout2i4 {
}
export declare class FillLayoutArray extends StructArrayLayout2i4 {
}
export declare class FillExtrusionLayoutArray extends StructArrayLayout2i4i12 {
}
export declare class LineLayoutArray extends StructArrayLayout2i4ub8 {
}
export declare class LineExtLayoutArray extends StructArrayLayout2f8 {
}
export declare class SymbolLayoutArray extends StructArrayLayout4i4ui4i24 {
}
export declare class SymbolDynamicLayoutArray extends StructArrayLayout3f12 {
}
export declare class SymbolOpacityArray extends StructArrayLayout1ul4 {
}
export declare class CollisionVertexArray extends StructArrayLayout2ub2f12 {
}
export declare class TriangleIndexArray extends StructArrayLayout3ui6 {
}
export declare class LineIndexArray extends StructArrayLayout2ui4 {
}
export declare class LineStripIndexArray extends StructArrayLayout1ui2 {
}
export declare type SerializedFeaturePositionMap = {
ids: Float64Array;
positions: Uint32Array;
};
export declare type FeaturePosition = {
index: number;
start: number;
end: number;
};
export declare class FeaturePositionMap {
ids: Array<number>;
positions: Array<number>;
indexed: boolean;
constructor();
add(id: unknown, index: number, start: number, end: number): void;
getPositions(id: unknown): Array<FeaturePosition>;
static serialize(map: FeaturePositionMap, transferables: Array<ArrayBuffer>): SerializedFeaturePositionMap;
static deserialize(obj: SerializedFeaturePositionMap): FeaturePositionMap;
}
export declare class IndexBuffer {
context: Context;
buffer: WebGLBuffer;
dynamicDraw: boolean;
constructor(context: Context, array: TriangleIndexArray | LineIndexArray | LineStripIndexArray, dynamicDraw?: boolean);
bind(): void;
updateData(array: StructArray): void;
destroy(): void;
}
export declare class VertexBuffer {
length: number;
attributes: ReadonlyArray<StructArrayMember>;
itemSize: number;
dynamicDraw: boolean;
context: Context;
buffer: WebGLBuffer;
/**
* @param dynamicDraw Whether this buffer will be repeatedly updated.
* @private
*/
constructor(context: Context, array: StructArray, attributes: ReadonlyArray<StructArrayMember>, dynamicDraw?: boolean);
bind(): void;
updateData(array: StructArray): void;
enableAttributes(gl: WebGLRenderingContext, program: Program<any>): void;
/**
* Set the attribute pointers in a WebGL context
* @param gl The WebGL context
* @param program The active WebGL program
* @param vertexOffset Index of the starting vertex of the segment
*/
setVertexAttribPointers(gl: WebGLRenderingContext, program: Program<any>, vertexOffset?: number | null): void;
/**
* Destroy the GL buffer bound to the given WebGL context
*/
destroy(): void;
}
export declare type BlendFuncConstant = WebGLRenderingContext["ZERO"] | WebGLRenderingContext["ONE"] | WebGLRenderingContext["SRC_COLOR"] | WebGLRenderingContext["ONE_MINUS_SRC_COLOR"] | WebGLRenderingContext["DST_COLOR"] | WebGLRenderingContext["ONE_MINUS_DST_COLOR"] | WebGLRenderingContext["SRC_ALPHA"] | WebGLRenderingContext["ONE_MINUS_SRC_ALPHA"] | WebGLRenderingContext["DST_ALPHA"] | WebGLRenderingContext["ONE_MINUS_DST_ALPHA"] | WebGLRenderingContext["CONSTANT_COLOR"] | WebGLRenderingContext["ONE_MINUS_CONSTANT_COLOR"] | WebGLRenderingContext["CONSTANT_ALPHA"] | WebGLRenderingContext["ONE_MINUS_CONSTANT_ALPHA"] | WebGLRenderingContext["BLEND_COLOR"];
export declare type BlendFuncType = [
BlendFuncConstant,
BlendFuncConstant
];
export declare type BlendEquationType = WebGLRenderingContext["FUNC_ADD"] | WebGLRenderingContext["FUNC_SUBTRACT"] | WebGLRenderingContext["FUNC_REVERSE_SUBTRACT"];
export declare type ColorMaskType = [
boolean,
boolean,
boolean,
boolean
];
export declare type CompareFuncType = WebGLRenderingContext["NEVER"] | WebGLRenderingContext["LESS"] | WebGLRenderingContext["EQUAL"] | WebGLRenderingContext["LEQUAL"] | WebGLRenderingContext["GREATER"] | WebGLRenderingContext["NOTEQUAL"] | WebGLRenderingContext["GEQUAL"] | WebGLRenderingContext["ALWAYS"];
export declare type DepthMaskType = boolean;
export declare type DepthRangeType = [
number,
number
];
export declare type DepthFuncType = CompareFuncType;
export declare type StencilFuncType = {
func: CompareFuncType;
ref: number;
mask: number;
};
export declare type StencilOpConstant = WebGLRenderingContext["KEEP"] | WebGLRenderingContext["ZERO"] | WebGLRenderingContext["REPLACE"] | WebGLRenderingContext["INCR"] | WebGLRenderingContext["INCR_WRAP"] | WebGLRenderingContext["DECR"] | WebGLRenderingContext["DECR_WRAP"] | WebGLRenderingContext["INVERT"];
export declare type StencilOpType = [
StencilOpConstant,
StencilOpConstant,
StencilOpConstant
];
export declare type TextureUnitType = number;
export declare type ViewportType = [
number,
number,
number,
number
];
export declare type StencilTestGL = {
func: WebGLRenderingContext["NEVER"];
mask: 0;
} | {
func: WebGLRenderingContext["LESS"];
mask: number;
} | {
func: WebGLRenderingContext["EQUAL"];
mask: number;
} | {
func: WebGLRenderingContext["LEQUAL"];
mask: number;
} | {
func: WebGLRenderingContext["GREATER"];
mask: number;
} | {
func: WebGLRenderingContext["NOTEQUAL"];
mask: number;
} | {
func: WebGLRenderingContext["GEQUAL"];
mask: number;
} | {
func: WebGLRenderingContext["ALWAYS"];
mask: 0;
};
export declare type CullFaceModeType = WebGLRenderingContext["FRONT"] | WebGLRenderingContext["BACK"] | WebGLRenderingContext["FRONT_AND_BACK"];
export declare type FrontFaceType = WebGLRenderingContext["CW"] | WebGLRenderingContext["CCW"];
export interface IValue<T> {
current: T;
default: T;
dirty: boolean;
get(): T;
setDefault(): void;
set(value: T): void;
}
export declare class BaseValue<T> implements IValue<T> {
gl: WebGLRenderingContext;
current: T;
default: T;
dirty: boolean;
constructor(context: Context);
get(): T;
set(value: T): void;
getDefault(): T;
setDefault(): void;
}
export declare class ClearColor extends BaseValue<Color> {
getDefault(): Color;
set(v: Color): void;
}
export declare class ClearDepth extends BaseValue<number> {
getDefault(): number;
set(v: number): void;
}
export declare class ClearStencil extends BaseValue<number> {
getDefault(): number;
set(v: number): void;
}
export declare class ColorMask extends BaseValue<ColorMaskType> {
getDefault(): ColorMaskType;
set(v: ColorMaskType): void;
}
export declare class DepthMask extends BaseValue<DepthMaskType> {
getDefault(): DepthMaskType;
set(v: DepthMaskType): void;
}
export declare class StencilMask extends BaseValue<number> {
getDefault(): number;
set(v: number): void;
}
export declare class StencilFunc extends BaseValue<StencilFuncType> {
getDefault(): StencilFuncType;
set(v: StencilFuncType): void;
}
export declare class StencilOp extends BaseValue<StencilOpType> {
getDefault(): StencilOpType;
set(v: StencilOpType): void;
}
export declare class StencilTest extends BaseValue<boolean> {
getDefault(): boolean;
set(v: boolean): void;
}
export declare class DepthRange extends BaseValue<DepthRangeType> {
getDefault(): DepthRangeType;
set(v: DepthRangeType): void;
}
export declare class DepthTest extends BaseValue<boolean> {
getDefault(): boolean;
set(v: boolean): void;
}
export declare class DepthFunc extends BaseValue<DepthFuncType> {
getDefault(): DepthFuncType;
set(v: DepthFuncType): void;
}
export declare class Blend extends BaseValue<boolean> {
getDefault(): boolean;
set(v: boolean): void;
}
export declare class BlendFunc extends BaseValue<BlendFuncType> {
getDefault(): BlendFuncType;
set(v: BlendFuncType): void;
}
export declare class BlendColor extends BaseValue<Color> {
getDefault(): Color;
set(v: Color): void;
}
export declare class BlendEquation extends BaseValue<BlendEquationType> {
getDefault(): BlendEquationType;
set(v: BlendEquationType): void;
}
export declare class CullFace extends BaseValue<boolean> {
getDefault(): boolean;
set(v: boolean): void;
}
export declare class CullFaceSide extends BaseValue<CullFaceModeType> {
getDefault(): CullFaceModeType;
set(v: CullFaceModeType): void;
}
export declare class FrontFace extends BaseValue<FrontFaceType> {
getDefault(): FrontFaceType;
set(v: FrontFaceType): void;
}
export declare class ProgramValue extends BaseValue<WebGLProgram> {
getDefault(): WebGLProgram;
set(v?: WebGLProgram | null): void;
}
export declare class ActiveTextureUnit extends BaseValue<TextureUnitType> {
getDefault(): TextureUnitType;
set(v: TextureUnitType): void;
}
export declare class Viewport extends BaseValue<ViewportType> {
getDefault(): ViewportType;
set(v: ViewportType): void;
}
export declare class BindFramebuffer extends BaseValue<WebGLFramebuffer> {
getDefault(): WebGLFramebuffer;
set(v?: WebGLFramebuffer | null): void;
}
export declare class BindRenderbuffer extends BaseValue<WebGLRenderbuffer> {
getDefault(): WebGLRenderbuffer;
set(v?: WebGLRenderbuffer | null): void;
}
export declare class BindTexture extends BaseValue<WebGLTexture> {
getDefault(): WebGLTexture;
set(v?: WebGLTexture | null): void;
}
export declare class BindVertexBuffer extends BaseValue<WebGLBuffer> {
getDefault(): WebGLBuffer;
set(v?: WebGLBuffer | null): void;
}
export declare class BindElementBuffer extends BaseValue<WebGLBuffer> {
getDefault(): WebGLBuffer;
set(v?: WebGLBuffer | null): void;
}
export declare class BindVertexArrayOES extends BaseValue<any> {
vao: any;
constructor(context: Context);
getDefault(): any;
set(v: any): void;
}
export declare class PixelStoreUnpack extends BaseValue<number> {
getDefault(): number;
set(v: number): void;
}
export declare class PixelStoreUnpackPremultiplyAlpha extends BaseValue<boolean> {
getDefault(): boolean;
set(v: boolean): void;
}
export declare class PixelStoreUnpackFlipY extends BaseValue<boolean> {
getDefault(): boolean;
set(v: boolean): void;
}
export declare class FramebufferAttachment<T> extends BaseValue<T> {
parent: WebGLFramebuffer;
context: Context;
constructor(context: Context, parent: WebGLFramebuffer);
getDefault(): any;
}
export declare class ColorAttachment extends FramebufferAttachment<WebGLTexture> {
setDirty(): void;
set(v?: WebGLTexture | null): void;
}
export declare class DepthAttachment extends FramebufferAttachment<WebGLRenderbuffer> {
set(v?: WebGLRenderbuffer | null): void;
}
export declare class Framebuffer {
context: Context;
width: number;
height: number;
framebuffer: WebGLFramebuffer;
colorAttachment: ColorAttachment;
depthAttachment: DepthAttachment;
constructor(context: Context, width: number, height: number, hasDepth: boolean);
destroy(): void;
}
export declare class DepthMode {
func: DepthFuncType;
mask: DepthMaskType;
range: DepthRangeType;
static ReadOnly: boolean;
static ReadWrite: boolean;
constructor(depthFunc: DepthFuncType, depthMask: DepthMaskType, depthRange: DepthRangeType);
static disabled: Readonly<DepthMode>;
}
export declare class StencilMode {
test: StencilTestGL;
ref: number;
mask: number;
fail: StencilOpConstant;
depthFail: StencilOpConstant;
pass: StencilOpConstant;
constructor(test: StencilTestGL, ref: number, mask: number, fail: StencilOpConstant, depthFail: StencilOpConstant, pass: StencilOpConstant);
static disabled: Readonly<StencilMode>;
}
export declare class ColorMode {
blendFunction: BlendFuncType;
blendColor: Color;
mask: ColorMaskType;
constructor(blendFunction: BlendFuncType, blendColor: Color, mask: ColorMaskType);
static Replace: BlendFuncType;
static disabled: Readonly<ColorMode>;
static unblended: Readonly<ColorMode>;
static alphaBlended: Readonly<ColorMode>;
}
export declare class CullFaceMode {
enable: boolean;
mode: CullFaceModeType;
frontFace: FrontFaceType;
constructor(enable: boolean, mode: CullFaceModeType, frontFace: FrontFaceType);
static disabled: Readonly<CullFaceMode>;
static backCCW: Readonly<CullFaceMode>;
}
export declare type ClearArgs = {
color?: Color;
depth?: number;
stencil?: number;
};
export declare class Context {
gl: WebGLRenderingContext;
extVertexArrayObject: any;
currentNumAttributes: number;
maxTextureSize: number;
clearColor: ClearColor;
clearDepth: ClearDepth;
clearStencil: ClearStencil;
colorMask: ColorMask;
depthMask: DepthMask;
stencilMask: StencilMask;
stencilFunc: StencilFunc;
stencilOp: StencilOp;
stencilTest: StencilTest;
depthRange: DepthRange;
depthTest: DepthTest;
depthFunc: DepthFunc;
blend: Blend;
blendFunc: BlendFunc;
blendColor: BlendColor;
blendEquation: BlendEquation;
cullFace: CullFace;
cullFaceSide: CullFaceSide;
frontFace: FrontFace;
program: ProgramValue;
activeTexture: ActiveTextureUnit;
viewport: Viewport;
bindFramebuffer: BindFramebuffer;
bindRenderbuffer: BindRenderbuffer;
bindTexture: BindTexture;
bindVertexBuffer: BindVertexBuffer;
bindElementBuffer: BindElementBuffer;
bindVertexArrayOES: BindVertexArrayOES;
pixelStoreUnpack: PixelStoreUnpack;
pixelStoreUnpackPremultiplyAlpha: PixelStoreUnpackPremultiplyAlpha;
pixelStoreUnpackFlipY: PixelStoreUnpackFlipY;
extTextureFilterAnisotropic: any;
extTextureFilterAnisotropicMax: any;
extTextureHalfFloat: any;
extRenderToTextureHalfFloat: any;
extTimerQuery: any;
constructor(gl: WebGLRenderingContext);
setDefault(): void;
setDirty(): void;
createIndexBuffer(array: TriangleIndexArray | LineIndexArray | LineStripIndexArray, dynamicDraw?: boolean): IndexBuffer;
createVertexBuffer(array: StructArray, attributes: ReadonlyArray<StructArrayMember>, dynamicDraw?: boolean): VertexBuffer;
createRenderbuffer(storageFormat: number, width: number, height: number): WebGLRenderbuffer;
createFramebuffer(width: number, height: number, hasDepth: boolean): Framebuffer;
clear({ color, depth }: ClearArgs): void;
setCullFace(cullFaceMode: Readonly<CullFaceMode>): void;
setDepthMode(depthMode: Readonly<DepthMode>): void;
setStencilMode(stencilMode: Readonly<StencilMode>): void;
setColorMode(colorMode: Readonly<ColorMode>): void;
unbindVAO(): void;
}
export declare type $ObjMap<T extends {}, F extends (v: any) => any> = {
[K in keyof T]: F extends (v: T[K]) => infer R ? R : never;
};
export declare type UniformValues<Us extends any> = $ObjMap<Us, <V>(u: Uniform<V>) => V>;
export declare type UniformLocations = {
[_: string]: WebGLUniformLocation;
};
declare abstract class Uniform<T> {
gl: WebGLRenderingContext;
location: WebGLUniformLocation;
current: T;
constructor(context: Context, location: WebGLUniformLocation);
abstract set(v: T): void;
}
export declare type UniformBindings = {
[_: string]: Uniform<any>;
};
export declare type Size = {
width: number;
height: number;
};
export declare type Point2D = {
x: number;
y: number;
};
export declare class AlphaImage {
width: number;
height: number;
data: Uint8Array;
constructor(size: Size, data?: Uint8Array | Uint8ClampedArray);
resize(size: Size): void;
clone(): AlphaImage;
static copy(srcImg: AlphaImage, dstImg: AlphaImage, srcPt: Point2D, dstPt: Point2D, size: Size): void;
}
export declare class RGBAImage {
width: number;
height: number;
data: Uint8Array;
constructor(size: Size, data?: Uint8Array | Uint8ClampedArray);
resize(size: Size): void;
replace(data: Uint8Array | Uint8ClampedArray, copy?: boolean): void;
clone(): RGBAImage;
static copy(srcImg: RGBAImage | ImageData, dstImg: RGBAImage, srcPt: Point2D, dstPt: Point2D, size: Size): void;
}
export declare type StyleImageData = {
data: RGBAImage;
version: number;
hasRenderCallback?: boolean;
userImage?: StyleImageInterface;
};
export declare type StyleImageMetadata = {
pixelRatio: number;
sdf: boolean;
stretchX?: Array<[
number,
number
]>;
stretchY?: Array<[
number,
number
]>;
content?: [
number,
number,
number,
number
];
};
export declare type StyleImage = StyleImageData & StyleImageMetadata;
/**
* Interface for dynamically generated style images. This is a specification for
* implementers to model: it is not an exported method or class.
*
* Images implementing this interface can be redrawn for every frame. They can be used to animate
* icons and patterns or make them respond to user input. Style images can implement a
* {@link StyleImageInterface#render} method. The method is called every frame and
* can be used to update the image.
*
* @interface StyleImageInterface
* @see [Add an animated icon to the map.](https://maplibre.org/maplibre-gl-js-docs/example/add-image-animated/)
*
* @example
* var flashingSquare = {
* width: 64,
* height: 64,
* data: new Uint8Array(64 * 64 * 4),
*
* onAdd: function(map) {
* this.map = map;
* },
*
* render: function() {
* // keep repainting while the icon is on the map
* this.map.triggerRepaint();
*
* // alternate between black and white based on the time
* var value = Math.round(Date.now() / 1000) % 2 === 0 ? 255 : 0;
*
* // check if image needs to be changed
* if (value !== this.previousValue) {
* this.previousValue = value;
*
* var bytesPerPixel = 4;
* for (var x = 0; x < this.width; x++) {
* for (var y = 0; y < this.height; y++) {
* var offset = (y * this.width + x) * bytesPerPixel;
* this.data[offset + 0] = value;
* this.data[offset + 1] = value;
* this.data[offset + 2] = value;
* this.data[offset + 3] = 255;
* }
* }
*
* // return true to indicate that the image changed
* return true;
* }
* }
* }
*
* map.addImage('flashing_square', flashingSquare);
*/
export interface StyleImageInterface {
/**
* @property {number} width
*/
width: number;
/**
* @property {number} height
*/
height: number;
/**
* @property {Uint8Array | Uint8ClampedArray} data
*/
data: Uint8Array | Uint8ClampedArray;
/**
* This method is called once before every frame where the icon will be used.
* The method can optionally update the image's `data` member with a new image.
*
* If the method updates the image it must return `true` to commit the change.
* If the method returns `false` or nothing the image is assumed to not have changed.
*
* If updates are infrequent it maybe easier to use {@link Map#updateImage} to update
* the image instead of implementing this method.
*
* @function
* @memberof StyleImageInterface
* @instance
* @name render
* @return {boolean} `true` if this method updated the image. `false` if the image was not changed.
*/
render?: () => boolean;
/**
* Optional method called when the layer has been added to the Map with {@link Map#addImage}.
*
* @function
* @memberof StyleImageInterface
* @instance
* @name onAdd
* @param {Map} map The Map this custom layer was just added to.
*/
onAdd?: (map: Map, id: string) => void;
/**
* Optional method called when the icon is removed from the map with {@link Map#removeImage}.
* This gives the image a chance to clean up resources and event listeners.
*
* @function
* @memberof StyleImageInterface
* @instance
* @name onRemove
*/
onRemove?: () => void;
}
export declare type TextureFormat = WebGLRenderingContext["RGBA"] | WebGLRenderingContext["ALPHA"];
export declare type TextureFilter = WebGLRenderingContext["LINEAR"] | WebGLRenderingContext["LINEAR_MIPMAP_NEAREST"] | WebGLRenderingContext["NEAREST"];
export declare type TextureWrap = WebGLRenderingContext["REPEAT"] | WebGLRenderingContext["CLAMP_TO_EDGE"] | WebGLRenderingContext["MIRRORED_REPEAT"];
export declare type EmptyImage = {
width: number;
height: number;
data: null;
};
export declare type DataTextureImage = RGBAImage | AlphaImage | EmptyImage;
export declare type TextureImage = TexImageSource | DataTextureImage;
export declare class Texture {
context: Context;
size: [
number,
number
];
texture: WebGLTexture;
format: TextureFormat;
filter: TextureFilter;
wrap: TextureWrap;
useMipmap: boolean;
constructor(context: Context, image: TextureImage, format: TextureFormat, options?: {
premultiply?: boolean;
useMipmap?: boolean;
} | null);
update(image: TextureImage, options?: {
premultiply?: boolean;
useMipmap?: boolean;
} | null, position?: {
x: number;
y: number;
}): void;
bind(filter: TextureFilter, wrap: TextureWrap, minFilter?: TextureFilter | null): void;
isSizePowerOfTwo(): boolean;
destroy(): void;
}
export declare type Pattern = {
bin: PotpackBox;
position: ImagePosition;
};
export declare class ImageManager extends Evented {
images: {
[_: string]: StyleImage;
};
updatedImages: {
[_: string]: boolean;
};
callbackDispatchedThisFrame: {
[_: string]: boolean;
};
loaded: boolean;
requestors: Array<{
ids: Array<string>;
callback: Callback<{
[_: string]: StyleImage;
}>;
}>;
patterns: {
[_: string]: Pattern;
};
atlasImage: RGBAImage;
atlasTexture: Texture;
dirty: boolean;
constructor();
isLoaded(): boolean;
setLoaded(loaded: boolean): void;
getImage(id: string): StyleImage;
addImage(id: string, image: StyleImage): void;
_validate(id: string, image: StyleImage): boolean;
_validateStretch(stretch: Array<[
number,
number
]>, size: number): boolean;
_validateContent(content: [
number,
number,
number,
number
], image: StyleImage): boolean;
updateImage(id: string, image: StyleImage): void;
removeImage(id: string): void;
listImages(): Array<string>;
getImages(ids: Array<string>, callback: Callback<{
[_: string]: StyleImage;
}>): void;
_notify(ids: Array<string>, callback: Callback<{
[_: string]: StyleImage;
}>): void;
getPixelSize(): {
width: number;
height: number;
};
getPattern(id: string): ImagePosition;
bind(context: Context): void;
_updatePatternAtlas(): void;
beginFrame(): void;
dispatchRenderCallbacks(ids: Array<string>): void;
}
export declare type GlyphMetrics = {
width: number;
height: number;
left: number;
top: number;
advance: number;
};
export declare type StyleGlyph = {
id: number;
bitmap: AlphaImage;
metrics: GlyphMetrics;
};
export declare type Rect = {
x: number;
y: number;
w: number;
h: number;
};
export declare type GlyphPosition = {
rect: Rect;
metrics: GlyphMetrics;
};
export declare type GlyphPositions = {
[_: string]: {
[_: number]: GlyphPosition;
};
};
export declare class ImagePosition {
paddedRect: Rect;
pixelRatio: number;
version: number;
stretchY: Array<[
number,
number
]>;
stretchX: Array<[
number,
number
]>;
content: [
number,
number,
number,
number
];
constructor(paddedRect: Rect, { pixelRatio, version, stretchX, stretchY, content }: StyleImage);
get tl(): [
number,
number
];
get br(): [
number,
number
];
get tlbr(): Array<number>;
get displaySize(): [
number,
number
];
}
export declare class ImageAtlas {
image: RGBAImage;
iconPositions: {
[_: string]: ImagePosition;
};
patternPositions: {
[_: string]: ImagePosition;
};
haveRenderCallbacks: Array<string>;
uploaded: boolean;
constructor(icons: {
[_: string]: StyleImage;
}, patterns: {
[_: string]: StyleImage;
});
addImages(images: {
[_: string]: StyleImage;
}, positions: {
[_: string]: ImagePosition;
}, bins: Array<Rect>): void;
patchUpdatedImages(imageManager: ImageManager, texture: Texture): void;
patchUpdatedImage(position: ImagePosition, image: StyleImage, texture: Texture): void;
}
export declare type SerializedGrid = {
buffer: ArrayBuffer;
};
export declare class TransferableGridIndex {
cells: number[][];
arrayBuffer: ArrayBuffer;
d: number;
keys: number[];
bboxes: number[];
n: number;
extent: number;
padding: number;
scale: any;
uid: number;
min: number;
max: number;
constructor(extent: number | ArrayBuffer, n?: number, padding?: number);
insert(key: number, x1: number, y1: number, x2: number, y2: number): void;
_insertReadonly(): void;
_insertCell(x1: number, y1: number, x2: number, y2: number, cellIndex: number, uid: number): void;
query(x1: number, y1: number, x2: number, y2: number, intersectionTest?: Function): number[];
_queryCell(x1: number, y1: number, x2: number, y2: number, cellIndex: number, result: any, seenUids: any, intersectionTest: Function): void;
_forEachCell(x1: number, y1: number, x2: number, y2: number, fn: Function, arg1: any, arg2: any, intersectionTest: any): void;
_convertFromCellCoord(x: any): number;
_convertToCellCoord(x: any): number;
toArrayBuffer(): ArrayBuffer;
static serialize(grid: TransferableGridIndex, transferables?: Array<Transferable>): SerializedGrid;
static deserialize(serialized: SerializedGrid): TransferableGridIndex;
}
export declare class DictionaryCoder {
_stringToNumber: {
[_: string]: number;
};
_numberToString: Array<string>;
constructor(strings: Array<string>);
encode(string: string): number;
decode(n: number): string;
}
export declare class GeoJSONFeature {
type: "Feature";
_geometry: GeoJSON.Geometry;
properties: {};
id: number | string | void;
_vectorTileFeature: VectorTileFeature;
constructor(vectorTileFeature: VectorTileFeature, z: number, x: number, y: number, id: string | number | void);
get geometry(): GeoJSON.Geometry;
set geometry(g: GeoJSON.Geometry);
toJSON(): Omit<this, "_geometry" | "_vectorTileFeature">;
}
export declare class EdgeInsets {
top: number;
bottom: number;
left: number;
right: number;
constructor(top?: number, bottom?: number, left?: number, right?: number);
/**
* Interpolates the inset in-place.
* This maintains the current inset value for any inset not present in `target`.
* @param {PaddingOptions | EdgeInsets} start interpolation start
* @param {PaddingOptions} target interpolation target
* @param {number} t interpolation step/weight
* @returns {EdgeInsets} the insets
* @memberof EdgeInsets
*/
interpolate(start: PaddingOptions | EdgeInsets, target: PaddingOptions, t: number): EdgeInsets;
/**
* Utility method that computes the new apprent center or vanishing point after applying insets.
* This is in pixels and with the top left being (0.0) and +y being downwards.
*
* @param {number} width the width
* @param {number} height the height
* @returns {Point} the point
* @memberof EdgeInsets
*/
getCenter(width: number, height: number): Point;
equals(other: PaddingOptions): boolean;
clone(): EdgeInsets;
/**
* Returns the current state as json, useful when you want to have a
* read-only representation of the inset.
*
* @returns {PaddingOptions} state as json
* @memberof EdgeInsets
*/
toJSON(): PaddingOptions;
}
/**
* Options for setting padding on calls to methods such as {@link Map#fitBounds}, {@link Map#fitScreenCoordinates}, and {@link Map#setPadding}. Adjust these options to set the amount of padding in pixels added to the edges of the canvas. Set a uniform padding on all edges or individual values for each edge. All properties of this object must be
* non-negative integers.
*
* @example
* var bbox = [[-79, 43], [-73, 45]];
* map.fitBounds(bbox, {
* padding: {top: 10, bottom:25, left: 15, right: 5}
* });
*
* @example
* var bbox = [[-79, 43], [-73, 45]];
* map.fitBounds(bbox, {
* padding: 20
* });
* @see [Fit to the bounds of a LineString](https://maplibre.org/maplibre-gl-js-docs/example/zoomto-linestring/)
* @see [Fit a map to a bounding box](https://maplibre.org/maplibre-gl-js-docs/example/fitbounds/)
*/
export declare type PaddingOptions = {
/**
* @property {number} top Padding in pixels from the top of the map canvas.
*/
top: number;
/**
* @property {number} bottom Padding in pixels from the bottom of the map canvas.
*/
bottom: number;
/**
* @property {number} left Padding in pixels from the left of the map canvas.
*/
right: number;
/**
* @property {number} right Padding in pixels from the right of the map canvas.
*/
left: number;
};
export declare class Transform {
tileSize: number;
tileZoom: number;
lngRange: [
number,
number
];
latRange: [
number,
number
];
maxValidLatitude: number;
scale: number;
width: number;
height: number;
angle: number;
rotationMatrix: mat2;
zoomFraction: number;
pixelsToGLUnits: [
number,
number
];
cameraToCenterDistance: number;
mercatorMatrix: mat4;
projMatrix: mat4;
invProjMatrix: mat4;
alignedProjMatrix: mat4;
pixelMatrix: mat4;
pixelMatrixInverse: mat4;
glCoordMatrix: mat4;
labelPlaneMatrix: mat4;
_fov: number;
_pitch: number;
_zoom: number;
_unmodified: boolean;
_renderWorldCopies: boolean;
_minZoom: number;
_maxZoom: number;
_minPitch: number;
_maxPitch: number;
_center: LngLat;
_edgeInsets: EdgeInsets;
_constraining: boolean;
_posMatrixCache: {
[_: string]: mat4;
};
_alignedPosMatrixCache: {
[_: string]: mat4;
};
constructor(minZoom?: number, maxZoom?: number, minPitch?: number, maxPitch?: number, renderWorldCopies?: boolean);
clone(): Transform;
get minZoom(): number;
set minZoom(zoom: number);
get maxZoom(): number;
set maxZoom(zoom: number);
get minPitch(): number;
set minPitch(pitch: number);
get maxPitch(): number;
set maxPitch(pitch: number);
get renderWorldCopies(): boolean;
set renderWorldCopies(renderWorldCopies: boolean);
get worldSize(): number;
get centerOffset(): Point;
get size(): Point;
get bearing(): number;
set bearing(bearing: number);
get pitch(): number;
set pitch(pitch: number);
get fov(): number;
set fov(fov: number);
get zoom(): number;
set zoom(zoom: number);
get center(): LngLat;
set center(center: LngLat);
get padding(): PaddingOptions;
set padding(padding: PaddingOptions);
/**
* The center of the screen in pixels with the top-left corner being (0,0)
* and +y axis pointing downwards. This accounts for padding.
*
* @readonly
* @type {Point}
* @memberof Transform
*/
get centerPoint(): Point;
/**
* Returns if the padding params match
*
* @param {PaddingOptions} padding the padding to check against
* @returns {boolean} true if they are equal, false otherwise
* @memberof Transform
*/
isPaddingEqual(padding: PaddingOptions): boolean;
/**
* Helper method to upadte edge-insets inplace
*
* @param {PaddingOptions} start the starting padding
* @param {PaddingOptions} target the target padding
* @param {number} t the step/weight
* @memberof Transform
*/
interpolatePadding(start: PaddingOptions, target: PaddingOptions, t: number): void;
/**
* Return a zoom level that will cover all tiles the transform
* @param {Object} options options
* @param {number} options.tileSize Tile size, expressed in screen pixels.
* @param {boolean} options.roundZoom Target zoom level. If true, the value will be rounded to the closest integer. Otherwise the value will be floored.
* @returns {number} zoom level An integer zoom level at which all tiles will be visible.
*/
coveringZoomLevel(options: {
roundZoom?: boolean;
tileSize: number;
}): number;
/**
* Return any "wrapped" copies of a given tile coordinate that are visible
* in the current view.
*
* @private
*/
getVisibleUnwrappedCoordinates(tileID: CanonicalTileID): UnwrappedTileID[];
/**
* Return all coordinates that could cover this transform for a covering
* zoom level.
* @param {Object} options
* @param {number} options.tileSize
* @param {number} options.minzoom
* @param {number} options.maxzoom
* @param {boolean} options.roundZoom
* @param {boolean} options.reparseOverscaled
* @param {boolean} options.renderWorldCopies
* @returns {Array<OverscaledTileID>} OverscaledTileIDs
* @private
*/
coveringTiles(options: {
tileSize: number;
minzoom?: number;
maxzoom?: number;
roundZoom?: boolean;
reparseOverscaled?: boolean;
renderWorldCopies?: boolean;
}): Array<OverscaledTileID>;
resize(width: number, height: number): void;
get unmodified(): boolean;
zoomScale(zoom: number): number;
scaleZoom(scale: number): number;
project(lnglat: LngLat): Point;
unproject(point: Point): LngLat;
get point(): Point;
setLocationAtPoint(lnglat: LngLat, point: Point): void;
/**
* Given a location, return the screen point that corresponds to it
* @param {LngLat} lnglat location
* @returns {Point} screen point
* @private
*/
locationPoint(lnglat: LngLat): Point;
/**
* Given a point on screen, return its lnglat
* @param {Point} p screen point
* @returns {LngLat} lnglat location
* @private
*/
pointLocation(p: Point): LngLat;
/**
* Given a geographical lnglat, return an unrounded
* coordinate that represents it at this transform's zoom level.
* @param {LngLat} lnglat
* @returns {Coordinate}
* @private
*/
locationCoordinate(lnglat: LngLat): MercatorCoordinate;
/**
* Given a Coordinate, return its geographical position.
* @param {Coordinate} coord
* @returns {LngLat} lnglat
* @private
*/
coordinateLocation(coord: MercatorCoordinate): LngLat;
pointCoordinate(p: Point): MercatorCoordinate;
/**
* Given a coordinate, return the screen point that corresponds to it
* @param {Coordinate} coord
* @returns {Point} screen point
* @private
*/
coordinatePoint(coord: MercatorCoordinate): Point;
/**
* Returns the map's geographical bounds. When the bearing or pitch is non-zero, the visible region is not
* an axis-aligned rectangle, and the result is the smallest bounds that encompasses the visible region.
* @returns {LngLatBounds} Returns a {@link LngLatBounds} object describing the map's geographical bounds.
*/
getBounds(): LngLatBounds;
/**
* Returns the maximum geographical bounds the map is constrained to, or `null` if none set.
* @returns {LngLatBounds} {@link LngLatBounds}
*/
getMaxBounds(): LngLatBounds | null;
/**
* Sets or clears the map's geographical constraints.
* @param {LngLatBounds} bounds A {@link LngLatBounds} object describing the new geographic boundaries of the map.
*/
setMaxBounds(bounds?: LngLatBounds): void;
/**
* Calculate the posMatrix that, given a tile coordinate, would be used to display the tile on a map.
* @param {UnwrappedTileID} unwrappedTileID;
* @private
*/
calculatePosMatrix(unwrappedTileID: UnwrappedTileID, aligned?: boolean): mat4;
customLayerMatrix(): mat4;
_constrain(): void;
_calcMatrices(): void;
maxPitchScaleFactor(): number;
getCameraPoint(): Point;
getCameraQueryGeometry(queryGeometry: Array<Point>): Array<Point>;
}
export declare type QueryParameters = {
scale: number;
pixelPosMatrix: mat4;
transform: Transform;
tileSize: number;
queryGeometry: Array<Point>;
cameraQueryGeometry: Array<Point>;
queryPadding: number;
params: {
filter: FilterSpecification;
layers: Array<string>;
availableImages: Array<string>;
};
};
export declare class FeatureIndex {
tileID: OverscaledTileID;
x: number;
y: number;
z: number;
grid: TransferableGridIndex;
grid3D: TransferableGridIndex;
featureIndexArray: FeatureIndexArray;
promoteId?: PromoteIdSpecification;
rawTileData: ArrayBuffer;
bucketLayerIDs: Array<Array<string>>;
vtLayers: {
[_: string]: VectorTileLayer;
};
sourceLayerCoder: DictionaryCoder;
constructor(tileID: OverscaledTileID, promoteId?: PromoteIdSpecification | null);
insert(feature: VectorTileFeature, geometry: Array<Array<Point>>, featureIndex: number, sourceLayerIndex: number, bucketIndex: number, is3D?: boolean): void;
loadVTLayers(): {
[_: string]: VectorTileLayer;
};
query(args: QueryParameters, styleLayers: {
[_: string]: StyleLayer;
}, serializedLayers: {
[_: string]: any;
}, sourceFeatureState: SourceFeatureState): {
[_: string]: Array<{
featureIndex: number;
feature: GeoJSONFeature;
}>;
};
loadMatchingFeature(result: {
[_: string]: Array<{
featureIndex: number;
feature: GeoJSONFeature;
intersectionZ?: boolean | number;
}>;
}, bucketIndex: number, sourceLayerIndex: number, featureIndex: number, filter: FeatureFilter, filterLayerIDs: Array<string>, availableImages: Array<string>, styleLayers: {
[_: string]: StyleLayer;
}, serializedLayers: {
[_: string]: any;
}, sourceFeatureState?: SourceFeatureState, intersectionTest?: (feature: VectorTileFeature, styleLayer: StyleLayer, featureState: any, id: string | number | void) => boolean | number): void;
lookupSymbolFeatures(symbolFeatureIndexes: Array<number>, serializedLayers: {
[_: string]: StyleLayer;
}, bucketIndex: number, sourceLayerIndex: number, filterSpec: FilterSpecification, filterLayerIDs: Array<string>, availableImages: Array<string>, styleLayers: {
[_: string]: StyleLayer;
}): {};
hasLayer(id: string): boolean;
getId(feature: VectorTileFeature, sourceLayerId: string): string | number;
}
export declare class DEMData {
uid: string;
data: Uint32Array;
stride: number;
dim: number;
encoding: "mapbox" | "terrarium";
constructor(uid: string, data: RGBAImage, encoding: "mapbox" | "terrarium");
get(x: number, y: number): number;
getUnpackVector(): number[];
_idx(x: number, y: number): number;
_unpackMapbox(r: number, g: number, b: number): number;
_unpackTerrarium(r: number, g: number, b: number): number;
getPixels(): RGBAImage;
backfillBorder(borderTile: DEMData, dx: number, dy: number): void;
}
export declare type WorkerTileResult = {
buckets: Array<Bucket>;
imageAtlas: ImageAtlas;
glyphAtlasImage: AlphaImage;
featureIndex: FeatureIndex;
collisionBoxArray: CollisionBoxArray;
rawTileData?: ArrayBuffer;
resourceTiming?: Array<PerformanceResourceTiming>;
glyphMap?: {
[_: string]: {
[_: number]: StyleGlyph;
};
} | null;
iconMap?: {
[_: string]: StyleImage;
} | null;
glyphPositions?: GlyphPositions | null;
};
export declare class ThrottledInvoker {
_channel: MessageChannel;
_triggered: boolean;
_callback: Function;
constructor(callback: Function);
trigger(): void;
remove(): void;
}
export declare class Actor {
target: any;
parent: any;
mapId: number;
callbacks: {
number: any;
};
name: string;
tasks: {
number: any;
};
taskQueue: Array<number>;
cancelCallbacks: {
number: Cancelable;
};
invoker: ThrottledInvoker;
globalScope: any;
constructor(target: any, parent: any, mapId?: number | null);
/**
* Sends a message from a main-thread map to a Worker or from a Worker back to
* a main-thread map instance.
*
* @param type The name of the target method to invoke or '[source-type].[source-name].name' for a method on a WorkerSource.
* @param targetMapId A particular mapId to which to send this message.
* @private
*/
send(type: string, data: unknown, callback?: Function | null, targetMapId?: string | null, mustQueue?: boolean): Cancelable;
receive(message: any): void;
process(): void;
processTask(id: number, task: any): void;
remove(): void;
}
export declare type TileState = // Tile data is in the process of loading.
"loading" | // Tile data has been loaded. Tile can be rendered.
"loaded" | // Tile data has been loaded and is being updated. Tile can be rendered.
"reloading" | // Tile data has been deleted.
"unloaded" | // Tile data was not loaded because of an error.
"errored" | "expired";
export declare class Tile {
tileID: OverscaledTileID;
uid: number;
uses: number;
tileSize: number;
buckets: {
[_: string]: Bucket;
};
latestFeatureIndex: FeatureIndex;
latestRawTileData: ArrayBuffer;
imageAtlas: ImageAtlas;
imageAtlasTexture: Texture;
glyphAtlasImage: AlphaImage;
glyphAtlasTexture: Texture;
expirationTime: any;
expiredRequestCount: number;
state: TileState;
timeAdded: any;
fadeEndTime: any;
collisionBoxArray: CollisionBoxArray;
redoWhenDone: boolean;
showCollisionBoxes: boolean;
placementSource: any;
actor: Actor;
vtLayers: {
[_: string]: VectorTileLayer;
};
neighboringTiles: any;
dem: DEMData;
aborted: boolean;
needsHillshadePrepare: boolean;
request: Cancelable;
texture: any;
fbo: Framebuffer;
demTexture: Texture;
refreshedUponExpiration: boolean;
reloadCallback: any;
resourceTiming: Array<PerformanceResourceTiming>;
queryPadding: number;
symbolFadeHoldUntil: number;
hasSymbolBuckets: boolean;
hasRTLText: boolean;
dependencies: any;
/**
* @param {OverscaledTileID} tileID
* @param size
* @private
*/
constructor(tileID: OverscaledTileID, size: number);
registerFadeDuration(duration: number): void;
wasRequested(): boolean;
/**
* Given a data object with a 'buffers' property, load it into
* this tile's elementGroups and buffers properties and set loaded
* to true. If the data is null, like in the case of an empty
* GeoJSON tile, no-op but still set loaded to true.
* @param {Object} data
* @param painter
* @returns {undefined}
* @private
*/
loadVectorData(data: WorkerTileResult, painter: any, justReloaded?: boolean | null): void;
/**
* Release any data or WebGL resources referenced by this tile.
* @returns {undefined}
* @private
*/
unloadVectorData(): void;
getBucket(layer: StyleLayer): Bucket;
upload(context: Context): void;
prepare(imageManager: ImageManager): void;
queryRenderedFeatures(layers: {
[_: string]: StyleLayer;
}, serializedLayers: {
[_: string]: any;
}, sourceFeatureState: SourceFeatureState, queryGeometry: Array<Point>, cameraQueryGeometry: Array<Point>, scale: number, params: {
filter: FilterSpecification;
layers: Array<string>;
availableImages: Array<string>;
}, transform: Transform, maxPitchScaleFactor: number, pixelPosMatrix: mat4): {
[_: string]: Array<{
featureIndex: number;
feature: GeoJSONFeature;
}>;
};
querySourceFeatures(result: Array<GeoJSONFeature>, params?: {
sourceLayer: string;
filter: Array<any>;
validate?: boolean;
}): void;
hasData(): boolean;
patternsLoaded(): boolean;
setExpiryData(data: any): void;
getExpiryTimeout(): number;
setFeatureState(states: LayerFeatureStates, painter: any): void;
holdingForFade(): boolean;
symbolFadeFinished(): boolean;
clearFadeHold(): void;
setHoldDuration(duration: number): void;
setDependencies(namespace: string, dependencies: Array<string>): void;
hasDependency(namespaces: Array<string>, keys: Array<string>): boolean;
}
export declare type FeatureStates = {
[featureId: string]: FeatureState;
};
export declare type LayerFeatureStates = {
[layer: string]: FeatureStates;
};
export declare class SourceFeatureState {
state: LayerFeatureStates;
stateChanges: LayerFeatureStates;
deletedStates: {};
constructor();
updateState(sourceLayer: string, featureId: number | string, newState: any): void;
removeFeatureState(sourceLayer: string, featureId?: number | string, key?: string): void;
getState(sourceLayer: string, featureId: number | string): any;
initializeTileState(tile: Tile, painter: any): void;
coalesceChanges(tiles: {
[_ in any]: Tile;
}, painter: any): void;
}
export declare type BinderUniform = {
name: string;
property: string;
binding: Uniform<any>;
};
/**
* `Binder` is the interface definition for the strategies for constructing,
* uploading, and binding paint property data as GLSL attributes. Most style-
* spec properties have a 1:1 relationship to shader attribute/uniforms, but
* some require multliple values per feature to be passed to the GPU, and in
* those cases we bind multiple attributes/uniforms.
*
* It has three implementations, one for each of the three strategies we use:
*
* * For _constant_ properties -- those whose value is a constant, or the constant
* result of evaluating a camera expression at a particular camera position -- we
* don't need a vertex attribute buffer, and instead use a uniform.
* * For data expressions, we use a vertex buffer with a single attribute value,
* the evaluated result of the source function for the given feature.
* * For composite expressions, we use a vertex buffer with two attributes: min and
* max values covering the range of zooms at which we expect the tile to be
* displayed. These values are calculated by evaluating the composite expression for
* the given feature at strategically chosen zoom levels. In addition to this
* attribute data, we also use a uniform value which the shader uses to interpolate
* between the min and max value at the final displayed zoom level. The use of a
* uniform allows us to cheaply update the value on every frame.
*
* Note that the shader source varies depending on whether we're using a uniform or
* attribute. We dynamically compile shaders at runtime to accomodate this.
*
* @private
*/
export interface AttributeBinder {
populatePaintArray(length: number, feature: Feature, imagePositions: {
[_: string]: ImagePosition;
}, canonical?: CanonicalTileID, formattedSection?: FormattedSection): void;
updatePaintArray(start: number, length: number, feature: Feature, featureState: FeatureState, imagePositions: {
[_: string]: ImagePosition;
}): void;
upload(a: Context): void;
destroy(): void;
}
export interface UniformBinder {
uniformNames: Array<string>;
setUniform(uniform: Uniform<any>, globals: GlobalProperties, currentValue: PossiblyEvaluatedPropertyValue<any>, uniformName: string): void;
getBinding(context: Context, location: WebGLUniformLocation, name: string): Partial<Uniform<any>>;
}
export declare class ProgramConfiguration {
binders: {
[_: string]: AttributeBinder | UniformBinder;
};
cacheKey: string;
_buffers: Array<VertexBuffer>;
constructor(layer: TypedStyleLayer, zoom: number, filterProperties: (_: string) => boolean);
getMaxValue(property: string): number;
populatePaintArrays(newLength: number, feature: Feature, imagePositions: {
[_: string]: ImagePosition;
}, canonical?: CanonicalTileID, formattedSection?: FormattedSection): void;
setConstantPatternPositions(posTo: ImagePosition, posFrom: ImagePosition): void;
updatePaintArrays(featureStates: FeatureStates, featureMap: FeaturePositionMap, vtLayer: VectorTileLayer, layer: TypedStyleLayer, imagePositions: {
[_: string]: ImagePosition;
}): boolean;
defines(): Array<string>;
getBinderAttributes(): Array<string>;
getBinderUniforms(): Array<string>;
getPaintVertexBuffers(): Array<VertexBuffer>;
getUniforms(context: Context, locations: UniformLocations): Array<BinderUniform>;
setUniforms(context: Context, binderUniforms: Array<BinderUniform>, properties: any, globals: GlobalProperties): void;
updatePaintBuffers(crossfade?: CrossfadeParameters): void;
upload(context: Context): void;
destroy(): void;
}
export declare class ProgramConfigurationSet<Layer extends TypedStyleLayer> {
programConfigurations: {
[_: string]: ProgramConfiguration;
};
needsUpload: boolean;
_featureMap: FeaturePositionMap;
_bufferOffset: number;
constructor(layers: ReadonlyArray<Layer>, zoom: number, filterProperties?: (_: string) => boolean);
populatePaintArrays(length: number, feature: Feature, index: number, imagePositions: {
[_: string]: ImagePosition;
}, canonical: CanonicalTileID, formattedSection?: FormattedSection): void;
updatePaintArrays(featureStates: FeatureStates, vtLayer: VectorTileLayer, layers: ReadonlyArray<TypedStyleLayer>, imagePositions: {
[_: string]: ImagePosition;
}): void;
get(layerId: string): ProgramConfiguration;
upload(context: Context): void;
destroy(): void;
}
export declare type DrawMode = WebGLRenderingContext["LINES"] | WebGLRenderingContext["TRIANGLES"] | WebGLRenderingContext["LINE_STRIP"];
export declare class Program<Us extends UniformBindings> {
program: WebGLProgram;
attributes: {
[_: string]: number;
};
numAttributes: number;
fixedUniforms: Us;
binderUniforms: Array<BinderUniform>;
failedToCreate: boolean;
constructor(context: Context, name: string, source: {
fragmentSource: string;
vertexSource: string;
staticAttributes: Array<string>;
staticUniforms: Array<string>;
}, configuration: ProgramConfiguration, fixedUniforms: (b: Context, a: UniformLocations) => Us, showOverdrawInspector: boolean);
draw(context: Context, drawMode: DrawMode, depthMode: Readonly<DepthMode>, stencilMode: Readonly<StencilMode>, colorMode: Readonly<ColorMode>, cullFaceMode: Readonly<CullFaceMode>, uniformValues: UniformValues<Us>, layerID: string, layoutVertexBuffer: VertexBuffer, indexBuffer: IndexBuffer, segments: SegmentVector, currentProperties?: any, zoom?: number | null, configuration?: ProgramConfiguration | null, dynamicLayoutBuffer?: VertexBuffer | null, dynamicLayoutBuffer2?: VertexBuffer | null): void;
}
export declare class VertexArrayObject {
context: Context;
boundProgram: Program<any>;
boundLayoutVertexBuffer: VertexBuffer;
boundPaintVertexBuffers: Array<VertexBuffer>;
boundIndexBuffer: IndexBuffer;
boundVertexOffset: number;
boundDynamicVertexBuffer: VertexBuffer;
boundDynamicVertexBuffer2: VertexBuffer;
vao: any;
constructor();
bind(context: Context, program: Program<any>, layoutVertexBuffer: VertexBuffer, paintVertexBuffers: Array<VertexBuffer>, indexBuffer?: IndexBuffer | null, vertexOffset?: number | null, dynamicVertexBuffer?: VertexBuffer | null, dynamicVertexBuffer2?: VertexBuffer | null): void;
freshBind(program: Program<any>, layoutVertexBuffer: VertexBuffer, paintVertexBuffers: Array<VertexBuffer>, indexBuffer?: IndexBuffer | null, vertexOffset?: number | null, dynamicVertexBuffer?: VertexBuffer | null, dynamicVertexBuffer2?: VertexBuffer | null): void;
destroy(): void;
}
export declare type Segment = {
sortKey?: number;
vertexOffset: number;
primitiveOffset: number;
vertexLength: number;
primitiveLength: number;
vaos: {
[_: string]: VertexArrayObject;
};
};
export declare class SegmentVector {
static MAX_VERTEX_ARRAY_LENGTH: number;
segments: Array<Segment>;
constructor(segments?: Array<Segment>);
prepareSegment(numVertices: number, layoutVertexArray: StructArray, indexArray: StructArray, sortKey?: number): Segment;
get(): Segment[];
destroy(): void;
static simpleSegment(vertexOffset: number, primitiveOffset: number, vertexLength: number, primitiveLength: number): SegmentVector;
}
export declare class HeatmapBucket extends CircleBucket<HeatmapStyleLayer> {
layers: Array<HeatmapStyleLayer>;
}
export declare type HeatmapPaintProps = {
"heatmap-radius": DataDrivenProperty<number>;
"heatmap-weight": DataDrivenProperty<number>;
"heatmap-intensity": DataConstantProperty<number>;
"heatmap-color": ColorRampProperty;
"heatmap-opacity": DataConstantProperty<number>;
};
export declare type HeatmapPaintPropsPossiblyEvaluated = {
"heatmap-radius": PossiblyEvaluatedPropertyValue<number>;
"heatmap-weight": PossiblyEvaluatedPropertyValue<number>;
"heatmap-intensity": number;
"heatmap-color": ColorRampProperty;
"heatmap-opacity": number;
};
export declare class HeatmapStyleLayer extends StyleLayer {
heatmapFbo: Framebuffer;
colorRamp: RGBAImage;
colorRampTexture: Texture;
_transitionablePaint: Transitionable<HeatmapPaintProps>;
_transitioningPaint: Transitioning<HeatmapPaintProps>;
paint: PossiblyEvaluated<HeatmapPaintProps, HeatmapPaintPropsPossiblyEvaluated>;
createBucket(options: any): HeatmapBucket;
constructor(layer: LayerSpecification);
_handleSpecialPaintPropertyUpdate(name: string): void;
_updateColorRamp(): void;
resize(): void;
queryRadius(): number;
queryIntersectsFeature(): boolean;
hasOffscreenPass(): boolean;
}
export declare class CircleBucket<Layer extends CircleStyleLayer | HeatmapStyleLayer> implements Bucket {
index: number;
zoom: number;
overscaling: number;
layerIds: Array<string>;
layers: Array<Layer>;
stateDependentLayers: Array<Layer>;
stateDependentLayerIds: Array<string>;
layoutVertexArray: CircleLayoutArray;
layoutVertexBuffer: VertexBuffer;
indexArray: TriangleIndexArray;
indexBuffer: IndexBuffer;
hasPattern: boolean;
programConfigurations: ProgramConfigurationSet<Layer>;
segments: SegmentVector;
uploaded: boolean;
constructor(options: BucketParameters<Layer>);
populate(features: Array<IndexedFeature>, options: PopulateParameters, canonical: CanonicalTileID): void;
update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: {
[_: string]: ImagePosition;
}): void;
isEmpty(): boolean;
uploadPending(): boolean;
upload(context: Context): void;
destroy(): void;
addFeature(feature: BucketFeature, geometry: Array<Array<Point>>, index: number, canonical: CanonicalTileID): void;
}
export declare type CircleLayoutProps = {
"circle-sort-key": DataDrivenProperty<number>;
};
export declare type CircleLayoutPropsPossiblyEvaluated = {
"circle-sort-key": PossiblyEvaluatedPropertyValue<number>;
};
export declare type CirclePaintProps = {
"circle-radius": DataDrivenProperty<number>;
"circle-color": DataDrivenProperty<Color>;
"circle-blur": DataDrivenProperty<number>;
"circle-opacity": DataDrivenProperty<number>;
"circle-translate": DataConstantProperty<[
number,
number
]>;
"circle-translate-anchor": DataConstantProperty<"map" | "viewport">;
"circle-pitch-scale": DataConstantProperty<"map" | "viewport">;
"circle-pitch-alignment": DataConstantProperty<"map" | "viewport">;
"circle-stroke-width": DataDrivenProperty<number>;
"circle-stroke-color": DataDrivenProperty<Color>;
"circle-stroke-opacity": DataDrivenProperty<number>;
};
export declare type CirclePaintPropsPossiblyEvaluated = {
"circle-radius": PossiblyEvaluatedPropertyValue<number>;
"circle-color": PossiblyEvaluatedPropertyValue<Color>;
"circle-blur": PossiblyEvaluatedPropertyValue<number>;
"circle-opacity": PossiblyEvaluatedPropertyValue<number>;
"circle-translate": [
number,
number
];
"circle-translate-anchor": "map" | "viewport";
"circle-pitch-scale": "map" | "viewport";
"circle-pitch-alignment": "map" | "viewport";
"circle-stroke-width": PossiblyEvaluatedPropertyValue<number>;
"circle-stroke-color": PossiblyEvaluatedPropertyValue<Color>;
"circle-stroke-opacity": PossiblyEvaluatedPropertyValue<number>;
};
export declare class CircleStyleLayer extends StyleLayer {
_unevaluatedLayout: Layout<CircleLayoutProps>;
layout: PossiblyEvaluated<CircleLayoutProps, CircleLayoutPropsPossiblyEvaluated>;
_transitionablePaint: Transitionable<CirclePaintProps>;
_transitioningPaint: Transitioning<CirclePaintProps>;
paint: PossiblyEvaluated<CirclePaintProps, CirclePaintPropsPossiblyEvaluated>;
constructor(layer: LayerSpecification);
createBucket(parameters: BucketParameters<any>): CircleBucket<any>;
queryRadius(bucket: Bucket): number;
queryIntersectsFeature(queryGeometry: Array<Point>, feature: VectorTileFeature, featureState: FeatureState, geometry: Array<Array<Point>>, zoom: number, transform: Transform, pixelsToTileUnits: number, pixelPosMatrix: mat4): boolean;
}
export declare class FillBucket implements Bucket {
index: number;
zoom: number;
overscaling: number;
layers: Array<FillStyleLayer>;
layerIds: Array<string>;
stateDependentLayers: Array<FillStyleLayer>;
stateDependentLayerIds: Array<string>;
patternFeatures: Array<BucketFeature>;
layoutVertexArray: FillLayoutArray;
layoutVertexBuffer: VertexBuffer;
indexArray: TriangleIndexArray;
indexBuffer: IndexBuffer;
indexArray2: LineIndexArray;
indexBuffer2: IndexBuffer;
hasPattern: boolean;
programConfigurations: ProgramConfigurationSet<FillStyleLayer>;
segments: SegmentVector;
segments2: SegmentVector;
uploaded: boolean;
constructor(options: BucketParameters<FillStyleLayer>);
populate(features: Array<IndexedFeature>, options: PopulateParameters, canonical: CanonicalTileID): void;
update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: {
[_: string]: ImagePosition;
}): void;
addFeatures(options: PopulateParameters, canonical: CanonicalTileID, imagePositions: {
[_: string]: ImagePosition;
}): void;
isEmpty(): boolean;
uploadPending(): boolean;
upload(context: Context): void;
destroy(): void;
addFeature(feature: BucketFeature, geometry: Array<Array<Point>>, index: number, canonical: CanonicalTileID, imagePositions: {
[_: string]: ImagePosition;
}): void;
}
export declare type FillLayoutProps = {
"fill-sort-key": DataDrivenProperty<number>;
};
export declare type FillLayoutPropsPossiblyEvaluated = {
"fill-sort-key": PossiblyEvaluatedPropertyValue<number>;
};
export declare type FillPaintProps = {
"fill-antialias": DataConstantProperty<boolean>;
"fill-opacity": DataDrivenProperty<number>;
"fill-color": DataDrivenProperty<Color>;
"fill-outline-color": DataDrivenProperty<Color>;
"fill-translate": DataConstantProperty<[
number,
number
]>;
"fill-translate-anchor": DataConstantProperty<"map" | "viewport">;
"fill-pattern": CrossFadedDataDrivenProperty<ResolvedImage>;
};
export declare type FillPaintPropsPossiblyEvaluated = {
"fill-antialias": boolean;
"fill-opacity": PossiblyEvaluatedPropertyValue<number>;
"fill-color": PossiblyEvaluatedPropertyValue<Color>;
"fill-outline-color": PossiblyEvaluatedPropertyValue<Color>;
"fill-translate": [
number,
number
];
"fill-translate-anchor": "map" | "viewport";
"fill-pattern": PossiblyEvaluatedPropertyValue<CrossFaded<ResolvedImage>>;
};
export declare class FillStyleLayer extends StyleLayer {
_unevaluatedLayout: Layout<FillLayoutProps>;
layout: PossiblyEvaluated<FillLayoutProps, FillLayoutPropsPossiblyEvaluated>;
_transitionablePaint: Transitionable<FillPaintProps>;
_transitioningPaint: Transitioning<FillPaintProps>;
paint: PossiblyEvaluated<FillPaintProps, FillPaintPropsPossiblyEvaluated>;
constructor(layer: LayerSpecification);
recalculate(parameters: EvaluationParameters, availableImages: Array<string>): void;
createBucket(parameters: BucketParameters<any>): FillBucket;
queryRadius(): number;
queryIntersectsFeature(queryGeometry: Array<Point>, feature: VectorTileFeature, featureState: FeatureState, geometry: Array<Array<Point>>, zoom: number, transform: Transform, pixelsToTileUnits: number): boolean;
isTileClipped(): boolean;
}
export declare class FillExtrusionBucket implements Bucket {
index: number;
zoom: number;
overscaling: number;
layers: Array<FillExtrusionStyleLayer>;
layerIds: Array<string>;
stateDependentLayers: Array<FillExtrusionStyleLayer>;
stateDependentLayerIds: Array<string>;
layoutVertexArray: FillExtrusionLayoutArray;
layoutVertexBuffer: VertexBuffer;
indexArray: TriangleIndexArray;
indexBuffer: IndexBuffer;
hasPattern: boolean;
programConfigurations: ProgramConfigurationSet<FillExtrusionStyleLayer>;
segments: SegmentVector;
uploaded: boolean;
features: Array<BucketFeature>;
constructor(options: BucketParameters<FillExtrusionStyleLayer>);
populate(features: Array<IndexedFeature>, options: PopulateParameters, canonical: CanonicalTileID): void;
addFeatures(options: PopulateParameters, canonical: CanonicalTileID, imagePositions: {
[_: string]: ImagePosition;
}): void;
update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: {
[_: string]: ImagePosition;
}): void;
isEmpty(): boolean;
uploadPending(): boolean;
upload(context: Context): void;
destroy(): void;
addFeature(feature: BucketFeature, geometry: Array<Array<Point>>, index: number, canonical: CanonicalTileID, imagePositions: {
[_: string]: ImagePosition;
}): void;
}
export declare type FillExtrusionPaintProps = {
"fill-extrusion-opacity": DataConstantProperty<number>;
"fill-extrusion-color": DataDrivenProperty<Color>;
"fill-extrusion-translate": DataConstantProperty<[
number,
number
]>;
"fill-extrusion-translate-anchor": DataConstantProperty<"map" | "viewport">;
"fill-extrusion-pattern": CrossFadedDataDrivenProperty<ResolvedImage>;
"fill-extrusion-height": DataDrivenProperty<number>;
"fill-extrusion-base": DataDrivenProperty<number>;
"fill-extrusion-vertical-gradient": DataConstantProperty<boolean>;
};
export declare type FillExtrusionPaintPropsPossiblyEvaluated = {
"fill-extrusion-opacity": number;
"fill-extrusion-color": PossiblyEvaluatedPropertyValue<Color>;
"fill-extrusion-translate": [
number,
number
];
"fill-extrusion-translate-anchor": "map" | "viewport";
"fill-extrusion-pattern": PossiblyEvaluatedPropertyValue<CrossFaded<ResolvedImage>>;
"fill-extrusion-height": PossiblyEvaluatedPropertyValue<number>;
"fill-extrusion-base": PossiblyEvaluatedPropertyValue<number>;
"fill-extrusion-vertical-gradient": boolean;
};
export declare class FillExtrusionStyleLayer extends StyleLayer {
_transitionablePaint: Transitionable<FillExtrusionPaintProps>;
_transitioningPaint: Transitioning<FillExtrusionPaintProps>;
paint: PossiblyEvaluated<FillExtrusionPaintProps, FillExtrusionPaintPropsPossiblyEvaluated>;
constructor(layer: LayerSpecification);
createBucket(parameters: BucketParameters<FillExtrusionStyleLayer>): FillExtrusionBucket;
queryRadius(): number;
is3D(): boolean;
queryIntersectsFeature(queryGeometry: Array<Point>, feature: VectorTileFeature, featureState: FeatureState, geometry: Array<Array<Point>>, zoom: number, transform: Transform, pixelsToTileUnits: number, pixelPosMatrix: mat4): boolean | number;
}
export declare type HillshadePaintProps = {
"hillshade-illumination-direction": DataConstantProperty<number>;
"hillshade-illumination-anchor": DataConstantProperty<"map" | "viewport">;
"hillshade-exaggeration": DataConstantProperty<number>;
"hillshade-shadow-color": DataConstantProperty<Color>;
"hillshade-highlight-color": DataConstantProperty<Color>;
"hillshade-accent-color": DataConstantProperty<Color>;
};
export declare type HillshadePaintPropsPossiblyEvaluated = {
"hillshade-illumination-direction": number;
"hillshade-illumination-anchor": "map" | "viewport";
"hillshade-exaggeration": number;
"hillshade-shadow-color": Color;
"hillshade-highlight-color": Color;
"hillshade-accent-color": Color;
};
export declare class HillshadeStyleLayer extends StyleLayer {
_transitionablePaint: Transitionable<HillshadePaintProps>;
_transitioningPaint: Transitioning<HillshadePaintProps>;
paint: PossiblyEvaluated<HillshadePaintProps, HillshadePaintPropsPossiblyEvaluated>;
constructor(layer: LayerSpecification);
hasOffscreenPass(): boolean;
}
export declare type LineClips = {
start: number;
end: number;
};
export declare type GradientTexture = {
texture?: Texture;
gradient?: RGBAImage;
version?: number;
};
export declare class LineBucket implements Bucket {
distance: number;
totalDistance: number;
maxLineLength: number;
scaledDistance: number;
lineClips?: LineClips;
e1: number;
e2: number;
index: number;
zoom: number;
overscaling: number;
layers: Array<LineStyleLayer>;
layerIds: Array<string>;
gradients: {
[x: string]: GradientTexture;
};
stateDependentLayers: Array<any>;
stateDependentLayerIds: Array<string>;
patternFeatures: Array<BucketFeature>;
lineClipsArray: Array<LineClips>;
layoutVertexArray: LineLayoutArray;
layoutVertexBuffer: VertexBuffer;
layoutVertexArray2: LineExtLayoutArray;
layoutVertexBuffer2: VertexBuffer;
indexArray: TriangleIndexArray;
indexBuffer: IndexBuffer;
hasPattern: boolean;
programConfigurations: ProgramConfigurationSet<LineStyleLayer>;
segments: SegmentVector;
uploaded: boolean;
constructor(options: BucketParameters<LineStyleLayer>);
populate(features: Array<IndexedFeature>, options: PopulateParameters, canonical: CanonicalTileID): void;
update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: {
[_: string]: ImagePosition;
}): void;
addFeatures(options: PopulateParameters, canonical: CanonicalTileID, imagePositions: {
[_: string]: ImagePosition;
}): void;
isEmpty(): boolean;
uploadPending(): boolean;
upload(context: Context): void;
destroy(): void;
lineFeatureClips(feature: BucketFeature): LineClips | undefined;
addFeature(feature: BucketFeature, geometry: Array<Array<Point>>, index: number, canonical: CanonicalTileID, imagePositions: {
[_: string]: ImagePosition;
}): void;
addLine(vertices: Array<Point>, feature: BucketFeature, join: string, cap: string, miterLimit: number, roundLimit: number): void;
/**
* Add two vertices to the buffers.
*
* @param p the line vertex to add buffer vertices for
* @param normal vertex normal
* @param endLeft extrude to shift the left vertex along the line
* @param endRight extrude to shift the left vertex along the line
* @param segment the segment object to add the vertex to
* @param round whether this is a round cap
* @private
*/
addCurrentVertex(p: Point, normal: Point, endLeft: number, endRight: number, segment: Segment, round?: boolean): void;
addHalfVertex({ x, y }: Point, extrudeX: number, extrudeY: number, round: boolean, up: boolean, dir: number, segment: Segment): void;
updateScaledDistance(): void;
updateDistance(prev: Point, next: Point): void;
}
export declare type LineLayoutProps = {
"line-cap": DataConstantProperty<"butt" | "round" | "square">;
"line-join": DataDrivenProperty<"bevel" | "round" | "miter">;
"line-miter-limit": DataConstantProperty<number>;
"line-round-limit": DataConstantProperty<number>;
"line-sort-key": DataDrivenProperty<number>;
};
export declare type LineLayoutPropsPossiblyEvaluated = {
"line-cap": "butt" | "round" | "square";
"line-join": PossiblyEvaluatedPropertyValue<"bevel" | "round" | "miter">;
"line-miter-limit": number;
"line-round-limit": number;
"line-sort-key": PossiblyEvaluatedPropertyValue<number>;
};
export declare type LinePaintProps = {
"line-opacity": DataDrivenProperty<number>;
"line-color": DataDrivenProperty<Color>;
"line-translate": DataConstantProperty<[
number,
number
]>;
"line-translate-anchor": DataConstantProperty<"map" | "viewport">;
"line-width": DataDrivenProperty<number>;
"line-gap-width": DataDrivenProperty<number>;
"line-offset": DataDrivenProperty<number>;
"line-blur": DataDrivenProperty<number>;
"line-dasharray": CrossFadedProperty<Array<number>>;
"line-pattern": CrossFadedDataDrivenProperty<ResolvedImage>;
"line-gradient": ColorRampProperty;
};
export declare type LinePaintPropsPossiblyEvaluated = {
"line-opacity": PossiblyEvaluatedPropertyValue<number>;
"line-color": PossiblyEvaluatedPropertyValue<Color>;
"line-translate": [
number,
number
];
"line-translate-anchor": "map" | "viewport";
"line-width": PossiblyEvaluatedPropertyValue<number>;
"line-gap-width": PossiblyEvaluatedPropertyValue<number>;
"line-offset": PossiblyEvaluatedPropertyValue<number>;
"line-blur": PossiblyEvaluatedPropertyValue<number>;
"line-dasharray": CrossFaded<Array<number>>;
"line-pattern": PossiblyEvaluatedPropertyValue<CrossFaded<ResolvedImage>>;
"line-gradient": ColorRampProperty;
};
export declare class LineStyleLayer extends StyleLayer {
_unevaluatedLayout: Layout<LineLayoutProps>;
layout: PossiblyEvaluated<LineLayoutProps, LineLayoutPropsPossiblyEvaluated>;
gradientVersion: number;
stepInterpolant: boolean;
_transitionablePaint: Transitionable<LinePaintProps>;
_transitioningPaint: Transitioning<LinePaintProps>;
paint: PossiblyEvaluated<LinePaintProps, LinePaintPropsPossiblyEvaluated>;
constructor(layer: LayerSpecification);
_handleSpecialPaintPropertyUpdate(name: string): void;
gradientExpression(): StylePropertyExpression;
recalculate(parameters: EvaluationParameters, availableImages: Array<string>): void;
createBucket(parameters: BucketParameters<any>): LineBucket;
queryRadius(bucket: Bucket): number;
queryIntersectsFeature(queryGeometry: Array<Point>, feature: VectorTileFeature, featureState: FeatureState, geometry: Array<Array<Point>>, zoom: number, transform: Transform, pixelsToTileUnits: number): boolean;
isTileClipped(): boolean;
}
declare enum WritingMode {
none = 0,
horizontal = 1,
vertical = 2,
horizontalOnly = 3
}
export declare class Anchor extends Point {
angle: any;
segment?: number;
constructor(x: number, y: number, angle: number, segment?: number);
clone(): Anchor;
}
/**
* A textured quad for rendering a single icon or glyph.
*
* The zoom range the glyph can be shown is defined by minScale and maxScale.
*
* @param tl The offset of the top left corner from the anchor.
* @param tr The offset of the top right corner from the anchor.
* @param bl The offset of the bottom left corner from the anchor.
* @param br The offset of the bottom right corner from the anchor.
* @param tex The texture coordinates.
*
* @private
*/
export declare type SymbolQuad = {
tl: Point;
tr: Point;
bl: Point;
br: Point;
tex: {
x: number;
y: number;
w: number;
h: number;
};
pixelOffsetTL: Point;
pixelOffsetBR: Point;
writingMode: any | void;
glyphOffset: [
number,
number
];
sectionIndex: number;
isSDF: boolean;
minFontScaleX: number;
minFontScaleY: number;
};
export declare type SizeData = {
kind: "constant";
layoutSize: number;
} | {
kind: "source";
} | {
kind: "camera";
minZoom: number;
maxZoom: number;
minSize: number;
maxSize: number;
interpolationType: InterpolationType;
} | {
kind: "composite";
minZoom: number;
maxZoom: number;
interpolationType: InterpolationType;
};
export declare type SingleCollisionBox = {
x1: number;
y1: number;
x2: number;
y2: number;
anchorPointX: number;
anchorPointY: number;
};
export declare type CollisionArrays = {
textBox?: SingleCollisionBox;
verticalTextBox?: SingleCollisionBox;
iconBox?: SingleCollisionBox;
verticalIconBox?: SingleCollisionBox;
textFeatureIndex?: number;
verticalTextFeatureIndex?: number;
iconFeatureIndex?: number;
verticalIconFeatureIndex?: number;
};
export declare type SymbolFeature = {
sortKey: number | void;
text: Formatted | void;
icon: ResolvedImage;
index: number;
sourceLayerIndex: number;
geometry: Array<Array<Point>>;
properties: any;
type: "Point" | "LineString" | "Polygon";
id?: any;
};
export declare type SortKeyRange = {
sortKey: number;
symbolInstanceStart: number;
symbolInstanceEnd: number;
};
declare function addDynamicAttributes(dynamicLayoutVertexArray: StructArray, p: Point, angle: number): void;
export declare class SymbolBuffers {
layoutVertexArray: SymbolLayoutArray;
layoutVertexBuffer: VertexBuffer;
indexArray: TriangleIndexArray;
indexBuffer: IndexBuffer;
programConfigurations: ProgramConfigurationSet<SymbolStyleLayer>;
segments: SegmentVector;
dynamicLayoutVertexArray: SymbolDynamicLayoutArray;
dynamicLayoutVertexBuffer: VertexBuffer;
opacityVertexArray: SymbolOpacityArray;
opacityVertexBuffer: VertexBuffer;
collisionVertexArray: CollisionVertexArray;
collisionVertexBuffer: VertexBuffer;
placedSymbolArray: PlacedSymbolArray;
constructor(programConfigurations: ProgramConfigurationSet<SymbolStyleLayer>);
isEmpty(): boolean;
upload(context: Context, dynamicIndexBuffer: boolean, upload?: boolean, update?: boolean): void;
destroy(): void;
}
export declare class CollisionBuffers {
layoutVertexArray: StructArray;
layoutAttributes: Array<StructArrayMember>;
layoutVertexBuffer: VertexBuffer;
indexArray: TriangleIndexArray | LineIndexArray;
indexBuffer: IndexBuffer;
segments: SegmentVector;
collisionVertexArray: CollisionVertexArray;
collisionVertexBuffer: VertexBuffer;
constructor(LayoutArray: {
new (...args: any): StructArray;
}, layoutAttributes: Array<StructArrayMember>, IndexArray: {
new (...args: any): TriangleIndexArray | LineIndexArray;
});
upload(context: Context): void;
destroy(): void;
}
export declare class SymbolBucket implements Bucket {
static MAX_GLYPHS: number;
static addDynamicAttributes: typeof addDynamicAttributes;
collisionBoxArray: CollisionBoxArray;
zoom: number;
overscaling: number;
layers: Array<SymbolStyleLayer>;
layerIds: Array<string>;
stateDependentLayers: Array<SymbolStyleLayer>;
stateDependentLayerIds: Array<string>;
index: number;
sdfIcons: boolean;
iconsInText: boolean;
iconsNeedLinear: boolean;
bucketInstanceId: number;
justReloaded: boolean;
hasPattern: boolean;
textSizeData: SizeData;
iconSizeData: SizeData;
glyphOffsetArray: GlyphOffsetArray;
lineVertexArray: SymbolLineVertexArray;
features: Array<SymbolFeature>;
symbolInstances: SymbolInstanceArray;
collisionArrays: Array<CollisionArrays>;
sortKeyRanges: Array<SortKeyRange>;
pixelRatio: number;
tilePixelRatio: number;
compareText: {
[_: string]: Array<Point>;
};
fadeStartTime: number;
sortFeaturesByKey: boolean;
sortFeaturesByY: boolean;
canOverlap: boolean;
sortedAngle: number;
featureSortOrder: Array<number>;
collisionCircleArray: Array<number>;
placementInvProjMatrix: mat4;
placementViewportMatrix: mat4;
text: SymbolBuffers;
icon: SymbolBuffers;
textCollisionBox: CollisionBuffers;
iconCollisionBox: CollisionBuffers;
uploaded: boolean;
sourceLayerIndex: number;
sourceID: string;
symbolInstanceIndexes: Array<number>;
writingModes: WritingMode[];
allowVerticalPlacement: boolean;
hasRTLText: boolean;
constructor(options: BucketParameters<SymbolStyleLayer>);
createArrays(): void;
calculateGlyphDependencies(text: string, stack: {
[_: number]: boolean;
}, textAlongLine: boolean, allowVerticalPlacement: boolean, doesAllowVerticalWritingMode: boolean): void;
populate(features: Array<IndexedFeature>, options: PopulateParameters, canonical: CanonicalTileID): void;
update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: {
[_: string]: ImagePosition;
}): void;
isEmpty(): boolean;
uploadPending(): boolean;
upload(context: Context): void;
destroyDebugData(): void;
destroy(): void;
addToLineVertexArray(anchor: Anchor, line: any): {
lineStartIndex: number;
lineLength: number;
};
addSymbols(arrays: SymbolBuffers, quads: Array<SymbolQuad>, sizeVertex: any, lineOffset: [
number,
number
], alongLine: boolean, feature: SymbolFeature, writingMode: WritingMode, labelAnchor: Anchor, lineStartIndex: number, lineLength: number, associatedIconIndex: number, canonical: CanonicalTileID): void;
_addCollisionDebugVertex(layoutVertexArray: StructArray, collisionVertexArray: StructArray, point: Point, anchorX: number, anchorY: number, extrude: Point): any;
addCollisionDebugVertices(x1: number, y1: number, x2: number, y2: number, arrays: CollisionBuffers, boxAnchorPoint: Point, symbolInstance: SymbolInstance): void;
addDebugCollisionBoxes(startIndex: number, endIndex: number, symbolInstance: SymbolInstance, isText: boolean): void;
generateCollisionDebugBuffers(): void;
_deserializeCollisionBoxesForSymbol(collisionBoxArray: CollisionBoxArray, textStartIndex: number, textEndIndex: number, verticalTextStartIndex: number, verticalTextEndIndex: number, iconStartIndex: number, iconEndIndex: number, verticalIconStartIndex: number, verticalIconEndIndex: number): CollisionArrays;
deserializeCollisionBoxes(collisionBoxArray: CollisionBoxArray): void;
hasTextData(): boolean;
hasIconData(): boolean;
hasDebugData(): CollisionBuffers;
hasTextCollisionBoxData(): boolean;
hasIconCollisionBoxData(): boolean;
addIndicesForPlacedSymbol(iconOrText: SymbolBuffers, placedSymbolIndex: number): void;
getSortedSymbolIndexes(angle: number): any[];
addToSortKeyRanges(symbolInstanceIndex: number, sortKey: number): void;
sortFeatures(angle: number): void;
}
export declare type SymbolLayoutProps = {
"symbol-placement": DataConstantProperty<"point" | "line" | "line-center">;
"symbol-spacing": DataConstantProperty<number>;
"symbol-avoid-edges": DataConstantProperty<boolean>;
"symbol-sort-key": DataDrivenProperty<number>;
"symbol-z-order": DataConstantProperty<"auto" | "viewport-y" | "source">;
"icon-allow-overlap": DataConstantProperty<boolean>;
"icon-ignore-placement": DataConstantProperty<boolean>;
"icon-optional": DataConstantProperty<boolean>;
"icon-rotation-alignment": DataConstantProperty<"map" | "viewport" | "auto">;
"icon-size": DataDrivenProperty<number>;
"icon-text-fit": DataConstantProperty<"none" | "width" | "height" | "both">;
"icon-text-fit-padding": DataConstantProperty<[
number,
number,
number,
number
]>;
"icon-image": DataDrivenProperty<ResolvedImage>;
"icon-rotate": DataDrivenProperty<number>;
"icon-padding": DataConstantProperty<number>;
"icon-keep-upright": DataConstantProperty<boolean>;
"icon-offset": DataDrivenProperty<[
number,
number
]>;
"icon-anchor": DataDrivenProperty<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">;
"icon-pitch-alignment": DataConstantProperty<"map" | "viewport" | "auto">;
"text-pitch-alignment": DataConstantProperty<"map" | "viewport" | "auto">;
"text-rotation-alignment": DataConstantProperty<"map" | "viewport" | "auto">;
"text-field": DataDrivenProperty<Formatted>;
"text-font": DataDrivenProperty<Array<string>>;
"text-size": DataDrivenProperty<number>;
"text-max-width": DataDrivenProperty<number>;
"text-line-height": DataConstantProperty<number>;
"text-letter-spacing": DataDrivenProperty<number>;
"text-justify": DataDrivenProperty<"auto" | "left" | "center" | "right">;
"text-radial-offset": DataDrivenProperty<number>;
"text-variable-anchor": DataConstantProperty<Array<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">>;
"text-anchor": DataDrivenProperty<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">;
"text-max-angle": DataConstantProperty<number>;
"text-writing-mode": DataConstantProperty<Array<"horizontal" | "vertical">>;
"text-rotate": DataDrivenProperty<number>;
"text-padding": DataConstantProperty<number>;
"text-keep-upright": DataConstantProperty<boolean>;
"text-rotate-to-line": DataConstantProperty<boolean>;
"text-transform": DataDrivenProperty<"none" | "uppercase" | "lowercase">;
"text-offset": DataDrivenProperty<[
number,
number
]>;
"text-allow-overlap": DataConstantProperty<boolean>;
"text-ignore-placement": DataConstantProperty<boolean>;
"text-optional": DataConstantProperty<boolean>;
};
export declare type SymbolLayoutPropsPossiblyEvaluated = {
"symbol-placement": "point" | "line" | "line-center";
"symbol-spacing": number;
"symbol-avoid-edges": boolean;
"symbol-sort-key": PossiblyEvaluatedPropertyValue<number>;
"symbol-z-order": "auto" | "viewport-y" | "source";
"icon-allow-overlap": boolean;
"icon-ignore-placement": boolean;
"icon-optional": boolean;
"icon-rotation-alignment": "map" | "viewport" | "auto";
"icon-size": PossiblyEvaluatedPropertyValue<number>;
"icon-text-fit": "none" | "width" | "height" | "both";
"icon-text-fit-padding": [
number,
number,
number,
number
];
"icon-image": PossiblyEvaluatedPropertyValue<ResolvedImage>;
"icon-rotate": PossiblyEvaluatedPropertyValue<number>;
"icon-padding": number;
"icon-keep-upright": boolean;
"icon-offset": PossiblyEvaluatedPropertyValue<[
number,
number
]>;
"icon-anchor": PossiblyEvaluatedPropertyValue<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">;
"icon-pitch-alignment": "map" | "viewport" | "auto";
"text-pitch-alignment": "map" | "viewport" | "auto";
"text-rotation-alignment": "map" | "viewport" | "auto";
"text-field": PossiblyEvaluatedPropertyValue<Formatted>;
"text-font": PossiblyEvaluatedPropertyValue<Array<string>>;
"text-size": PossiblyEvaluatedPropertyValue<number>;
"text-max-width": PossiblyEvaluatedPropertyValue<number>;
"text-line-height": number;
"text-letter-spacing": PossiblyEvaluatedPropertyValue<number>;
"text-justify": PossiblyEvaluatedPropertyValue<"auto" | "left" | "center" | "right">;
"text-radial-offset": PossiblyEvaluatedPropertyValue<number>;
"text-variable-anchor": Array<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">;
"text-anchor": PossiblyEvaluatedPropertyValue<"center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right">;
"text-max-angle": number;
"text-writing-mode": Array<"horizontal" | "vertical">;
"text-rotate": PossiblyEvaluatedPropertyValue<number>;
"text-padding": number;
"text-keep-upright": boolean;
"text-rotate-to-line": boolean;
"text-transform": PossiblyEvaluatedPropertyValue<"none" | "uppercase" | "lowercase">;
"text-offset": PossiblyEvaluatedPropertyValue<[
number,
number
]>;
"text-allow-overlap": boolean;
"text-ignore-placement": boolean;
"text-optional": boolean;
};
export declare type SymbolPaintProps = {
"icon-opacity": DataDrivenProperty<number>;
"icon-color": DataDrivenProperty<Color>;
"icon-halo-color": DataDrivenProperty<Color>;
"icon-halo-width": DataDrivenProperty<number>;
"icon-halo-blur": DataDrivenProperty<number>;
"icon-translate": DataConstantProperty<[
number,
number
]>;
"icon-translate-anchor": DataConstantProperty<"map" | "viewport">;
"text-opacity": DataDrivenProperty<number>;
"text-color": DataDrivenProperty<Color>;
"text-halo-color": DataDrivenProperty<Color>;
"text-halo-width": DataDrivenProperty<number>;
"text-halo-blur": DataDrivenProperty<number>;
"text-translate": DataConstantProperty<[
number,
number
]>;
"text-translate-anchor": DataConstantProperty<"map" | "viewport">;
};
export declare type SymbolPaintPropsPossiblyEvaluated = {
"icon-opacity": PossiblyEvaluatedPropertyValue<number>;
"icon-color": PossiblyEvaluatedPropertyValue<Color>;
"icon-halo-color": PossiblyEvaluatedPropertyValue<Color>;
"icon-halo-width": PossiblyEvaluatedPropertyValue<number>;
"icon-halo-blur": PossiblyEvaluatedPropertyValue<number>;
"icon-translate": [
number,
number
];
"icon-translate-anchor": "map" | "viewport";
"text-opacity": PossiblyEvaluatedPropertyValue<number>;
"text-color": PossiblyEvaluatedPropertyValue<Color>;
"text-halo-color": PossiblyEvaluatedPropertyValue<Color>;
"text-halo-width": PossiblyEvaluatedPropertyValue<number>;
"text-halo-blur": PossiblyEvaluatedPropertyValue<number>;
"text-translate": [
number,
number
];
"text-translate-anchor": "map" | "viewport";
};
export declare class SymbolStyleLayer extends StyleLayer {
_unevaluatedLayout: Layout<SymbolLayoutProps>;
layout: PossiblyEvaluated<SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated>;
_transitionablePaint: Transitionable<SymbolPaintProps>;
_transitioningPaint: Transitioning<SymbolPaintProps>;
paint: PossiblyEvaluated<SymbolPaintProps, SymbolPaintPropsPossiblyEvaluated>;
constructor(layer: LayerSpecification);
recalculate(parameters: EvaluationParameters, availableImages: Array<string>): void;
getValueAndResolveTokens(name: any, feature: Feature, canonical: CanonicalTileID, availableImages: Array<string>): any;
createBucket(parameters: BucketParameters<any>): SymbolBucket;
queryRadius(): number;
queryIntersectsFeature(): boolean;
_setPaintOverrides(): void;
_handleOverridablePaintPropertyUpdate<T, R>(name: string, oldValue: PropertyValue<T, R>, newValue: PropertyValue<T, R>): boolean;
static hasPaintOverride(layout: PossiblyEvaluated<SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated>, propertyName: string): boolean;
}
export declare type TypedStyleLayer = CircleStyleLayer | FillStyleLayer | FillExtrusionStyleLayer | HeatmapStyleLayer | HillshadeStyleLayer | LineStyleLayer | SymbolStyleLayer;
export declare type BucketParameters<Layer extends TypedStyleLayer> = {
index: number;
layers: Array<Layer>;
zoom: number;
pixelRatio: number;
overscaling: number;
collisionBoxArray: CollisionBoxArray;
sourceLayerIndex: number;
sourceID: string;
};
export declare type PopulateParameters = {
featureIndex: FeatureIndex;
iconDependencies: {};
patternDependencies: {};
glyphDependencies: {};
availableImages: Array<string>;
};
export declare type IndexedFeature = {
feature: VectorTileFeature;
id: number | string;
index: number;
sourceLayerIndex: number;
};
export declare type BucketFeature = {
index: number;
sourceLayerIndex: number;
geometry: Array<Array<Point>>;
properties: any;
type: 1 | 2 | 3;
id?: any;
readonly patterns: {
[_: string]: {
"min": string;
"mid": string;
"max": string;
};
};
sortKey?: number;
};
/**
* The `Bucket` interface is the single point of knowledge about turning vector
* tiles into WebGL buffers.
*
* `Bucket` is an abstract interface. An implementation exists for each style layer type.
* Create a bucket via the `StyleLayer#createBucket` method.
*
* The concrete bucket types, using layout options from the style layer,
* transform feature geometries into vertex and index data for use by the
* vertex shader. They also (via `ProgramConfiguration`) use feature
* properties and the zoom level to populate the attributes needed for
* data-driven styling.
*
* Buckets are designed to be built on a worker thread and then serialized and
* transferred back to the main thread for rendering. On the worker side, a
* bucket's vertex, index, and attribute data is stored in `bucket.arrays:
* ArrayGroup`. When a bucket's data is serialized and sent back to the main
* thread, is gets deserialized (using `new Bucket(serializedBucketData)`, with
* the array data now stored in `bucket.buffers: BufferGroup`. BufferGroups
* hold the same data as ArrayGroups, but are tuned for consumption by WebGL.
*
* @private
*/
export interface Bucket {
layerIds: Array<string>;
hasPattern: boolean;
readonly layers: Array<any>;
readonly stateDependentLayers: Array<any>;
readonly stateDependentLayerIds: Array<string>;
populate(features: Array<IndexedFeature>, options: PopulateParameters, canonical: CanonicalTileID): void;
update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: {
[_: string]: ImagePosition;
}): void;
isEmpty(): boolean;
upload(context: Context): void;
uploadPending(): boolean;
/**
* Release the WebGL resources associated with the buffers. Note that because
* buckets are shared between layers having the same layout properties, they
* must be destroyed in groups (all buckets for a tile, or all symbol buckets).
*
* @private
*/
destroy(): void;
}
export declare type CustomRenderMethod = (gl: WebGLRenderingContext, matrix: mat4) => void;
/**
* Interface for custom style layers. This is a specification for
* implementers to model: it is not an exported method or class.
*
* Custom layers allow a user to render directly into the map's GL context using the map's camera.
* These layers can be added between any regular layers using {@link Map#addLayer}.
*
* Custom layers must have a unique `id` and must have the `type` of `"custom"`.
* They must implement `render` and may implement `prerender`, `onAdd` and `onRemove`.
* They can trigger rendering using {@link Map#triggerRepaint}
* and they should appropriately handle {@link Map.event:webglcontextlost} and
* {@link Map.event:webglcontextrestored}.
*
* The `renderingMode` property controls whether the layer is treated as a `"2d"` or `"3d"` map layer. Use:
* - `"renderingMode": "3d"` to use the depth buffer and share it with other layers
* - `"renderingMode": "2d"` to add a layer with no depth. If you need to use the depth buffer for a `"2d"` layer you must use an offscreen
* framebuffer and {@link CustomLayerInterface#prerender}
*
* @interface CustomLayerInterface
* @example
* // Custom layer implemented as ES6 class
* class NullIslandLayer {
* constructor() {
* this.id = 'null-island';
* this.type = 'custom';
* this.renderingMode = '2d';
* }
*
* onAdd(map, gl) {
* const vertexSource = `
* uniform mat4 u_matrix;
* void main() {
* gl_Position = u_matrix * vec4(0.5, 0.5, 0.0, 1.0);
* gl_PointSize = 20.0;
* }`;
*
* const fragmentSource = `
* void main() {
* gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
* }`;
*
* const vertexShader = gl.createShader(gl.VERTEX_SHADER);
* gl.shaderSource(vertexShader, vertexSource);
* gl.compileShader(vertexShader);
* const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
* gl.shaderSource(fragmentShader, fragmentSource);
* gl.compileShader(fragmentShader);
*
* this.program = gl.createProgram();
* gl.attachShader(this.program, vertexShader);
* gl.attachShader(this.program, fragmentShader);
* gl.linkProgram(this.program);
* }
*
* render(gl, matrix) {
* gl.useProgram(this.program);
* gl.uniformMatrix4fv(gl.getUniformLocation(this.program, "u_matrix"), false, matrix);
* gl.drawArrays(gl.POINTS, 0, 1);
* }
* }
*
* map.on('load', function() {
* map.addLayer(new NullIslandLayer());
* });
*/
export interface CustomLayerInterface {
/**
* @property {string} id A unique layer id.
*/
id: string;
/**
* @property {string} type The layer's type. Must be `"custom"`.
*/
type: "custom";
/**
* @property {string} renderingMode Either `"2d"` or `"3d"`. Defaults to `"2d"`.
*/
renderingMode: "2d" | "3d";
/**
* Called during a render frame allowing the layer to draw into the GL context.
*
* The layer can assume blending and depth state is set to allow the layer to properly
* blend and clip other layers. The layer cannot make any other assumptions about the
* current GL state.
*
* If the layer needs to render to a texture, it should implement the `prerender` method
* to do this and only use the `render` method for drawing directly into the main framebuffer.
*
* The blend function is set to `gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA)`. This expects
* colors to be provided in premultiplied alpha form where the `r`, `g` and `b` values are already
* multiplied by the `a` value. If you are unable to provide colors in premultiplied form you
* may want to change the blend function to
* `gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA)`.
*
* @function
* @memberof CustomLayerInterface
* @instance
* @name render
* @param {WebGLRenderingContext} gl The map's gl context.
* @param {Array<number>} matrix The map's camera matrix. It projects spherical mercator
* coordinates to gl coordinates. The spherical mercator coordinate `[0, 0]` represents the
* top left corner of the mercator world and `[1, 1]` represents the bottom right corner. When
* the `renderingMode` is `"3d"`, the z coordinate is conformal. A box with identical x, y, and z
* lengths in mercator units would be rendered as a cube. {@link MercatorCoordinate}.fromLngLat
* can be used to project a `LngLat` to a mercator coordinate.
*/
render: CustomRenderMethod;
/**
* Optional method called during a render frame to allow a layer to prepare resources or render into a texture.
*
* The layer cannot make any assumptions about the current GL state and must bind a framebuffer before rendering.
*
* @function
* @memberof CustomLayerInterface
* @instance
* @name prerender
* @param {WebGLRenderingContext} gl The map's gl context.
* @param {mat4} matrix The map's camera matrix. It projects spherical mercator
* coordinates to gl coordinates. The mercator coordinate `[0, 0]` represents the
* top left corner of the mercator world and `[1, 1]` represents the bottom right corner. When
* the `renderingMode` is `"3d"`, the z coordinate is conformal. A box with identical x, y, and z
* lengths in mercator units would be rendered as a cube. {@link MercatorCoordinate}.fromLngLat
* can be used to project a `LngLat` to a mercator coordinate.
*/
prerender: CustomRenderMethod;
/**
* Optional method called when the layer has been added to the Map with {@link Map#addLayer}. This
* gives the layer a chance to initialize gl resources and register event listeners.
*
* @function
* @memberof CustomLayerInterface
* @instance
* @name onAdd
* @param {Map} map The Map this custom layer was just added to.
* @param {WebGLRenderingContext} gl The gl context for the map.
*/
onAdd(map: Map, gl: WebGLRenderingContext): void;
/**
* Optional method called when the layer has been removed from the Map with {@link Map#removeLayer}. This
* gives the layer a chance to clean up gl resources and event listeners.
*
* @function
* @memberof CustomLayerInterface
* @instance
* @name onRemove
* @param {Map} map The Map this custom layer was just added to.
* @param {WebGLRenderingContext} gl The gl context for the map.
*/
onRemove(map: Map, gl: WebGLRenderingContext): void;
}
declare abstract class StyleLayer extends Evented {
id: string;
metadata: unknown;
type: LayerSpecification["type"] | CustomLayerInterface["type"];
source: string;
sourceLayer: string;
minzoom: number;
maxzoom: number;
filter: FilterSpecification | void;
visibility: "visible" | "none" | void;
_crossfadeParameters: CrossfadeParameters;
_unevaluatedLayout: Layout<any>;
readonly layout: unknown;
_transitionablePaint: Transitionable<any>;
_transitioningPaint: Transitioning<any>;
readonly paint: unknown;
_featureFilter: FeatureFilter;
readonly onAdd: ((map: Map) => void);
readonly onRemove: ((map: Map) => void);
queryRadius?(bucket: Bucket): number;
queryIntersectsFeature?(queryGeometry: Array<Point>, feature: VectorTileFeature, featureState: FeatureState, geometry: Array<Array<Point>>, zoom: number, transform: Transform, pixelsToTileUnits: number, pixelPosMatrix: mat4): boolean | number;
constructor(layer: LayerSpecification | CustomLayerInterface, properties: Readonly<{
layout?: Properties<any>;
paint?: Properties<any>;
}>);
getCrossfadeParameters(): CrossfadeParameters;
getLayoutProperty(name: string): any;
setLayoutProperty(name: string, value: any, options?: StyleSetterOptions): void;
getPaintProperty(name: string): unknown;
setPaintProperty(name: string, value: unknown, options?: StyleSetterOptions): boolean;
_handleSpecialPaintPropertyUpdate(_: string): void;
_handleOverridablePaintPropertyUpdate<T, R>(name: string, oldValue: PropertyValue<T, R>, newValue: PropertyValue<T, R>): boolean;
isHidden(zoom: number): boolean;
updateTransitions(parameters: TransitionParameters): void;
hasTransition(): boolean;
recalculate(parameters: EvaluationParameters, availableImages: Array<string>): void;
serialize(): LayerSpecification;
_validate(validate: Function, key: string, name: string, value: unknown, options?: StyleSetterOptions): boolean;
is3D(): boolean;
isTileClipped(): boolean;
hasOffscreenPass(): boolean;
resize(): void;
isStateDependent(): boolean;
}
declare function loadGlyphRange(fontstack: string, range: number, urlTemplate: string, requestManager: RequestManager, callback: Callback<{
[_: number]: StyleGlyph | null;
}>): void;
export declare type Entry = {
glyphs: {
[id: number]: StyleGlyph | null;
};
requests: {
[range: number]: Array<Callback<{
[_: number]: StyleGlyph | null;
}>>;
};
ranges: {
[range: number]: boolean | null;
};
tinySDF?: TinySDF;
};
export declare class GlyphManager {
requestManager: RequestManager;
localIdeographFontFamily: string;
entries: {
[_: string]: Entry;
};
url: string;
static loadGlyphRange: typeof loadGlyphRange;
static TinySDF: typeof TinySDF;
constructor(requestManager: RequestManager, localIdeographFontFamily?: string | null);
setURL(url?: string | null): void;
getGlyphs(glyphs: {
[stack: string]: Array<number>;
}, callback: Callback<{
[stack: string]: {
[id: number]: StyleGlyph;
};
}>): void;
_doesCharSupportLocalGlyph(id: number): boolean;
_tinySDF(entry: Entry, stack: string, id: number): StyleGlyph;
}
export declare type LightPosition = {
x: number;
y: number;
z: number;
};
export declare class LightPositionProperty implements Property<[
number,
number,
number
], LightPosition> {
specification: StylePropertySpecification;
constructor();
possiblyEvaluate(value: PropertyValue<[
number,
number,
number
], LightPosition>, parameters: EvaluationParameters): LightPosition;
interpolate(a: LightPosition, b: LightPosition, t: number): LightPosition;
}
export declare type Props = {
"anchor": DataConstantProperty<"map" | "viewport">;
"position": LightPositionProperty;
"color": DataConstantProperty<Color>;
"intensity": DataConstantProperty<number>;
};
export declare type PropsPossiblyEvaluated = {
"anchor": "map" | "viewport";
"position": LightPosition;
"color": Color;
"intensity": number;
};
export declare class Light extends Evented {
_transitionable: Transitionable<Props>;
_transitioning: Transitioning<Props>;
properties: PossiblyEvaluated<Props, PropsPossiblyEvaluated>;
constructor(lightOptions?: LightSpecification);
getLight(): any;
setLight(light?: LightSpecification, options?: StyleSetterOptions): void;
updateTransitions(parameters: TransitionParameters): void;
hasTransition(): boolean;
recalculate(parameters: EvaluationParameters): void;
_validate(validate: Function, value: unknown, options?: {
validate?: boolean;
}): boolean;
}
export declare class LineAtlas {
width: number;
height: number;
nextRow: number;
bytes: number;
data: Uint8Array;
dashEntry: {
[_: string]: any;
};
dirty: boolean;
texture: WebGLTexture;
constructor(width: number, height: number);
/**
* Get or create a dash line pattern.
*
* @param {Array<number>} dasharray
* @param {boolean} round whether to add circle caps in between dash segments
* @returns {Object} position of dash texture in { y, height, width }
* @private
*/
getDash(dasharray: Array<number>, round: boolean): any;
getDashRanges(dasharray: Array<number>, lineAtlasWidth: number, stretch: number): any[];
addRoundDash(ranges: any, stretch: number, n: number): void;
addRegularDash(ranges: any): void;
addDash(dasharray: Array<number>, round: boolean): {
y: number;
height: number;
width: number;
};
bind(context: Context): void;
}
declare const status: {
unavailable: string;
deferred: string;
loading: string;
loaded: string;
error: string;
};
export declare type PluginState = {
pluginStatus: typeof status[keyof typeof status];
pluginURL: string;
};
export declare type PluginStateSyncCallback = (state: PluginState) => void;
declare const registerForPluginStateChange: (callback: PluginStateSyncCallback) => PluginStateSyncCallback;
export declare type MessageListener = (a: {
data: any;
target: any;
}) => unknown;
export interface WorkerInterface {
addEventListener(type: "message", listener: MessageListener): void;
removeEventListener(type: "message", listener: MessageListener): void;
postMessage(message: any): void;
terminate(): void;
}
export declare class WorkerPool {
static workerCount: number;
active: {
[_ in number | string]: boolean;
};
workers: Array<WorkerInterface>;
constructor();
acquire(mapId: number | string): Array<WorkerInterface>;
release(mapId: number | string): void;
isPreloaded(): boolean;
numActive(): number;
}
export declare class Dispatcher {
workerPool: WorkerPool;
actors: Array<Actor>;
currentActor: number;
id: number;
static Actor: {
new (...args: any): Actor;
};
constructor(workerPool: WorkerPool, parent: any);
/**
* Broadcast a message to all Workers.
* @private
*/
broadcast(type: string, data: unknown, cb?: (...args: any[]) => any): void;
/**
* Acquires an actor to dispatch messages to. The actors are distributed in round-robin fashion.
* @returns An actor object backed by a web worker for processing messages.
*/
getActor(): Actor;
remove(): void;
}
export declare type MapLayerMouseEvent = MapMouseEvent & {
features?: GeoJSON.Feature[];
};
export declare type MapLayerTouchEvent = MapTouchEvent & {
features?: GeoJSON.Feature[];
};
export declare type MapSourceDataType = "content" | "metadata";
export declare type MapLayerEventType = {
click: MapLayerMouseEvent;
dblclick: MapLayerMouseEvent;
mousedown: MapLayerMouseEvent;
mouseup: MapLayerMouseEvent;
mousemove: MapLayerMouseEvent;
mouseenter: MapLayerMouseEvent;
mouseleave: MapLayerMouseEvent;
mouseover: MapLayerMouseEvent;
mouseout: MapLayerMouseEvent;
contextmenu: MapLayerMouseEvent;
touchstart: MapLayerTouchEvent;
touchend: MapLayerTouchEvent;
touchcancel: MapLayerTouchEvent;
};
export interface MapLibreEvent<TOrig = undefined> {
type: string;
target: Map;
originalEvent: TOrig;
}
export interface MapStyleDataEvent extends MapLibreEvent {
dataType: "style";
}
export interface MapSourceDataEvent extends MapLibreEvent {
dataType: "source";
isSourceLoaded: boolean;
source: SourceSpecification;
sourceId: string;
sourceDataType: MapSourceDataType;
tile: any;
}
export declare class MapMouseEvent extends Event implements MapLibreEvent<MouseEvent> {
/**
* The event type (one of {@link Map.event:mousedown},
* {@link Map.event:mouseup},
* {@link Map.event:click},
* {@link Map.event:dblclick},
* {@link Map.event:mousemove},
* {@link Map.event:mouseover},
* {@link Map.event:mouseenter},
* {@link Map.event:mouseleave},
* {@link Map.event:mouseout},
* {@link Map.event:contextmenu}).
*/
type: "mousedown" | "mouseup" | "click" | "dblclick" | "mousemove" | "mouseover" | "mouseenter" | "mouseleave" | "mouseout" | "contextmenu";
/**
* The `Map` object that fired the event.
*/
target: Map;
/**
* The DOM event which caused the map event.
*/
originalEvent: MouseEvent;
/**
* The pixel coordinates of the mouse cursor, relative to the map and measured from the top left corner.
*/
point: Point;
/**
* The geographic location on the map of the mouse cursor.
*/
lngLat: LngLat;
/**
* Prevents subsequent default processing of the event by the map.
*
* Calling this method will prevent the following default map behaviors:
*
* * On `mousedown` events, the behavior of {@link DragPanHandler}
* * On `mousedown` events, the behavior of {@link DragRotateHandler}
* * On `mousedown` events, the behavior of {@link BoxZoomHandler}
* * On `dblclick` events, the behavior of {@link DoubleClickZoomHandler}
*
*/
preventDefault(): void;
/**
* `true` if `preventDefault` has been called.
* @private
*/
get defaultPrevented(): boolean;
_defaultPrevented: boolean;
/**
* @private
*/
constructor(type: string, map: Map, originalEvent: MouseEvent, data?: any);
}
export declare class MapTouchEvent extends Event implements MapLibreEvent<TouchEvent> {
/**
* The event type.
*/
type: "touchstart" | "touchend" | "touchcancel";
/**
* The `Map` object that fired the event.
*/
target: Map;
/**
* The DOM event which caused the map event.
*/
originalEvent: TouchEvent;
/**
* The geographic location on the map of the center of the touch event points.
*/
lngLat: LngLat;
/**
* The pixel coordinates of the center of the touch event points, relative to the map and measured from the top left
* corner.
*/
point: Point;
/**
* The array of pixel coordinates corresponding to a
* [touch event's `touches`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/touches) property.
*/
points: Array<Point>;
/**
* The geographical locations on the map corresponding to a
* [touch event's `touches`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/touches) property.
*/
lngLats: Array<LngLat>;
/**
* Prevents subsequent default processing of the event by the map.
*
* Calling this method will prevent the following default map behaviors:
*
* * On `touchstart` events, the behavior of {@link DragPanHandler}
* * On `touchstart` events, the behavior of {@link TouchZoomRotateHandler}
*
*/
preventDefault(): void;
/**
* `true` if `preventDefault` has been called.
* @private
*/
get defaultPrevented(): boolean;
_defaultPrevented: boolean;
/**
* @private
*/
constructor(type: string, map: Map, originalEvent: TouchEvent);
}
export declare class MapWheelEvent extends Event {
/**
* The event type.
*/
type: "wheel";
/**
* The `Map` object that fired the event.
*/
target: Map;
/**
* The DOM event which caused the map event.
*/
originalEvent: WheelEvent;
/**
* Prevents subsequent default processing of the event by the map.
*
* Calling this method will prevent the the behavior of {@link ScrollZoomHandler}.
*/
preventDefault(): void;
/**
* `true` if `preventDefault` has been called.
* @private
*/
get defaultPrevented(): boolean;
_defaultPrevented: boolean;
/**
* @private
*/
constructor(type: string, map: Map, originalEvent: WheelEvent);
}
/**
* A `MapLibreZoomEvent` is the event type for the boxzoom-related map events emitted by the {@link BoxZoomHandler}.
*
* @typedef {Object} MapLibreZoomEvent
* @property {MouseEvent} originalEvent The DOM event that triggered the boxzoom event. Can be a `MouseEvent` or `KeyboardEvent`
* @property {string} type The type of boxzoom event. One of `boxzoomstart`, `boxzoomend` or `boxzoomcancel`
* @property {Map} target The `Map` instance that triggerred the event
*/
export declare type MapLibreZoomEvent = {
type: "boxzoomstart" | "boxzoomend" | "boxzoomcancel";
target: Map;
originalEvent: MouseEvent;
};
/**
* A `MapDataEvent` object is emitted with the {@link Map.event:data}
* and {@link Map.event:dataloading} events. Possible values for
* `dataType`s are:
*
* - `'source'`: The non-tile data associated with any source
* - `'style'`: The [style](https://maplibre.org/maplibre-gl-js-docs/style-spec/) used by the map
*
* @typedef {Object} MapDataEvent
* @property {string} type The event type.
* @property {string} dataType The type of data that has changed. One of `'source'`, `'style'`.
* @property {boolean} [isSourceLoaded] True if the event has a `dataType` of `source` and the source has no outstanding network requests.
* @property {Object} [source] The [style spec representation of the source](https://maplibre.org/maplibre-gl-js-docs/style-spec/#sources) if the event has a `dataType` of `source`.
* @property {string} [sourceDataType] Included if the event has a `dataType` of `source` and the event signals
* that internal data has been received or changed. Possible values are `metadata`, `content` and `visibility`.
* @property {Object} [tile] The tile being loaded or changed, if the event has a `dataType` of `source` and
* the event is related to loading of a tile.
* @property {Coordinates} [coord] The coordinate of the tile if the event has a `dataType` of `source` and
* the event is related to loading of a tile.
* @example
* // The sourcedata event is an example of MapDataEvent.
* // Set up an event listener on the map.
* map.on('sourcedata', function(e) {
* if (e.isSourceLoaded) {
* // Do something when the source has finished loading
* }
* });
*/
export declare type MapDataEvent = {
type: string;
dataType: string;
sourceDataType: MapSourceDataType;
};
export declare type MapContextEvent = {
type: "webglcontextlost" | "webglcontextrestored";
originalEvent: WebGLContextEvent;
};
export interface MapStyleImageMissingEvent extends MapLibreEvent {
type: "styleimagemissing";
id: string;
}
/**
* MapEventType - a mapping between the event name and the event value
*/
export declare type MapEventType = {
error: ErrorEvent;
load: MapLibreEvent;
idle: MapLibreEvent;
remove: MapLibreEvent;
render: MapLibreEvent;
resize: MapLibreEvent;
webglcontextlost: MapContextEvent;
webglcontextrestored: MapContextEvent;
dataloading: MapDataEvent;
data: MapDataEvent;
tiledataloading: MapDataEvent;
sourcedataloading: MapSourceDataEvent;
styledataloading: MapStyleDataEvent;
sourcedata: MapSourceDataEvent;
styledata: MapStyleDataEvent;
styleimagemissing: MapStyleImageMissingEvent;
boxzoomcancel: MapLibreZoomEvent;
boxzoomstart: MapLibreZoomEvent;
boxzoomend: MapLibreZoomEvent;
touchcancel: MapTouchEvent;
touchmove: MapTouchEvent;
touchend: MapTouchEvent;
touchstart: MapTouchEvent;
click: MapMouseEvent;
contextmenu: MapMouseEvent;
dblclick: MapMouseEvent;
mousemove: MapMouseEvent;
mouseup: MapMouseEvent;
mousedown: MapMouseEvent;
mouseout: MapMouseEvent;
mouseover: MapMouseEvent;
movestart: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;
move: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;
moveend: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;
zoomstart: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;
zoom: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;
zoomend: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;
rotatestart: MapLibreEvent<MouseEvent | TouchEvent | undefined>;
rotate: MapLibreEvent<MouseEvent | TouchEvent | undefined>;
rotateend: MapLibreEvent<MouseEvent | TouchEvent | undefined>;
dragstart: MapLibreEvent<MouseEvent | TouchEvent | undefined>;
drag: MapLibreEvent<MouseEvent | TouchEvent | undefined>;
dragend: MapLibreEvent<MouseEvent | TouchEvent | undefined>;
pitchstart: MapLibreEvent<MouseEvent | TouchEvent | undefined>;
pitch: MapLibreEvent<MouseEvent | TouchEvent | undefined>;
pitchend: MapLibreEvent<MouseEvent | TouchEvent | undefined>;
wheel: MapWheelEvent;
};
export declare type MapEvent = /**
* Fired when a pointing device (usually a mouse) is pressed within the map.
*
* **Note:** This event is compatible with the optional `layerId` parameter.
* If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only when the
* the cursor is pressed while inside a visible portion of the specifed layer.
*
* @event mousedown
* @memberof Map
* @instance
* @property {MapMouseEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener
* map.on('mousedown', function() {
* console.log('A mousedown event has occurred.');
* });
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener for a specific layer
* map.on('mousedown', 'poi-label', function() {
* console.log('A mousedown event has occurred on a visible portion of the poi-label layer.');
* });
* @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
*/ "mousedown"
/**
* Fired when a pointing device (usually a mouse) is released within the map.
*
* **Note:** This event is compatible with the optional `layerId` parameter.
* If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only when the
* the cursor is released while inside a visible portion of the specifed layer.
*
* @event mouseup
* @memberof Map
* @instance
* @property {MapMouseEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener
* map.on('mouseup', function() {
* console.log('A mouseup event has occurred.');
* });
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener for a specific layer
* map.on('mouseup', 'poi-label', function() {
* console.log('A mouseup event has occurred on a visible portion of the poi-label layer.');
* });
* @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
*/ | "mouseup"
/**
* Fired when a pointing device (usually a mouse) is moved within the map.
* As you move the cursor across a web page containing a map,
* the event will fire each time it enters the map or any child elements.
*
* **Note:** This event is compatible with the optional `layerId` parameter.
* If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only when the
* the cursor is moved inside a visible portion of the specifed layer.
*
* @event mouseover
* @memberof Map
* @instance
* @property {MapMouseEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener
* map.on('mouseover', function() {
* console.log('A mouseover event has occurred.');
* });
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener for a specific layer
* map.on('mouseover', 'poi-label', function() {
* console.log('A mouseover event has occurred on a visible portion of the poi-label layer.');
* });
* @see [Get coordinates of the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/mouse-position/)
* @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/hover-styles/)
* @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-hover/)
*/ | "mouseover"
/**
* Fired when a pointing device (usually a mouse) is moved while the cursor is inside the map.
* As you move the cursor across the map, the event will fire every time the cursor changes position within the map.
*
* **Note:** This event is compatible with the optional `layerId` parameter.
* If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only when the
* the cursor is inside a visible portion of the specified layer.
*
* @event mousemove
* @memberof Map
* @instance
* @property {MapMouseEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener
* map.on('mousemove', function() {
* console.log('A mousemove event has occurred.');
* });
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener for a specific layer
* map.on('mousemove', 'poi-label', function() {
* console.log('A mousemove event has occurred on a visible portion of the poi-label layer.');
* });
* @see [Get coordinates of the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/mouse-position/)
* @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/hover-styles/)
* @see [Display a popup on over](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-hover/)
*/ | "mousemove"
/**
* Fired when a pointing device (usually a mouse) is pressed and released at the same point on the map.
*
* **Note:** This event is compatible with the optional `layerId` parameter.
* If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only when the
* point that is pressed and released contains a visible portion of the specifed layer.
*
* @event click
* @memberof Map
* @instance
* @property {MapMouseEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener
* map.on('click', function(e) {
* console.log('A click event has occurred at ' + e.lngLat);
* });
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener for a specific layer
* map.on('click', 'poi-label', function(e) {
* console.log('A click event has occurred on a visible portion of the poi-label layer at ' + e.lngLat);
* });
* @see [Measure distances](https://maplibre.org/maplibre-gl-js-docs/example/measure/)
* @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js-docs/example/center-on-symbol/)
*/ | "click"
/**
* Fired when a pointing device (usually a mouse) is pressed and released twice at the same point on
* the map in rapid succession.
*
* **Note:** This event is compatible with the optional `layerId` parameter.
* If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only
* when the point that is clicked twice contains a visible portion of the specifed layer.
*
* @event dblclick
* @memberof Map
* @instance
* @property {MapMouseEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener
* map.on('dblclick', function(e) {
* console.log('A dblclick event has occurred at ' + e.lngLat);
* });
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener for a specific layer
* map.on('dblclick', 'poi-label', function(e) {
* console.log('A dblclick event has occurred on a visible portion of the poi-label layer at ' + e.lngLat);
* });
*/ | "dblclick"
/**
* Fired when a pointing device (usually a mouse) enters a visible portion of a specified layer from
* outside that layer or outside the map canvas.
*
* **Important:** This event can only be listened for when {@link Map#on} includes three arguments,
* where the second argument specifies the desired layer.
*
* @event mouseenter
* @memberof Map
* @instance
* @property {MapMouseEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener
* map.on('mouseenter', 'water', function() {
* console.log('A mouseenter event occurred on a visible portion of the water layer.');
* });
* @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js-docs/example/center-on-symbol/)
* @see [Display a popup on click](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-click/)
*/ | "mouseenter"
/**
* Fired when a pointing device (usually a mouse) leaves a visible portion of a specified layer, or leaves
* the map canvas.
*
* **Important:** This event can only be listened for when {@link Map#on} includes three arguements,
* where the second argument specifies the desired layer.
*
* @event mouseleave
* @memberof Map
* @instance
* @property {MapMouseEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // when the pointing device leaves
* // a visible portion of the specified layer.
* map.on('mouseleave', 'water', function() {
* console.log('A mouseleave event occurred.');
* });
* @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/hover-styles/)
* @see [Display a popup on click](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-click/)
*/ | "mouseleave"
/**
* Fired when a point device (usually a mouse) leaves the map's canvas.
*
* @event mouseout
* @memberof Map
* @instance
* @property {MapMouseEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // when the pointing device leave's
* // the map's canvas.
* map.on('mouseout', function() {
* console.log('A mouseout event occurred.');
* });
*/ | "mouseout"
/**
* Fired when the right button of the mouse is clicked or the context menu key is pressed within the map.
*
* @event contextmenu
* @memberof Map
* @instance
* @property {MapMouseEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // when the right mouse button is
* // pressed within the map.
* map.on('contextmenu', function() {
* console.log('A contextmenu event occurred.');
* });
*/ | "contextmenu"
/**
* Fired when a [`wheel`](https://developer.mozilla.org/en-US/docs/Web/Events/wheel) event occurs within the map.
*
* @event wheel
* @memberof Map
* @instance
* @property {MapWheelEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // when a wheel event occurs within the map.
* map.on('wheel', function() {
* console.log('A wheel event occurred.');
* });
*/ | "wheel"
/**
* Fired when a [`touchstart`](https://developer.mozilla.org/en-US/docs/Web/Events/touchstart) event occurs within the map.
*
* @event touchstart
* @memberof Map
* @instance
* @property {MapTouchEvent} data
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // when a touchstart event occurs within the map.
* map.on('touchstart', function() {
* console.log('A touchstart event occurred.');
* });
* @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
*/ | "touchstart"
/**
* Fired when a [`touchend`](https://developer.mozilla.org/en-US/docs/Web/Events/touchend) event occurs within the map.
*
* @event touchend
* @memberof Map
* @instance
* @property {MapTouchEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // when a touchstart event occurs within the map.
* map.on('touchstart', function() {
* console.log('A touchstart event occurred.');
* });
* @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
*/ | "touchend"
/**
* Fired when a [`touchmove`](https://developer.mozilla.org/en-US/docs/Web/Events/touchmove) event occurs within the map.
*
* @event touchmove
* @memberof Map
* @instance
* @property {MapTouchEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // when a touchmove event occurs within the map.
* map.on('touchmove', function() {
* console.log('A touchmove event occurred.');
* });
* @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
*/ | "touchmove"
/**
* Fired when a [`touchcancel`](https://developer.mozilla.org/en-US/docs/Web/Events/touchcancel) event occurs within the map.
*
* @event touchcancel
* @memberof Map
* @instance
* @property {MapTouchEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // when a touchcancel event occurs within the map.
* map.on('touchcancel', function() {
* console.log('A touchcancel event occurred.');
* });
*/ | "touchcancel"
/**
* Fired just before the map begins a transition from one
* view to another, as the result of either user interaction or methods such as {@link Map#jumpTo}.
*
* @event movestart
* @memberof Map
* @instance
* @property {{originalEvent: DragEvent}} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // just before the map begins a transition
* // from one view to another.
* map.on('movestart', function() {
* console.log('A movestart` event occurred.');
* });
*/ | "movestart"
/**
* Fired repeatedly during an animated transition from one view to
* another, as the result of either user interaction or methods such as {@link Map#flyTo}.
*
* @event move
* @memberof Map
* @instance
* @property {MapMouseEvent | MapTouchEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // repeatedly during an animated transition.
* map.on('move', function() {
* console.log('A move event occurred.');
* });
* @see [Display HTML clusters with custom properties](https://maplibre.org/maplibre-gl-js-docs/example/cluster-html/)
*/ | "move"
/**
* Fired just after the map completes a transition from one
* view to another, as the result of either user interaction or methods such as {@link Map#jumpTo}.
*
* @event moveend
* @memberof Map
* @instance
* @property {{originalEvent: DragEvent}} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // just after the map completes a transition.
* map.on('moveend', function() {
* console.log('A moveend event occurred.');
* });
* @see [Display HTML clusters with custom properties](https://maplibre.org/maplibre-gl-js-docs/example/cluster-html/)
*/ | "moveend"
/**
* Fired when a "drag to pan" interaction starts. See {@link DragPanHandler}.
*
* @event dragstart
* @memberof Map
* @instance
* @property {{originalEvent: DragEvent}} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // when a "drag to pan" interaction starts.
* map.on('dragstart', function() {
* console.log('A dragstart event occurred.');
* });
*/ | "dragstart"
/**
* Fired repeatedly during a "drag to pan" interaction. See {@link DragPanHandler}.
*
* @event drag
* @memberof Map
* @instance
* @property {MapMouseEvent | MapTouchEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // repeatedly during a "drag to pan" interaction.
* map.on('drag', function() {
* console.log('A drag event occurred.');
* });
*/ | "drag"
/**
* Fired when a "drag to pan" interaction ends. See {@link DragPanHandler}.
*
* @event dragend
* @memberof Map
* @instance
* @property {{originalEvent: DragEvent}} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // when a "drag to pan" interaction ends.
* map.on('dragend', function() {
* console.log('A dragend event occurred.');
* });
* @see [Create a draggable marker](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-marker/)
*/ | "dragend"
/**
* Fired just before the map begins a transition from one zoom level to another,
* as the result of either user interaction or methods such as {@link Map#flyTo}.
*
* @event zoomstart
* @memberof Map
* @instance
* @property {MapMouseEvent | MapTouchEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // just before a zoom transition starts.
* map.on('zoomstart', function() {
* console.log('A zoomstart event occurred.');
* });
*/ | "zoomstart"
/**
* Fired repeatedly during an animated transition from one zoom level to another,
* as the result of either user interaction or methods such as {@link Map#flyTo}.
*
* @event zoom
* @memberof Map
* @instance
* @property {MapMouseEvent | MapTouchEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // repeatedly during a zoom transition.
* map.on('zoom', function() {
* console.log('A zoom event occurred.');
* });
*/ | "zoom"
/**
* Fired just after the map completes a transition from one zoom level to another,
* as the result of either user interaction or methods such as {@link Map#flyTo}.
*
* @event zoomend
* @memberof Map
* @instance
* @property {MapMouseEvent | MapTouchEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // just after a zoom transition finishes.
* map.on('zoomend', function() {
* console.log('A zoomend event occurred.');
* });
*/ | "zoomend"
/**
* Fired when a "drag to rotate" interaction starts. See {@link DragRotateHandler}.
*
* @event rotatestart
* @memberof Map
* @instance
* @property {MapMouseEvent | MapTouchEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // just before a "drag to rotate" interaction starts.
* map.on('rotatestart', function() {
* console.log('A rotatestart event occurred.');
* });
*/ | "rotatestart"
/**
* Fired repeatedly during a "drag to rotate" interaction. See {@link DragRotateHandler}.
*
* @event rotate
* @memberof Map
* @instance
* @property {MapMouseEvent | MapTouchEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // repeatedly during "drag to rotate" interaction.
* map.on('rotate', function() {
* console.log('A rotate event occurred.');
* });
*/ | "rotate"
/**
* Fired when a "drag to rotate" interaction ends. See {@link DragRotateHandler}.
*
* @event rotateend
* @memberof Map
* @instance
* @property {MapMouseEvent | MapTouchEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // just after a "drag to rotate" interaction ends.
* map.on('rotateend', function() {
* console.log('A rotateend event occurred.');
* });
*/ | "rotateend"
/**
* Fired whenever the map's pitch (tilt) begins a change as
* the result of either user interaction or methods such as {@link Map#flyTo} .
*
* @event pitchstart
* @memberof Map
* @instance
* @property {MapEventData} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // just before a pitch (tilt) transition starts.
* map.on('pitchstart', function() {
* console.log('A pitchstart event occurred.');
* });
*/ | "pitchstart"
/**
* Fired repeatedly during the map's pitch (tilt) animation between
* one state and another as the result of either user interaction
* or methods such as {@link Map#flyTo}.
*
* @event pitch
* @memberof Map
* @instance
* @property {MapEventData} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // repeatedly during a pitch (tilt) transition.
* map.on('pitch', function() {
* console.log('A pitch event occurred.');
* });
*/ | "pitch"
/**
* Fired immediately after the map's pitch (tilt) finishes changing as
* the result of either user interaction or methods such as {@link Map#flyTo}.
*
* @event pitchend
* @memberof Map
* @instance
* @property {MapEventData} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // just after a pitch (tilt) transition ends.
* map.on('pitchend', function() {
* console.log('A pitchend event occurred.');
* });
*/ | "pitchend"
/**
* Fired when a "box zoom" interaction starts. See {@link BoxZoomHandler}.
*
* @event boxzoomstart
* @memberof Map
* @instance
* @property {MapLibreZoomEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // just before a "box zoom" interaction starts.
* map.on('boxzoomstart', function() {
* console.log('A boxzoomstart event occurred.');
* });
*/ | "boxzoomstart"
/**
* Fired when a "box zoom" interaction ends. See {@link BoxZoomHandler}.
*
* @event boxzoomend
* @memberof Map
* @instance
* @type {Object}
* @property {MapLibreZoomEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // just after a "box zoom" interaction ends.
* map.on('boxzoomend', function() {
* console.log('A boxzoomend event occurred.');
* });
*/ | "boxzoomend"
/**
* Fired when the user cancels a "box zoom" interaction, or when the bounding box does not meet the minimum size threshold.
* See {@link BoxZoomHandler}.
*
* @event boxzoomcancel
* @memberof Map
* @instance
* @property {MapLibreZoomEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // the user cancels a "box zoom" interaction.
* map.on('boxzoomcancel', function() {
* console.log('A boxzoomcancel event occurred.');
* });
*/ | "boxzoomcancel"
/**
* Fired immediately after the map has been resized.
*
* @event resize
* @memberof Map
* @instance
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // immediately after the map has been resized.
* map.on('resize', function() {
* console.log('A resize event occurred.');
* });
*/ | "resize"
/**
* Fired when the WebGL context is lost.
*
* @event webglcontextlost
* @memberof Map
* @instance
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // when the WebGL context is lost.
* map.on('webglcontextlost', function() {
* console.log('A webglcontextlost event occurred.');
* });
*/ | "webglcontextlost"
/**
* Fired when the WebGL context is restored.
*
* @event webglcontextrestored
* @memberof Map
* @instance
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // when the WebGL context is restored.
* map.on('webglcontextrestored', function() {
* console.log('A webglcontextrestored event occurred.');
* });
*/ | "webglcontextrestored"
/**
* Fired immediately after all necessary resources have been downloaded
* and the first visually complete rendering of the map has occurred.
*
* @event load
* @memberof Map
* @instance
* @type {Object}
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // when the map has finished loading.
* map.on('load', function() {
* console.log('A load event occurred.');
* });
* @see [Draw GeoJSON points](https://maplibre.org/maplibre-gl-js-docs/example/geojson-markers/)
* @see [Add live realtime data](https://maplibre.org/maplibre-gl-js-docs/example/live-geojson/)
* @see [Animate a point](https://maplibre.org/maplibre-gl-js-docs/example/animate-point-along-line/)
*/ | "load"
/**
* Fired whenever the map is drawn to the screen, as the result of
*
* - a change to the map's position, zoom, pitch, or bearing
* - a change to the map's style
* - a change to a GeoJSON source
* - the loading of a vector tile, GeoJSON file, glyph, or sprite
*
* @event render
* @memberof Map
* @instance
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // whenever the map is drawn to the screen.
* map.on('render', function() {
* console.log('A render event occurred.');
* });
*/ | "render"
/**
* Fired after the last frame rendered before the map enters an
* "idle" state:
*
* - No camera transitions are in progress
* - All currently requested tiles have loaded
* - All fade/transition animations have completed
*
* @event idle
* @memberof Map
* @instance
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // just before the map enters an "idle" state.
* map.on('idle', function() {
* console.log('A idle event occurred.');
* });
*/ | "idle"
/**
* Fired immediately after the map has been removed with {@link Map.event:remove}.
*
* @event remove
* @memberof Map
* @instance
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // just after the map is removed.
* map.on('remove', function() {
* console.log('A remove event occurred.');
* });
*/ | "remove"
/**
* Fired when an error occurs. This is GL JS's primary error reporting
* mechanism. We use an event instead of `throw` to better accommodate
* asyncronous operations. If no listeners are bound to the `error` event, the
* error will be printed to the console.
*
* @event error
* @memberof Map
* @instance
* @property {{error: {message: string}}} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // when an error occurs.
* map.on('error', function() {
* console.log('A error event occurred.');
* });
*/ | "error"
/**
* Fired when any map data loads or changes. See {@link MapDataEvent}
* for more information.
*
* @event data
* @memberof Map
* @instance
* @property {MapDataEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // when map data loads or changes.
* map.on('data', function() {
* console.log('A data event occurred.');
* });
* @see [Display HTML clusters with custom properties](https://maplibre.org/maplibre-gl-js-docs/example/cluster-html/)
*/ | "data"
/**
* Fired when the map's style loads or changes. See
* {@link MapDataEvent} for more information.
*
* @event styledata
* @memberof Map
* @instance
* @property {MapDataEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // when the map's style loads or changes.
* map.on('styledata', function() {
* console.log('A styledata event occurred.');
* });
*/ | "styledata"
/**
* Fired when one of the map's sources loads or changes, including if a tile belonging
* to a source loads or changes. See {@link MapDataEvent} for more information.
*
* @event sourcedata
* @memberof Map
* @instance
* @property {MapDataEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // when one of the map's sources loads or changes.
* map.on('sourcedata', function() {
* console.log('A sourcedata event occurred.');
* });
*/ | "sourcedata"
/**
* Fired when any map data (style, source, tile, etc) begins loading or
* changing asyncronously. All `dataloading` events are followed by a `data`
* or `error` event. See {@link MapDataEvent} for more information.
*
* @event dataloading
* @memberof Map
* @instance
* @property {MapDataEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // when any map data begins loading
* // or changing asynchronously.
* map.on('dataloading', function() {
* console.log('A dataloading event occurred.');
* });
*/ | "dataloading"
/**
* Fired when the map's style begins loading or changing asyncronously.
* All `styledataloading` events are followed by a `styledata`
* or `error` event. See {@link MapDataEvent} for more information.
*
* @event styledataloading
* @memberof Map
* @instance
* @property {MapDataEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // map's style begins loading or
* // changing asyncronously.
* map.on('styledataloading', function() {
* console.log('A styledataloading event occurred.');
* });
*/ | "styledataloading"
/**
* Fired when one of the map's sources begins loading or changing asyncronously.
* All `sourcedataloading` events are followed by a `sourcedata` or `error` event.
* See {@link MapDataEvent} for more information.
*
* @event sourcedataloading
* @memberof Map
* @instance
* @property {MapDataEvent} data
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // map's sources begin loading or
* // changing asyncronously.
* map.on('sourcedataloading', function() {
* console.log('A sourcedataloading event occurred.');
* });
*/ | "sourcedataloading"
/**
* Fired when an icon or pattern needed by the style is missing. The missing image can
* be added with {@link Map#addImage} within this event listener callback to prevent the image from
* being skipped. This event can be used to dynamically generate icons and patterns.
*
* @event styleimagemissing
* @memberof Map
* @instance
* @property {string} id The id of the missing image.
* @example
* // Initialize the map
* var map = new maplibregl.Map({ // map options });
* // Set an event listener that fires
* // an icon or pattern is missing.
* map.on('styleimagemissing', function() {
* console.log('A styleimagemissing event occurred.');
* });
* @see [Generate and add a missing icon to the map](https://maplibre.org/maplibre-gl-js-docs/example/add-image-missing-generated/)
*/ | "styleimagemissing"
/**
* @event style.load
* @memberof Map
* @instance
* @private
*/ | "style.load";
/**
* The `Source` interface must be implemented by each source type, including "core" types (`vector`, `raster`,
* `video`, etc.) and all custom, third-party types.
*
* @private
*
* @param {string} id The id for the source. Must not be used by any existing source.
* @param {Object} options Source options, specific to the source type (except for `options.type`, which is always
* required).
* @param {string} options.type The source type, matching the value of `name` used in {@link Style#addSourceType}.
* @param {Dispatcher} dispatcher A {@link Dispatcher} instance, which can be used to send messages to the workers.
*
* @fires data with `{dataType: 'source', sourceDataType: 'metadata'}` to indicate that any necessary metadata
* has been loaded so that it's okay to call `loadTile`; and with `{dataType: 'source', sourceDataType: 'content'}`
* to indicate that the source data has changed, so that any current caches should be flushed.
* @property {string} id The id for the source. Must match the id passed to the constructor.
* @property {number} minzoom
* @property {number} maxzoom
* @property {boolean} isTileClipped `false` if tiles can be drawn outside their boundaries, `true` if they cannot.
* @property {boolean} reparseOverscaled `true` if tiles should be sent back to the worker for each overzoomed zoom
* level, `false` if not.
* @property {boolean} roundZoom `true` if zoom levels are rounded to the nearest integer in the source data, `false`
* if they are floor-ed to the nearest integer.
*/
export interface Source {
readonly type: string;
id: string;
minzoom: number;
maxzoom: number;
tileSize: number;
attribution?: string;
roundZoom?: boolean;
isTileClipped?: boolean;
maplibreLogo?: boolean;
tileID?: CanonicalTileID;
reparseOverscaled?: boolean;
vectorLayerIds?: Array<string>;
hasTransition(): boolean;
loaded(): boolean;
fire(event: Event): unknown;
readonly onAdd?: (map: Map) => void;
readonly onRemove?: (map: Map) => void;
loadTile(tile: Tile, callback: Callback<void>): void;
readonly hasTile?: (tileID: OverscaledTileID) => boolean;
readonly abortTile?: (tile: Tile, callback: Callback<void>) => void;
readonly unloadTile?: (tile: Tile, callback: Callback<void>) => void;
/**
* @returns A plain (stringifiable) JS object representing the current state of the source.
* Creating a source using the returned object as the `options` should result in a Source that is
* equivalent to this one.
* @private
*/
serialize(): any;
readonly prepare?: () => void;
}
export declare type SourceStatics = {
workerSourceURL?: URL;
};
export declare type SourceClass = {
new (...args: any): Source;
} & SourceStatics;
declare const getSourceType: (name: string) => any;
declare const setSourceType: (name: string, type: new (...args: any) => Source) => void;
export declare class TileCache {
max: number;
data: {
[key: string]: Array<{
value: Tile;
timeout: ReturnType<typeof setTimeout>;
}>;
};
order: Array<string>;
onRemove: (element: Tile) => void;
/**
* @param {number} max number of permitted values
* @param {Function} onRemove callback called with items when they expire
*/
constructor(max: number, onRemove: (element: Tile) => void);
/**
* Clear the cache
*
* @returns {TileCache} this cache
* @private
*/
reset(): this;
/**
* Add a key, value combination to the cache, trimming its size if this pushes
* it over max length.
*
* @param {OverscaledTileID} tileID lookup key for the item
* @param {*} data any value
*
* @returns {TileCache} this cache
* @private
*/
add(tileID: OverscaledTileID, data: Tile, expiryTimeout: number | void): this;
/**
* Determine whether the value attached to `key` is present
*
* @param {OverscaledTileID} tileID the key to be looked-up
* @returns {boolean} whether the cache has this value
* @private
*/
has(tileID: OverscaledTileID): boolean;
/**
* Get the value attached to a specific key and remove data from cache.
* If the key is not found, returns `null`
*
* @param {OverscaledTileID} tileID the key to look up
* @returns {*} the data, or null if it isn't found
* @private
*/
getAndRemove(tileID: OverscaledTileID): Tile;
_getAndRemoveByKey(key: string): Tile;
getByKey(key: string): Tile;
/**
* Get the value attached to a specific key without removing data
* from the cache. If the key is not found, returns `null`
*
* @param {OverscaledTileID} tileID the key to look up
* @returns {*} the data, or null if it isn't found
* @private
*/
get(tileID: OverscaledTileID): Tile;
/**
* Remove a key/value combination from the cache.
*
* @param {OverscaledTileID} tileID the key for the pair to delete
* @param {Tile} value If a value is provided, remove that exact version of the value.
* @returns {TileCache} this cache
* @private
*/
remove(tileID: OverscaledTileID, value?: {
value: Tile;
timeout: ReturnType<typeof setTimeout>;
}): this;
/**
* Change the max size of the cache.
*
* @param {number} max the max size of the cache
* @returns {TileCache} this cache
* @private
*/
setMaxSize(max: number): TileCache;
/**
* Remove entries that do not pass a filter function. Used for removing
* stale tiles from the cache.
*
* @param {function} filterFn Determines whether the tile is filtered. If the supplied function returns false, the tile will be filtered out.
*/
filter(filterFn: (tile: Tile) => boolean): void;
}
export declare class SourceCache extends Evented {
id: string;
dispatcher: Dispatcher;
map: Map;
style: Style;
_source: Source;
_sourceLoaded: boolean;
_sourceErrored: boolean;
_tiles: {
[_: string]: Tile;
};
_prevLng: number;
_cache: TileCache;
_timers: {
[_ in any]: ReturnType<typeof setTimeout>;
};
_cacheTimers: {
[_ in any]: ReturnType<typeof setTimeout>;
};
_maxTileCacheSize: number;
_paused: boolean;
_shouldReloadOnResume: boolean;
_coveredTiles: {
[_: string]: boolean;
};
transform: Transform;
used: boolean;
_state: SourceFeatureState;
_loadedParentTiles: {
[_: string]: Tile;
};
static maxUnderzooming: number;
static maxOverzooming: number;
constructor(id: string, options: SourceSpecification, dispatcher: Dispatcher);
onAdd(map: Map): void;
onRemove(map: Map): void;
/**
* Return true if no tile data is pending, tiles will not change unless
* an additional API call is received.
* @private
*/
loaded(): boolean;
getSource(): Source;
pause(): void;
resume(): void;
_loadTile(tile: Tile, callback: Callback<void>): void;
_unloadTile(tile: Tile): void;
_abortTile(tile: Tile): void;
serialize(): any;
prepare(context: Context): void;
/**
* Return all tile ids ordered with z-order, and cast to numbers
* @private
*/
getIds(): Array<string>;
getRenderableIds(symbolLayer?: boolean): Array<string>;
hasRenderableParent(tileID: OverscaledTileID): boolean;
_isIdRenderable(id: string, symbolLayer?: boolean): boolean;
reload(): void;
_reloadTile(id: string, state: TileState): void;
_tileLoaded(tile: Tile, id: string, previousState: TileState, err?: Error | null): void;
/**
* For raster terrain source, backfill DEM to eliminate visible tile boundaries
* @private
*/
_backfillDEM(tile: Tile): void;
/**
* Get a specific tile by TileID
* @private
*/
getTile(tileID: OverscaledTileID): Tile;
/**
* Get a specific tile by id
* @private
*/
getTileByID(id: string): Tile;
/**
* For a given set of tiles, retain children that are loaded and have a zoom
* between `zoom` (exclusive) and `maxCoveringZoom` (inclusive)
* @private
*/
_retainLoadedChildren(idealTiles: {
[_ in any]: OverscaledTileID;
}, zoom: number, maxCoveringZoom: number, retain: {
[_ in any]: OverscaledTileID;
}): void;
/**
* Find a loaded parent of the given tile (up to minCoveringZoom)
* @private
*/
findLoadedParent(tileID: OverscaledTileID, minCoveringZoom: number): Tile;
_getLoadedTile(tileID: OverscaledTileID): Tile;
/**
* Resizes the tile cache based on the current viewport's size
* or the maxTileCacheSize option passed during map creation
*
* Larger viewports use more tiles and need larger caches. Larger viewports
* are more likely to be found on devices with more memory and on pages where
* the map is more important.
* @private
*/
updateCacheSize(transform: Transform): void;
handleWrapJump(lng: number): void;
/**
* Removes tiles that are outside the viewport and adds new tiles that
* are inside the viewport.
* @private
*/
update(transform: Transform): void;
releaseSymbolFadeTiles(): void;
_updateRetainedTiles(idealTileIDs: Array<OverscaledTileID>, zoom: number): {
[_: string]: OverscaledTileID;
};
_updateLoadedParentTileCache(): void;
/**
* Add a tile, given its coordinate, to the pyramid.
* @private
*/
_addTile(tileID: OverscaledTileID): Tile;
_setTileReloadTimer(id: string, tile: Tile): void;
/**
* Remove a tile, given its id, from the pyramid
* @private
*/
_removeTile(id: string): void;
/**
* Remove all tiles from this pyramid
*/
clearTiles(): void;
/**
* Search through our current tiles and attempt to find the tiles that
* cover the given bounds.
* @param pointQueryGeometry coordinates of the corners of bounding rectangle
* @returns {Array<Object>} result items have {tile, minX, maxX, minY, maxY}, where min/max bounding values are the given bounds transformed in into the coordinate space of this tile.
* @private
*/
tilesIn(pointQueryGeometry: Array<Point>, maxPitchScaleFactor: number, has3DLayer: boolean): any[];
getVisibleCoordinates(symbolLayer?: boolean): Array<OverscaledTileID>;
hasTransition(): boolean;
/**
* Set the value of a particular state for a feature
* @private
*/
setFeatureState(sourceLayer: string, featureId: number | string, state: any): void;
/**
* Resets the value of a particular state key for a feature
* @private
*/
removeFeatureState(sourceLayer?: string, featureId?: number | string, key?: string): void;
/**
* Get the entire state object for a feature
* @private
*/
getFeatureState(sourceLayer: string, featureId: number | string): any;
/**
* Sets the set of keys that the tile depends on. This allows tiles to
* be reloaded when their dependencies change.
* @private
*/
setDependencies(tileKey: string, namespace: string, dependencies: Array<string>): void;
/**
* Reloads all tiles that depend on the given keys.
* @private
*/
reloadTilesForDependencies(namespaces: Array<string>, keys: Array<string>): void;
}
export declare type QueryResult<T> = {
key: T;
x1: number;
y1: number;
x2: number;
y2: number;
};
export declare class GridIndex<T> {
circleKeys: Array<T>;
boxKeys: Array<T>;
boxCells: Array<Array<number>>;
circleCells: Array<Array<number>>;
bboxes: Array<number>;
circles: Array<number>;
xCellCount: number;
yCellCount: number;
width: number;
height: number;
xScale: number;
yScale: number;
boxUid: number;
circleUid: number;
constructor(width: number, height: number, cellSize: number);
keysLength(): number;
insert(key: T, x1: number, y1: number, x2: number, y2: number): void;
insertCircle(key: T, x: number, y: number, radius: number): void;
private _insertBoxCell;
private _insertCircleCell;
private _query;
query(x1: number, y1: number, x2: number, y2: number): Array<QueryResult<T>>;
hitTest(x1: number, y1: number, x2: number, y2: number, predicate?: (key: T) => boolean): boolean;
hitTestCircle(x: number, y: number, radius: number, predicate?: (key: T) => boolean): boolean;
private _queryCell;
private _queryCellCircle;
private _forEachCell;
private _convertToXCellCoord;
private _convertToYCellCoord;
private _circlesCollide;
private _circleAndRectCollide;
}
export declare type FeatureKey = {
bucketInstanceId: number;
featureIndex: number;
collisionGroupID: number;
};
export declare class CollisionIndex {
grid: GridIndex<FeatureKey>;
ignoredGrid: GridIndex<FeatureKey>;
transform: Transform;
pitchfactor: number;
screenRightBoundary: number;
screenBottomBoundary: number;
gridRightBoundary: number;
gridBottomBoundary: number;
constructor(transform: Transform, grid?: GridIndex<FeatureKey>, ignoredGrid?: GridIndex<FeatureKey>);
placeCollisionBox(collisionBox: SingleCollisionBox, allowOverlap: boolean, textPixelRatio: number, posMatrix: mat4, collisionGroupPredicate?: (key: FeatureKey) => boolean): {
box: Array<number>;
offscreen: boolean;
};
placeCollisionCircles(allowOverlap: boolean, symbol: any, lineVertexArray: SymbolLineVertexArray, glyphOffsetArray: GlyphOffsetArray, fontSize: number, posMatrix: mat4, labelPlaneMatrix: mat4, labelToScreenMatrix: mat4, showCollisionCircles: boolean, pitchWithMap: boolean, collisionGroupPredicate: (key: FeatureKey) => boolean, circlePixelDiameter: number, textPixelPadding: number): {
circles: Array<number>;
offscreen: boolean;
collisionDetected: boolean;
};
/**
* Because the geometries in the CollisionIndex are an approximation of the shape of
* symbols on the map, we use the CollisionIndex to look up the symbol part of
* `queryRenderedFeatures`.
*
* @private
*/
queryRenderedSymbols(viewportQueryGeometry: Array<Point>): {};
insertCollisionBox(collisionBox: Array<number>, ignorePlacement: boolean, bucketInstanceId: number, featureIndex: number, collisionGroupID: number): void;
insertCollisionCircles(collisionCircles: Array<number>, ignorePlacement: boolean, bucketInstanceId: number, featureIndex: number, collisionGroupID: number): void;
projectAndGetPerspectiveRatio(posMatrix: mat4, x: number, y: number): {
point: Point;
perspectiveRatio: number;
};
isOffscreen(x1: number, y1: number, x2: number, y2: number): boolean;
isInsideGrid(x1: number, y1: number, x2: number, y2: number): boolean;
getViewportMatrix(): mat4;
}
export declare type TextAnchor = "center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
export declare class OpacityState {
opacity: number;
placed: boolean;
constructor(prevState: OpacityState, increment: number, placed: boolean, skipFade?: boolean | null);
isHidden(): boolean;
}
export declare class JointOpacityState {
text: OpacityState;
icon: OpacityState;
constructor(prevState: JointOpacityState, increment: number, placedText: boolean, placedIcon: boolean, skipFade?: boolean | null);
isHidden(): boolean;
}
export declare class JointPlacement {
text: boolean;
icon: boolean;
skipFade: boolean;
constructor(text: boolean, icon: boolean, skipFade: boolean);
}
export declare class CollisionCircleArray {
invProjMatrix: mat4;
viewportMatrix: mat4;
circles: Array<number>;
constructor();
}
export declare class RetainedQueryData {
bucketInstanceId: number;
featureIndex: FeatureIndex;
sourceLayerIndex: number;
bucketIndex: number;
tileID: OverscaledTileID;
featureSortOrder: Array<number>;
constructor(bucketInstanceId: number, featureIndex: FeatureIndex, sourceLayerIndex: number, bucketIndex: number, tileID: OverscaledTileID);
}
export declare type CollisionGroup = {
ID: number;
predicate?: any;
};
export declare class CollisionGroups {
collisionGroups: {
[groupName: string]: CollisionGroup;
};
maxGroupID: number;
crossSourceCollisions: boolean;
constructor(crossSourceCollisions: boolean);
get(sourceID: string): CollisionGroup;
}
export declare type VariableOffset = {
textOffset: [
number,
number
];
width: number;
height: number;
anchor: TextAnchor;
textBoxScale: number;
prevAnchor?: TextAnchor;
};
export declare type TileLayerParameters = {
bucket: SymbolBucket;
layout: PossiblyEvaluated<SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated>;
posMatrix: mat4;
textLabelPlaneMatrix: mat4;
labelToScreenMatrix: mat4;
scale: number;
textPixelRatio: number;
holdingForFade: boolean;
collisionBoxArray: CollisionBoxArray;
partiallyEvaluatedTextSize: {
uSize: number;
uSizeT: number;
};
collisionGroup: CollisionGroup;
};
export declare type BucketPart = {
sortKey?: number | void;
symbolInstanceStart: number;
symbolInstanceEnd: number;
parameters: TileLayerParameters;
};
export declare type CrossTileID = string | number;
export declare class Placement {
transform: Transform;
collisionIndex: CollisionIndex;
placements: {
[_ in CrossTileID]: JointPlacement;
};
opacities: {
[_ in CrossTileID]: JointOpacityState;
};
variableOffsets: {
[_ in CrossTileID]: VariableOffset;
};
placedOrientations: {
[_ in CrossTileID]: number;
};
commitTime: number;
prevZoomAdjustment: number;
lastPlacementChangeTime: number;
stale: boolean;
fadeDuration: number;
retainedQueryData: {
[_: number]: RetainedQueryData;
};
collisionGroups: CollisionGroups;
prevPlacement: Placement;
zoomAtLastRecencyCheck: number;
collisionCircleArrays: {
[k in any]: CollisionCircleArray;
};
constructor(transform: Transform, fadeDuration: number, crossSourceCollisions: boolean, prevPlacement?: Placement);
getBucketParts(results: Array<BucketPart>, styleLayer: StyleLayer, tile: Tile, sortAcrossTiles: boolean): void;
attemptAnchorPlacement(anchor: TextAnchor, textBox: SingleCollisionBox, width: number, height: number, textBoxScale: number, rotateWithMap: boolean, pitchWithMap: boolean, textPixelRatio: number, posMatrix: mat4, collisionGroup: CollisionGroup, textAllowOverlap: boolean, symbolInstance: SymbolInstance, bucket: SymbolBucket, orientation: number, iconBox?: SingleCollisionBox | null): {
shift: Point;
placedGlyphBoxes: {
box: Array<number>;
offscreen: boolean;
};
};
placeLayerBucketPart(bucketPart: BucketPart, seenCrossTileIDs: {
[k in string | number]: boolean;
}, showCollisionBoxes: boolean): void;
markUsedJustification(bucket: SymbolBucket, placedAnchor: TextAnchor, symbolInstance: SymbolInstance, orientation: number): void;
markUsedOrientation(bucket: SymbolBucket, orientation: number, symbolInstance: SymbolInstance): void;
commit(now: number): void;
updateLayerOpacities(styleLayer: StyleLayer, tiles: Array<Tile>): void;
updateBucketOpacities(bucket: SymbolBucket, seenCrossTileIDs: {
[k in string | number]: boolean;
}, collisionBoxArray?: CollisionBoxArray | null): void;
symbolFadeChange(now: number): number;
zoomAdjustment(zoom: number): number;
hasTransitions(now: number): boolean;
stillRecent(now: number, zoom: number): boolean;
setStale(): void;
}
export declare class LayerPlacement {
_sortAcrossTiles: boolean;
_currentTileIndex: number;
_currentPartIndex: number;
_seenCrossTileIDs: {
[k in string | number]: boolean;
};
_bucketParts: Array<BucketPart>;
constructor(styleLayer: SymbolStyleLayer);
continuePlacement(tiles: Array<Tile>, placement: Placement, showCollisionBoxes: boolean, styleLayer: StyleLayer, shouldPausePlacement: () => boolean): boolean;
}
export declare class PauseablePlacement {
placement: Placement;
_done: boolean;
_currentPlacementIndex: number;
_forceFullPlacement: boolean;
_showCollisionBoxes: boolean;
_inProgressLayer: LayerPlacement;
constructor(transform: Transform, order: Array<string>, forceFullPlacement: boolean, showCollisionBoxes: boolean, fadeDuration: number, crossSourceCollisions: boolean, prevPlacement?: Placement);
isDone(): boolean;
continuePlacement(order: Array<string>, layers: {
[_: string]: StyleLayer;
}, layerTiles: {
[_: string]: Array<Tile>;
}): void;
commit(now: number): Placement;
}
export declare class TileLayerIndex {
tileID: OverscaledTileID;
indexedSymbolInstances: {
[_: number]: Array<{
crossTileID: number;
coord: {
x: number;
y: number;
};
}>;
};
bucketInstanceId: number;
constructor(tileID: OverscaledTileID, symbolInstances: SymbolInstanceArray, bucketInstanceId: number);
getScaledCoordinates(symbolInstance: SymbolInstance, childTileID: OverscaledTileID): {
x: number;
y: number;
};
findMatches(symbolInstances: SymbolInstanceArray, newTileID: OverscaledTileID, zoomCrossTileIDs: {
[crossTileID: number]: boolean;
}): void;
}
export declare class CrossTileIDs {
maxCrossTileID: number;
constructor();
generate(): number;
}
export declare class CrossTileSymbolLayerIndex {
indexes: {
[zoom in string | number]: {
[tileId in string | number]: TileLayerIndex;
};
};
usedCrossTileIDs: {
[zoom in string | number]: {
[crossTileID: number]: boolean;
};
};
lng: number;
constructor();
handleWrapJump(lng: number): void;
addBucket(tileID: OverscaledTileID, bucket: SymbolBucket, crossTileIDs: CrossTileIDs): boolean;
removeBucketCrossTileIDs(zoom: string | number, removedBucket: TileLayerIndex): void;
removeStaleBuckets(currentIDs: {
[k in string | number]: boolean;
}): boolean;
}
export declare class CrossTileSymbolIndex {
layerIndexes: {
[layerId: string]: CrossTileSymbolLayerIndex;
};
crossTileIDs: CrossTileIDs;
maxBucketInstanceId: number;
bucketsInCurrentPlacement: {
[_: number]: boolean;
};
constructor();
addLayer(styleLayer: StyleLayer, tiles: Array<Tile>, lng: number): boolean;
pruneUnusedLayers(usedLayers: Array<string>): void;
}
export declare type ValidationError = {
message: string;
line: number;
identifier?: string;
};
export declare type Validator = (a: any) => ReadonlyArray<ValidationError>;
export declare type StyleOptions = {
validate?: boolean;
localIdeographFontFamily?: string;
};
export declare type StyleSetterOptions = {
validate?: boolean;
};
export declare class Style extends Evented {
map: Map;
stylesheet: StyleSpecification;
dispatcher: Dispatcher;
imageManager: ImageManager;
glyphManager: GlyphManager;
lineAtlas: LineAtlas;
light: Light;
_request: Cancelable;
_spriteRequest: Cancelable;
_layers: {
[_: string]: StyleLayer;
};
_serializedLayers: {
[_: string]: any;
};
_order: Array<string>;
sourceCaches: {
[_: string]: SourceCache;
};
zoomHistory: ZoomHistory;
_loaded: boolean;
_rtlTextPluginCallback: (a: any) => any;
_changed: boolean;
_updatedSources: {
[_: string]: "clear" | "reload";
};
_updatedLayers: {
[_: string]: true;
};
_removedLayers: {
[_: string]: StyleLayer;
};
_changedImages: {
[_: string]: true;
};
_updatedPaintProps: {
[layer: string]: true;
};
_layerOrderChanged: boolean;
_availableImages: Array<string>;
crossTileSymbolIndex: CrossTileSymbolIndex;
pauseablePlacement: PauseablePlacement;
placement: Placement;
z: number;
static getSourceType: typeof getSourceType;
static setSourceType: typeof setSourceType;
static registerForPluginStateChange: typeof registerForPluginStateChange;
constructor(map: Map, options?: StyleOptions);
loadURL(url: string, options?: {
validate?: boolean;
}): void;
loadJSON(json: StyleSpecification, options?: StyleSetterOptions): void;
loadEmpty(): void;
_load(json: StyleSpecification, validate: boolean): void;
_loadSprite(url: string): void;
_validateLayer(layer: StyleLayer): void;
loaded(): boolean;
_serializeLayers(ids: Array<string>): Array<LayerSpecification>;
hasTransitions(): boolean;
_checkLoaded(): void;
/**
* Apply queued style updates in a batch and recalculate zoom-dependent paint properties.
* @private
*/
update(parameters: EvaluationParameters): void;
_updateTilesForChangedImages(): void;
_updateWorkerLayers(updatedIds: Array<string>, removedIds: Array<string>): void;
_resetUpdates(): void;
/**
* Update this style's state to match the given style JSON, performing only
* the necessary mutations.
*
* May throw an Error ('Unimplemented: METHOD') if the mapbox-gl-style-spec
* diff algorithm produces an operation that is not supported.
*
* @returns {boolean} true if any changes were made; false otherwise
* @private
*/
setState(nextState: StyleSpecification): boolean;
addImage(id: string, image: StyleImage): this;
updateImage(id: string, image: StyleImage): void;
getImage(id: string): StyleImage;
removeImage(id: string): this;
_afterImageUpdated(id: string): void;
listImages(): string[];
addSource(id: string, source: SourceSpecification, options?: StyleSetterOptions): void;
/**
* Remove a source from this stylesheet, given its id.
* @param {string} id id of the source to remove
* @throws {Error} if no source is found with the given ID
* @returns {Map} The {@link Map} object.
*/
removeSource(id: string): this;
/**
* Set the data of a GeoJSON source, given its id.
* @param {string} id id of the source
* @param {GeoJSON|string} data GeoJSON source
*/
setGeoJSONSourceData(id: string, data: GeoJSON.GeoJSON | string): void;
/**
* Get a source by id.
* @param {string} id id of the desired source
* @returns {Source | undefined} source
*/
getSource(id: string): Source | undefined;
/**
* Add a layer to the map style. The layer will be inserted before the layer with
* ID `before`, or appended if `before` is omitted.
* @param {Object | CustomLayerInterface} layerObject The style layer to add.
* @param {string} [before] ID of an existing layer to insert before
* @param {Object} options Style setter options.
* @returns {Map} The {@link Map} object.
*/
addLayer(layerObject: LayerSpecification | CustomLayerInterface, before?: string, options?: StyleSetterOptions): void;
/**
* Moves a layer to a different z-position. The layer will be inserted before the layer with
* ID `before`, or appended if `before` is omitted.
* @param {string} id ID of the layer to move
* @param {string} [before] ID of an existing layer to insert before
*/
moveLayer(id: string, before?: string): void;
/**
* Remove the layer with the given id from the style.
*
* If no such layer exists, an `error` event is fired.
*
* @param {string} id id of the layer to remove
* @fires error
*/
removeLayer(id: string): void;
/**
* Return the style layer object with the given `id`.
*
* @param {string} id - id of the desired layer
* @returns {?Object} a layer, if one with the given `id` exists
*/
getLayer(id: string): StyleLayer;
/**
* checks if a specific layer is present within the style.
*
* @param {string} id - id of the desired layer
* @returns {boolean} a boolean specifying if the given layer is present
*/
hasLayer(id: string): boolean;
setLayerZoomRange(layerId: string, minzoom?: number | null, maxzoom?: number | null): void;
setFilter(layerId: string, filter?: FilterSpecification | null, options?: StyleSetterOptions): void;
/**
* Get a layer's filter object
* @param {string} layer the layer to inspect
* @returns {*} the layer's filter, if any
*/
getFilter(layer: string): void | FilterSpecification;
setLayoutProperty(layerId: string, name: string, value: any, options?: StyleSetterOptions): void;
/**
* Get a layout property's value from a given layer
* @param {string} layerId the layer to inspect
* @param {string} name the name of the layout property
* @returns {*} the property value
*/
getLayoutProperty(layerId: string, name: string): any;
setPaintProperty(layerId: string, name: string, value: any, options?: StyleSetterOptions): void;
getPaintProperty(layer: string, name: string): unknown;
setFeatureState(target: {
source: string;
sourceLayer?: string;
id: string | number;
}, state: any): void;
removeFeatureState(target: {
source: string;
sourceLayer?: string;
id?: string | number;
}, key?: string): void;
getFeatureState(target: {
source: string;
sourceLayer?: string;
id: string | number;
}): any;
getTransition(): any;
serialize(): StyleSpecification;
_updateLayer(layer: StyleLayer): void;
_flattenAndSortRenderedFeatures(sourceResults: Array<any>): any[];
queryRenderedFeatures(queryGeometry: any, params: any, transform: Transform): any[];
querySourceFeatures(sourceID: string, params?: {
sourceLayer: string;
filter: Array<any>;
validate?: boolean;
}): any[];
addSourceType(name: string, SourceType: SourceClass, callback: Callback<void>): void;
getLight(): any;
setLight(lightOptions: LightSpecification, options?: StyleSetterOptions): void;
_validate(validate: Validator, key: string, value: any, props: any, options?: {
validate?: boolean;
}): boolean;
_remove(): void;
_clearSource(id: string): void;
_reloadSource(id: string): void;
_updateSources(transform: Transform): void;
_generateCollisionBoxes(): void;
_updatePlacement(transform: Transform, showCollisionBoxes: boolean, fadeDuration: number, crossSourceCollisions: boolean, forceFullPlacement?: boolean): boolean;
_releaseSymbolFadeTiles(): void;
getImages(mapId: string, params: {
icons: Array<string>;
source: string;
tileID: OverscaledTileID;
type: string;
}, callback: Callback<{
[_: string]: StyleImage;
}>): void;
getGlyphs(mapId: string, params: {
stacks: {
[_: string]: Array<number>;
};
}, callback: Callback<{
[_: string]: {
[_: number]: StyleGlyph;
};
}>): void;
getResource(mapId: string, params: RequestParameters, callback: ResponseCallback<any>): Cancelable;
}
export declare type RenderPass = "offscreen" | "opaque" | "translucent";
export declare type PainterOptions = {
showOverdrawInspector: boolean;
showTileBoundaries: boolean;
showPadding: boolean;
rotating: boolean;
zooming: boolean;
moving: boolean;
gpuTiming: boolean;
fadeDuration: number;
};
export declare class Painter {
context: Context;
transform: Transform;
_tileTextures: {
[_: number]: Array<Texture>;
};
numSublayers: number;
depthEpsilon: number;
emptyProgramConfiguration: ProgramConfiguration;
width: number;
height: number;
tileExtentBuffer: VertexBuffer;
tileExtentSegments: SegmentVector;
debugBuffer: VertexBuffer;
debugSegments: SegmentVector;
rasterBoundsBuffer: VertexBuffer;
rasterBoundsSegments: SegmentVector;
viewportBuffer: VertexBuffer;
viewportSegments: SegmentVector;
quadTriangleIndexBuffer: IndexBuffer;
tileBorderIndexBuffer: IndexBuffer;
_tileClippingMaskIDs: {
[_: string]: number;
};
stencilClearMode: StencilMode;
style: Style;
options: PainterOptions;
lineAtlas: LineAtlas;
imageManager: ImageManager;
glyphManager: GlyphManager;
depthRangeFor3D: DepthRangeType;
opaquePassCutoff: number;
renderPass: RenderPass;
currentLayer: number;
currentStencilSource: string;
nextStencilID: number;
id: string;
_showOverdrawInspector: boolean;
cache: {
[_: string]: Program<any>;
};
crossTileSymbolIndex: CrossTileSymbolIndex;
symbolFadeChange: number;
gpuTimers: {
[_: string]: any;
};
emptyTexture: Texture;
debugOverlayTexture: Texture;
debugOverlayCanvas: HTMLCanvasElement;
constructor(gl: WebGLRenderingContext, transform: Transform);
resize(width: number, height: number): void;
setup(): void;
clearStencil(): void;
_renderTileClippingMasks(layer: StyleLayer, tileIDs: Array<OverscaledTileID>): void;
stencilModeFor3D(): StencilMode;
stencilModeForClipping(tileID: OverscaledTileID): StencilMode;
stencilConfigForOverlap(tileIDs: Array<OverscaledTileID>): [
{
[_: number]: Readonly<StencilMode>;
},
Array<OverscaledTileID>
];
colorModeForRenderPass(): Readonly<ColorMode>;
depthModeForSublayer(n: number, mask: DepthMaskType, func?: DepthFuncType | null): Readonly<DepthMode>;
opaquePassEnabledForLayer(): boolean;
render(style: Style, options: PainterOptions): void;
renderLayer(painter: Painter, sourceCache: SourceCache, layer: StyleLayer, coords: Array<OverscaledTileID>): void;
gpuTimingStart(layer: StyleLayer): void;
gpuTimingEnd(): void;
collectGpuTimers(): {
[_: string]: any;
};
queryGpuTimers(gpuTimers: {
[_: string]: any;
}): {};
/**
* Transform a matrix to incorporate the *-translate and *-translate-anchor properties into it.
* @param inViewportPixelUnitsUnits True when the units accepted by the matrix are in viewport pixels instead of tile units.
* @returns {mat4} matrix
* @private
*/
translatePosMatrix(matrix: mat4, tile: Tile, translate: [
number,
number
], translateAnchor: "map" | "viewport", inViewportPixelUnitsUnits?: boolean): mat4;
saveTileTexture(texture: Texture): void;
getTileTexture(size: number): Texture;
/**
* Checks whether a pattern image is needed, and if it is, whether it is not loaded.
*
* @returns true if a needed image is missing and rendering needs to be skipped.
* @private
*/
isPatternMissing(image?: CrossFaded<ResolvedImage> | null): boolean;
useProgram(name: string, programConfiguration?: ProgramConfiguration | null): Program<any>;
setCustomLayerDefaults(): void;
setBaseState(): void;
initDebugOverlayCanvas(): void;
destroy(): void;
}
export declare class Hash {
_map: Map;
_updateHash: () => ReturnType<typeof setTimeout>;
_hashName: string;
constructor(hashName?: string | null);
addTo(map: Map): this;
remove(): this;
getHashString(mapFeedback?: boolean): string;
_getCurrentHash(): any;
_onHashChange(): boolean;
_updateHashUnthrottled(): void;
}
export declare class MouseHandler {
_enabled: boolean;
_active: boolean;
_lastPoint: Point;
_eventButton: number;
_moved: boolean;
_clickTolerance: number;
constructor(options: {
clickTolerance: number;
});
reset(): void;
_correctButton(e: MouseEvent, button: number): boolean;
_move(lastPoint: Point, point: Point): {};
mousedown(e: MouseEvent, point: Point): void;
mousemoveWindow(e: MouseEvent, point: Point): {};
mouseupWindow(e: MouseEvent): void;
enable(): void;
disable(): void;
isEnabled(): boolean;
isActive(): boolean;
}
export declare class MousePanHandler extends MouseHandler {
mousedown(e: MouseEvent, point: Point): void;
_correctButton(e: MouseEvent, button: number): boolean;
_move(lastPoint: Point, point: Point): {
around: Point;
panDelta: Point;
};
}
export declare class MouseRotateHandler extends MouseHandler {
_correctButton(e: MouseEvent, button: number): boolean;
_move(lastPoint: Point, point: Point): {
bearingDelta: number;
};
contextmenu(e: MouseEvent): void;
}
export declare class MousePitchHandler extends MouseHandler {
_correctButton(e: MouseEvent, button: number): boolean;
_move(lastPoint: Point, point: Point): {
pitchDelta: number;
};
contextmenu(e: MouseEvent): void;
}
export declare class TouchPanHandler {
_enabled: boolean;
_active: boolean;
_touches: {
[k in string | number]: Point;
};
_minTouches: number;
_clickTolerance: number;
_sum: Point;
constructor(options: {
clickTolerance: number;
});
reset(): void;
touchstart(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): {
around: Point;
panDelta: Point;
};
touchmove(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): {
around: Point;
panDelta: Point;
};
touchend(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): void;
touchcancel(): void;
_calculateTransform(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): {
around: Point;
panDelta: Point;
};
enable(): void;
disable(): void;
isEnabled(): boolean;
isActive(): boolean;
}
export declare type DragPanOptions = {
linearity?: number;
easing?: (t: number) => number;
deceleration?: number;
maxSpeed?: number;
};
export declare class DragPanHandler {
_el: HTMLElement;
_mousePan: MousePanHandler;
_touchPan: TouchPanHandler;
_inertiaOptions: DragPanOptions;
/**
* @private
*/
constructor(el: HTMLElement, mousePan: MousePanHandler, touchPan: TouchPanHandler);
/**
* Enables the "drag to pan" interaction.
*
* @param {Object} [options] Options object
* @param {number} [options.linearity=0] factor used to scale the drag velocity
* @param {Function} [options.easing=bezier(0, 0, 0.3, 1)] easing function applled to `map.panTo` when applying the drag.
* @param {number} [options.maxSpeed=1400] the maximum value of the drag velocity.
* @param {number} [options.deceleration=2500] the rate at which the speed reduces after the pan ends.
*
* @example
* map.dragPan.enable();
* @example
* map.dragPan.enable({
* linearity: 0.3,
* easing: bezier(0, 0, 0.3, 1),
* maxSpeed: 1400,
* deceleration: 2500,
* });
*/
enable(options?: DragPanOptions): void;
/**
* Disables the "drag to pan" interaction.
*
* @example
* map.dragPan.disable();
*/
disable(): void;
/**
* Returns a Boolean indicating whether the "drag to pan" interaction is enabled.
*
* @returns {boolean} `true` if the "drag to pan" interaction is enabled.
*/
isEnabled(): boolean;
/**
* Returns a Boolean indicating whether the "drag to pan" interaction is active, i.e. currently being used.
*
* @returns {boolean} `true` if the "drag to pan" interaction is active.
*/
isActive(): boolean;
}
export declare class HandlerInertia {
_map: Map;
_inertiaBuffer: Array<{
time: number;
settings: any;
}>;
constructor(map: Map);
clear(): void;
record(settings: any): void;
_drainInertiaBuffer(): void;
_onMoveEnd(panInertiaOptions?: DragPanOptions): any;
}
export declare type InputEvent = MouseEvent | TouchEvent | KeyboardEvent | WheelEvent;
export declare class RenderFrameEvent extends Event {
type: "renderFrame";
timeStamp: number;
}
export interface Handler {
enable(): void;
disable(): void;
isEnabled(): boolean;
isActive(): boolean;
reset(): void;
readonly touchstart?: (e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) => HandlerResult | void;
readonly touchmove?: (e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) => HandlerResult | void;
readonly touchend?: (e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) => HandlerResult | void;
readonly touchcancel?: (e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) => HandlerResult | void;
readonly mousedown?: (e: MouseEvent, point: Point) => HandlerResult | void;
readonly mousemove?: (e: MouseEvent, point: Point) => HandlerResult | void;
readonly mouseup?: (e: MouseEvent, point: Point) => HandlerResult | void;
readonly dblclick?: (e: MouseEvent, point: Point) => HandlerResult | void;
readonly wheel?: (e: WheelEvent, point: Point) => HandlerResult | void;
readonly keydown?: (e: KeyboardEvent) => HandlerResult | void;
readonly keyup?: (e: KeyboardEvent) => HandlerResult | void;
readonly renderFrame?: () => HandlerResult | void;
}
export declare type HandlerResult = {
panDelta?: Point;
zoomDelta?: number;
bearingDelta?: number;
pitchDelta?: number;
around?: Point | null;
pinchAround?: Point | null;
cameraAnimation?: (map: Map) => any;
originalEvent?: any;
needsRenderFrame?: boolean;
noInertia?: boolean;
};
export declare class HandlerManager {
_map: Map;
_el: HTMLElement;
_handlers: Array<{
handlerName: string;
handler: Handler;
allowed: any;
}>;
_eventsInProgress: any;
_frameId: number;
_inertia: HandlerInertia;
_bearingSnap: number;
_handlersById: {
[x: string]: Handler;
};
_updatingCamera: boolean;
_changes: Array<[
HandlerResult,
any,
any
]>;
_previousActiveHandlers: {
[x: string]: Handler;
};
_listeners: Array<[
Window | Document | HTMLElement,
string,
{
passive?: boolean;
capture?: boolean;
} | undefined
]>;
constructor(map: Map, options: CompleteMapOptions);
destroy(): void;
_addDefaultHandlers(options: CompleteMapOptions): void;
_add(handlerName: string, handler: Handler, allowed?: Array<string>): void;
stop(allowEndAnimation: boolean): void;
isActive(): boolean;
isZooming(): boolean;
isRotating(): boolean;
isMoving(): boolean;
_blockedByActive(activeHandlers: {
[x: string]: Handler;
}, allowed: Array<string>, myName: string): boolean;
handleWindowEvent(e: InputEvent): void;
_getMapTouches(touches: TouchList): TouchList;
handleEvent(e: InputEvent | RenderFrameEvent, eventName?: string): void;
mergeHandlerResult(mergedHandlerResult: HandlerResult, eventsInProgress: any, handlerResult: HandlerResult, name: string, e?: InputEvent): void;
_applyChanges(): void;
_updateMapTransform(combinedResult: any, combinedEventsInProgress: any, deactivatedHandlers: any): void;
_fireEvents(newEventsInProgress: {
[x: string]: any;
}, deactivatedHandlers: any, allowEndAnimation: boolean): void;
_fireEvent(type: string, e: any): void;
_requestFrame(): number;
_triggerRenderFrame(): void;
}
export declare type TaskID = number;
export declare type Task = {
callback: (timeStamp: number) => void;
id: TaskID;
cancelled: boolean;
};
export declare class TaskQueue {
_queue: Array<Task>;
_id: TaskID;
_cleared: boolean;
_currentlyRunning: Array<Task> | false;
constructor();
add(callback: (timeStamp: number) => void): TaskID;
remove(id: TaskID): void;
run(timeStamp?: number): void;
clear(): void;
}
/**
* A [Point](https://github.com/mapbox/point-geometry) or an array of two numbers representing `x` and `y` screen coordinates in pixels.
*
* @typedef {(Point | [number, number])} PointLike
* @example
* var p1 = new Point(-77, 38); // a PointLike which is a Point
* var p2 = [-77, 38]; // a PointLike which is an array of two numbers
*/
export declare type PointLike = Point | [
number,
number
];
export declare type RequireAtLeastOne<T> = {
[K in keyof T]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<keyof T, K>>>;
}[keyof T];
/**
* Options common to {@link Map#jumpTo}, {@link Map#easeTo}, and {@link Map#flyTo}, controlling the desired location,
* zoom, bearing, and pitch of the camera. All properties are optional, and when a property is omitted, the current
* camera value for that property will remain unchanged.
*
* @typedef {Object} CameraOptions
* @property {LngLatLike} center The desired center.
* @property {number} zoom The desired zoom level.
* @property {number} bearing The desired bearing in degrees. The bearing is the compass direction that
* is "up". For example, `bearing: 90` orients the map so that east is up.
* @property {number} pitch The desired pitch in degrees. The pitch is the angle towards the horizon
* measured in degrees with a range between 0 and 60 degrees. For example, pitch: 0 provides the appearance
* of looking straight down at the map, while pitch: 60 tilts the user's perspective towards the horizon.
* Increasing the pitch value is often used to display 3D objects.
* @property {LngLatLike} around If `zoom` is specified, `around` determines the point around which the zoom is centered.
* @property {PaddingOptions} padding Dimensions in pixels applied on each side of the viewport for shifting the vanishing point.
* @example
* // set the map's initial perspective with CameraOptions
* var map = new maplibregl.Map({
* container: 'map',
* style: 'https://demotiles.maplibre.org/style.json',
* center: [-73.5804, 45.53483],
* pitch: 60,
* bearing: -60,
* zoom: 10
* });
* @see [Set pitch and bearing](https://maplibre.org/maplibre-gl-js-docs/example/set-perspective/)
* @see [Jump to a series of locations](https://maplibre.org/maplibre-gl-js-docs/example/jump-to/)
* @see [Fly to a location](https://maplibre.org/maplibre-gl-js-docs/example/flyto/)
* @see [Display buildings in 3D](https://maplibre.org/maplibre-gl-js-docs/example/3d-buildings/)
*/
export declare type CameraOptions = CenterZoomBearing & {
pitch?: number;
around?: LngLatLike;
};
export declare type CenterZoomBearing = {
center?: LngLatLike;
zoom?: number;
bearing?: number;
};
export declare type JumpToOptions = CameraOptions & {
padding?: PaddingOptions;
};
export declare type CameraForBoundsOptions = CameraOptions & {
padding?: number | RequireAtLeastOne<PaddingOptions>;
offset?: PointLike;
maxZoom?: number;
};
export declare type FlyToOptions = AnimationOptions & CameraOptions & {
curve?: number;
minZoom?: number;
speed?: number;
screenSpeed?: number;
maxDuration?: number;
padding?: number | RequireAtLeastOne<PaddingOptions>;
};
export declare type EaseToOptions = AnimationOptions & CameraOptions & {
delayEndEvents?: number;
padding?: number | RequireAtLeastOne<PaddingOptions>;
};
export declare type FitBoundsOptions = FlyToOptions & {
linear?: boolean;
offset?: PointLike;
maxZoom?: number;
maxDuration?: number;
padding?: number | RequireAtLeastOne<PaddingOptions>;
};
/**
* Options common to map movement methods that involve animation, such as {@link Map#panBy} and
* {@link Map#easeTo}, controlling the duration and easing function of the animation. All properties
* are optional.
*
* @typedef {Object} AnimationOptions
* @property {number} duration The animation's duration, measured in milliseconds.
* @property {Function} easing A function taking a time in the range 0..1 and returning a number where 0 is
* the initial state and 1 is the final state.
* @property {PointLike} offset of the target center relative to real map container center at the end of animation.
* @property {boolean} animate If `false`, no animation will occur.
* @property {boolean} essential If `true`, then the animation is considered essential and will not be affected by
* [`prefers-reduced-motion`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion).
*/
export declare type AnimationOptions = {
duration?: number;
easing?: (_: number) => number;
offset?: PointLike;
animate?: boolean;
essential?: boolean;
};
declare abstract class Camera extends Evented {
transform: Transform;
_moving: boolean;
_zooming: boolean;
_rotating: boolean;
_pitching: boolean;
_padding: boolean;
_bearingSnap: number;
_easeStart: number;
_easeOptions: {
duration?: number;
easing?: (_: number) => number;
};
_easeId: string | void;
_onEaseFrame: (_: number) => void;
_onEaseEnd: (easeId?: string) => void;
_easeFrameId: TaskID;
abstract _requestRenderFrame(a: () => void): TaskID;
abstract _cancelRenderFrame(_: TaskID): void;
constructor(transform: Transform, options: {
bearingSnap: number;
});
/**
* Returns the map's geographical centerpoint.
*
* @memberof Map#
* @returns The map's geographical centerpoint.
* @example
* // return a LngLat object such as {lng: 0, lat: 0}
* var center = map.getCenter();
* // access longitude and latitude values directly
* var {lng, lat} = map.getCenter();
*/
getCenter(): LngLat;
/**
* Sets the map's geographical centerpoint. Equivalent to `jumpTo({center: center})`.
*
* @memberof Map#
* @param center The centerpoint to set.
* @param eventData Additional properties to be added to event objects of events triggered by this method.
* @fires movestart
* @fires moveend
* @returns {Map} `this`
* @example
* map.setCenter([-74, 38]);
*/
setCenter(center: LngLatLike, eventData?: any): this;
/**
* Pans the map by the specified offset.
*
* @memberof Map#
* @param offset `x` and `y` coordinates by which to pan the map.
* @param options Options object
* @param eventData Additional properties to be added to event objects of events triggered by this method.
* @fires movestart
* @fires moveend
* @returns {Map} `this`
* @see [Navigate the map with game-like controls](https://maplibre.org/maplibre-gl-js-docs/example/game-controls/)
*/
panBy(offset: PointLike, options?: AnimationOptions, eventData?: any): this;
/**
* Pans the map to the specified location with an animated transition.
*
* @memberof Map#
* @param lnglat The location to pan the map to.
* @param options Options describing the destination and animation of the transition.
* @param eventData Additional properties to be added to event objects of events triggered by this method.
* @fires movestart
* @fires moveend
* @returns {Map} `this`
* @example
* map.panTo([-74, 38]);
* @example
* // Specify that the panTo animation should last 5000 milliseconds.
* map.panTo([-74, 38], {duration: 5000});
* @see [Update a feature in realtime](https://maplibre.org/maplibre-gl-js-docs/example/live-update-feature/)
*/
panTo(lnglat: LngLatLike, options?: AnimationOptions, eventData?: any): this;
/**
* Returns the map's current zoom level.
*
* @memberof Map#
* @returns The map's current zoom level.
* @example
* map.getZoom();
*/
getZoom(): number;
/**
* Sets the map's zoom level. Equivalent to `jumpTo({zoom: zoom})`.
*
* @memberof Map#
* @param zoom The zoom level to set (0-20).
* @param eventData Additional properties to be added to event objects of events triggered by this method.
* @fires movestart
* @fires zoomstart
* @fires move
* @fires zoom
* @fires moveend
* @fires zoomend
* @returns {Map} `this`
* @example
* // Zoom to the zoom level 5 without an animated transition
* map.setZoom(5);
*/
setZoom(zoom: number, eventData?: any): this;
/**
* Zooms the map to the specified zoom level, with an animated transition.
*
* @memberof Map#
* @param zoom The zoom level to transition to.
* @param options Options object
* @param eventData Additional properties to be added to event objects of events triggered by this method.
* @fires movestart
* @fires zoomstart
* @fires move
* @fires zoom
* @fires moveend
* @fires zoomend
* @returns {Map} `this`
* @example
* // Zoom to the zoom level 5 without an animated transition
* map.zoomTo(5);
* // Zoom to the zoom level 8 with an animated transition
* map.zoomTo(8, {
* duration: 2000,
* offset: [100, 50]
* });
*/
zoomTo(zoom: number, options?: AnimationOptions | null, eventData?: any): this;
/**
* Increases the map's zoom level by 1.
*
* @memberof Map#
* @param options Options object
* @param eventData Additional properties to be added to event objects of events triggered by this method.
* @fires movestart
* @fires zoomstart
* @fires move
* @fires zoom
* @fires moveend
* @fires zoomend
* @returns {Map} `this`
* @example
* // zoom the map in one level with a custom animation duration
* map.zoomIn({duration: 1000});
*/
zoomIn(options?: AnimationOptions, eventData?: any): this;
/**
* Decreases the map's zoom level by 1.
*
* @memberof Map#
* @param options Options object
* @param eventData Additional properties to be added to event objects of events triggered by this method.
* @fires movestart
* @fires zoomstart
* @fires move
* @fires zoom
* @fires moveend
* @fires zoomend
* @returns {Map} `this`
* @example
* // zoom the map out one level with a custom animation offset
* map.zoomOut({offset: [80, 60]});
*/
zoomOut(options?: AnimationOptions, eventData?: any): this;
/**
* Returns the map's current bearing. The bearing is the compass direction that is "up"; for example, a bearing
* of 90° orients the map so that east is up.
*
* @memberof Map#
* @returns The map's current bearing.
* @see [Navigate the map with game-like controls](https://maplibre.org/maplibre-gl-js-docs/example/game-controls/)
*/
getBearing(): number;
/**
* Sets the map's bearing (rotation). The bearing is the compass direction that is "up"; for example, a bearing
* of 90° orients the map so that east is up.
*
* Equivalent to `jumpTo({bearing: bearing})`.
*
* @memberof Map#
* @param bearing The desired bearing.
* @param eventData Additional properties to be added to event objects of events triggered by this method.
* @fires movestart
* @fires moveend
* @returns {Map} `this`
* @example
* // rotate the map to 90 degrees
* map.setBearing(90);
*/
setBearing(bearing: number, eventData?: any): this;
/**
* Returns the current padding applied around the map viewport.
*
* @memberof Map#
* @returns The current padding around the map viewport.
*/
getPadding(): PaddingOptions;
/**
* Sets the padding in pixels around the viewport.
*
* Equivalent to `jumpTo({padding: padding})`.
*
* @memberof Map#
* @param padding The desired padding. Format: { left: number, right: number, top: number, bottom: number }
* @param eventData Additional properties to be added to event objects of events triggered by this method.
* @fires movestart
* @fires moveend
* @returns {Map} `this`
* @example
* // Sets a left padding of 300px, and a top padding of 50px
* map.setPadding({ left: 300, top: 50 });
*/
setPadding(padding: PaddingOptions, eventData?: any): this;
/**
* Rotates the map to the specified bearing, with an animated transition. The bearing is the compass direction
* that is \"up\"; for example, a bearing of 90° orients the map so that east is up.
*
* @memberof Map#
* @param bearing The desired bearing.
* @param options Options object
* @param eventData Additional properties to be added to event objects of events triggered by this method.
* @fires movestart
* @fires moveend
* @returns {Map} `this`
*/
rotateTo(bearing: number, options?: AnimationOptions, eventData?: any): this;
/**
* Rotates the map so that north is up (0° bearing), with an animated transition.
*
* @memberof Map#
* @param options Options object
* @param eventData Additional properties to be added to event objects of events triggered by this method.
* @fires movestart
* @fires moveend
* @returns {Map} `this`
*/
resetNorth(options?: AnimationOptions, eventData?: any): this;
/**
* Rotates and pitches the map so that north is up (0° bearing) and pitch is 0°, with an animated transition.
*
* @memberof Map#
* @param options Options object
* @param eventData Additional properties to be added to event objects of events triggered by this method.
* @fires movestart
* @fires moveend
* @returns {Map} `this`
*/
resetNorthPitch(options?: AnimationOptions, eventData?: any): this;
/**
* Snaps the map so that north is up (0° bearing), if the current bearing is close enough to it (i.e. within the
* `bearingSnap` threshold).
*
* @memberof Map#
* @param options Options object
* @param eventData Additional properties to be added to event objects of events triggered by this method.
* @fires movestart
* @fires moveend
* @returns {Map} `this`
*/
snapToNorth(options?: AnimationOptions, eventData?: any): this;
/**
* Returns the map's current pitch (tilt).
*
* @memberof Map#
* @returns The map's current pitch, measured in degrees away from the plane of the screen.
*/
getPitch(): number;
/**
* Sets the map's pitch (tilt). Equivalent to `jumpTo({pitch: pitch})`.
*
* @memberof Map#
* @param pitch The pitch to set, measured in degrees away from the plane of the screen (0-60).
* @param eventData Additional properties to be added to event objects of events triggered by this method.
* @fires pitchstart
* @fires movestart
* @fires moveend
* @returns {Map} `this`
*/
setPitch(pitch: number, eventData?: any): this;
/**
* @memberof Map#
* @param {LngLatBoundsLike} bounds Calculate the center for these bounds in the viewport and use
* the highest zoom level up to and including `Map#getMaxZoom()` that fits
* in the viewport. LngLatBounds represent a box that is always axis-aligned with bearing 0.
* @param options Options object
* @param {number | PaddingOptions} [options.padding] The amount of padding in pixels to add to the given bounds.
* @param {number} [options.bearing=0] Desired map bearing at end of animation, in degrees.
* @param {PointLike} [options.offset=[0, 0]] The center of the given bounds relative to the map's center, measured in pixels.
* @param {number} [options.maxZoom] The maximum zoom level to allow when the camera would transition to the specified bounds.
* @returns {CenterZoomBearing} If map is able to fit to provided bounds, returns `center`, `zoom`, and `bearing`.
* If map is unable to fit, method will warn and return undefined.
* @example
* var bbox = [[-79, 43], [-73, 45]];
* var newCameraTransform = map.cameraForBounds(bbox, {
* padding: {top: 10, bottom:25, left: 15, right: 5}
* });
*/
cameraForBounds(bounds: LngLatBoundsLike, options?: CameraForBoundsOptions): CenterZoomBearing;
/**
* Calculate the center of these two points in the viewport and use
* the highest zoom level up to and including `Map#getMaxZoom()` that fits
* the points in the viewport at the specified bearing.
* @memberof Map#
* @param {LngLatLike} p0 First point
* @param {LngLatLike} p1 Second point
* @param bearing Desired map bearing at end of animation, in degrees
* @param options
* @param {number | PaddingOptions} [options.padding] The amount of padding in pixels to add to the given bounds.
* @param {PointLike} [options.offset=[0, 0]] The center of the given bounds relative to the map's center, measured in pixels.
* @param {number} [options.maxZoom] The maximum zoom level to allow when the camera would transition to the specified bounds.
* @returns {CenterZoomBearing} If map is able to fit to provided bounds, returns `center`, `zoom`, and `bearing`.
* If map is unable to fit, method will warn and return undefined.
* @private
* @example
* var p0 = [-79, 43];
* var p1 = [-73, 45];
* var bearing = 90;
* var newCameraTransform = map._cameraForBoxAndBearing(p0, p1, bearing, {
* padding: {top: 10, bottom:25, left: 15, right: 5}
* });
*/
_cameraForBoxAndBearing(p0: LngLatLike, p1: LngLatLike, bearing: number, options?: CameraForBoundsOptions): CenterZoomBearing;
/**
* Pans and zooms the map to contain its visible area within the specified geographical bounds.
* This function will also reset the map's bearing to 0 if bearing is nonzero.
*
* @memberof Map#
* @param bounds Center these bounds in the viewport and use the highest
* zoom level up to and including `Map#getMaxZoom()` that fits them in the viewport.
* @param {FitBoundsOptions} [options] Options supports all properties from {@link AnimationOptions} and {@link CameraOptions} in addition to the fields below.
* @param {number | PaddingOptions} [options.padding] The amount of padding in pixels to add to the given bounds.
* @param {boolean} [options.linear=false] If `true`, the map transitions using
* {@link Map#easeTo}. If `false`, the map transitions using {@link Map#flyTo}. See
* those functions and {@link AnimationOptions} for information about options available.
* @param {Function} [options.easing] An easing function for the animated transition. See {@link AnimationOptions}.
* @param {PointLike} [options.offset=[0, 0]] The center of the given bounds relative to the map's center, measured in pixels.
* @param {number} [options.maxZoom] The maximum zoom level to allow when the map view transitions to the specified bounds.
* @param {Object} [eventData] Additional properties to be added to event objects of events triggered by this method.
* @fires movestart
* @fires moveend
* @returns {Map} `this`
* @example
* var bbox = [[-79, 43], [-73, 45]];
* map.fitBounds(bbox, {
* padding: {top: 10, bottom:25, left: 15, right: 5}
* });
* @see [Fit a map to a bounding box](https://maplibre.org/maplibre-gl-js-docs/example/fitbounds/)
*/
fitBounds(bounds: LngLatBoundsLike, options?: FitBoundsOptions, eventData?: any): this;
/**
* Pans, rotates and zooms the map to to fit the box made by points p0 and p1
* once the map is rotated to the specified bearing. To zoom without rotating,
* pass in the current map bearing.
*
* @memberof Map#
* @param p0 First point on screen, in pixel coordinates
* @param p1 Second point on screen, in pixel coordinates
* @param bearing Desired map bearing at end of animation, in degrees
* @param options Options object
* @param {number | PaddingOptions} [options.padding] The amount of padding in pixels to add to the given bounds.
* @param {boolean} [options.linear=false] If `true`, the map transitions using
* {@link Map#easeTo}. If `false`, the map transitions using {@link Map#flyTo}. See
* those functions and {@link AnimationOptions} for information about options available.
* @param {Function} [options.easing] An easing function for the animated transition. See {@link AnimationOptions}.
* @param {PointLike} [options.offset=[0, 0]] The center of the given bounds relative to the map's center, measured in pixels.
* @param {number} [options.maxZoom] The maximum zoom level to allow when the map view transitions to the specified bounds.
* @param eventData Additional properties to be added to event objects of events triggered by this method.
* @fires movestart
* @fires moveend
* @returns {Map} `this`
* @example
* var p0 = [220, 400];
* var p1 = [500, 900];
* map.fitScreenCoordinates(p0, p1, map.getBearing(), {
* padding: {top: 10, bottom:25, left: 15, right: 5}
* });
* @see Used by {@link BoxZoomHandler}
*/
fitScreenCoordinates(p0: PointLike, p1: PointLike, bearing: number, options?: FitBoundsOptions, eventData?: any): this;
_fitInternal(calculatedOptions?: CenterZoomBearing, options?: FitBoundsOptions, eventData?: any): this;
/**
* Changes any combination of center, zoom, bearing, and pitch, without
* an animated transition. The map will retain its current values for any
* details not specified in `options`.
*
* @memberof Map#
* @param options Options object
* @param eventData Additional properties to be added to event objects of events triggered by this method.
* @fires movestart
* @fires zoomstart
* @fires pitchstart
* @fires rotate
* @fires move
* @fires zoom
* @fires pitch
* @fires moveend
* @fires zoomend
* @fires pitchend
* @returns {Map} `this`
* @example
* // jump to coordinates at current zoom
* map.jumpTo({center: [0, 0]});
* // jump with zoom, pitch, and bearing options
* map.jumpTo({
* center: [0, 0],
* zoom: 8,
* pitch: 45,
* bearing: 90
* });
* @see [Jump to a series of locations](https://maplibre.org/maplibre-gl-js-docs/example/jump-to/)
* @see [Update a feature in realtime](https://maplibre.org/maplibre-gl-js-docs/example/live-update-feature/)
*/
jumpTo(options: JumpToOptions, eventData?: any): this;
/**
* Changes any combination of `center`, `zoom`, `bearing`, `pitch`, and `padding` with an animated transition
* between old and new values. The map will retain its current values for any
* details not specified in `options`.
*
* Note: The transition will happen instantly if the user has enabled
* the `reduced motion` accesibility feature enabled in their operating system,
* unless `options` includes `essential: true`.
*
* @memberof Map#
* @param options Options describing the destination and animation of the transition.
* Accepts {@link CameraOptions} and {@link AnimationOptions}.
* @param eventData Additional properties to be added to event objects of events triggered by this method.
* @fires movestart
* @fires zoomstart
* @fires pitchstart
* @fires rotate
* @fires move
* @fires zoom
* @fires pitch
* @fires moveend
* @fires zoomend
* @fires pitchend
* @returns {Map} `this`
* @see [Navigate the map with game-like controls](https://maplibre.org/maplibre-gl-js-docs/example/game-controls/)
*/
easeTo(options: EaseToOptions & {
easeId?: string;
noMoveStart?: boolean;
}, eventData?: any): this;
_prepareEase(eventData: any, noMoveStart: boolean, currently?: any): void;
_fireMoveEvents(eventData?: any): void;
_afterEase(eventData?: any, easeId?: string): void;
/**
* Changes any combination of center, zoom, bearing, and pitch, animating the transition along a curve that
* evokes flight. The animation seamlessly incorporates zooming and panning to help
* the user maintain her bearings even after traversing a great distance.
*
* Note: The animation will be skipped, and this will behave equivalently to `jumpTo`
* if the user has the `reduced motion` accesibility feature enabled in their operating system,
* unless 'options' includes `essential: true`.
*
* @memberof Map#
* @param {FlyToOptions} options Options describing the destination and animation of the transition.
* Accepts {@link CameraOptions}, {@link AnimationOptions},
* and the following additional options.
* @param {number} [options.curve=1.42] The zooming "curve" that will occur along the
* flight path. A high value maximizes zooming for an exaggerated animation, while a low
* value minimizes zooming for an effect closer to {@link Map#easeTo}. 1.42 is the average
* value selected by participants in the user study discussed in
* [van Wijk (2003)](https://www.win.tue.nl/~vanwijk/zoompan.pdf). A value of
* `Math.pow(6, 0.25)` would be equivalent to the root mean squared average velocity. A
* value of 1 would produce a circular motion.
* @param {number} [options.minZoom] The zero-based zoom level at the peak of the flight path. If
* `options.curve` is specified, this option is ignored.
* @param {number} [options.speed=1.2] The average speed of the animation defined in relation to
* `options.curve`. A speed of 1.2 means that the map appears to move along the flight path
* by 1.2 times `options.curve` screenfuls every second. A _screenful_ is the map's visible span.
* It does not correspond to a fixed physical distance, but varies by zoom level.
* @param {number} [options.screenSpeed] The average speed of the animation measured in screenfuls
* per second, assuming a linear timing curve. If `options.speed` is specified, this option is ignored.
* @param {number} [options.maxDuration] The animation's maximum duration, measured in milliseconds.
* If duration exceeds maximum duration, it resets to 0.
* @param eventData Additional properties to be added to event objects of events triggered by this method.
* @fires movestart
* @fires zoomstart
* @fires pitchstart
* @fires move
* @fires zoom
* @fires rotate
* @fires pitch
* @fires moveend
* @fires zoomend
* @fires pitchend
* @returns {Map} `this`
* @example
* // fly with default options to null island
* map.flyTo({center: [0, 0], zoom: 9});
* // using flyTo options
* map.flyTo({
* center: [0, 0],
* zoom: 9,
* speed: 0.2,
* curve: 1,
* easing(t) {
* return t;
* }
* });
* @see [Fly to a location](https://maplibre.org/maplibre-gl-js-docs/example/flyto/)
* @see [Slowly fly to a location](https://maplibre.org/maplibre-gl-js-docs/example/flyto-options/)
* @see [Fly to a location based on scroll position](https://maplibre.org/maplibre-gl-js-docs/example/scroll-fly-to/)
*/
flyTo(options: FlyToOptions, eventData?: any): this;
isEasing(): boolean;
/**
* Stops any animated transition underway.
*
* @memberof Map#
* @returns {Map} `this`
*/
stop(): this;
_stop(allowGestures?: boolean, easeId?: string): this;
_ease(frame: (_: number) => void, finish: () => void, options: {
animate?: boolean;
duration?: number;
easing?: (_: number) => number;
}): void;
_renderFrameCallback(): void;
_normalizeBearing(bearing: number, currentBearing: number): number;
_normalizeCenter(center: LngLat): void;
}
export declare class ScrollZoomHandler {
_map: Map;
_el: HTMLElement;
_enabled: boolean;
_active: boolean;
_zooming: boolean;
_aroundCenter: boolean;
_around: LngLat;
_aroundPoint: Point;
_type: "wheel" | "trackpad" | null;
_lastValue: number;
_timeout: ReturnType<typeof setTimeout>;
_finishTimeout: ReturnType<typeof setTimeout>;
_lastWheelEvent: any;
_lastWheelEventTime: number;
_startZoom: number;
_targetZoom: number;
_delta: number;
_easing: ((a: number) => number);
_prevEase: {
start: number;
duration: number;
easing: (_: number) => number;
};
_frameId: boolean;
_handler: HandlerManager;
_defaultZoomRate: number;
_wheelZoomRate: number;
/**
* @private
*/
constructor(map: Map, handler: HandlerManager);
/**
* Set the zoom rate of a trackpad
* @param {number} [zoomRate=1/100] The rate used to scale trackpad movement to a zoom value.
* @example
* // Speed up trackpad zoom
* map.scrollZoom.setZoomRate(1/25);
*/
setZoomRate(zoomRate: number): void;
/**
* Set the zoom rate of a mouse wheel
* @param {number} [wheelZoomRate=1/450] The rate used to scale mouse wheel movement to a zoom value.
* @example
* // Slow down zoom of mouse wheel
* map.scrollZoom.setWheelZoomRate(1/600);
*/
setWheelZoomRate(wheelZoomRate: number): void;
/**
* Returns a Boolean indicating whether the "scroll to zoom" interaction is enabled.
*
* @returns {boolean} `true` if the "scroll to zoom" interaction is enabled.
*/
isEnabled(): boolean;
isActive(): boolean;
isZooming(): boolean;
/**
* Enables the "scroll to zoom" interaction.
*
* @param {Object} [options] Options object.
* @param {string} [options.around] If "center" is passed, map will zoom around center of map
*
* @example
* map.scrollZoom.enable();
* @example
* map.scrollZoom.enable({ around: 'center' })
*/
enable(options?: any): void;
/**
* Disables the "scroll to zoom" interaction.
*
* @example
* map.scrollZoom.disable();
*/
disable(): void;
wheel(e: WheelEvent): void;
_onTimeout(initialEvent: any): void;
_start(e: any): void;
renderFrame(): {
noInertia: boolean;
needsRenderFrame: boolean;
zoomDelta: number;
around: Point;
originalEvent: any;
};
_smoothOutEasing(duration: number): (t: number) => number;
reset(): void;
}
export declare class BoxZoomHandler {
_map: Map;
_el: HTMLElement;
_container: HTMLElement;
_enabled: boolean;
_active: boolean;
_startPos: Point;
_lastPos: Point;
_box: HTMLElement;
_clickTolerance: number;
/**
* @private
*/
constructor(map: Map, options: {
clickTolerance: number;
});
/**
* Returns a Boolean indicating whether the "box zoom" interaction is enabled.
*
* @returns {boolean} `true` if the "box zoom" interaction is enabled.
*/
isEnabled(): boolean;
/**
* Returns a Boolean indicating whether the "box zoom" interaction is active, i.e. currently being used.
*
* @returns {boolean} `true` if the "box zoom" interaction is active.
*/
isActive(): boolean;
/**
* Enables the "box zoom" interaction.
*
* @example
* map.boxZoom.enable();
*/
enable(): void;
/**
* Disables the "box zoom" interaction.
*
* @example
* map.boxZoom.disable();
*/
disable(): void;
mousedown(e: MouseEvent, point: Point): void;
mousemoveWindow(e: MouseEvent, point: Point): void;
mouseupWindow(e: MouseEvent, point: Point): {
cameraAnimation: (map: any) => any;
};
keydown(e: KeyboardEvent): void;
reset(): void;
_fireEvent(type: string, e: any): Map;
}
export declare class TwoTouchHandler {
_enabled: boolean;
_active: boolean;
_firstTwoTouches: [
number,
number
];
_vector: Point;
_startVector: Point;
_aroundCenter: boolean;
constructor();
reset(): void;
_start(points: [
Point,
Point
]): void;
_move(points: [
Point,
Point
], pinchAround: Point, e: TouchEvent): {};
touchstart(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): void;
touchmove(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): {};
touchend(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): void;
touchcancel(): void;
enable(options?: {
around?: "center";
} | null): void;
disable(): void;
isEnabled(): boolean;
isActive(): boolean;
}
export declare class TouchZoomHandler extends TwoTouchHandler {
_distance: number;
_startDistance: number;
reset(): void;
_start(points: [
Point,
Point
]): void;
_move(points: [
Point,
Point
], pinchAround: Point): {
zoomDelta: number;
pinchAround: Point;
};
}
export declare class TouchRotateHandler extends TwoTouchHandler {
_minDiameter: number;
reset(): void;
_start(points: [
Point,
Point
]): void;
_move(points: [
Point,
Point
], pinchAround: Point): {
bearingDelta: number;
pinchAround: Point;
};
_isBelowThreshold(vector: Point): boolean;
}
export declare class TouchPitchHandler extends TwoTouchHandler {
_valid: boolean | void;
_firstMove: number;
_lastPoints: [
Point,
Point
];
reset(): void;
_start(points: [
Point,
Point
]): void;
_move(points: [
Point,
Point
], center: Point, e: TouchEvent): {
pitchDelta: number;
};
gestureBeginsVertically(vectorA: Point, vectorB: Point, timeStamp: number): boolean | void;
}
export declare class DragRotateHandler {
_mouseRotate: MouseRotateHandler;
_mousePitch: MousePitchHandler;
_pitchWithRotate: boolean;
/**
* @param {Object} [options]
* @param {number} [options.bearingSnap] The threshold, measured in degrees, that determines when the map's
* bearing will snap to north.
* @param {bool} [options.pitchWithRotate=true] Control the map pitch in addition to the bearing
* @private
*/
constructor(options: {
pitchWithRotate: boolean;
}, mouseRotate: MouseRotateHandler, mousePitch: MousePitchHandler);
/**
* Enables the "drag to rotate" interaction.
*
* @example
* map.dragRotate.enable();
*/
enable(): void;
/**
* Disables the "drag to rotate" interaction.
*
* @example
* map.dragRotate.disable();
*/
disable(): void;
/**
* Returns a Boolean indicating whether the "drag to rotate" interaction is enabled.
*
* @returns {boolean} `true` if the "drag to rotate" interaction is enabled.
*/
isEnabled(): boolean;
/**
* Returns a Boolean indicating whether the "drag to rotate" interaction is active, i.e. currently being used.
*
* @returns {boolean} `true` if the "drag to rotate" interaction is active.
*/
isActive(): boolean;
}
export declare class KeyboardHandler {
_enabled: boolean;
_active: boolean;
_panStep: number;
_bearingStep: number;
_pitchStep: number;
_rotationDisabled: boolean;
/**
* @private
*/
constructor();
reset(): void;
keydown(e: KeyboardEvent): {
cameraAnimation: (map: Map) => void;
};
/**
* Enables the "keyboard rotate and zoom" interaction.
*
* @example
* map.keyboard.enable();
*/
enable(): void;
/**
* Disables the "keyboard rotate and zoom" interaction.
*
* @example
* map.keyboard.disable();
*/
disable(): void;
/**
* Returns a Boolean indicating whether the "keyboard rotate and zoom"
* interaction is enabled.
*
* @returns {boolean} `true` if the "keyboard rotate and zoom"
* interaction is enabled.
*/
isEnabled(): boolean;
/**
* Returns true if the handler is enabled and has detected the start of a
* zoom/rotate gesture.
*
* @returns {boolean} `true` if the handler is enabled and has detected the
* start of a zoom/rotate gesture.
*/
isActive(): boolean;
/**
* Disables the "keyboard pan/rotate" interaction, leaving the
* "keyboard zoom" interaction enabled.
*
* @example
* map.keyboard.disableRotation();
*/
disableRotation(): void;
/**
* Enables the "keyboard pan/rotate" interaction.
*
* @example
* map.keyboard.enable();
* map.keyboard.enableRotation();
*/
enableRotation(): void;
}
export declare class ClickZoomHandler {
_enabled: boolean;
_active: boolean;
constructor();
reset(): void;
dblclick(e: MouseEvent, point: Point): {
cameraAnimation: (map: Map) => void;
};
enable(): void;
disable(): void;
isEnabled(): boolean;
isActive(): boolean;
}
export declare class SingleTapRecognizer {
numTouches: number;
centroid: Point;
startTime: number;
aborted: boolean;
touches: {
[k in number | string]: Point;
};
constructor(options: {
numTouches: number;
});
reset(): void;
touchstart(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): void;
touchmove(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): void;
touchend(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): Point;
}
export declare class TapRecognizer {
singleTap: SingleTapRecognizer;
numTaps: number;
lastTime: number;
lastTap: Point;
count: number;
constructor(options: {
numTaps: number;
numTouches: number;
});
reset(): void;
touchstart(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): void;
touchmove(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): void;
touchend(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): Point;
}
export declare class TapZoomHandler {
_enabled: boolean;
_active: boolean;
_zoomIn: TapRecognizer;
_zoomOut: TapRecognizer;
constructor();
reset(): void;
touchstart(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): void;
touchmove(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): void;
touchend(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): {
cameraAnimation: (map: Map) => Map;
};
touchcancel(): void;
enable(): void;
disable(): void;
isEnabled(): boolean;
isActive(): boolean;
}
export declare class DoubleClickZoomHandler {
_clickZoom: ClickZoomHandler;
_tapZoom: TapZoomHandler;
/**
* @private
*/
constructor(clickZoom: ClickZoomHandler, TapZoom: TapZoomHandler);
/**
* Enables the "double click to zoom" interaction.
*
* @example
* map.doubleClickZoom.enable();
*/
enable(): void;
/**
* Disables the "double click to zoom" interaction.
*
* @example
* map.doubleClickZoom.disable();
*/
disable(): void;
/**
* Returns a Boolean indicating whether the "double click to zoom" interaction is enabled.
*
* @returns {boolean} `true` if the "double click to zoom" interaction is enabled.
*/
isEnabled(): boolean;
/**
* Returns a Boolean indicating whether the "double click to zoom" interaction is active, i.e. currently being used.
*
* @returns {boolean} `true` if the "double click to zoom" interaction is active.
*/
isActive(): boolean;
}
export declare class TapDragZoomHandler {
_enabled: boolean;
_active: boolean;
_swipePoint: Point;
_swipeTouch: number;
_tapTime: number;
_tap: TapRecognizer;
constructor();
reset(): void;
touchstart(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): void;
touchmove(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): {
zoomDelta: number;
};
touchend(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): void;
touchcancel(): void;
enable(): void;
disable(): void;
isEnabled(): boolean;
isActive(): boolean;
}
export declare class TouchZoomRotateHandler {
_el: HTMLElement;
_touchZoom: TouchZoomHandler;
_touchRotate: TouchRotateHandler;
_tapDragZoom: TapDragZoomHandler;
_rotationDisabled: boolean;
_enabled: boolean;
/**
* @private
*/
constructor(el: HTMLElement, touchZoom: TouchZoomHandler, touchRotate: TouchRotateHandler, tapDragZoom: TapDragZoomHandler);
/**
* Enables the "pinch to rotate and zoom" interaction.
*
* @param {Object} [options] Options object.
* @param {string} [options.around] If "center" is passed, map will zoom around the center
*
* @example
* map.touchZoomRotate.enable();
* @example
* map.touchZoomRotate.enable({ around: 'center' });
*/
enable(options?: {
around?: "center";
} | null): void;
/**
* Disables the "pinch to rotate and zoom" interaction.
*
* @example
* map.touchZoomRotate.disable();
*/
disable(): void;
/**
* Returns a Boolean indicating whether the "pinch to rotate and zoom" interaction is enabled.
*
* @returns {boolean} `true` if the "pinch to rotate and zoom" interaction is enabled.
*/
isEnabled(): boolean;
/**
* Returns true if the handler is enabled and has detected the start of a zoom/rotate gesture.
*
* @returns {boolean} //eslint-disable-line
*/
isActive(): boolean;
/**
* Disables the "pinch to rotate" interaction, leaving the "pinch to zoom"
* interaction enabled.
*
* @example
* map.touchZoomRotate.disableRotation();
*/
disableRotation(): void;
/**
* Enables the "pinch to rotate" interaction.
*
* @example
* map.touchZoomRotate.enable();
* map.touchZoomRotate.enableRotation();
*/
enableRotation(): void;
}
export declare type ControlPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";
/**
* Interface for interactive controls added to the map. This is a
* specification for implementers to model: it is not
* an exported method or class.
*
* Controls must implement `onAdd` and `onRemove`, and must own an
* element, which is often a `div` element. To use MapLibre GL JS's
* default control styling, add the `maplibregl-ctrl` class to your control's
* node.
*
* @interface IControl
* @example
* // Control implemented as ES6 class
* class HelloWorldControl {
* onAdd(map) {
* this._map = map;
* this._container = document.createElement('div');
* this._container.className = 'maplibregl-ctrl';
* this._container.textContent = 'Hello, world';
* return this._container;
* }
*
* onRemove() {
* this._container.parentNode.removeChild(this._container);
* this._map = undefined;
* }
* }
*
* // Control implemented as ES5 prototypical class
* function HelloWorldControl() { }
*
* HelloWorldControl.prototype.onAdd = function(map) {
* this._map = map;
* this._container = document.createElement('div');
* this._container.className = 'maplibregl-ctrl';
* this._container.textContent = 'Hello, world';
* return this._container;
* };
*
* HelloWorldControl.prototype.onRemove = function () {
* this._container.parentNode.removeChild(this._container);
* this._map = undefined;
* };
*/
export interface IControl {
/**
* Register a control on the map and give it a chance to register event listeners
* and resources. This method is called by {@link Map#addControl}
* internally.
*
* @function
* @memberof IControl
* @instance
* @name onAdd
* @param {Map} map the Map this control will be added to
* @returns {HTMLElement} The control's container element. This should
* be created by the control and returned by onAdd without being attached
* to the DOM: the map will insert the control's element into the DOM
* as necessary.
*/
onAdd(map: Map): HTMLElement;
/**
* Unregister a control on the map and give it a chance to detach event listeners
* and resources. This method is called by {@link Map#removeControl}
* internally.
*
* @function
* @memberof IControl
* @instance
* @name onRemove
* @param {Map} map the Map this control will be removed from
* @returns {undefined} there is no required return value for this method
*/
onRemove(map: Map): void;
/**
* Optionally provide a default position for this control. If this method
* is implemented and {@link Map#addControl} is called without the `position`
* parameter, the value returned by getDefaultPosition will be used as the
* control's position.
*
* @function
* @memberof IControl
* @instance
* @name getDefaultPosition
* @returns {ControlPosition} a control position, one of the values valid in addControl.
*/
readonly getDefaultPosition?: () => ControlPosition;
}
export declare type MapOptions = {
hash?: boolean | string;
interactive?: boolean;
container: HTMLElement | string;
bearingSnap?: number;
attributionControl?: boolean;
customAttribution?: string | Array<string>;
logoPosition?: ControlPosition;
failIfMajorPerformanceCaveat?: boolean;
preserveDrawingBuffer?: boolean;
antialias?: boolean;
refreshExpiredTiles?: boolean;
maxBounds?: LngLatBoundsLike;
scrollZoom?: boolean;
minZoom?: number | null;
maxZoom?: number | null;
minPitch?: number | null;
maxPitch?: number | null;
boxZoom?: boolean;
dragRotate?: boolean;
dragPan?: DragPanOptions | boolean;
keyboard?: boolean;
doubleClickZoom?: boolean;
touchZoomRotate?: boolean;
touchPitch?: boolean;
trackResize?: boolean;
center?: LngLatLike;
zoom?: number;
bearing?: number;
pitch?: number;
renderWorldCopies?: boolean;
maxTileCacheSize?: number;
transformRequest?: RequestTransformFunction;
locale?: any;
fadeDuration?: number;
crossSourceCollisions?: boolean;
collectResourceTiming?: boolean;
clickTolerance?: number;
bounds?: LngLatBoundsLike;
fitBoundsOptions?: Object;
localIdeographFontFamily?: string;
style: StyleSpecification | string;
pitchWithRotate?: boolean;
};
export declare type Complete<T> = {
[P in keyof Required<T>]: Pick<T, P> extends Required<Pick<T, P>> ? T[P] : (T[P] | undefined);
};
export declare type CompleteMapOptions = Complete<MapOptions>;
export declare class Map extends Camera {
style: Style;
painter: Painter;
handlers: HandlerManager;
_container: HTMLElement;
_canvasContainer: HTMLElement;
_controlContainer: HTMLElement;
_controlPositions: {
[_: string]: HTMLElement;
};
_interactive: boolean;
_showTileBoundaries: boolean;
_showCollisionBoxes: boolean;
_showPadding: boolean;
_showOverdrawInspector: boolean;
_repaint: boolean;
_vertices: boolean;
_canvas: HTMLCanvasElement;
_maxTileCacheSize: number;
_frame: Cancelable;
_styleDirty: boolean;
_sourcesDirty: boolean;
_placementDirty: boolean;
_loaded: boolean;
_fullyLoaded: boolean;
_trackResize: boolean;
_preserveDrawingBuffer: boolean;
_failIfMajorPerformanceCaveat: boolean;
_antialias: boolean;
_refreshExpiredTiles: boolean;
_hash: Hash;
_delegatedListeners: any;
_fadeDuration: number;
_crossSourceCollisions: boolean;
_crossFadingFactor: number;
_collectResourceTiming: boolean;
_renderTaskQueue: TaskQueue;
_controls: Array<IControl>;
_mapId: number;
_localIdeographFontFamily: string;
_requestManager: RequestManager;
_locale: any;
_removed: boolean;
_clickTolerance: number;
/**
* The map's {@link ScrollZoomHandler}, which implements zooming in and out with a scroll wheel or trackpad.
* Find more details and examples using `scrollZoom` in the {@link ScrollZoomHandler} section.
*/
scrollZoom: ScrollZoomHandler;
/**
* The map's {@link BoxZoomHandler}, which implements zooming using a drag gesture with the Shift key pressed.
* Find more details and examples using `boxZoom` in the {@link BoxZoomHandler} section.
*/
boxZoom: BoxZoomHandler;
/**
* The map's {@link DragRotateHandler}, which implements rotating the map while dragging with the right
* mouse button or with the Control key pressed. Find more details and examples using `dragRotate`
* in the {@link DragRotateHandler} section.
*/
dragRotate: DragRotateHandler;
/**
* The map's {@link DragPanHandler}, which implements dragging the map with a mouse or touch gesture.
* Find more details and examples using `dragPan` in the {@link DragPanHandler} section.
*/
dragPan: DragPanHandler;
/**
* The map's {@link KeyboardHandler}, which allows the user to zoom, rotate, and pan the map using keyboard
* shortcuts. Find more details and examples using `keyboard` in the {@link KeyboardHandler} section.
*/
keyboard: KeyboardHandler;
/**
* The map's {@link DoubleClickZoomHandler}, which allows the user to zoom by double clicking.
* Find more details and examples using `doubleClickZoom` in the {@link DoubleClickZoomHandler} section.
*/
doubleClickZoom: DoubleClickZoomHandler;
/**
* The map's {@link TouchZoomRotateHandler}, which allows the user to zoom or rotate the map with touch gestures.
* Find more details and examples using `touchZoomRotate` in the {@link TouchZoomRotateHandler} section.
*/
touchZoomRotate: TouchZoomRotateHandler;
/**
* The map's {@link TouchPitchHandler}, which allows the user to pitch the map with touch gestures.
* Find more details and examples using `touchPitch` in the {@link TouchPitchHandler} section.
*/
touchPitch: TouchPitchHandler;
constructor(options: MapOptions);
_getMapId(): number;
/**
* Adds an {@link IControl} to the map, calling `control.onAdd(this)`.
*
* @param {IControl} control The {@link IControl} to add.
* @param {string} [position] position on the map to which the control will be added.
* Valid values are `'top-left'`, `'top-right'`, `'bottom-left'`, and `'bottom-right'`. Defaults to `'top-right'`.
* @returns {Map} `this`
* @example
* // Add zoom and rotation controls to the map.
* map.addControl(new maplibregl.NavigationControl());
* @see [Display map navigation controls](https://maplibre.org/maplibre-gl-js-docs/example/navigation/)
*/
addControl(control: IControl, position?: ControlPosition): this;
/**
* Removes the control from the map.
*
* @param {IControl} control The {@link IControl} to remove.
* @returns {Map} `this`
* @example
* // Define a new navigation control.
* var navigation = new maplibregl.NavigationControl();
* // Add zoom and rotation controls to the map.
* map.addControl(navigation);
* // Remove zoom and rotation controls from the map.
* map.removeControl(navigation);
*/
removeControl(control: IControl): this;
/**
* Checks if a control exists on the map.
*
* @param {IControl} control The {@link IControl} to check.
* @returns {boolean} True if map contains control.
* @example
* // Define a new navigation control.
* var navigation = new maplibregl.NavigationControl();
* // Add zoom and rotation controls to the map.
* map.addControl(navigation);
* // Check that the navigation control exists on the map.
* map.hasControl(navigation);
*/
hasControl(control: IControl): boolean;
/**
* Resizes the map according to the dimensions of its
* `container` element.
*
* Checks if the map container size changed and updates the map if it has changed.
* This method must be called after the map's `container` is resized programmatically
* or when the map is shown after being initially hidden with CSS.
*
* @param eventData Additional properties to be passed to `movestart`, `move`, `resize`, and `moveend`
* events that get triggered as a result of resize. This can be useful for differentiating the
* source of an event (for example, user-initiated or programmatically-triggered events).
* @returns {Map} `this`
* @example
* // Resize the map when the map container is shown
* // after being initially hidden with CSS.
* var mapDiv = document.getElementById('map');
* if (mapDiv.style.visibility === true) map.resize();
*/
resize(eventData?: any): this;
/**
* Returns the map's geographical bounds. When the bearing or pitch is non-zero, the visible region is not
* an axis-aligned rectangle, and the result is the smallest bounds that encompasses the visible region.
* @returns {LngLatBounds} The geographical bounds of the map as {@link LngLatBounds}.
* @example
* var bounds = map.getBounds();
*/
getBounds(): LngLatBounds;
/**
* Returns the maximum geographical bounds the map is constrained to, or `null` if none set.
* @returns The map object.
* @example
* var maxBounds = map.getMaxBounds();
*/
getMaxBounds(): LngLatBounds | null;
/**
* Sets or clears the map's geographical bounds.
*
* Pan and zoom operations are constrained within these bounds.
* If a pan or zoom is performed that would
* display regions outside these bounds, the map will
* instead display a position and zoom level
* as close as possible to the operation's request while still
* remaining within the bounds.
*
* @param {LngLatBoundsLike | null | undefined} bounds The maximum bounds to set. If `null` or `undefined` is provided, the function removes the map's maximum bounds.
* @returns {Map} `this`
* @example
* // Define bounds that conform to the `LngLatBoundsLike` object.
* var bounds = [
* [-74.04728, 40.68392], // [west, south]
* [-73.91058, 40.87764] // [east, north]
* ];
* // Set the map's max bounds.
* map.setMaxBounds(bounds);
*/
setMaxBounds(bounds: LngLatBoundsLike): this;
/**
* Sets or clears the map's minimum zoom level.
* If the map's current zoom level is lower than the new minimum,
* the map will zoom to the new minimum.
*
* It is not always possible to zoom out and reach the set `minZoom`.
* Other factors such as map height may restrict zooming. For example,
* if the map is 512px tall it will not be possible to zoom below zoom 0
* no matter what the `minZoom` is set to.
*
* @param {number | null | undefined} minZoom The minimum zoom level to set (-2 - 24).
* If `null` or `undefined` is provided, the function removes the current minimum zoom (i.e. sets it to -2).
* @returns {Map} `this`
* @example
* map.setMinZoom(12.25);
*/
setMinZoom(minZoom?: number | null): this;
/**
* Returns the map's minimum allowable zoom level.
*
* @returns {number} minZoom
* @example
* var minZoom = map.getMinZoom();
*/
getMinZoom(): number;
/**
* Sets or clears the map's maximum zoom level.
* If the map's current zoom level is higher than the new maximum,
* the map will zoom to the new maximum.
*
* @param {number | null | undefined} maxZoom The maximum zoom level to set.
* If `null` or `undefined` is provided, the function removes the current maximum zoom (sets it to 22).
* @returns {Map} `this`
* @example
* map.setMaxZoom(18.75);
*/
setMaxZoom(maxZoom?: number | null): this;
/**
* Returns the map's maximum allowable zoom level.
*
* @returns {number} maxZoom
* @example
* var maxZoom = map.getMaxZoom();
*/
getMaxZoom(): number;
/**
* Sets or clears the map's minimum pitch.
* If the map's current pitch is lower than the new minimum,
* the map will pitch to the new minimum.
*
* @param {number | null | undefined} minPitch The minimum pitch to set (0-85). Values greater than 60 degrees are experimental and may result in rendering issues. If you encounter any, please raise an issue with details in the MapLibre project.
* If `null` or `undefined` is provided, the function removes the current minimum pitch (i.e. sets it to 0).
* @returns {Map} `this`
*/
setMinPitch(minPitch?: number | null): this;
/**
* Returns the map's minimum allowable pitch.
*
* @returns {number} minPitch
*/
getMinPitch(): number;
/**
* Sets or clears the map's maximum pitch.
* If the map's current pitch is higher than the new maximum,
* the map will pitch to the new maximum.
*
* @param {number | null | undefined} maxPitch The maximum pitch to set (0-85). Values greater than 60 degrees are experimental and may result in rendering issues. If you encounter any, please raise an issue with details in the MapLibre project.
* If `null` or `undefined` is provided, the function removes the current maximum pitch (sets it to 60).
* @returns {Map} `this`
*/
setMaxPitch(maxPitch?: number | null): this;
/**
* Returns the map's maximum allowable pitch.
*
* @returns {number} maxPitch
*/
getMaxPitch(): number;
/**
* Returns the state of `renderWorldCopies`. If `true`, multiple copies of the world will be rendered side by side beyond -180 and 180 degrees longitude. If set to `false`:
* - When the map is zoomed out far enough that a single representation of the world does not fill the map's entire
* container, there will be blank space beyond 180 and -180 degrees longitude.
* - Features that cross 180 and -180 degrees longitude will be cut in two (with one portion on the right edge of the
* map and the other on the left edge of the map) at every zoom level.
* @returns {boolean} renderWorldCopies
* @example
* var worldCopiesRendered = map.getRenderWorldCopies();
* @see [Render world copies](https://maplibre.org/maplibre-gl-js-docs/example/render-world-copies/)
*/
getRenderWorldCopies(): boolean;
/**
* Sets the state of `renderWorldCopies`.
*
* @param {boolean} renderWorldCopies If `true`, multiple copies of the world will be rendered side by side beyond -180 and 180 degrees longitude. If set to `false`:
* - When the map is zoomed out far enough that a single representation of the world does not fill the map's entire
* container, there will be blank space beyond 180 and -180 degrees longitude.
* - Features that cross 180 and -180 degrees longitude will be cut in two (with one portion on the right edge of the
* map and the other on the left edge of the map) at every zoom level.
*
* `undefined` is treated as `true`, `null` is treated as `false`.
* @returns {Map} `this`
* @example
* map.setRenderWorldCopies(true);
* @see [Render world copies](https://maplibre.org/maplibre-gl-js-docs/example/render-world-copies/)
*/
setRenderWorldCopies(renderWorldCopies?: boolean | null): this;
/**
* Returns a [Point](https://github.com/mapbox/point-geometry) representing pixel coordinates, relative to the map's `container`,
* that correspond to the specified geographical location.
*
* @param {LngLatLike} lnglat The geographical location to project.
* @returns {Point} The [Point](https://github.com/mapbox/point-geometry) corresponding to `lnglat`, relative to the map's `container`.
* @example
* var coordinate = [-122.420679, 37.772537];
* var point = map.project(coordinate);
*/
project(lnglat: LngLatLike): Point;
/**
* Returns a {@link LngLat} representing geographical coordinates that correspond
* to the specified pixel coordinates.
*
* @param {PointLike} point The pixel coordinates to unproject.
* @returns {LngLat} The {@link LngLat} corresponding to `point`.
* @example
* map.on('click', function(e) {
* // When the map is clicked, get the geographic coordinate.
* var coordinate = map.unproject(e.point);
* });
*/
unproject(point: PointLike): LngLat;
/**
* Returns true if the map is panning, zooming, rotating, or pitching due to a camera animation or user gesture.
* @returns {boolean} True if the map is moving.
* @example
* var isMoving = map.isMoving();
*/
isMoving(): boolean;
/**
* Returns true if the map is zooming due to a camera animation or user gesture.
* @returns {boolean} True if the map is zooming.
* @example
* var isZooming = map.isZooming();
*/
isZooming(): boolean;
/**
* Returns true if the map is rotating due to a camera animation or user gesture.
* @returns {boolean} True if the map is rotating.
* @example
* map.isRotating();
*/
isRotating(): boolean;
_createDelegatedListener(type: MapEvent, layerId: any, listener: any): {
layer: any;
listener: any;
delegates: {
mousemove: (e: any) => void;
mouseout: (e: any) => void;
};
} | {
layer: any;
listener: any;
delegates: {
[x: string]: (e: any) => void;
mousemove?: undefined;
mouseout?: undefined;
};
};
/**
* Adds a listener for events of a specified type, optionally limited to features in a specified style layer.
*
* @param {string} type The event type to listen for. Events compatible with the optional `layerId` parameter are triggered
* when the cursor enters a visible portion of the specified layer from outside that layer or outside the map canvas.
*
* | Event | Compatible with `layerId` |
* |-----------------------------------------------------------|---------------------------|
* | [`mousedown`](#map.event:mousedown) | yes |
* | [`mouseup`](#map.event:mouseup) | yes |
* | [`mouseover`](#map.event:mouseover) | yes |
* | [`mouseout`](#map.event:mouseout) | yes |
* | [`mousemove`](#map.event:mousemove) | yes |
* | [`mouseenter`](#map.event:mouseenter) | yes (required) |
* | [`mouseleave`](#map.event:mouseleave) | yes (required) |
* | [`click`](#map.event:click) | yes |
* | [`dblclick`](#map.event:dblclick) | yes |
* | [`contextmenu`](#map.event:contextmenu) | yes |
* | [`touchstart`](#map.event:touchstart) | yes |
* | [`touchend`](#map.event:touchend) | yes |
* | [`touchcancel`](#map.event:touchcancel) | yes |
* | [`wheel`](#map.event:wheel) | |
* | [`resize`](#map.event:resize) | |
* | [`remove`](#map.event:remove) | |
* | [`touchmove`](#map.event:touchmove) | |
* | [`movestart`](#map.event:movestart) | |
* | [`move`](#map.event:move) | |
* | [`moveend`](#map.event:moveend) | |
* | [`dragstart`](#map.event:dragstart) | |
* | [`drag`](#map.event:drag) | |
* | [`dragend`](#map.event:dragend) | |
* | [`zoomstart`](#map.event:zoomstart) | |
* | [`zoom`](#map.event:zoom) | |
* | [`zoomend`](#map.event:zoomend) | |
* | [`rotatestart`](#map.event:rotatestart) | |
* | [`rotate`](#map.event:rotate) | |
* | [`rotateend`](#map.event:rotateend) | |
* | [`pitchstart`](#map.event:pitchstart) | |
* | [`pitch`](#map.event:pitch) | |
* | [`pitchend`](#map.event:pitchend) | |
* | [`boxzoomstart`](#map.event:boxzoomstart) | |
* | [`boxzoomend`](#map.event:boxzoomend) | |
* | [`boxzoomcancel`](#map.event:boxzoomcancel) | |
* | [`webglcontextlost`](#map.event:webglcontextlost) | |
* | [`webglcontextrestored`](#map.event:webglcontextrestored) | |
* | [`load`](#map.event:load) | |
* | [`render`](#map.event:render) | |
* | [`idle`](#map.event:idle) | |
* | [`error`](#map.event:error) | |
* | [`data`](#map.event:data) | |
* | [`styledata`](#map.event:styledata) | |
* | [`sourcedata`](#map.event:sourcedata) | |
* | [`dataloading`](#map.event:dataloading) | |
* | [`styledataloading`](#map.event:styledataloading) | |
* | [`sourcedataloading`](#map.event:sourcedataloading) | |
* | [`styleimagemissing`](#map.event:styleimagemissing) | |
*
* @param {string | Listener} layerIdOrListener The ID of a style layer or a listener if no ID is provided. Event will only be triggered if its location
* is within a visible feature in this layer. The event will have a `features` property containing
* an array of the matching features. If `layerIdOrListener` is not supplied, the event will not have a `features` property.
* Please note that many event types are not compatible with the optional `layerIdOrListener` parameter.
* @param {Function} listener The function to be called when the event is fired.
* @returns {Map} `this`
* @example
* // Set an event listener that will fire
* // when the map has finished loading
* map.on('load', function() {
* // Once the map has finished loading,
* // add a new layer
* map.addLayer({
* id: 'points-of-interest',
* source: {
* type: 'vector',
* url: 'https://maplibre.org/maplibre-gl-js-docs/style-spec/'
* },
* 'source-layer': 'poi_label',
* type: 'circle',
* paint: {
* // MapLibre Style Specification paint properties
* },
* layout: {
* // MapLibre Style Specification layout properties
* }
* });
* });
* @example
* // Set an event listener that will fire
* // when a feature on the countries layer of the map is clicked
* map.on('click', 'countries', function(e) {
* new maplibregl.Popup()
* .setLngLat(e.lngLat)
* .setHTML(`Country name: ${e.features[0].properties.name}`)
* .addTo(map);
* });
* @see [Display popup on click](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-click/)
* @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js-docs/example/center-on-symbol/)
* @see [Create a hover effect](https://maplibre.org/maplibre-gl-js-docs/example/hover-styles/)
* @see [Create a draggable marker](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
*/
on<T extends keyof MapLayerEventType>(type: T, layer: string, listener: (ev: MapLayerEventType[T] & Object) => void): this;
on<T extends keyof MapEventType>(type: T, listener: (ev: MapEventType[T] & Object) => void): this;
on(type: MapEvent, listener: Listener): this;
/**
* Adds a listener that will be called only once to a specified event type.
*
* @method
* @name once
* @memberof Map
* @instance
* @param {string} type The event type to add a listener for.
* @param {Function} listener The function to be called when the event is fired.
* The listener function is called with the data object passed to `fire`,
* extended with `target` and `type` properties.
* @returns {Map} `this`
*/
/**
* Adds a listener that will be called only once to a specified event type occurring on features in a specified style layer.
*
* @param {string} type The event type to listen for; one of `'mousedown'`, `'mouseup'`, `'click'`, `'dblclick'`,
* `'mousemove'`, `'mouseenter'`, `'mouseleave'`, `'mouseover'`, `'mouseout'`, `'contextmenu'`, `'touchstart'`,
* `'touchend'`, or `'touchcancel'`. `mouseenter` and `mouseover` events are triggered when the cursor enters
* a visible portion of the specified layer from outside that layer or outside the map canvas. `mouseleave`
* and `mouseout` events are triggered when the cursor leaves a visible portion of the specified layer, or leaves
* the map canvas.
* @param {string} layerIdOrListener The ID of a style layer or a listener if no ID is provided. Only events whose location is within a visible
* feature in this layer will trigger the listener. The event will have a `features` property containing
* an array of the matching features.
* @param {Function} listener The function to be called when the event is fired.
* @returns {Map} `this`
*/
once<T extends keyof MapLayerEventType>(type: T, layer: string, listener: (ev: MapLayerEventType[T] & Object) => void): this;
once<T extends keyof MapEventType>(type: T, listener: (ev: MapEventType[T] & Object) => void): this;
once(type: MapEvent, listener: Listener): this;
/**
* Removes an event listener previously added with `Map#on`.
*
* @method
* @name off
* @memberof Map
* @instance
* @param {string} type The event type previously used to install the listener.
* @param {Function} listener The function previously installed as a listener.
* @returns {Map} `this`
*/
/**
* Removes an event listener for layer-specific events previously added with `Map#on`.
*
* @param {string} type The event type previously used to install the listener.
* @param {string} layerIdOrListener The layer ID or listener previously used to install the listener.
* @param {Function} listener The function previously installed as a listener.
* @returns {Map} `this`
*/
off<T extends keyof MapLayerEventType>(type: T, layer: string, listener: (ev: MapLayerEventType[T] & Object) => void): this;
off<T extends keyof MapEventType>(type: T, listener: (ev: MapEventType[T] & Object) => void): this;
off(type: MapEvent, listener: Listener): this;
/**
* Returns an array of [GeoJSON](http://geojson.org/)
* [Feature objects](https://tools.ietf.org/html/rfc7946#section-3.2)
* representing visible features that satisfy the query parameters.
*
* @param {PointLike|Array<PointLike>} [geometry] - The geometry of the query region:
* either a single point or southwest and northeast points describing a bounding box.
* Omitting this parameter (i.e. calling {@link Map#queryRenderedFeatures} with zero arguments,
* or with only a `options` argument) is equivalent to passing a bounding box encompassing the entire
* map viewport.
* @param {Object} [options] Options object.
* @param {Array<string>} [options.layers] An array of [style layer IDs](https://maplibre.org/maplibre-gl-js-docs/style-spec/#layer-id) for the query to inspect.
* Only features within these layers will be returned. If this parameter is undefined, all layers will be checked.
* @param {Array} [options.filter] A [filter](https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#filter)
* to limit query results.
* @param {boolean} [options.validate=true] Whether to check if the [options.filter] conforms to the MapLibre GL Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
*
* @returns {Array<Object>} An array of [GeoJSON](http://geojson.org/)
* [feature objects](https://tools.ietf.org/html/rfc7946#section-3.2).
*
* The `properties` value of each returned feature object contains the properties of its source feature. For GeoJSON sources, only
* string and numeric property values are supported (i.e. `null`, `Array`, and `Object` values are not supported).
*
* Each feature includes top-level `layer`, `source`, and `sourceLayer` properties. The `layer` property is an object
* representing the style layer to which the feature belongs. Layout and paint properties in this object contain values
* which are fully evaluated for the given zoom level and feature.
*
* Only features that are currently rendered are included. Some features will **not** be included, like:
*
* - Features from layers whose `visibility` property is `"none"`.
* - Features from layers whose zoom range excludes the current zoom level.
* - Symbol features that have been hidden due to text or icon collision.
*
* Features from all other layers are included, including features that may have no visible
* contribution to the rendered result; for example, because the layer's opacity or color alpha component is set to
* 0.
*
* The topmost rendered feature appears first in the returned array, and subsequent features are sorted by
* descending z-order. Features that are rendered multiple times (due to wrapping across the antimeridian at low
* zoom levels) are returned only once (though subject to the following caveat).
*
* Because features come from tiled vector data or GeoJSON data that is converted to tiles internally, feature
* geometries may be split or duplicated across tile boundaries and, as a result, features may appear multiple
* times in query results. For example, suppose there is a highway running through the bounding rectangle of a query.
* The results of the query will be those parts of the highway that lie within the map tiles covering the bounding
* rectangle, even if the highway extends into other tiles, and the portion of the highway within each map tile
* will be returned as a separate feature. Similarly, a point feature near a tile boundary may appear in multiple
* tiles due to tile buffering.
*
* @example
* // Find all features at a point
* var features = map.queryRenderedFeatures(
* [20, 35],
* { layers: ['my-layer-name'] }
* );
*
* @example
* // Find all features within a static bounding box
* var features = map.queryRenderedFeatures(
* [[10, 20], [30, 50]],
* { layers: ['my-layer-name'] }
* );
*
* @example
* // Find all features within a bounding box around a point
* var width = 10;
* var height = 20;
* var features = map.queryRenderedFeatures([
* [point.x - width / 2, point.y - height / 2],
* [point.x + width / 2, point.y + height / 2]
* ], { layers: ['my-layer-name'] });
*
* @example
* // Query all rendered features from a single layer
* var features = map.queryRenderedFeatures({ layers: ['my-layer-name'] });
* @see [Get features under the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/queryrenderedfeatures/)
*/
queryRenderedFeatures(geometry?: PointLike | [
PointLike,
PointLike
], options?: any): any[];
/**
* Returns an array of [GeoJSON](http://geojson.org/)
* [Feature objects](https://tools.ietf.org/html/rfc7946#section-3.2)
* representing features within the specified vector tile or GeoJSON source that satisfy the query parameters.
*
* @param {string} sourceId The ID of the vector tile or GeoJSON source to query.
* @param {Object} [parameters] Options object.
* @param {string} [parameters.sourceLayer] The name of the source layer
* to query. *For vector tile sources, this parameter is required.* For GeoJSON sources, it is ignored.
* @param {Array} [parameters.filter] A [filter](https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#filter)
* to limit query results.
* @param {boolean} [parameters.validate=true] Whether to check if the [parameters.filter] conforms to the MapLibre GL Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
*
* @returns {Array<Object>} An array of [GeoJSON](http://geojson.org/)
* [Feature objects](https://tools.ietf.org/html/rfc7946#section-3.2).
*
* In contrast to {@link Map#queryRenderedFeatures}, this function returns all features matching the query parameters,
* whether or not they are rendered by the current style (i.e. visible). The domain of the query includes all currently-loaded
* vector tiles and GeoJSON source tiles: this function does not check tiles outside the currently
* visible viewport.
*
* Because features come from tiled vector data or GeoJSON data that is converted to tiles internally, feature
* geometries may be split or duplicated across tile boundaries and, as a result, features may appear multiple
* times in query results. For example, suppose there is a highway running through the bounding rectangle of a query.
* The results of the query will be those parts of the highway that lie within the map tiles covering the bounding
* rectangle, even if the highway extends into other tiles, and the portion of the highway within each map tile
* will be returned as a separate feature. Similarly, a point feature near a tile boundary may appear in multiple
* tiles due to tile buffering.
*
* @example
* // Find all features in one source layer in a vector source
* var features = map.querySourceFeatures('your-source-id', {
* sourceLayer: 'your-source-layer'
* });
*
*/
querySourceFeatures(sourceId: string, parameters?: {
sourceLayer: string;
filter: Array<any>;
validate?: boolean;
} | null): any[];
/**
* Updates the map's MapLibre style object with a new value.
*
* If a style is already set when this is used and options.diff is set to true, the map renderer will attempt to compare the given style
* against the map's current state and perform only the changes necessary to make the map style match the desired state. Changes in sprites
* (images used for icons and patterns) and glyphs (fonts for label text) **cannot** be diffed. If the sprites or fonts used in the current
* style and the given style are different in any way, the map renderer will force a full update, removing the current style and building
* the given one from scratch.
*
*
* @param style A JSON object conforming to the schema described in the
* [MapLibre Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/), or a URL to such JSON.
* @param {Object} [options] Options object.
* @param {boolean} [options.diff=true] If false, force a 'full' update, removing the current style
* and building the given one instead of attempting a diff-based update.
* @param {string} [options.localIdeographFontFamily='sans-serif'] Defines a CSS
* font-family for locally overriding generation of glyphs in the 'CJK Unified Ideographs', 'Hiragana', 'Katakana' and 'Hangul Syllables' ranges.
* In these ranges, font settings from the map's style will be ignored, except for font-weight keywords (light/regular/medium/bold).
* Set to `false`, to enable font settings from the map's style for these glyph ranges.
* Forces a full update.
* @returns {Map} `this`
*
* @example
* map.setStyle("https://demotiles.maplibre.org/style.json");
*
*/
setStyle(style: StyleSpecification | string | null, options?: {
diff?: boolean;
} & StyleOptions): this;
/**
* Updates the requestManager's transform request with a new function
*
* @param transformRequest A callback run before the Map makes a request for an external URL. The callback can be used to modify the url, set headers, or set the credentials property for cross-origin requests.
* Expected to return an object with a `url` property and optionally `headers` and `credentials` properties
*
* @returns {Map} `this`
*
* @example
* map.setTransformRequest((url: string, resourceType: string) => {});
*/
setTransformRequest(transformRequest: RequestTransformFunction): this;
_getUIString(key: string): any;
_updateStyle(style: StyleSpecification | string | null, options?: {
diff?: boolean;
} & StyleOptions): this;
_lazyInitEmptyStyle(): void;
_diffStyle(style: StyleSpecification | string, options?: {
diff?: boolean;
} & StyleOptions): void;
_updateDiff(style: StyleSpecification, options?: {
diff?: boolean;
} & StyleOptions): void;
/**
* Returns the map's MapLibre style object, a JSON object which can be used to recreate the map's style.
*
* @returns {Object} The map's style JSON object.
*
* @example
* var styleJson = map.getStyle();
*
*/
getStyle(): StyleSpecification;
/**
* Returns a Boolean indicating whether the map's style is fully loaded.
*
* @returns {boolean} A Boolean indicating whether the style is fully loaded.
*
* @example
* var styleLoadStatus = map.isStyleLoaded();
*/
isStyleLoaded(): boolean | void;
/**
* Adds a source to the map's style.
*
* @param {string} id The ID of the source to add. Must not conflict with existing sources.
* @param {Object} source The source object, conforming to the
* MapLibre Style Specification's [source definition](https://maplibre.org/maplibre-gl-js-docs/style-spec/#sources) or
* {@link CanvasSourceOptions}.
* @fires source.add
* @returns {Map} `this`
* @example
* map.addSource('my-data', {
* type: 'vector',
* url: 'https://demotiles.maplibre.org/tiles/tiles.json'
* });
* @example
* map.addSource('my-data', {
* "type": "geojson",
* "data": {
* "type": "Feature",
* "geometry": {
* "type": "Point",
* "coordinates": [-77.0323, 38.9131]
* },
* "properties": {
* "title": "Mapbox DC",
* "marker-symbol": "monument"
* }
* }
* });
* @see GeoJSON source: [Add live realtime data](https://maplibre.org/maplibre-gl-js-docs/example/live-geojson/)
*/
addSource(id: string, source: SourceSpecification): this;
/**
* Returns a Boolean indicating whether the source is loaded. Returns `true` if the source with
* the given ID in the map's style has no outstanding network requests, otherwise `false`.
*
* @param {string} id The ID of the source to be checked.
* @returns {boolean} A Boolean indicating whether the source is loaded.
* @example
* var sourceLoaded = map.isSourceLoaded('bathymetry-data');
*/
isSourceLoaded(id: string): boolean;
/**
* Returns a Boolean indicating whether all tiles in the viewport from all sources on
* the style are loaded.
*
* @returns {boolean} A Boolean indicating whether all tiles are loaded.
* @example
* var tilesLoaded = map.areTilesLoaded();
*/
areTilesLoaded(): boolean;
/**
* Adds a [custom source type](#Custom Sources), making it available for use with
* {@link Map#addSource}.
* @private
* @param {string} name The name of the source type; source definition objects use this name in the `{type: ...}` field.
* @param {Function} SourceType A {@link Source} constructor.
* @param {Callback<void>} callback Called when the source type is ready or with an error argument if there is an error.
*/
addSourceType(name: string, SourceType: any, callback: Callback<void>): void;
/**
* Removes a source from the map's style.
*
* @param {string} id The ID of the source to remove.
* @returns {Map} `this`
* @example
* map.removeSource('bathymetry-data');
*/
removeSource(id: string): this;
/**
* Returns the source with the specified ID in the map's style.
*
* This method is often used to update a source using the instance members for the relevant
* source type as defined in [Sources](#sources).
* For example, setting the `data` for a GeoJSON source or updating the `url` and `coordinates`
* of an image source.
*
* @param {string} id The ID of the source to get.
* @returns {Source | undefined} The style source with the specified ID or `undefined` if the ID
* corresponds to no existing sources.
* The shape of the object varies by source type.
* A list of options for each source type is available on the MapLibre Style Specification's
* [Sources](https://maplibre.org/maplibre-gl-js-docs/style-spec/sources/) page.
* @example
* var sourceObject = map.getSource('points');
* @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
* @see [Animate a point](https://maplibre.org/maplibre-gl-js-docs/example/animate-point-along-line/)
* @see [Add live realtime data](https://maplibre.org/maplibre-gl-js-docs/example/live-geojson/)
*/
getSource(id: string): Source | undefined;
/**
* Add an image to the style. This image can be displayed on the map like any other icon in the style's
* sprite using the image's ID with
* [`icon-image`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#layout-symbol-icon-image),
* [`background-pattern`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#paint-background-background-pattern),
* [`fill-pattern`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#paint-fill-fill-pattern),
* or [`line-pattern`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#paint-line-line-pattern).
* A {@link Map.event:error} event will be fired if there is not enough space in the sprite to add this image.
*
* @param id The ID of the image.
* @param image The image as an `HTMLImageElement`, `ImageData`, `ImageBitmap` or object with `width`, `height`, and `data`
* properties with the same format as `ImageData`.
* @param options Options object.
* @param options.pixelRatio The ratio of pixels in the image to physical pixels on the screen
* @param options.sdf Whether the image should be interpreted as an SDF image
* @param options.content `[x1, y1, x2, y2]` If `icon-text-fit` is used in a layer with this image, this option defines the part of the image that can be covered by the content in `text-field`.
* @param options.stretchX `[[x1, x2], ...]` If `icon-text-fit` is used in a layer with this image, this option defines the part(s) of the image that can be stretched horizontally.
* @param options.stretchY `[[y1, y2], ...]` If `icon-text-fit` is used in a layer with this image, this option defines the part(s) of the image that can be stretched vertically.
*
* @example
* // If the style's sprite does not already contain an image with ID 'cat',
* // add the image 'cat-icon.png' to the style's sprite with the ID 'cat'.
* map.loadImage('https://upload.wikimedia.org/wikipedia/commons/thumb/6/60/Cat_silhouette.svg/400px-Cat_silhouette.svg.png', function(error, image) {
* if (error) throw error;
* if (!map.hasImage('cat')) map.addImage('cat', image);
* });
*
*
* // Add a stretchable image that can be used with `icon-text-fit`
* // In this example, the image is 600px wide by 400px high.
* map.loadImage('https://upload.wikimedia.org/wikipedia/commons/8/89/Black_and_White_Boxed_%28bordered%29.png', function(error, image) {
* if (error) throw error;
* if (!map.hasImage('border-image')) {
* map.addImage('border-image', image, {
* content: [16, 16, 300, 384], // place text over left half of image, avoiding the 16px border
* stretchX: [[16, 584]], // stretch everything horizontally except the 16px border
* stretchY: [[16, 384]], // stretch everything vertically except the 16px border
* });
* }
* });
*
*
* @see Use `HTMLImageElement`: [Add an icon to the map](https://maplibre.org/maplibre-gl-js-docs/example/add-image/)
* @see Use `ImageData`: [Add a generated icon to the map](https://maplibre.org/maplibre-gl-js-docs/example/add-image-generated/)
*/
addImage(id: string, image: HTMLImageElement | ImageBitmap | ImageData | {
width: number;
height: number;
data: Uint8Array | Uint8ClampedArray;
} | StyleImageInterface, { pixelRatio, sdf, stretchX, stretchY, content }?: Partial<StyleImageMetadata>): this;
/**
* Update an existing image in a style. This image can be displayed on the map like any other icon in the style's
* sprite using the image's ID with
* [`icon-image`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#layout-symbol-icon-image),
* [`background-pattern`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#paint-background-background-pattern),
* [`fill-pattern`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#paint-fill-fill-pattern),
* or [`line-pattern`](https://maplibre.org/maplibre-gl-js-docs/style-spec/#paint-line-line-pattern).
*
* @param id The ID of the image.
* @param image The image as an `HTMLImageElement`, `ImageData`, `ImageBitmap` or object with `width`, `height`, and `data`
* properties with the same format as `ImageData`.
*
* @example
* // If an image with the ID 'cat' already exists in the style's sprite,
* // replace that image with a new image, 'other-cat-icon.png'.
* if (map.hasImage('cat')) map.updateImage('cat', './other-cat-icon.png');
*/
updateImage(id: string, image: HTMLImageElement | ImageBitmap | ImageData | {
width: number;
height: number;
data: Uint8Array | Uint8ClampedArray;
} | StyleImageInterface): this;
/**
* Check whether or not an image with a specific ID exists in the style. This checks both images
* in the style's original sprite and any images
* that have been added at runtime using {@link Map#addImage}.
*
* @param id The ID of the image.
*
* @returns {boolean} A Boolean indicating whether the image exists.
* @example
* // Check if an image with the ID 'cat' exists in
* // the style's sprite.
* var catIconExists = map.hasImage('cat');
*/
hasImage(id: string): boolean;
/**
* Remove an image from a style. This can be an image from the style's original
* sprite or any images
* that have been added at runtime using {@link Map#addImage}.
*
* @param id The ID of the image.
*
* @example
* // If an image with the ID 'cat' exists in
* // the style's sprite, remove it.
* if (map.hasImage('cat')) map.removeImage('cat');
*/
removeImage(id: string): void;
/**
* Load an image from an external URL to be used with {@link Map#addImage}. External
* domains must support [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS).
*
* @param {string} url The URL of the image file. Image file must be in png, webp, or jpg format.
* @param {Callback<HTMLImageElement | ImageBitmap>} callback Expecting `callback(error, data)`. Called when the image has loaded or with an error argument if there is an error.
*
* @example
* // Load an image from an external URL.
* map.loadImage('http://placekitten.com/50/50', function(error, image) {
* if (error) throw error;
* // Add the loaded image to the style's sprite with the ID 'kitten'.
* map.addImage('kitten', image);
* });
*
* @see [Add an icon to the map](https://maplibre.org/maplibre-gl-js-docs/example/add-image/)
*/
loadImage(url: string, callback: Callback<HTMLImageElement | ImageBitmap>): void;
/**
* Returns an Array of strings containing the IDs of all images currently available in the map.
* This includes both images from the style's original sprite
* and any images that have been added at runtime using {@link Map#addImage}.
*
* @returns {Array<string>} An Array of strings containing the names of all sprites/images currently available in the map.
*
* @example
* var allImages = map.listImages();
*
*/
listImages(): string[];
/**
* Adds a [MapLibre style layer](https://maplibre.org/maplibre-gl-js-docs/style-spec/#layers)
* to the map's style.
*
* A layer defines how data from a specified source will be styled. Read more about layer types
* and available paint and layout properties in the [MapLibre Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/#layers).
*
* @param {Object | CustomLayerInterface} layer The layer to add, conforming to either the MapLibre Style Specification's [layer definition](https://maplibre.org/maplibre-gl-js-docs/style-spec/#layers) or, less commonly, the {@link CustomLayerInterface} specification.
* The MapLibre Style Specification's layer definition is appropriate for most layers.
*
* @param {string} layer.id A unique identifer that you define.
* @param {string} layer.type The type of layer (for example `fill` or `symbol`).
* A list of layer types is available in the [MapLibre Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#type).
*
* (This can also be `custom`. For more information, see {@link CustomLayerInterface}.)
* @param {string | Object} [layer.source] The data source for the layer.
* Reference a source that has _already been defined_ using the source's unique id.
* Reference a _new source_ using a source object (as defined in the [MapLibre Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/sources/)) directly.
* This is **required** for all `layer.type` options _except_ for `custom`.
* @param {string} [layer.sourceLayer] (optional) The name of the source layer within the specified `layer.source` to use for this style layer.
* This is only applicable for vector tile sources and is **required** when `layer.source` is of the type `vector`.
* @param {array} [layer.filter] (optional) An expression specifying conditions on source features.
* Only features that match the filter are displayed.
* The MapLibre Style Specification includes more information on the limitations of the [`filter`](https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#filter) parameter
* and a complete list of available [expressions](https://maplibre.org/maplibre-gl-js-docs/style-spec/expressions/).
* If no filter is provided, all features in the source (or source layer for vector tilesets) will be displayed.
* @param {Object} [layer.paint] (optional) Paint properties for the layer.
* Available paint properties vary by `layer.type`.
* A full list of paint properties for each layer type is available in the [MapLibre Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/).
* If no paint properties are specified, default values will be used.
* @param {Object} [layer.layout] (optional) Layout properties for the layer.
* Available layout properties vary by `layer.type`.
* A full list of layout properties for each layer type is available in the [MapLibre Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/).
* If no layout properties are specified, default values will be used.
* @param {number} [layer.maxzoom] (optional) The maximum zoom level for the layer.
* At zoom levels equal to or greater than the maxzoom, the layer will be hidden.
* The value can be any number between `0` and `24` (inclusive).
* If no maxzoom is provided, the layer will be visible at all zoom levels for which there are tiles available.
* @param {number} [layer.minzoom] (optional) The minimum zoom level for the layer.
* At zoom levels less than the minzoom, the layer will be hidden.
* The value can be any number between `0` and `24` (inclusive).
* If no minzoom is provided, the layer will be visible at all zoom levels for which there are tiles available.
* @param {Object} [layer.metadata] (optional) Arbitrary properties useful to track with the layer, but do not influence rendering.
* @param {string} [layer.renderingMode] This is only applicable for layers with the type `custom`.
* See {@link CustomLayerInterface} for more information.
* @param {string} [beforeId] The ID of an existing layer to insert the new layer before,
* resulting in the new layer appearing visually beneath the existing layer.
* If this argument is not specified, the layer will be appended to the end of the layers array
* and appear visually above all other layers.
*
* @returns {Map} `this`
*
* @example
* // Add a circle layer with a vector source
* map.addLayer({
* id: 'points-of-interest',
* source: {
* type: 'vector',
* url: 'https://demotiles.maplibre.org/tiles/tiles.json'
* },
* 'source-layer': 'poi_label',
* type: 'circle',
* paint: {
* // MapLibre Style Specification paint properties
* },
* layout: {
* // MapLibre Style Specification layout properties
* }
* });
*
* @example
* // Define a source before using it to create a new layer
* map.addSource('state-data', {
* type: 'geojson',
* data: 'path/to/data.geojson'
* });
*
* map.addLayer({
* id: 'states',
* // References the GeoJSON source defined above
* // and does not require a `source-layer`
* source: 'state-data',
* type: 'symbol',
* layout: {
* // Set the label content to the
* // feature's `name` property
* text-field: ['get', 'name']
* }
* });
*
* @example
* // Add a new symbol layer before an existing layer
* map.addLayer({
* id: 'states',
* // References a source that's already been defined
* source: 'state-data',
* type: 'symbol',
* layout: {
* // Set the label content to the
* // feature's `name` property
* text-field: ['get', 'name']
* }
* // Add the layer before the existing `cities` layer
* }, 'cities');
*
* @see [Create and style clusters](https://maplibre.org/maplibre-gl-js-docs/example/cluster/)
* @see [Add a vector tile source](https://maplibre.org/maplibre-gl-js-docs/example/vector-source/)
* @see [Add a WMS source](https://maplibre.org/maplibre-gl-js-docs/example/wms/)
*/
addLayer(layer: LayerSpecification | CustomLayerInterface, beforeId?: string): this;
/**
* Moves a layer to a different z-position.
*
* @param {string} id The ID of the layer to move.
* @param {string} [beforeId] The ID of an existing layer to insert the new layer before. When viewing the map, the `id` layer will appear beneath the `beforeId` layer. If `beforeId` is omitted, the layer will be appended to the end of the layers array and appear above all other layers on the map.
* @returns {Map} `this`
*
* @example
* // Move a layer with ID 'polygon' before the layer with ID 'country-label'. The `polygon` layer will appear beneath the `country-label` layer on the map.
* map.moveLayer('polygon', 'country-label');
*/
moveLayer(id: string, beforeId?: string): this;
/**
* Removes the layer with the given ID from the map's style.
*
* If no such layer exists, an `error` event is fired.
*
* @param {string} id id of the layer to remove
* @fires error
*
* @example
* // If a layer with ID 'state-data' exists, remove it.
* if (map.getLayer('state-data')) map.removeLayer('state-data');
*/
removeLayer(id: string): this;
/**
* Returns the layer with the specified ID in the map's style.
*
* @param {string} id The ID of the layer to get.
* @returns {StyleLayer} The layer with the specified ID, or `undefined`
* if the ID corresponds to no existing layers.
*
* @example
* var stateDataLayer = map.getLayer('state-data');
*
* @see [Filter symbols by toggling a list](https://maplibre.org/maplibre-gl-js-docs/example/filter-markers/)
* @see [Filter symbols by text input](https://maplibre.org/maplibre-gl-js-docs/example/filter-markers-by-input/)
*/
getLayer(id: string): StyleLayer;
/**
* Sets the zoom extent for the specified style layer. The zoom extent includes the
* [minimum zoom level](https://maplibre.org/maplibre-gl-js-docs/style-spec/#layer-minzoom)
* and [maximum zoom level](https://maplibre.org/maplibre-gl-js-docs/style-spec/#layer-maxzoom))
* at which the layer will be rendered.
*
* Note: For style layers using vector sources, style layers cannot be rendered at zoom levels lower than the
* minimum zoom level of the _source layer_ because the data does not exist at those zoom levels. If the minimum
* zoom level of the source layer is higher than the minimum zoom level defined in the style layer, the style
* layer will not be rendered at all zoom levels in the zoom range.
*
* @param {string} layerId The ID of the layer to which the zoom extent will be applied.
* @param {number} minzoom The minimum zoom to set (0-24).
* @param {number} maxzoom The maximum zoom to set (0-24).
* @returns {Map} `this`
*
* @example
* map.setLayerZoomRange('my-layer', 2, 5);
*
*/
setLayerZoomRange(layerId: string, minzoom: number, maxzoom: number): this;
/**
* Sets the filter for the specified style layer.
*
* Filters control which features a style layer renders from its source.
* Any feature for which the filter expression evaluates to `true` will be
* rendered on the map. Those that are false will be hidden.
*
* Use `setFilter` to show a subset of your source data.
*
* To clear the filter, pass `null` or `undefined` as the second parameter.
*
* @param {string} layerId The ID of the layer to which the filter will be applied.
* @param {Array | null | undefined} filter The filter, conforming to the MapLibre Style Specification's
* [filter definition](https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#filter). If `null` or `undefined` is provided, the function removes any existing filter from the layer.
* @param {Object} [options] Options object.
* @param {boolean} [options.validate=true] Whether to check if the filter conforms to the MapLibre GL Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
* @returns {Map} `this`
*
* @example
* // display only features with the 'name' property 'USA'
* map.setFilter('my-layer', ['==', ['get', 'name'], 'USA']);
* @example
* // display only features with five or more 'available-spots'
* map.setFilter('bike-docks', ['>=', ['get', 'available-spots'], 5]);
* @example
* // remove the filter for the 'bike-docks' style layer
* map.setFilter('bike-docks', null);
*
* @see [Create a timeline animation](https://maplibre.org/maplibre-gl-js-docs/example/timeline-animation/)
*/
setFilter(layerId: string, filter?: FilterSpecification | null, options?: StyleSetterOptions): this;
/**
* Returns the filter applied to the specified style layer.
*
* @param {string} layerId The ID of the style layer whose filter to get.
* @returns {Array} The layer's filter.
*/
getFilter(layerId: string): void | FilterSpecification;
/**
* Sets the value of a paint property in the specified style layer.
*
* @param {string} layerId The ID of the layer to set the paint property in.
* @param {string} name The name of the paint property to set.
* @param {*} value The value of the paint property to set.
* Must be of a type appropriate for the property, as defined in the [MapLibre Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/).
* @param {Object} [options] Options object.
* @param {boolean} [options.validate=true] Whether to check if `value` conforms to the MapLibre GL Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
* @returns {Map} `this`
* @example
* map.setPaintProperty('my-layer', 'fill-color', '#faafee');
* @see [Change a layer's color with buttons](https://maplibre.org/maplibre-gl-js-docs/example/color-switcher/)
* @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
*/
setPaintProperty(layerId: string, name: string, value: any, options?: StyleSetterOptions): this;
/**
* Returns the value of a paint property in the specified style layer.
*
* @param {string} layerId The ID of the layer to get the paint property from.
* @param {string} name The name of a paint property to get.
* @returns {*} The value of the specified paint property.
*/
getPaintProperty(layerId: string, name: string): unknown;
/**
* Sets the value of a layout property in the specified style layer.
*
* @param {string} layerId The ID of the layer to set the layout property in.
* @param {string} name The name of the layout property to set.
* @param {*} value The value of the layout property. Must be of a type appropriate for the property, as defined in the [MapLibre Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/).
* @param {Object} [options] Options object.
* @param {boolean} [options.validate=true] Whether to check if `value` conforms to the MapLibre GL Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
* @returns {Map} `this`
* @example
* map.setLayoutProperty('my-layer', 'visibility', 'none');
*/
setLayoutProperty(layerId: string, name: string, value: any, options?: StyleSetterOptions): this;
/**
* Returns the value of a layout property in the specified style layer.
*
* @param {string} layerId The ID of the layer to get the layout property from.
* @param {string} name The name of the layout property to get.
* @returns {*} The value of the specified layout property.
*/
getLayoutProperty(layerId: string, name: string): any;
/**
* Sets the any combination of light values.
*
* @param light Light properties to set. Must conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/#light).
* @param {Object} [options] Options object.
* @param {boolean} [options.validate=true] Whether to check if the filter conforms to the MapLibre GL Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.
* @returns {Map} `this`
* @example
* var layerVisibility = map.getLayoutProperty('my-layer', 'visibility');
*/
setLight(light: LightSpecification, options?: StyleSetterOptions): this;
/**
* Returns the value of the light object.
*
* @returns {Object} light Light properties of the style.
*/
getLight(): any;
/**
* Sets the `state` of a feature.
* A feature's `state` is a set of user-defined key-value pairs that are assigned to a feature at runtime.
* When using this method, the `state` object is merged with any existing key-value pairs in the feature's state.
* Features are identified by their `feature.id` attribute, which can be any number or string.
*
* This method can only be used with sources that have a `feature.id` attribute. The `feature.id` attribute can be defined in three ways:
* - For vector or GeoJSON sources, including an `id` attribute in the original data file.
* - For vector or GeoJSON sources, using the [`promoteId`](https://maplibre.org/maplibre-gl-js-docs/style-spec/sources/#vector-promoteId) option at the time the source is defined.
* - For GeoJSON sources, using the [`generateId`](https://maplibre.org/maplibre-gl-js-docs/style-spec/sources/#geojson-generateId) option to auto-assign an `id` based on the feature's index in the source data. If you change feature data using `map.getSource('some id').setData(..)`, you may need to re-apply state taking into account updated `id` values.
*
* _Note: You can use the [`feature-state` expression](https://maplibre.org/maplibre-gl-js-docs/style-spec/expressions/#feature-state) to access the values in a feature's state object for the purposes of styling._
*
* @param {Object} feature Feature identifier. Feature objects returned from
* {@link Map#queryRenderedFeatures} or event handlers can be used as feature identifiers.
* @param {string | number} feature.id Unique id of the feature.
* @param {string} feature.source The id of the vector or GeoJSON source for the feature.
* @param {string} [feature.sourceLayer] (optional) *For vector tile sources, `sourceLayer` is required.*
* @param {Object} state A set of key-value pairs. The values should be valid JSON types.
*
* @example
* // When the mouse moves over the `my-layer` layer, update
* // the feature state for the feature under the mouse
* map.on('mousemove', 'my-layer', function(e) {
* if (e.features.length > 0) {
* map.setFeatureState({
* source: 'my-source',
* sourceLayer: 'my-source-layer',
* id: e.features[0].id,
* }, {
* hover: true
* });
* }
* });
*
* @see [Create a hover effect](https://maplibre.org/maplibre-gl-js-docs/example/hover-styles/)
*/
setFeatureState(feature: {
source: string;
sourceLayer?: string;
id: string | number;
}, state: any): this;
/**
* Removes the `state` of a feature, setting it back to the default behavior.
* If only a `target.source` is specified, it will remove the state for all features from that source.
* If `target.id` is also specified, it will remove all keys for that feature's state.
* If `key` is also specified, it removes only that key from that feature's state.
* Features are identified by their `feature.id` attribute, which can be any number or string.
*
* @param {Object} target Identifier of where to remove state. It can be a source, a feature, or a specific key of feature.
* Feature objects returned from {@link Map#queryRenderedFeatures} or event handlers can be used as feature identifiers.
* @param {string | number} target.id (optional) Unique id of the feature. Optional if key is not specified.
* @param {string} target.source The id of the vector or GeoJSON source for the feature.
* @param {string} [target.sourceLayer] (optional) *For vector tile sources, `sourceLayer` is required.*
* @param {string} key (optional) The key in the feature state to reset.
*
* @example
* // Reset the entire state object for all features
* // in the `my-source` source
* map.removeFeatureState({
* source: 'my-source'
* });
*
* @example
* // When the mouse leaves the `my-layer` layer,
* // reset the entire state object for the
* // feature under the mouse
* map.on('mouseleave', 'my-layer', function(e) {
* map.removeFeatureState({
* source: 'my-source',
* sourceLayer: 'my-source-layer',
* id: e.features[0].id
* });
* });
*
* @example
* // When the mouse leaves the `my-layer` layer,
* // reset only the `hover` key-value pair in the
* // state for the feature under the mouse
* map.on('mouseleave', 'my-layer', function(e) {
* map.removeFeatureState({
* source: 'my-source',
* sourceLayer: 'my-source-layer',
* id: e.features[0].id
* }, 'hover');
* });
*
*/
removeFeatureState(target: {
source: string;
sourceLayer?: string;
id?: string | number;
}, key?: string): this;
/**
* Gets the `state` of a feature.
* A feature's `state` is a set of user-defined key-value pairs that are assigned to a feature at runtime.
* Features are identified by their `feature.id` attribute, which can be any number or string.
*
* _Note: To access the values in a feature's state object for the purposes of styling the feature, use the [`feature-state` expression](https://maplibre.org/maplibre-gl-js-docs/style-spec/expressions/#feature-state)._
*
* @param {Object} feature Feature identifier. Feature objects returned from
* {@link Map#queryRenderedFeatures} or event handlers can be used as feature identifiers.
* @param {string | number} feature.id Unique id of the feature.
* @param {string} feature.source The id of the vector or GeoJSON source for the feature.
* @param {string} [feature.sourceLayer] (optional) *For vector tile sources, `sourceLayer` is required.*
*
* @returns {Object} The state of the feature: a set of key-value pairs that was assigned to the feature at runtime.
*
* @example
* // When the mouse moves over the `my-layer` layer,
* // get the feature state for the feature under the mouse
* map.on('mousemove', 'my-layer', function(e) {
* if (e.features.length > 0) {
* map.getFeatureState({
* source: 'my-source',
* sourceLayer: 'my-source-layer',
* id: e.features[0].id
* });
* }
* });
*
*/
getFeatureState(feature: {
source: string;
sourceLayer?: string;
id: string | number;
}): any;
/**
* Returns the map's containing HTML element.
*
* @returns {HTMLElement} The map's container.
*/
getContainer(): HTMLElement;
/**
* Returns the HTML element containing the map's `<canvas>` element.
*
* If you want to add non-GL overlays to the map, you should append them to this element.
*
* This is the element to which event bindings for map interactivity (such as panning and zooming) are
* attached. It will receive bubbled events from child elements such as the `<canvas>`, but not from
* map controls.
*
* @returns {HTMLElement} The container of the map's `<canvas>`.
* @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
*/
getCanvasContainer(): HTMLElement;
/**
* Returns the map's `<canvas>` element.
*
* @returns {HTMLCanvasElement} The map's `<canvas>` element.
* @see [Measure distances](https://maplibre.org/maplibre-gl-js-docs/example/measure/)
* @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-hover/)
* @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js-docs/example/center-on-symbol/)
*/
getCanvas(): HTMLCanvasElement;
_containerDimensions(): number[];
_setupContainer(): void;
_resizeCanvas(width: number, height: number): void;
_setupPainter(): void;
_contextLost(event: any): void;
_contextRestored(event: any): void;
_onMapScroll(event: any): boolean;
/**
* Returns a Boolean indicating whether the map is fully loaded.
*
* Returns `false` if the style is not yet fully loaded,
* or if there has been a change to the sources or style that
* has not yet fully loaded.
*
* @returns {boolean} A Boolean indicating whether the map is fully loaded.
*/
loaded(): boolean;
/**
* Update this map's style and sources, and re-render the map.
*
* @param {boolean} updateStyle mark the map's style for reprocessing as
* well as its sources
* @returns {Map} this
* @private
*/
_update(updateStyle?: boolean): this;
/**
* Request that the given callback be executed during the next render
* frame. Schedule a render frame if one is not already scheduled.
* @returns An id that can be used to cancel the callback
* @private
*/
_requestRenderFrame(callback: () => void): TaskID;
_cancelRenderFrame(id: TaskID): void;
/**
* Call when a (re-)render of the map is required:
* - The style has changed (`setPaintProperty()`, etc.)
* - Source data has changed (e.g. tiles have finished loading)
* - The map has is moving (or just finished moving)
* - A transition is in progress
*
* @param {number} paintStartTimeStamp The time when the animation frame began executing.
*
* @returns {Map} this
* @private
*/
_render(paintStartTimeStamp: number): this;
/**
* Force a synchronous redraw of the map.
* @example
* map.redraw();
* @returns {Map} `this`
*/
redraw(): Map;
/**
* Clean up and release all internal resources associated with this map.
*
* This includes DOM elements, event bindings, web workers, and WebGL resources.
*
* Use this method when you are done using the map and wish to ensure that it no
* longer consumes browser resources. Afterwards, you must not call any other
* methods on the map.
*/
remove(): void;
/**
* Trigger the rendering of a single frame. Use this method with custom layers to
* repaint the map when the layer changes. Calling this multiple times before the
* next frame is rendered will still result in only a single frame being rendered.
* @example
* map.triggerRepaint();
* @see [Add a 3D model](https://maplibre.org/maplibre-gl-js-docs/example/add-3d-model/)
* @see [Add an animated icon to the map](https://maplibre.org/maplibre-gl-js-docs/example/add-image-animated/)
*/
triggerRepaint(): void;
_onWindowOnline(): void;
_onWindowResize(event: Event): void;
/**
* Gets and sets a Boolean indicating whether the map will render an outline
* around each tile and the tile ID. These tile boundaries are useful for
* debugging.
*
* The uncompressed file size of the first vector source is drawn in the top left
* corner of each tile, next to the tile ID.
*
* @name showTileBoundaries
* @type {boolean}
* @instance
* @memberof Map
* @example
* map.showTileBoundaries = true;
*/
get showTileBoundaries(): boolean;
set showTileBoundaries(value: boolean);
/**
* Gets and sets a Boolean indicating whether the map will visualize
* the padding offsets.
*
* @name showPadding
* @type {boolean}
* @instance
* @memberof Map
*/
get showPadding(): boolean;
set showPadding(value: boolean);
/**
* Gets and sets a Boolean indicating whether the map will render boxes
* around all symbols in the data source, revealing which symbols
* were rendered or which were hidden due to collisions.
* This information is useful for debugging.
*
* @name showCollisionBoxes
* @type {boolean}
* @instance
* @memberof Map
*/
get showCollisionBoxes(): boolean;
set showCollisionBoxes(value: boolean);
get showOverdrawInspector(): boolean;
set showOverdrawInspector(value: boolean);
/**
* Gets and sets a Boolean indicating whether the map will
* continuously repaint. This information is useful for analyzing performance.
*
* @name repaint
* @type {boolean}
* @instance
* @memberof Map
*/
get repaint(): boolean;
set repaint(value: boolean);
get vertices(): boolean;
set vertices(value: boolean);
_setCacheLimits(limit: number, checkThreshold: number): void;
}
export declare type NavigationOptions = {
showCompass?: boolean;
showZoom?: boolean;
visualizePitch?: boolean;
};
export declare class NavigationControl implements IControl {
_map: Map;
options: NavigationOptions;
_container: HTMLElement;
_zoomInButton: HTMLButtonElement;
_zoomOutButton: HTMLButtonElement;
_compass: HTMLButtonElement;
_compassIcon: HTMLElement;
_handler: MouseRotateWrapper;
constructor(options: NavigationOptions);
_updateZoomButtons(): void;
_rotateCompassArrow(): void;
onAdd(map: Map): HTMLElement;
onRemove(): void;
_createButton(className: string, fn: (e?: any) => unknown): HTMLButtonElement;
_setButtonTitle(button: HTMLButtonElement, title: string): void;
}
export declare class MouseRotateWrapper {
map: Map;
_clickTolerance: number;
element: HTMLElement;
mouseRotate: MouseRotateHandler;
mousePitch: MousePitchHandler;
_startPos: Point;
_lastPos: Point;
constructor(map: Map, element: HTMLElement, pitch?: boolean);
down(e: MouseEvent, point: Point): void;
move(e: MouseEvent, point: Point): void;
off(): void;
offTemp(): void;
mousedown(e: MouseEvent): void;
mousemove(e: MouseEvent): void;
mouseup(e: MouseEvent): void;
touchstart(e: TouchEvent): void;
touchmove(e: TouchEvent): void;
touchend(e: TouchEvent): void;
reset(): void;
}
export declare type PositionAnchor = "center" | "top" | "bottom" | "left" | "right" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
export declare type Offset = number | PointLike | {
[_ in PositionAnchor]: PointLike;
};
export declare type PopupOptions = {
closeButton?: boolean;
closeOnClick?: boolean;
closeOnMove?: boolean;
focusAfterOpen?: boolean;
anchor?: PositionAnchor;
offset?: Offset;
className?: string;
maxWidth?: string;
};
export declare class Popup extends Evented {
_map: Map;
options: PopupOptions;
_content: HTMLElement;
_container: HTMLElement;
_closeButton: HTMLButtonElement;
_tip: HTMLElement;
_lngLat: LngLat;
_trackPointer: boolean;
_pos: Point;
constructor(options?: PopupOptions);
/**
* Adds the popup to a map.
*
* @param {Map} map The MapLibre GL JS map to add the popup to.
* @returns {Popup} `this`
* @example
* new maplibregl.Popup()
* .setLngLat([0, 0])
* .setHTML("<h1>Null Island</h1>")
* .addTo(map);
* @see [Display a popup](https://maplibre.org/maplibre-gl-js-docs/example/popup/)
* @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-hover/)
* @see [Display a popup on click](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-click/)
* @see [Show polygon information on click](https://maplibre.org/maplibre-gl-js-docs/example/polygon-popup-on-click/)
*/
addTo(map: Map): this;
/**
* @returns {boolean} `true` if the popup is open, `false` if it is closed.
*/
isOpen(): boolean;
/**
* Removes the popup from the map it has been added to.
*
* @example
* var popup = new maplibregl.Popup().addTo(map);
* popup.remove();
* @returns {Popup} `this`
*/
remove(): this;
/**
* Returns the geographical location of the popup's anchor.
*
* The longitude of the result may differ by a multiple of 360 degrees from the longitude previously
* set by `setLngLat` because `Popup` wraps the anchor longitude across copies of the world to keep
* the popup on screen.
*
* @returns {LngLat} The geographical location of the popup's anchor.
*/
getLngLat(): LngLat;
/**
* Sets the geographical location of the popup's anchor, and moves the popup to it. Replaces trackPointer() behavior.
*
* @param lnglat The geographical location to set as the popup's anchor.
* @returns {Popup} `this`
*/
setLngLat(lnglat: LngLatLike): this;
/**
* Tracks the popup anchor to the cursor position on screens with a pointer device (it will be hidden on touchscreens). Replaces the `setLngLat` behavior.
* For most use cases, set `closeOnClick` and `closeButton` to `false`.
* @example
* var popup = new maplibregl.Popup({ closeOnClick: false, closeButton: false })
* .setHTML("<h1>Hello World!</h1>")
* .trackPointer()
* .addTo(map);
* @returns {Popup} `this`
*/
trackPointer(): this;
/**
* Returns the `Popup`'s HTML element.
* @example
* // Change the `Popup` element's font size
* var popup = new maplibregl.Popup()
* .setLngLat([-96, 37.8])
* .setHTML("<p>Hello World!</p>")
* .addTo(map);
* var popupElem = popup.getElement();
* popupElem.style.fontSize = "25px";
* @returns {HTMLElement} element
*/
getElement(): HTMLElement;
/**
* Sets the popup's content to a string of text.
*
* This function creates a [Text](https://developer.mozilla.org/en-US/docs/Web/API/Text) node in the DOM,
* so it cannot insert raw HTML. Use this method for security against XSS
* if the popup content is user-provided.
*
* @param text Textual content for the popup.
* @returns {Popup} `this`
* @example
* var popup = new maplibregl.Popup()
* .setLngLat(e.lngLat)
* .setText('Hello, world!')
* .addTo(map);
*/
setText(text: string): this;
/**
* Sets the popup's content to the HTML provided as a string.
*
* This method does not perform HTML filtering or sanitization, and must be
* used only with trusted content. Consider {@link Popup#setText} if
* the content is an untrusted text string.
*
* @param html A string representing HTML content for the popup.
* @returns {Popup} `this`
* @example
* var popup = new maplibregl.Popup()
* .setLngLat(e.lngLat)
* .setHTML("<h1>Hello World!</h1>")
* .addTo(map);
* @see [Display a popup](https://maplibre.org/maplibre-gl-js-docs/example/popup/)
* @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-hover/)
* @see [Display a popup on click](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-click/)
* @see [Attach a popup to a marker instance](https://maplibre.org/maplibre-gl-js-docs/example/set-popup/)
*/
setHTML(html: string): this;
/**
* Returns the popup's maximum width.
*
* @returns {string} The maximum width of the popup.
*/
getMaxWidth(): string;
/**
* Sets the popup's maximum width. This is setting the CSS property `max-width`.
* Available values can be found here: https://developer.mozilla.org/en-US/docs/Web/CSS/max-width
*
* @param maxWidth A string representing the value for the maximum width.
* @returns {Popup} `this`
*/
setMaxWidth(maxWidth: string): this;
/**
* Sets the popup's content to the element provided as a DOM node.
*
* @param htmlNode A DOM node to be used as content for the popup.
* @returns {Popup} `this`
* @example
* // create an element with the popup content
* var div = document.createElement('div');
* div.innerHTML = 'Hello, world!';
* var popup = new maplibregl.Popup()
* .setLngLat(e.lngLat)
* .setDOMContent(div)
* .addTo(map);
*/
setDOMContent(htmlNode: Node): this;
/**
* Adds a CSS class to the popup container element.
*
* @param {string} className Non-empty string with CSS class name to add to popup container
*
* @example
* let popup = new maplibregl.Popup()
* popup.addClassName('some-class')
*/
addClassName(className: string): void;
/**
* Removes a CSS class from the popup container element.
*
* @param {string} className Non-empty string with CSS class name to remove from popup container
*
* @example
* let popup = new maplibregl.Popup()
* popup.removeClassName('some-class')
*/
removeClassName(className: string): void;
/**
* Sets the popup's offset.
*
* @param offset Sets the popup's offset.
* @returns {Popup} `this`
*/
setOffset(offset?: Offset): this;
/**
* Add or remove the given CSS class on the popup container, depending on whether the container currently has that class.
*
* @param {string} className Non-empty string with CSS class name to add/remove
*
* @returns {boolean} if the class was removed return false, if class was added, then return true
*
* @example
* let popup = new maplibregl.Popup()
* popup.toggleClassName('toggleClass')
*/
toggleClassName(className: string): boolean;
_createCloseButton(): void;
_onMouseUp(event: MapMouseEvent): void;
_onMouseMove(event: MapMouseEvent): void;
_onDrag(event: MapMouseEvent): void;
_update(cursor?: Point): void;
_focusFirstElement(): void;
_onClose(): void;
}
export declare type MarkerOptions = {
element?: HTMLElement;
offset?: PointLike;
anchor?: PositionAnchor;
color?: string;
scale?: number;
draggable?: boolean;
clickTolerance?: number;
rotation?: number;
rotationAlignment?: string;
pitchAlignment?: string;
};
export declare class Marker extends Evented {
_map: Map;
_anchor: PositionAnchor;
_offset: Point;
_element: HTMLElement;
_popup: Popup;
_lngLat: LngLat;
_pos: Point;
_color: string;
_scale: number;
_defaultMarker: boolean;
_draggable: boolean;
_clickTolerance: number;
_isDragging: boolean;
_state: "inactive" | "pending" | "active";
_positionDelta: Point;
_pointerdownPos: Point;
_rotation: number;
_pitchAlignment: string;
_rotationAlignment: string;
_originalTabIndex: string;
constructor(options?: MarkerOptions, legacyOptions?: MarkerOptions);
/**
* Attaches the `Marker` to a `Map` object.
* @param {Map} map The MapLibre GL JS map to add the marker to.
* @returns {Marker} `this`
* @example
* var marker = new maplibregl.Marker()
* .setLngLat([30.5, 50.5])
* .addTo(map); // add the marker to the map
*/
addTo(map: Map): this;
/**
* Removes the marker from a map
* @example
* var marker = new maplibregl.Marker().addTo(map);
* marker.remove();
* @returns {Marker} `this`
*/
remove(): this;
/**
* Get the marker's geographical location.
*
* The longitude of the result may differ by a multiple of 360 degrees from the longitude previously
* set by `setLngLat` because `Marker` wraps the anchor longitude across copies of the world to keep
* the marker on screen.
*
* @returns {LngLat} A {@link LngLat} describing the marker's location.
* @example
* // Store the marker's longitude and latitude coordinates in a variable
* var lngLat = marker.getLngLat();
* // Print the marker's longitude and latitude values in the console
* console.log('Longitude: ' + lngLat.lng + ', Latitude: ' + lngLat.lat )
* @see [Create a draggable Marker](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-marker/)
*/
getLngLat(): LngLat;
/**
* Set the marker's geographical position and move it.
* @param {LngLat} lnglat A {@link LngLat} describing where the marker should be located.
* @returns {Marker} `this`
* @example
* // Create a new marker, set the longitude and latitude, and add it to the map
* new maplibregl.Marker()
* .setLngLat([-65.017, -16.457])
* .addTo(map);
* @see [Add custom icons with Markers](https://maplibre.org/maplibre-gl-js-docs/example/custom-marker-icons/)
* @see [Create a draggable Marker](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-marker/)
*/
setLngLat(lnglat: LngLatLike): this;
/**
* Returns the `Marker`'s HTML element.
* @returns {HTMLElement} element
*/
getElement(): HTMLElement;
/**
* Binds a {@link Popup} to the {@link Marker}.
* @param popup An instance of the {@link Popup} class. If undefined or null, any popup
* set on this {@link Marker} instance is unset.
* @returns {Marker} `this`
* @example
* var marker = new maplibregl.Marker()
* .setLngLat([0, 0])
* .setPopup(new maplibregl.Popup().setHTML("<h1>Hello World!</h1>")) // add popup
* .addTo(map);
* @see [Attach a popup to a marker instance](https://maplibre.org/maplibre-gl-js-docs/example/set-popup/)
*/
setPopup(popup?: Popup | null): this;
_onKeyPress(e: KeyboardEvent): void;
_onMapClick(e: MapMouseEvent): void;
/**
* Returns the {@link Popup} instance that is bound to the {@link Marker}.
* @returns {Popup} popup
* @example
* var marker = new maplibregl.Marker()
* .setLngLat([0, 0])
* .setPopup(new maplibregl.Popup().setHTML("<h1>Hello World!</h1>"))
* .addTo(map);
*
* console.log(marker.getPopup()); // return the popup instance
*/
getPopup(): Popup;
/**
* Opens or closes the {@link Popup} instance that is bound to the {@link Marker}, depending on the current state of the {@link Popup}.
* @returns {Marker} `this`
* @example
* var marker = new maplibregl.Marker()
* .setLngLat([0, 0])
* .setPopup(new maplibregl.Popup().setHTML("<h1>Hello World!</h1>"))
* .addTo(map);
*
* marker.togglePopup(); // toggle popup open or closed
*/
togglePopup(): this;
_update(e?: {
type: "move" | "moveend";
}): void;
/**
* Get the marker's offset.
* @returns {Point} The marker's screen coordinates in pixels.
*/
getOffset(): Point;
/**
* Sets the offset of the marker
* @param {PointLike} offset The offset in pixels as a {@link PointLike} object to apply relative to the element's center. Negatives indicate left and up.
* @returns {Marker} `this`
*/
setOffset(offset: PointLike): this;
_onMove(e: MapMouseEvent | MapTouchEvent): void;
_onUp(): void;
_addDragHandler(e: MapMouseEvent | MapTouchEvent): void;
/**
* Sets the `draggable` property and functionality of the marker
* @param {boolean} [shouldBeDraggable=false] Turns drag functionality on/off
* @returns {Marker} `this`
*/
setDraggable(shouldBeDraggable: boolean): this;
/**
* Returns true if the marker can be dragged
* @returns {boolean} True if the marker is draggable.
*/
isDraggable(): boolean;
/**
* Sets the `rotation` property of the marker.
* @param {number} [rotation=0] The rotation angle of the marker (clockwise, in degrees), relative to its respective {@link Marker#setRotationAlignment} setting.
* @returns {Marker} `this`
*/
setRotation(rotation: number): this;
/**
* Returns the current rotation angle of the marker (in degrees).
* @returns {number} The current rotation angle of the marker.
*/
getRotation(): number;
/**
* Sets the `rotationAlignment` property of the marker.
* @param {string} [alignment='auto'] Sets the `rotationAlignment` property of the marker.
* @returns {Marker} `this`
*/
setRotationAlignment(alignment: string): this;
/**
* Returns the current `rotationAlignment` property of the marker.
* @returns {string} The current rotational alignment of the marker.
*/
getRotationAlignment(): string;
/**
* Sets the `pitchAlignment` property of the marker.
* @param {string} [alignment] Sets the `pitchAlignment` property of the marker. If alignment is 'auto', it will automatically match `rotationAlignment`.
* @returns {Marker} `this`
*/
setPitchAlignment(alignment: string): this;
/**
* Returns the current `pitchAlignment` property of the marker.
* @returns {string} The current pitch alignment of the marker in degrees.
*/
getPitchAlignment(): string;
}
export declare type GeolocateOptions = {
positionOptions?: PositionOptions;
fitBoundsOptions?: FitBoundsOptions;
trackUserLocation?: boolean;
showAccuracyCircle?: boolean;
showUserLocation?: boolean;
};
export declare class GeolocateControl extends Evented implements IControl {
_map: Map;
options: GeolocateOptions;
_container: HTMLElement;
_dotElement: HTMLElement;
_circleElement: HTMLElement;
_geolocateButton: HTMLButtonElement;
_geolocationWatchID: number;
_timeoutId: ReturnType<typeof setTimeout>;
_watchState: "OFF" | "ACTIVE_LOCK" | "WAITING_ACTIVE" | "ACTIVE_ERROR" | "BACKGROUND" | "BACKGROUND_ERROR";
_lastKnownPosition: any;
_userLocationDotMarker: Marker;
_accuracyCircleMarker: Marker;
_accuracy: number;
_setup: boolean;
constructor(options: GeolocateOptions);
onAdd(map: Map): HTMLElement;
onRemove(): void;
/**
* Check if the Geolocation API Position is outside the map's maxbounds.
*
* @param {Position} position the Geolocation API Position
* @returns {boolean} Returns `true` if position is outside the map's maxbounds, otherwise returns `false`.
* @private
*/
_isOutOfMapMaxBounds(position: GeolocationPosition): boolean;
_setErrorState(): void;
/**
* When the Geolocation API returns a new location, update the GeolocateControl.
*
* @param {Position} position the Geolocation API Position
* @private
*/
_onSuccess(position: GeolocationPosition): void;
/**
* Update the camera location to center on the current position
*
* @param {Position} position the Geolocation API Position
* @private
*/
_updateCamera(position: GeolocationPosition): void;
/**
* Update the user location dot Marker to the current position
*
* @param {Position} [position] the Geolocation API Position
* @private
*/
_updateMarker(position?: GeolocationPosition | null): void;
_updateCircleRadius(): void;
_onZoom(): void;
_onError(error: GeolocationPositionError): void;
_finish(): void;
_setupUI(supported: boolean): void;
/**
* Programmatically request and move the map to the user's location.
*
* @returns {boolean} Returns `false` if called before control was added to a map, otherwise returns `true`.
* @example
* // Initialize the geolocate control.
* var geolocate = new maplibregl.GeolocateControl({
* positionOptions: {
* enableHighAccuracy: true
* },
* trackUserLocation: true
* });
* // Add the control to the map.
* map.addControl(geolocate);
* map.on('load', function() {
* geolocate.trigger();
* });
*/
trigger(): boolean;
_clearWatch(): void;
}
export declare type AttributionOptions = {
compact?: boolean;
customAttribution?: string | Array<string>;
};
export declare class AttributionControl implements IControl {
options: AttributionOptions;
_map: Map;
_container: HTMLElement;
_innerContainer: HTMLElement;
_compactButton: HTMLElement;
_editLink: HTMLAnchorElement;
_attribHTML: string;
styleId: string;
styleOwner: string;
constructor(options?: AttributionOptions);
getDefaultPosition(): ControlPosition;
onAdd(map: Map): HTMLElement;
onRemove(): void;
_setElementTitle(element: HTMLElement, title: string): void;
_toggleAttribution(): void;
_updateData(e: any): void;
_updateAttributions(): void;
_updateCompact(): void;
}
export declare type Unit = "imperial" | "metric" | "nautical";
export declare type ScaleOptions = {
maxWidth?: number;
unit?: Unit;
};
export declare class ScaleControl implements IControl {
_map: Map;
_container: HTMLElement;
options: ScaleOptions;
constructor(options: ScaleOptions);
getDefaultPosition(): ControlPosition;
_onMove(): void;
onAdd(map: Map): HTMLElement;
onRemove(): void;
/**
* Set the scale's unit of the distance
*
* @param unit Unit of the distance (`'imperial'`, `'metric'` or `'nautical'`).
*/
setUnit(unit: Unit): void;
}
export declare type FullscreenOptions = {
container?: HTMLElement;
};
export declare class FullscreenControl implements IControl {
_map: Map;
_controlContainer: HTMLElement;
_fullscreen: boolean;
_fullscreenchange: string;
_fullscreenButton: HTMLButtonElement;
_container: HTMLElement;
constructor(options: FullscreenOptions);
onAdd(map: Map): HTMLElement;
onRemove(): void;
_checkFullscreenSupport(): boolean;
_setupUI(): void;
_updateTitle(): void;
_getTitle(): any;
_isFullscreen(): boolean;
_changeIcon(): void;
_onClickFullscreen(): void;
}
declare function prewarm(): void;
declare function clearPrewarmedResources(): void;
declare const exported: {
supported: import("@mapbox/mapbox-gl-supported").IsSupported;
setRTLTextPlugin: (url: string, callback: (error?: Error) => void, deferred?: boolean) => void;
getRTLTextPluginStatus: () => string;
Map: typeof Map;
NavigationControl: typeof NavigationControl;
GeolocateControl: typeof GeolocateControl;
AttributionControl: typeof AttributionControl;
ScaleControl: typeof ScaleControl;
FullscreenControl: typeof FullscreenControl;
Popup: typeof Popup;
Marker: typeof Marker;
Style: typeof Style;
LngLat: typeof LngLat;
LngLatBounds: typeof LngLatBounds;
Point: typeof Point;
MercatorCoordinate: typeof MercatorCoordinate;
Evented: typeof Evented;
config: {
MAX_PARALLEL_IMAGE_REQUESTS: number;
REGISTERED_PROTOCOLS: {
[x: string]: any;
};
};
/**
* Initializes resources like WebWorkers that can be shared across maps to lower load
* times in some situations. `maplibregl.workerUrl` and `maplibregl.workerCount`, if being
* used, must be set before `prewarm()` is called to have an effect.
*
* By default, the lifecycle of these resources is managed automatically, and they are
* lazily initialized when a Map is first created. By invoking `prewarm()`, these
* resources will be created ahead of time, and will not be cleared when the last Map
* is removed from the page. This allows them to be re-used by new Map instances that
* are created later. They can be manually cleared by calling
* `maplibregl.clearPrewarmedResources()`. This is only necessary if your web page remains
* active but stops using maps altogether.
*
* This is primarily useful when using GL-JS maps in a single page app, wherein a user
* would navigate between various views that can cause Map instances to constantly be
* created and destroyed.
*
* @function prewarm
* @example
* maplibregl.prewarm()
*/
prewarm: typeof prewarm;
/**
* Clears up resources that have previously been created by `maplibregl.prewarm()`.
* Note that this is typically not necessary. You should only call this function
* if you expect the user of your app to not return to a Map view at any point
* in your application.
*
* @function clearPrewarmedResources
* @example
* maplibregl.clearPrewarmedResources()
*/
clearPrewarmedResources: typeof clearPrewarmedResources;
/**
* Gets and sets the number of web workers instantiated on a page with GL JS maps.
* By default, it is set to half the number of CPU cores (capped at 6).
* Make sure to set this property before creating any map instances for it to have effect.
*
* @var {string} workerCount
* @returns {number} Number of workers currently configured.
* @example
* maplibregl.workerCount = 2;
*/
workerCount: number;
/**
* Gets and sets the maximum number of images (raster tiles, sprites, icons) to load in parallel,
* which affects performance in raster-heavy maps. 16 by default.
*
* @var {string} maxParallelImageRequests
* @returns {number} Number of parallel requests currently configured.
* @example
* maplibregl.maxParallelImageRequests = 10;
*/
maxParallelImageRequests: number;
/**
* Clears browser storage used by this library. Using this method flushes the MapLibre tile
* cache that is managed by this library. Tiles may still be cached by the browser
* in some cases.
*
* This API is supported on browsers where the [`Cache` API](https://developer.mozilla.org/en-US/docs/Web/API/Cache)
* is supported and enabled. This includes all major browsers when pages are served over
* `https://`, except Internet Explorer and Edge Mobile.
*
* When called in unsupported browsers or environments (private or incognito mode), the
* callback will be called with an error argument.
*
* @function clearStorage
* @param {Function} callback Called with an error argument if there is an error.
* @example
* maplibregl.clearStorage();
*/
clearStorage(callback?: (err?: Error | null) => void): void;
workerUrl: string;
/**
* Sets a custom load tile function that will be called when using a source that starts with a custom url schema.
* The example below will be triggered for custom:// urls defined in the sources list in the style definitions.
* The function passed will receive the request parameters and should call the callback with the resulting request,
* for example a pbf vector tile, non-compressed, represented as ArrayBuffer.
*
* @function addProtocol
* @param {string} customProtocol - the protocol to hook, for example 'custom'
* @param {Function} loadFn - the function to use when trying to fetch a tile specified by the customProtocol
* @example
* // this will fetch a file using the fetch API (this is obviously a non iteresting example...)
* maplibre.addProtocol('custom', (params, callback) => {
fetch(`https://${params.url.split("://")[1]}`)
.then(t => {
if (t.status == 200) {
t.arrayBuffer().then(arr => {
callback(null, arr, null, null);
});
} else {
callback(new Error(`Tile fetch error: ${t.statusText}`));
}
})
.catch(e => {
callback(new Error(e));
});
return { cancel: () => { } };
});
* // the following is an example of a way to return an error when trying to load a tile
* maplibre.addProtocol('custom2', (params, callback) => {
* callback(new Error('someErrorMessage'));
* return { cancel: () => { } };
* });
*/
addProtocol(customProtocol: string, loadFn: (requestParameters: RequestParameters, callback: ResponseCallback<any>) => Cancelable): void;
/**
* Removes a previusly added protocol
*
* @function removeProtocol
* @param {string} customProtocol - the custom protocol to remove registration for
* @example
* maplibregl.removeProtocol('custom');
*/
removeProtocol(customProtocol: string): void;
};
/**
* Test whether the browser supports MapLibre GL JS.
*
* @function supported
* @param {Object} [options]
* @param {boolean} [options.failIfMajorPerformanceCaveat=false] If `true`,
* the function will return `false` if the performance of MapLibre GL JS would
* be dramatically worse than expected (e.g. a software WebGL renderer would be used).
* @return {boolean}
* @example
* // Show an alert if the browser does not support MapLibre GL
* if (!maplibregl.supported()) {
* alert('Your browser does not support MapLibre GL');
* }
* @see [Check for browser support](https://maplibre.org/maplibre-gl-js-docs/example/check-for-support/)
*/
/**
* Sets the map's [RTL text plugin](https://www.mapbox.com/mapbox-gl-js/plugins/#mapbox-gl-rtl-text).
* Necessary for supporting the Arabic and Hebrew languages, which are written right-to-left.
*
* @function setRTLTextPlugin
* @param {string} pluginURL URL pointing to the Mapbox RTL text plugin source.
* @param {Function} callback Called with an error argument if there is an error.
* @param {boolean} lazy If set to `true`, mapboxgl will defer loading the plugin until rtl text is encountered,
* rtl text will then be rendered only after the plugin finishes loading.
* @example
* maplibregl.setRTLTextPlugin('https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.0/mapbox-gl-rtl-text.js');
* @see [Add support for right-to-left scripts](https://maplibre.org/maplibre-gl-js-docs/example/mapbox-gl-rtl-text/)
*/
/**
* Gets the map's [RTL text plugin](https://www.mapbox.com/mapbox-gl-js/plugins/#mapbox-gl-rtl-text) status.
* The status can be `unavailable` (i.e. not requested or removed), `loading`, `loaded` or `error`.
* If the status is `loaded` and the plugin is requested again, an error will be thrown.
*
* @function getRTLTextPluginStatus
* @example
* const pluginStatus = maplibregl.getRTLTextPluginStatus();
*/
export default exported;
export as namespace maplibregl;
export {};
This file has been truncated, but you can view the full file.
/* MapLibre GL JS is licensed under the 3-Clause BSD License. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v2.0.5/LICENSE.txt */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.maplibregl = factory());
})(this, (function () { 'use strict';
/* eslint-disable */
var shared, worker, maplibregl;
// define gets called three times: one for each chunk. we rely on the order
// they're imported to know which is which
function define(_, chunk) {
if (!shared) {
shared = chunk;
} else if (!worker) {
worker = chunk;
} else {
var workerBundleString = 'var sharedChunk = {}; (' + shared + ')(sharedChunk); (' + worker + ')(sharedChunk);'
var sharedChunk = {};
shared(sharedChunk);
maplibregl = chunk(sharedChunk);
if (typeof window !== 'undefined') {
maplibregl.workerUrl = window.URL.createObjectURL(new Blob([workerBundleString], { type: 'text/javascript' }));
}
}
}
define(["exports"],(function(t){"use strict";var e=r;function r(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=n;}function n(t,r,n,i){const s=new e(t,r,n,i);return function(t){return s.solve(t)}}r.prototype={sampleCurveX:function(t){return ((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return ((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return (3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,n=0;n<8;n++){var i=this.sampleCurveX(r)-t;if(Math.abs(i)<e)return r;var s=this.sampleCurveDerivativeX(r);if(Math.abs(s)<1e-6)break;r-=i/s;}var a=0,o=1;for(r=t,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-t)<e));n++)t>i?a=r:o=r,r=.5*(o-a)+a;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};const i=n(.25,.1,.25,1);function s(t,e,r){return Math.min(r,Math.max(e,t))}function a(t,e,r){const n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function o(t,...e){for(const r of e)for(const e in r)t[e]=r[e];return t}let l=1;function u(t,e){t.forEach((t=>{e[t]&&(e[t]=e[t].bind(e));}));}function c(t,e,r){const n={};for(const i in t)n[i]=e.call(r||this,t[i],i,t);return n}function h(t,e,r){const n={};for(const i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function p(t){return Array.isArray(t)?t.map(p):"object"==typeof t&&t?c(t,p):t}const f={};function d(t){f[t]||("undefined"!=typeof console&&console.warn(t),f[t]=!0);}function y(t,e,r){return (r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function m(t){let e=0;for(let r,n,i=0,s=t.length,a=s-1;i<s;a=i++)r=t[i],n=t[a],e+=(n.x-r.x)*(r.y+n.y);return e}function g(){return "undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function x(t){const e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((t,r,n,i)=>{const s=n||i;return e[r]=!s||s.toLowerCase(),""})),e["max-age"]){const t=parseInt(e["max-age"],10);isNaN(t)?delete e["max-age"]:e["max-age"]=t;}return e}let v,b,w=null;function _(t){if(null==w){const e=t.navigator?t.navigator.userAgent:null;w=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")));}return w}function A(t){return "undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap}const k={now:performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(t){const e=requestAnimationFrame(t);return {cancel:()=>cancelAnimationFrame(e)}},getImageData(t,e=0){const r=window.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:t=>(v||(v=document.createElement("a")),v.href=t,v.href),hardwareConcurrency:"undefined"!=typeof navigator&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return !!matchMedia&&(null==b&&(b=matchMedia("(prefers-reduced-motion: reduce)")),b.matches)}};var S=z;function z(t,e){this.x=t,this.y=e;}z.prototype={clone:function(){return new z(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=n,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-n*(this.y-e.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},z.convert=function(t){return t instanceof z?t:Array.isArray(t)?new z(t[0],t[1]):t};const I={MAX_PARALLEL_IMAGE_REQUESTS:16,REGISTERED_PROTOCOLS:{}},M="mapbox-tiles";let C,B,P=500,V=50;function E(){"undefined"==typeof caches||C||(C=caches.open(M));}let F=1/0;const T={supported:!1,testSupport:function(t){!$&&D&&(O?R(t):L=t);}};let L,D,$=!1,O=!1;function R(t){const e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,D),t.isContextLost())return;T.supported=!0;}catch(t){}t.deleteTexture(e),$=!0;}"undefined"!=typeof document&&(D=document.createElement("img"),D.onload=function(){L&&R(L),L=null,O=!0;},D.onerror=function(){$=!0,L=null;},D.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const U={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(U);class q extends Error{constructor(t,e,r){super(t),this.status=e,this.url=r,this.name=this.constructor.name,this.message=t;}toString(){return `${this.name}: ${this.message} (${this.status}): ${this.url}`}}const j=g()?()=>self.worker&&self.worker.referrer:()=>("blob:"===window.location.protocol?window.parent:window).location.href;function N(t,e){const r=new AbortController,n=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:j(),signal:r.signal});let i=!1,s=!1;"json"===t.type&&n.headers.set("Accept","application/json");return ((r,a,o)=>{if(s)return;const l=Date.now();fetch(n).then((r=>r.ok?((r,a,o)=>{("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((t=>{s||(a&&o&&function(t,e,r){if(E(),!C)return;const n={status:e.status,statusText:e.statusText,headers:new Headers};e.headers.forEach(((t,e)=>n.headers.set(e,t)));const i=x(e.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===B)try{new Response(new ReadableStream),B=!0;}catch(t){B=!1;}B?e(t.body):t.blob().then(e);}(e,(e=>{const r=new Response(e,n);E(),C&&C.then((e=>e.put(function(t){const e=t.indexOf("?");return e<0?t:t.slice(0,e)}(t.url),r))).catch((t=>d(t.message)));})));}(n,a,o),i=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")));})).catch((t=>{s||e(new Error(t.message));}));})(r,null,l):e(new q(r.statusText,r.status,t.url)))).catch((t=>{20!==t.code&&e(new Error(t.message));}));})(),{cancel:()=>{s=!0,i||r.abort();}}}const K=function(t,e){if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){if(g()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e);if(!g()){const r=t.url.substring(0,t.url.indexOf("://"));return (I.REGISTERED_PROTOCOLS[r]||N)(t,e)}}if(!(/^file:/.test(r=t.url)||/^file:/.test(j())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return N(t,e);if(g()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){const r=new XMLHttpRequest;r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer");for(const e in t.headers)r.setRequestHeader(e,t.headers[e]);return "json"===t.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===t.credentials,r.onerror=()=>{e(new Error(r.statusText));},r.onload=()=>{if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){let n=r.response;if("json"===t.type)try{n=JSON.parse(r.response);}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"));}else e(new q(r.statusText,r.status,t.url));},r.send(t.body),{cancel:()=>r.abort()}}(t,e)},Z=function(t,e){return K(o(t,{type:"arrayBuffer"}),e)};function G(t){const e=window.document.createElement("a");return e.href=t,e.protocol===window.document.location.protocol&&e.host===window.document.location.host}const J="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let X,Y;X=[],Y=0;const H=function(t,e){if(T.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),Y>=I.MAX_PARALLEL_IMAGE_REQUESTS){const r={requestParameters:t,callback:e,cancelled:!1,cancel(){this.cancelled=!0;}};return X.push(r),r}Y++;let r=!1;const n=()=>{if(!r)for(r=!0,Y--;X.length&&Y<I.MAX_PARALLEL_IMAGE_REQUESTS;){const t=X.shift(),{requestParameters:e,callback:r,cancelled:n}=t;n||(t.cancel=H(e,r).cancel);}},i=Z(t,((t,r,i,s)=>{n(),t?e(t):r&&function(t,e,r,n){"function"==typeof createImageBitmap?function(t,e){const r=new Blob([new Uint8Array(t)],{type:"image/png"});createImageBitmap(r).then((t=>{e(null,t);})).catch((t=>{e(new Error(`Could not load image because of ${t.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`));}));}(t,e):function(t,e,r,n){const i=new Image;i.onload=()=>{e(null,i),URL.revokeObjectURL(i.src),i.onload=null,window.requestAnimationFrame((()=>{i.src=J;}));},i.onerror=()=>e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const s=new Blob([new Uint8Array(t)],{type:"image/png"});i.cacheControl=r,i.expires=n,i.src=t.byteLength?URL.createObjectURL(s):J;}(t,e,r,n);}(r,e,i,s);}));return {cancel:()=>{i.cancel(),n();}}};function W(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e));}function Q(t,e,r){if(r&&r[t]){const n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1);}}class tt{constructor(t,e={}){o(this,e),this.type=t;}}class et extends tt{constructor(t,e={}){super("error",o({error:t},e));}}class rt{on(t,e){return this._listeners=this._listeners||{},W(t,e,this._listeners),this}off(t,e){return Q(t,e,this._listeners),Q(t,e,this._oneTimeListeners),this}once(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},W(t,e,this._oneTimeListeners),this}fire(t,e){"string"==typeof t&&(t=new tt(t,e||{}));const r=t.type;if(this.listens(r)){t.target=this;const e=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(const r of e)r.call(this,t);const n=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(const e of n)Q(r,e,this._oneTimeListeners),e.call(this,t);const i=this._eventedParent;i&&(o(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),i.fire(t));}else t instanceof et&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}}var nt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate-to-line":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};class it{constructor(t,e,r,n){this.message=(t?`${t}: `:"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__);}}function st(t){const e=t.value;return e?[new it(t.key,e,"constants have been deprecated as of v8")]:[]}function at(t,...e){for(const r of e)for(const e in r)t[e]=r[e];return t}function ot(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function lt(t){if(Array.isArray(t))return t.map(lt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const r in t)e[r]=lt(t[r]);return e}return ot(t)}class ut extends Error{constructor(t,e){super(e),this.message=e,this.key=t;}}class ct{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[t,r]of e)this.bindings[t]=r;}concat(t){return new ct(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return !!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const ht={kind:"null"},pt={kind:"number"},ft={kind:"string"},dt={kind:"boolean"},yt={kind:"color"},mt={kind:"object"},gt={kind:"value"},xt={kind:"collator"},vt={kind:"formatted"},bt={kind:"resolvedImage"};function wt(t,e){return {kind:"array",itemType:t,N:e}}function _t(t){if("array"===t.kind){const e=_t(t.itemType);return "number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const At=[ht,pt,ft,dt,yt,vt,mt,wt(gt),bt];function kt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!kt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else {if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of At)if(!kt(t,e))return null}return `Expected ${_t(t)} but found ${_t(e)} instead.`}function St(t,e){return e.some((e=>e.kind===t.kind))}function zt(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}var It,Mt={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Ct(t){return (t=Math.round(t))<0?0:t>255?255:t}function Bt(t){return Ct("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function Pt(t){return (e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e;}function Vt(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{It={}.parseCSSColor=function(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in Mt)return Mt[r].slice();if("#"===r[0])return 4===r.length?(e=parseInt(r.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===r.length&&(e=parseInt(r.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var n=r.indexOf("("),i=r.indexOf(")");if(-1!==n&&i+1===r.length){var s=r.substr(0,n),a=r.substr(n+1,i-(n+1)).split(","),o=1;switch(s){case"rgba":if(4!==a.length)return null;o=Pt(a.pop());case"rgb":return 3!==a.length?null:[Bt(a[0]),Bt(a[1]),Bt(a[2]),o];case"hsla":if(4!==a.length)return null;o=Pt(a.pop());case"hsl":if(3!==a.length)return null;var l=(parseFloat(a[0])%360+360)%360/360,u=Pt(a[1]),c=Pt(a[2]),h=c<=.5?c*(u+1):c+u-c*u,p=2*c-h;return [Ct(255*Vt(p,h,l+1/3)),Ct(255*Vt(p,h,l)),Ct(255*Vt(p,h,l-1/3)),o];default:return null}}return null};}catch(t){}class Et{constructor(t,e,r,n=1){this.r=t,this.g=e,this.b=r,this.a=n;}static parse(t){if(!t)return;if(t instanceof Et)return t;if("string"!=typeof t)return;const e=It(t);return e?new Et(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,r,n]=this.toArray();return `rgba(${Math.round(t)},${Math.round(e)},${Math.round(r)},${n})`}toArray(){const{r:t,g:e,b:r,a:n}=this;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*r/n,n]}}Et.black=new Et(0,0,0,1),Et.white=new Et(1,1,1,1),Et.transparent=new Et(0,0,0,0),Et.red=new Et(1,0,0,1);class Ft{constructor(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"});}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Tt{constructor(t,e,r,n,i){this.text=t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i;}}class Lt{constructor(t){this.sections=t;}static fromString(t){return new Lt([new Tt(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||t.image&&0!==t.image.name.length))}static factory(t){return t instanceof Lt?t:Lt.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}serialize(){const t=["format"];for(const e of this.sections){if(e.image){t.push(["image",e.image.name]);continue}t.push(e.text);const r={};e.fontStack&&(r["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(r["font-scale"]=e.scale),e.textColor&&(r["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(r);}return t}}class Dt{constructor(t){this.name=t.name,this.available=t.available;}toString(){return this.name}static fromString(t){return t?new Dt({name:t,available:!1}):null}serialize(){return ["image",this.name]}}function $t(t,e,r,n){return "number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Ot(t){if(null===t)return !0;if("string"==typeof t)return !0;if("boolean"==typeof t)return !0;if("number"==typeof t)return !0;if(t instanceof Et)return !0;if(t instanceof Ft)return !0;if(t instanceof Lt)return !0;if(t instanceof Dt)return !0;if(Array.isArray(t)){for(const e of t)if(!Ot(e))return !1;return !0}if("object"==typeof t){for(const e in t)if(!Ot(t[e]))return !1;return !0}return !1}function Rt(t){if(null===t)return ht;if("string"==typeof t)return ft;if("boolean"==typeof t)return dt;if("number"==typeof t)return pt;if(t instanceof Et)return yt;if(t instanceof Ft)return xt;if(t instanceof Lt)return vt;if(t instanceof Dt)return bt;if(Array.isArray(t)){const e=t.length;let r;for(const e of t){const t=Rt(e);if(r){if(r===t)continue;r=gt;break}r=t;}return wt(r||gt,e)}return mt}function Ut(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Et||t instanceof Lt||t instanceof Dt?t.toString():JSON.stringify(t)}class qt{constructor(t,e){this.type=t,this.value=e;}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Ot(t[1]))return e.error("invalid value");const r=t[1];let n=Rt(r);const i=e.expectedType;return "array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new qt(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return !0}serialize(){return "array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Et?["rgba"].concat(this.value.toArray()):this.value instanceof Lt?this.value.serialize():this.value}}class jt{constructor(t){this.name="ExpressionEvaluationError",this.message=t;}toJSON(){return this.message}}const Nt={string:ft,number:pt,boolean:dt,object:mt};class Kt{constructor(t,e){this.type=t,this.args=e;}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let r,n=1;const i=t[0];if("array"===i){let i,s;if(t.length>2){const r=t[1];if("string"!=typeof r||!(r in Nt)||"object"===r)return e.error('The item type argument of "array" must be one of string, number, boolean',1);i=Nt[r],n++;}else i=gt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);s=t[2],n++;}r=wt(i,s);}else r=Nt[i];const s=[];for(;n<t.length;n++){const r=e.parse(t[n],n,gt);if(!r)return null;s.push(r);}return new Kt(r,s)}evaluate(t){for(let e=0;e<this.args.length;e++){const r=this.args[e].evaluate(t);if(!kt(this.type,Rt(r)))return r;if(e===this.args.length-1)throw new jt(`Expected value to be of type ${_t(this.type)}, but found ${_t(Rt(r))} instead.`)}return null}eachChild(t){this.args.forEach(t);}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);const n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n);}}return e.concat(this.args.map((t=>t.serialize())))}}class Zt{constructor(t){this.type=vt,this.sections=t;}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");const n=[];let i=!1;for(let r=1;r<=t.length-1;++r){const s=t[r];if(i&&"object"==typeof s&&!Array.isArray(s)){i=!1;let t=null;if(s["font-scale"]&&(t=e.parse(s["font-scale"],1,pt),!t))return null;let r=null;if(s["text-font"]&&(r=e.parse(s["text-font"],1,wt(ft)),!r))return null;let a=null;if(s["text-color"]&&(a=e.parse(s["text-color"],1,yt),!a))return null;const o=n[n.length-1];o.scale=t,o.font=r,o.textColor=a;}else {const s=e.parse(t[r],1,gt);if(!s)return null;const a=s.type.kind;if("string"!==a&&"value"!==a&&"null"!==a&&"resolvedImage"!==a)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:s,scale:null,font:null,textColor:null});}}return new Zt(n)}evaluate(t){return new Lt(this.sections.map((e=>{const r=e.content.evaluate(t);return Rt(r)===bt?new Tt("",r,null,null,null):new Tt(Ut(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor);}outputDefined(){return !1}serialize(){const t=["format"];for(const e of this.sections){t.push(e.content.serialize());const r={};e.scale&&(r["font-scale"]=e.scale.serialize()),e.font&&(r["text-font"]=e.font.serialize()),e.textColor&&(r["text-color"]=e.textColor.serialize()),t.push(r);}return t}}class Gt{constructor(t){this.type=bt,this.input=t;}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const r=e.parse(t[1],1,ft);return r?new Gt(r):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),r=Dt.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r}eachChild(t){t(this.input);}outputDefined(){return !1}serialize(){return ["image",this.input.serialize()]}}const Jt={"to-boolean":dt,"to-color":yt,"to-number":pt,"to-string":ft};class Xt{constructor(t,e){this.type=t,this.args=e;}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");const n=Jt[r],i=[];for(let r=1;r<t.length;r++){const n=e.parse(t[r],r,gt);if(!n)return null;i.push(n);}return new Xt(n,i)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let e,r;for(const n of this.args){if(e=n.evaluate(t),r=null,e instanceof Et)return e;if("string"==typeof e){const r=t.parseColor(e);if(r)return r}else if(Array.isArray(e)&&(r=e.length<3||e.length>4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:$t(e[0],e[1],e[2],e[3]),!r))return new Et(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new jt(r||`Could not parse color from value '${"string"==typeof e?e:String(JSON.stringify(e))}'`)}if("number"===this.type.kind){let e=null;for(const r of this.args){if(e=r.evaluate(t),null===e)return 0;const n=Number(e);if(!isNaN(n))return n}throw new jt(`Could not convert ${JSON.stringify(e)} to number.`)}return "formatted"===this.type.kind?Lt.fromString(Ut(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?Dt.fromString(Ut(this.args[0].evaluate(t))):Ut(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t);}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new Zt([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Gt(this.args[0]).serialize();const t=[`to-${this.type.kind}`];return this.eachChild((e=>{t.push(e.serialize());})),t}}const Yt=["Unknown","Point","LineString","Polygon"];class Ht{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null;}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Yt[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Et.parse(t)),e}}class Wt{constructor(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n;}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t);}outputDefined(){return !1}serialize(){return [this.name].concat(this.args.map((t=>t.serialize())))}static parse(t,e){const r=t[0],n=Wt.definitions[r];if(!n)return e.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const i=Array.isArray(n)?n[0]:n.type,s=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,a=s.filter((([e])=>!Array.isArray(e)||e.length===t.length-1));let o=null;for(const[n,s]of a){o=new we(e.registry,e.path,null,e.scope);const a=[];let l=!1;for(let e=1;e<t.length;e++){const r=t[e],i=Array.isArray(n)?n[e-1]:n.type,s=o.parse(r,1+a.length,i);if(!s){l=!0;break}a.push(s);}if(!l)if(Array.isArray(n)&&n.length!==a.length)o.error(`Expected ${n.length} arguments, but found ${a.length} instead.`);else {for(let t=0;t<a.length;t++){const e=Array.isArray(n)?n[t]:n.type,r=a[t];o.concat(t+1).checkSubtype(e,r.type);}if(0===o.errors.length)return new Wt(r,i,s,a)}}if(1===a.length)e.errors.push(...o.errors);else {const r=(a.length?a:s).map((([t])=>{return e=t,Array.isArray(e)?`(${e.map(_t).join(", ")})`:`(${_t(e.type)}...)`;var e;})).join(" | "),n=[];for(let r=1;r<t.length;r++){const i=e.parse(t[r],1+n.length);if(!i)return null;n.push(_t(i.type));}e.error(`Expected arguments of type ${r}, but found (${n.join(", ")}) instead.`);}return null}static register(t,e){Wt.definitions=e;for(const r in e)t[r]=Wt;}}class Qt{constructor(t,e,r){this.type=xt,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e;}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");const n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,dt);if(!n)return null;const i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,dt);if(!i)return null;let s=null;return r.locale&&(s=e.parse(r.locale,1,ft),!s)?null:new Qt(n,i,s)}evaluate(t){return new Ft(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale);}outputDefined(){return !1}serialize(){const t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]}}const te=8192;function ee(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1]);}function re(t,e){return !(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function ne(t,e){const r=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,i=Math.pow(2,e.z);return [Math.round(r*i*te),Math.round(n*i*te)]}function ie(t,e,r){const n=t[0]-e[0],i=t[1]-e[1],s=t[0]-r[0],a=t[1]-r[1];return n*a-s*i==0&&n*s<=0&&i*a<=0}function se(t,e){let r=!1;for(let a=0,o=e.length;a<o;a++){const o=e[a];for(let e=0,a=o.length;e<a-1;e++){if(ie(t,o[e],o[e+1]))return !1;(i=o[e])[1]>(n=t)[1]!=(s=o[e+1])[1]>n[1]&&n[0]<(s[0]-i[0])*(n[1]-i[1])/(s[1]-i[1])+i[0]&&(r=!r);}}var n,i,s;return r}function ae(t,e){for(let r=0;r<e.length;r++)if(se(t,e[r]))return !0;return !1}function oe(t,e,r,n){const i=n[0]-r[0],s=n[1]-r[1],a=(t[0]-r[0])*s-i*(t[1]-r[1]),o=(e[0]-r[0])*s-i*(e[1]-r[1]);return a>0&&o<0||a<0&&o>0}function le(t,e,r){for(const u of r)for(let r=0;r<u.length-1;++r)if(0!=(o=[(a=u[r+1])[0]-(s=u[r])[0],a[1]-s[1]])[0]*(l=[(i=e)[0]-(n=t)[0],i[1]-n[1]])[1]-o[1]*l[0]&&oe(n,i,s,a)&&oe(s,a,n,i))return !0;var n,i,s,a,o,l;return !1}function ue(t,e){for(let r=0;r<t.length;++r)if(!se(t[r],e))return !1;for(let r=0;r<t.length-1;++r)if(le(t[r],t[r+1],e))return !1;return !0}function ce(t,e){for(let r=0;r<e.length;r++)if(ue(t,e[r]))return !0;return !1}function he(t,e,r){const n=[];for(let i=0;i<t.length;i++){const s=[];for(let n=0;n<t[i].length;n++){const a=ne(t[i][n],r);ee(e,a),s.push(a);}n.push(s);}return n}function pe(t,e,r){const n=[];for(let i=0;i<t.length;i++){const s=he(t[i],e,r);n.push(s);}return n}function fe(t,e,r,n){if(t[0]<r[0]||t[0]>r[2]){const e=.5*n;let i=t[0]-r[0]>e?-n:r[0]-t[0]>e?n:0;0===i&&(i=t[0]-r[2]>e?-n:r[2]-t[0]>e?n:0),t[0]+=i;}ee(e,t);}function de(t,e,r,n){const i=Math.pow(2,n.z)*te,s=[n.x*te,n.y*te],a=[];for(const n of t)for(const t of n){const n=[t.x+s[0],t.y+s[1]];fe(n,e,r,i),a.push(n);}return a}function ye(t,e,r,n){const i=Math.pow(2,n.z)*te,s=[n.x*te,n.y*te],a=[];for(const r of t){const t=[];for(const n of r){const r=[n.x+s[0],n.y+s[1]];ee(e,r),t.push(r);}a.push(t);}if(e[2]-e[0]<=i/2){(o=e)[0]=o[1]=1/0,o[2]=o[3]=-1/0;for(const t of a)for(const n of t)fe(n,e,r,i);}var o;return a}class me{constructor(t,e){this.type=dt,this.geojson=t,this.geometries=e;}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Ot(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t<e.features.length;++t){const r=e.features[t].geometry.type;if("Polygon"===r||"MultiPolygon"===r)return new me(e,e.features[t].geometry)}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new me(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new me(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){const s=he(e.coordinates,n,i),a=de(t.geometry(),r,n,i);if(!re(r,n))return !1;for(const t of a)if(!se(t,s))return !1}if("MultiPolygon"===e.type){const s=pe(e.coordinates,n,i),a=de(t.geometry(),r,n,i);if(!re(r,n))return !1;for(const t of a)if(!ae(t,s))return !1}return !0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){const s=he(e.coordinates,n,i),a=ye(t.geometry(),r,n,i);if(!re(r,n))return !1;for(const t of a)if(!ue(t,s))return !1}if("MultiPolygon"===e.type){const s=pe(e.coordinates,n,i),a=ye(t.geometry(),r,n,i);if(!re(r,n))return !1;for(const t of a)if(!ce(t,s))return !1}return !0}(t,this.geometries)}return !1}eachChild(){}outputDefined(){return !0}serialize(){return ["within",this.geojson]}}function ge(t){if(t instanceof Wt){if("get"===t.name&&1===t.args.length)return !1;if("feature-state"===t.name)return !1;if("has"===t.name&&1===t.args.length)return !1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return !1;if(/^filter-/.test(t.name))return !1}if(t instanceof me)return !1;let e=!0;return t.eachChild((t=>{e&&!ge(t)&&(e=!1);})),e}function xe(t){if(t instanceof Wt&&"feature-state"===t.name)return !1;let e=!0;return t.eachChild((t=>{e&&!xe(t)&&(e=!1);})),e}function ve(t,e){if(t instanceof Wt&&e.indexOf(t.name)>=0)return !1;let r=!0;return t.eachChild((t=>{r&&!ve(t,e)&&(r=!1);})),r}class be{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e;}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const r=t[1];return e.scope.has(r)?new be(r,e.scope.get(r)):e.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return !1}serialize(){return ["var",this.name]}}class we{constructor(t,e=[],r,n=new ct,i=[]){this.registry=t,this.path=e,this.key=e.map((t=>`[${t}]`)).join(""),this.scope=n,this.errors=i,this.expectedType=r;}parse(t,e,r,n,i={}){return e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)}_parse(t,e){function r(t,e,r){return "assert"===r?new Kt(e,[t]):"coerce"===r?new Xt(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const n=t[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const i=this.registry[n];if(i){let n=i.parse(t,this);if(!n)return null;if(this.expectedType){const t=this.expectedType,i=n.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==i.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==i.kind&&"string"!==i.kind){if(this.checkSubtype(t,i))return null}else n=r(n,t,e.typeAnnotation||"coerce");else n=r(n,t,e.typeAnnotation||"assert");}if(!(n instanceof qt)&&"resolvedImage"!==n.type.kind&&_e(n)){const t=new Ht;try{n=new qt(n.type,n.evaluate(t));}catch(t){return this.error(t.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,e,r){const n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new we(this.registry,n,e||null,i,this.errors)}error(t,...e){const r=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new ut(r,t));}checkSubtype(t,e){const r=kt(t,e);return r&&this.error(r),r}}function _e(t){if(t instanceof be)return _e(t.boundExpression);if(t instanceof Wt&&"error"===t.name)return !1;if(t instanceof Qt)return !1;if(t instanceof me)return !1;const e=t instanceof Xt||t instanceof Kt;let r=!0;return t.eachChild((t=>{r=e?r&&_e(t):r&&t instanceof qt;})),!!r&&ge(t)&&ve(t,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Ae(t,e){const r=t.length-1;let n,i,s=0,a=r,o=0;for(;s<=a;)if(o=Math.floor((s+a)/2),n=t[o],i=t[o+1],n<=e){if(o===r||e<i)return o;s=o+1;}else {if(!(n>e))throw new jt("Input is not a number.");a=o-1;}return 0}class ke{constructor(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[t,e]of r)this.labels.push(t),this.outputs.push(e);}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const r=e.parse(t[1],1,pt);if(!r)return null;const n=[];let i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(let r=1;r<t.length;r+=2){const s=1===r?-1/0:t[r],a=t[r+1],o=r,l=r+1;if("number"!=typeof s)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',o);if(n.length&&n[n.length-1][0]>=s)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',o);const u=e.parse(a,l,i);if(!u)return null;i=i||u.type,n.push([s,u]);}return new ke(i,r,n)}evaluate(t){const e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);const i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[Ae(e,n)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e);}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){const t=["step",this.input.serialize()];for(let e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}function Se(t,e,r){return t*(1-r)+e*r}var ze=Object.freeze({__proto__:null,number:Se,color:function(t,e,r){return new Et(Se(t.r,e.r,r),Se(t.g,e.g,r),Se(t.b,e.b,r),Se(t.a,e.a,r))},array:function(t,e,r){return t.map(((t,n)=>Se(t,e[n],r)))}});const Ie=.95047,Me=1.08883,Ce=4/29,Be=6/29,Pe=3*Be*Be,Ve=Math.PI/180,Ee=180/Math.PI;function Fe(t){return t>.008856451679035631?Math.pow(t,1/3):t/Pe+Ce}function Te(t){return t>Be?t*t*t:Pe*(t-Ce)}function Le(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function De(t){return (t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function $e(t){const e=De(t.r),r=De(t.g),n=De(t.b),i=Fe((.4124564*e+.3575761*r+.1804375*n)/Ie),s=Fe((.2126729*e+.7151522*r+.072175*n)/1);return {l:116*s-16,a:500*(i-s),b:200*(s-Fe((.0193339*e+.119192*r+.9503041*n)/Me)),alpha:t.a}}function Oe(t){let e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Te(e),r=Ie*Te(r),n=Me*Te(n),new Et(Le(3.2404542*r-1.5371385*e-.4985314*n),Le(-.969266*r+1.8760108*e+.041556*n),Le(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function Re(t,e,r){const n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}const Ue={forward:$e,reverse:Oe,interpolate:function(t,e,r){return {l:Se(t.l,e.l,r),a:Se(t.a,e.a,r),b:Se(t.b,e.b,r),alpha:Se(t.alpha,e.alpha,r)}}},qe={forward:function(t){const{l:e,a:r,b:n}=$e(t),i=Math.atan2(n,r)*Ee;return {h:i<0?i+360:i,c:Math.sqrt(r*r+n*n),l:e,alpha:t.a}},reverse:function(t){const e=t.h*Ve,r=t.c;return Oe({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return {h:Re(t.h,e.h,r),c:Se(t.c,e.c,r),l:Se(t.l,e.l,r),alpha:Se(t.alpha,e.alpha,r)}}};var je=Object.freeze({__proto__:null,lab:Ue,hcl:qe});class Ne{constructor(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(const[t,e]of i)this.labels.push(t),this.outputs.push(e);}static interpolationFactor(t,r,n,i){let s=0;if("exponential"===t.name)s=Ke(r,t.base,n,i);else if("linear"===t.name)s=Ke(r,1,n,i);else if("cubic-bezier"===t.name){const a=t.controlPoints;s=new e(a[0],a[1],a[2],a[3]).solve(Ke(r,1,n,i));}return s}static parse(t,e){let[r,n,i,...s]=t;if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const t=n[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:t};}else {if("cubic-bezier"!==n[0])return e.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const t=n.slice(1);if(4!==t.length||t.some((t=>"number"!=typeof t||t<0||t>1)))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:t};}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(i=e.parse(i,2,pt),!i)return null;const a=[];let o=null;"interpolate-hcl"===r||"interpolate-lab"===r?o=yt:e.expectedType&&"value"!==e.expectedType.kind&&(o=e.expectedType);for(let t=0;t<s.length;t+=2){const r=s[t],n=s[t+1],i=t+3,l=t+4;if("number"!=typeof r)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',i);if(a.length&&a[a.length-1][0]>=r)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',i);const u=e.parse(n,l,o);if(!u)return null;o=o||u.type,a.push([r,u]);}return "number"===o.kind||"color"===o.kind||"array"===o.kind&&"number"===o.itemType.kind&&"number"==typeof o.N?new Ne(o,r,n,i,a):e.error(`Type ${_t(o)} is not interpolatable.`)}evaluate(t){const e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);const i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);const s=Ae(e,n),a=Ne.interpolationFactor(this.interpolation,n,e[s],e[s+1]),o=r[s].evaluate(t),l=r[s+1].evaluate(t);return "interpolate"===this.operator?ze[this.type.kind.toLowerCase()](o,l,a):"interpolate-hcl"===this.operator?qe.reverse(qe.interpolate(qe.forward(o),qe.forward(l),a)):Ue.reverse(Ue.interpolate(Ue.forward(o),Ue.forward(l),a))}eachChild(t){t(this.input);for(const e of this.outputs)t(e);}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){let t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const e=[this.operator,t,this.input.serialize()];for(let t=0;t<this.labels.length;t++)e.push(this.labels[t],this.outputs[t].serialize());return e}}function Ke(t,e,r,n){const i=n-r,s=t-r;return 0===i?0:1===e?s/i:(Math.pow(e,s)-1)/(Math.pow(e,i)-1)}class Ze{constructor(t,e){this.type=t,this.args=e;}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let r=null;const n=e.expectedType;n&&"value"!==n.kind&&(r=n);const i=[];for(const n of t.slice(1)){const t=e.parse(n,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!t)return null;r=r||t.type,i.push(t);}const s=n&&i.some((t=>kt(n,t.type)));return new Ze(s?gt:r,i)}evaluate(t){let e,r=null,n=0;for(const i of this.args)if(n++,r=i.evaluate(t),r&&r instanceof Dt&&!r.available&&(e||(e=r.name),r=null,n===this.args.length&&(r=e)),null!==r)break;return r}eachChild(t){this.args.forEach(t);}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=["coalesce"];return this.eachChild((e=>{t.push(e.serialize());})),t}}class Ge{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e;}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result);}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const r=[];for(let n=1;n<t.length-1;n+=2){const i=t[n];if("string"!=typeof i)return e.error(`Expected string, but found ${typeof i} instead.`,n);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);const s=e.parse(t[n+1],n+1);if(!s)return null;r.push([i,s]);}const n=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return n?new Ge(r,n):null}outputDefined(){return this.result.outputDefined()}serialize(){const t=["let"];for(const[e,r]of this.bindings)t.push(e,r.serialize());return t.push(this.result.serialize()),t}}class Je{constructor(t,e,r){this.type=t,this.index=e,this.input=r;}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,pt),n=e.parse(t[2],2,wt(e.expectedType||gt));return r&&n?new Je(n.type.itemType,r,n):null}evaluate(t){const e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new jt(`Array index out of bounds: ${e} < 0.`);if(e>=r.length)throw new jt(`Array index out of bounds: ${e} > ${r.length-1}.`);if(e!==Math.floor(e))throw new jt(`Array index must be an integer, but found ${e} instead.`);return r[e]}eachChild(t){t(this.index),t(this.input);}outputDefined(){return !1}serialize(){return ["at",this.index.serialize(),this.input.serialize()]}}class Xe{constructor(t,e){this.type=dt,this.needle=t,this.haystack=e;}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,gt),n=e.parse(t[2],2,gt);return r&&n?St(r.type,[dt,ft,pt,ht,gt])?new Xe(r,n):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${_t(r.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return !1;if(!zt(e,["boolean","string","number","null"]))throw new jt(`Expected first argument to be of type boolean, string, number or null, but found ${_t(Rt(e))} instead.`);if(!zt(r,["string","array"]))throw new jt(`Expected second argument to be of type array or string, but found ${_t(Rt(r))} instead.`);return r.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack);}outputDefined(){return !0}serialize(){return ["in",this.needle.serialize(),this.haystack.serialize()]}}class Ye{constructor(t,e,r){this.type=pt,this.needle=t,this.haystack=e,this.fromIndex=r;}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,gt),n=e.parse(t[2],2,gt);if(!r||!n)return null;if(!St(r.type,[dt,ft,pt,ht,gt]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${_t(r.type)} instead`);if(4===t.length){const i=e.parse(t[3],3,pt);return i?new Ye(r,n,i):null}return new Ye(r,n)}evaluate(t){const e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!zt(e,["boolean","string","number","null"]))throw new jt(`Expected first argument to be of type boolean, string, number or null, but found ${_t(Rt(e))} instead.`);if(!zt(r,["string","array"]))throw new jt(`Expected second argument to be of type array or string, but found ${_t(Rt(r))} instead.`);if(this.fromIndex){const n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex);}outputDefined(){return !1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return ["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return ["index-of",this.needle.serialize(),this.haystack.serialize()]}}class He{constructor(t,e,r,n,i,s){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=s;}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);const i={},s=[];for(let a=2;a<t.length-1;a+=2){let o=t[a];const l=t[a+1];Array.isArray(o)||(o=[o]);const u=e.concat(a);if(0===o.length)return u.error("Expected at least one branch label.");for(const t of o){if("number"!=typeof t&&"string"!=typeof t)return u.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,Rt(t)))return null}else r=Rt(t);if(void 0!==i[String(t)])return u.error("Branch labels must be unique.");i[String(t)]=s.length;}const c=e.parse(l,a,n);if(!c)return null;n=n||c.type,s.push(c);}const a=e.parse(t[1],1,gt);if(!a)return null;const o=e.parse(t[t.length-1],t.length-1,n);return o?"value"!==a.type.kind&&e.concat(1).checkSubtype(r,a.type)?null:new He(r,n,a,i,s,o):null}evaluate(t){const e=this.input.evaluate(t);return (Rt(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise);}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],e=Object.keys(this.cases).sort(),r=[],n={};for(const t of e){const e=n[this.cases[t]];void 0===e?(n[this.cases[t]]=r.length,r.push([this.cases[t],[t]])):r[e][1].push(t);}const i=t=>"number"===this.inputType.kind?Number(t):t;for(const[e,n]of r)t.push(1===n.length?i(n[0]):n.map(i)),t.push(this.outputs[e].serialize());return t.push(this.otherwise.serialize()),t}}class We{constructor(t,e,r){this.type=t,this.branches=e,this.otherwise=r;}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);const n=[];for(let i=1;i<t.length-1;i+=2){const s=e.parse(t[i],i,dt);if(!s)return null;const a=e.parse(t[i+1],i+1,r);if(!a)return null;n.push([s,a]),r=r||a.type;}const i=e.parse(t[t.length-1],t.length-1,r);return i?new We(r,n,i):null}evaluate(t){for(const[e,r]of this.branches)if(e.evaluate(t))return r.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,r]of this.branches)t(e),t(r);t(this.otherwise);}outputDefined(){return this.branches.every((([t,e])=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild((e=>{t.push(e.serialize());})),t}}class Qe{constructor(t,e,r,n){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=n;}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const r=e.parse(t[1],1,gt),n=e.parse(t[2],2,pt);if(!r||!n)return null;if(!St(r.type,[wt(gt),ft,gt]))return e.error(`Expected first argument to be of type array or string, but found ${_t(r.type)} instead`);if(4===t.length){const i=e.parse(t[3],3,pt);return i?new Qe(r.type,r,n,i):null}return new Qe(r.type,r,n)}evaluate(t){const e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!zt(e,["string","array"]))throw new jt(`Expected first argument to be of type array or string, but found ${_t(Rt(e))} instead.`);if(this.endIndex){const n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex);}outputDefined(){return !1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return ["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return ["slice",this.input.serialize(),this.beginIndex.serialize()]}}function tr(t,e){return "=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function er(t,e,r,n){return 0===n.compare(e,r)}function rr(t,e,r){const n="=="!==t&&"!="!==t;return class i{constructor(t,e,r){this.type=dt,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind;}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const r=t[0];let s=e.parse(t[1],1,gt);if(!s)return null;if(!tr(r,s.type))return e.concat(1).error(`"${r}" comparisons are not supported for type '${_t(s.type)}'.`);let a=e.parse(t[2],2,gt);if(!a)return null;if(!tr(r,a.type))return e.concat(2).error(`"${r}" comparisons are not supported for type '${_t(a.type)}'.`);if(s.type.kind!==a.type.kind&&"value"!==s.type.kind&&"value"!==a.type.kind)return e.error(`Cannot compare types '${_t(s.type)}' and '${_t(a.type)}'.`);n&&("value"===s.type.kind&&"value"!==a.type.kind?s=new Kt(a.type,[s]):"value"!==s.type.kind&&"value"===a.type.kind&&(a=new Kt(s.type,[a])));let o=null;if(4===t.length){if("string"!==s.type.kind&&"string"!==a.type.kind&&"value"!==s.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(o=e.parse(t[3],3,xt),!o)return null}return new i(s,a,o)}evaluate(i){const s=this.lhs.evaluate(i),a=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){const e=Rt(s),r=Rt(a);if(e.kind!==r.kind||"string"!==e.kind&&"number"!==e.kind)throw new jt(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const t=Rt(s),r=Rt(a);if("string"!==t.kind||"string"!==r.kind)return e(i,s,a)}return this.collator?r(i,s,a,this.collator.evaluate(i)):e(i,s,a)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator);}outputDefined(){return !0}serialize(){const e=[t];return this.eachChild((t=>{e.push(t.serialize());})),e}}}const nr=rr("==",(function(t,e,r){return e===r}),er),ir=rr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return !er(0,e,r,n)})),sr=rr("<",(function(t,e,r){return e<r}),(function(t,e,r,n){return n.compare(e,r)<0})),ar=rr(">",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),or=rr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),lr=rr(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0}));class ur{constructor(t,e,r,n,i){this.type=ft,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i;}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const r=e.parse(t[1],1,pt);if(!r)return null;const n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");let i=null;if(n.locale&&(i=e.parse(n.locale,1,ft),!i))return null;let s=null;if(n.currency&&(s=e.parse(n.currency,1,ft),!s))return null;let a=null;if(n["min-fraction-digits"]&&(a=e.parse(n["min-fraction-digits"],1,pt),!a))return null;let o=null;return n["max-fraction-digits"]&&(o=e.parse(n["max-fraction-digits"],1,pt),!o)?null:new ur(r,i,s,a,o)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits);}outputDefined(){return !1}serialize(){const t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}class cr{constructor(t){this.type=pt,this.input=t;}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error(`Expected argument of type string or array, but found ${_t(r.type)} instead.`):new cr(r):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new jt(`Expected value to be of type string or array, but found ${_t(Rt(e))} instead.`)}eachChild(t){t(this.input);}outputDefined(){return !1}serialize(){const t=["length"];return this.eachChild((e=>{t.push(e.serialize());})),t}}const hr={"==":nr,"!=":ir,">":ar,"<":sr,">=":lr,"<=":or,array:Kt,at:Je,boolean:Kt,case:We,coalesce:Ze,collator:Qt,format:Zt,image:Gt,in:Xe,"index-of":Ye,interpolate:Ne,"interpolate-hcl":Ne,"interpolate-lab":Ne,length:cr,let:Ge,literal:qt,match:He,number:Kt,"number-format":ur,object:Kt,slice:Qe,step:ke,string:Kt,"to-boolean":Xt,"to-color":Xt,"to-number":Xt,"to-string":Xt,var:be,within:me};function pr(t,[e,r,n,i]){e=e.evaluate(t),r=r.evaluate(t),n=n.evaluate(t);const s=i?i.evaluate(t):1,a=$t(e,r,n,s);if(a)throw new jt(a);return new Et(e/255*s,r/255*s,n/255*s,s)}function fr(t,e){return t in e}function dr(t,e){const r=e[t];return void 0===r?null:r}function yr(t){return {type:t}}function mr(t){return {result:"success",value:t}}function gr(t){return {result:"error",value:t}}function xr(t){return "data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function vr(t){return !!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function br(t){return !!t.expression&&t.expression.interpolated}function wr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function _r(t){return "object"==typeof t&&null!==t&&!Array.isArray(t)}function Ar(t){return t}function kr(t,e){const r="color"===e.type,n=t.stops&&"object"==typeof t.stops[0][0],i=n||!(n||void 0!==t.property),s=t.type||(br(e)?"exponential":"interval");if(r&&((t=at({},t)).stops&&(t.stops=t.stops.map((t=>[t[0],Et.parse(t[1])]))),t.default=Et.parse(t.default?t.default:e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!je[t.colorSpace])throw new Error(`Unknown color space: ${t.colorSpace}`);let a,o,l;if("exponential"===s)a=Mr;else if("interval"===s)a=Ir;else if("categorical"===s){a=zr,o=Object.create(null);for(const e of t.stops)o[e[0]]=e[1];l=typeof t.stops[0][0];}else {if("identity"!==s)throw new Error(`Unknown function type "${s}"`);a=Cr;}if(n){const r={},n=[];for(let e=0;e<t.stops.length;e++){const i=t.stops[e],s=i[0].zoom;void 0===r[s]&&(r[s]={zoom:s,type:t.type,property:t.property,default:t.default,stops:[]},n.push(s)),r[s].stops.push([i[0].value,i[1]]);}const i=[];for(const t of n)i.push([r[t].zoom,kr(r[t],e)]);const s={name:"linear"};return {kind:"composite",interpolationType:s,interpolationFactor:Ne.interpolationFactor.bind(void 0,s),zoomStops:i.map((t=>t[0])),evaluate:({zoom:r},n)=>Mr({stops:i,base:t.base},e,r).evaluate(r,n)}}if(i){const r="exponential"===s?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return {kind:"camera",interpolationType:r,interpolationFactor:Ne.interpolationFactor.bind(void 0,r),zoomStops:t.stops.map((t=>t[0])),evaluate:({zoom:r})=>a(t,e,r,o,l)}}return {kind:"source",evaluate(r,n){const i=n&&n.properties?n.properties[t.property]:void 0;return void 0===i?Sr(t.default,e.default):a(t,e,i,o,l)}}}function Sr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function zr(t,e,r,n,i){return Sr(typeof r===i?n[r]:void 0,t.default,e.default)}function Ir(t,e,r){if("number"!==wr(r))return Sr(t.default,e.default);const n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];const i=Ae(t.stops.map((t=>t[0])),r);return t.stops[i][1]}function Mr(t,e,r){const n=void 0!==t.base?t.base:1;if("number"!==wr(r))return Sr(t.default,e.default);const i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];const s=Ae(t.stops.map((t=>t[0])),r),a=function(t,e,r,n){const i=n-r,s=t-r;return 0===i?0:1===e?s/i:(Math.pow(e,s)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[s][0],t.stops[s+1][0]),o=t.stops[s][1],l=t.stops[s+1][1];let u=ze[e.type]||Ar;if(t.colorSpace&&"rgb"!==t.colorSpace){const e=je[t.colorSpace];u=(t,r)=>e.reverse(e.interpolate(e.forward(t),e.forward(r),a));}return "function"==typeof o.evaluate?{evaluate(...t){const e=o.evaluate.apply(void 0,t),r=l.evaluate.apply(void 0,t);if(void 0!==e&&void 0!==r)return u(e,r,a)}}:u(o,l,a)}function Cr(t,e,r){return "color"===e.type?r=Et.parse(r):"formatted"===e.type?r=Lt.fromString(r.toString()):"resolvedImage"===e.type?r=Dt.fromString(r.toString()):wr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Sr(r,t.default,e.default)}Wt.register(hr,{error:[{kind:"error"},[ft],(t,[e])=>{throw new jt(e.evaluate(t))}],typeof:[ft,[gt],(t,[e])=>_t(Rt(e.evaluate(t)))],"to-rgba":[wt(pt,4),[yt],(t,[e])=>e.evaluate(t).toArray()],rgb:[yt,[pt,pt,pt],pr],rgba:[yt,[pt,pt,pt,pt],pr],has:{type:dt,overloads:[[[ft],(t,[e])=>fr(e.evaluate(t),t.properties())],[[ft,mt],(t,[e,r])=>fr(e.evaluate(t),r.evaluate(t))]]},get:{type:gt,overloads:[[[ft],(t,[e])=>dr(e.evaluate(t),t.properties())],[[ft,mt],(t,[e,r])=>dr(e.evaluate(t),r.evaluate(t))]]},"feature-state":[gt,[ft],(t,[e])=>dr(e.evaluate(t),t.featureState||{})],properties:[mt,[],t=>t.properties()],"geometry-type":[ft,[],t=>t.geometryType()],id:[gt,[],t=>t.id()],zoom:[pt,[],t=>t.globals.zoom],"heatmap-density":[pt,[],t=>t.globals.heatmapDensity||0],"line-progress":[pt,[],t=>t.globals.lineProgress||0],accumulated:[gt,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[pt,yr(pt),(t,e)=>{let r=0;for(const n of e)r+=n.evaluate(t);return r}],"*":[pt,yr(pt),(t,e)=>{let r=1;for(const n of e)r*=n.evaluate(t);return r}],"-":{type:pt,overloads:[[[pt,pt],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[pt],(t,[e])=>-e.evaluate(t)]]},"/":[pt,[pt,pt],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[pt,[pt,pt],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[pt,[],()=>Math.LN2],pi:[pt,[],()=>Math.PI],e:[pt,[],()=>Math.E],"^":[pt,[pt,pt],(t,[e,r])=>Math.pow(e.evaluate(t),r.evaluate(t))],sqrt:[pt,[pt],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[pt,[pt],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[pt,[pt],(t,[e])=>Math.log(e.evaluate(t))],log2:[pt,[pt],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[pt,[pt],(t,[e])=>Math.sin(e.evaluate(t))],cos:[pt,[pt],(t,[e])=>Math.cos(e.evaluate(t))],tan:[pt,[pt],(t,[e])=>Math.tan(e.evaluate(t))],asin:[pt,[pt],(t,[e])=>Math.asin(e.evaluate(t))],acos:[pt,[pt],(t,[e])=>Math.acos(e.evaluate(t))],atan:[pt,[pt],(t,[e])=>Math.atan(e.evaluate(t))],min:[pt,yr(pt),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[pt,yr(pt),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[pt,[pt],(t,[e])=>Math.abs(e.evaluate(t))],round:[pt,[pt],(t,[e])=>{const r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[pt,[pt],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[pt,[pt],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[dt,[ft,gt],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[dt,[gt],(t,[e])=>t.id()===e.value],"filter-type-==":[dt,[ft],(t,[e])=>t.geometryType()===e.value],"filter-<":[dt,[ft,gt],(t,[e,r])=>{const n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n<i}],"filter-id-<":[dt,[gt],(t,[e])=>{const r=t.id(),n=e.value;return typeof r==typeof n&&r<n}],"filter->":[dt,[ft,gt],(t,[e,r])=>{const n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>i}],"filter-id->":[dt,[gt],(t,[e])=>{const r=t.id(),n=e.value;return typeof r==typeof n&&r>n}],"filter-<=":[dt,[ft,gt],(t,[e,r])=>{const n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[dt,[gt],(t,[e])=>{const r=t.id(),n=e.value;return typeof r==typeof n&&r<=n}],"filter->=":[dt,[ft,gt],(t,[e,r])=>{const n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[dt,[gt],(t,[e])=>{const r=t.id(),n=e.value;return typeof r==typeof n&&r>=n}],"filter-has":[dt,[gt],(t,[e])=>e.value in t.properties()],"filter-has-id":[dt,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[dt,[wt(ft)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[dt,[wt(gt)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[dt,[ft,wt(gt)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[dt,[ft,wt(gt)],(t,[e,r])=>function(t,e,r,n){for(;r<=n;){const i=r+n>>1;if(e[i]===t)return !0;e[i]>t?n=i-1:r=i+1;}return !1}(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:dt,overloads:[[[dt,dt],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[yr(dt),(t,e)=>{for(const r of e)if(!r.evaluate(t))return !1;return !0}]]},any:{type:dt,overloads:[[[dt,dt],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[yr(dt),(t,e)=>{for(const r of e)if(r.evaluate(t))return !0;return !1}]]},"!":[dt,[dt],(t,[e])=>!e.evaluate(t)],"is-supported-script":[dt,[ft],(t,[e])=>{const r=t.globals&&t.globals.isSupportedScript;return !r||r(e.evaluate(t))}],upcase:[ft,[ft],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[ft,[ft],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[ft,yr(gt),(t,e)=>e.map((e=>Ut(e.evaluate(t)))).join("")],"resolved-locale":[ft,[xt],(t,[e])=>e.evaluate(t).resolvedLocale()]});class Br{constructor(t,e){this.expression=t,this._warningHistory={},this._evaluator=new Ht,this._defaultValue=e?function(t){return "color"===t.type&&_r(t.default)?new Et(0,0,0,0):"color"===t.type?Et.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null;}evaluateWithoutErrorHandling(t,e,r,n,i,s){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=s,this.expression.evaluate(this._evaluator)}evaluate(t,e,r,n,i,s){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=s||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new jt(`Expected value to be one of ${Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}function Pr(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in hr}function Vr(t,e){const r=new we(hr,[],e?function(t){const e={color:yt,string:ft,number:pt,enum:ft,boolean:dt,formatted:vt,resolvedImage:bt};return "array"===t.type?wt(e[t.value]||gt,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?mr(new Br(n,e)):gr(r.errors)}class Er{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!xe(e.expression);}evaluateWithoutErrorHandling(t,e,r,n,i,s){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,s)}evaluate(t,e,r,n,i,s){return this._styleExpression.evaluate(t,e,r,n,i,s)}}class Fr{constructor(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!xe(e.expression),this.interpolationType=n;}evaluateWithoutErrorHandling(t,e,r,n,i,s){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,s)}evaluate(t,e,r,n,i,s){return this._styleExpression.evaluate(t,e,r,n,i,s)}interpolationFactor(t,e,r){return this.interpolationType?Ne.interpolationFactor(this.interpolationType,t,e,r):0}}function Tr(t,e){const r=Vr(t,e);if("error"===r.result)return r;const n=r.value.expression,i=ge(n);if(!i&&!xr(e))return gr([new ut("","data expressions not supported")]);const s=ve(n,["zoom"]);if(!s&&!vr(e))return gr([new ut("","zoom expressions not supported")]);const a=Dr(n);return a||s?a instanceof ut?gr([a]):a instanceof Ne&&!br(e)?gr([new ut("",'"interpolate" expressions cannot be used with this property')]):mr(a?new Fr(i?"camera":"composite",r.value,a.labels,a instanceof Ne?a.interpolation:void 0):new Er(i?"constant":"source",r.value)):gr([new ut("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Lr{constructor(t,e){this._parameters=t,this._specification=e,at(this,kr(this._parameters,this._specification));}static deserialize(t){return new Lr(t._parameters,t._specification)}static serialize(t){return {_parameters:t._parameters,_specification:t._specification}}}function Dr(t){let e=null;if(t instanceof Ge)e=Dr(t.result);else if(t instanceof Ze){for(const r of t.args)if(e=Dr(r),e)break}else (t instanceof ke||t instanceof Ne)&&t.input instanceof Wt&&"zoom"===t.input.name&&(e=t);return e instanceof ut||t.eachChild((t=>{const r=Dr(t);r instanceof ut?e=r:!e&&r?e=new ut("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&r&&e!==r&&(e=new ut("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'));})),e}function $r(t){const e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},s=t.style,a=t.styleSpec;let o=[];const l=wr(r);if("object"!==l)return [new it(e,r,`object expected, ${l} found`)];for(const t in r){const l=t.split(".")[0],u=n[l]||n["*"];let c;if(i[l])c=i[l];else if(n[l])c=pn;else if(i["*"])c=i["*"];else {if(!n["*"]){o.push(new it(e,r[t],`unknown property "${t}"`));continue}c=pn;}o=o.concat(c({key:(e?`${e}.`:e)+t,value:r[t],valueSpec:u,style:s,styleSpec:a,object:r,objectKey:t},r));}for(const t in n)i[t]||n[t].required&&void 0===n[t].default&&void 0===r[t]&&o.push(new it(e,r,`missing required property "${t}"`));return o}function Or(t){const e=t.value,r=t.valueSpec,n=t.style,i=t.styleSpec,s=t.key,a=t.arrayElementValidator||pn;if("array"!==wr(e))return [new it(s,e,`array expected, ${wr(e)} found`)];if(r.length&&e.length!==r.length)return [new it(s,e,`array length ${r.length} expected, length ${e.length} found`)];if(r["min-length"]&&e.length<r["min-length"])return [new it(s,e,`array length at least ${r["min-length"]} expected, length ${e.length} found`)];let o={type:r.value,values:r.values};i.$version<7&&(o.function=r.function),"object"===wr(r.value)&&(o=r.value);let l=[];for(let t=0;t<e.length;t++)l=l.concat(a({array:e,arrayIndex:t,value:e[t],valueSpec:o,style:n,styleSpec:i,key:`${s}[${t}]`}));return l}function Rr(t){const e=t.key,r=t.value,n=t.valueSpec;let i=wr(r);return "number"===i&&r!=r&&(i="NaN"),"number"!==i?[new it(e,r,`number expected, ${i} found`)]:"minimum"in n&&r<n.minimum?[new it(e,r,`${r} is less than the minimum value ${n.minimum}`)]:"maximum"in n&&r>n.maximum?[new it(e,r,`${r} is greater than the maximum value ${n.maximum}`)]:[]}function Ur(t){const e=t.valueSpec,r=ot(t.value.type);let n,i,s,a={};const o="categorical"!==r&&void 0===t.value.property,l=!o,u="array"===wr(t.value.stops)&&"array"===wr(t.value.stops[0])&&"object"===wr(t.value.stops[0][0]),c=$r({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===r)return [new it(t.key,t.value,'identity function may not have a "stops" property')];let e=[];const n=t.value;return e=e.concat(Or({key:t.key,value:n,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===wr(n)&&0===n.length&&e.push(new it(t.key,n,"array must have at least one stop")),e},default:function(t){return pn({key:t.key,value:t.value,valueSpec:e,style:t.style,styleSpec:t.styleSpec})}}});return "identity"===r&&o&&c.push(new it(t.key,t.value,'missing required property "property"')),"identity"===r||t.value.stops||c.push(new it(t.key,t.value,'missing required property "stops"')),"exponential"===r&&t.valueSpec.expression&&!br(t.valueSpec)&&c.push(new it(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!xr(t.valueSpec)?c.push(new it(t.key,t.value,"property functions not supported")):o&&!vr(t.valueSpec)&&c.push(new it(t.key,t.value,"zoom functions not supported"))),"categorical"!==r&&!u||void 0!==t.value.property||c.push(new it(t.key,t.value,'"property" property is required')),c;function h(t){let r=[];const n=t.value,o=t.key;if("array"!==wr(n))return [new it(o,n,`array expected, ${wr(n)} found`)];if(2!==n.length)return [new it(o,n,`array length 2 expected, length ${n.length} found`)];if(u){if("object"!==wr(n[0]))return [new it(o,n,`object expected, ${wr(n[0])} found`)];if(void 0===n[0].zoom)return [new it(o,n,"object stop key must have zoom")];if(void 0===n[0].value)return [new it(o,n,"object stop key must have value")];if(s&&s>ot(n[0].zoom))return [new it(o,n[0].zoom,"stop zoom values must appear in ascending order")];ot(n[0].zoom)!==s&&(s=ot(n[0].zoom),i=void 0,a={}),r=r.concat($r({key:`${o}[0]`,value:n[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Rr,value:p}}));}else r=r.concat(p({key:`${o}[0]`,value:n[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},n));return Pr(lt(n[1]))?r.concat([new it(`${o}[1]`,n[1],"expressions are not allowed in function stops.")]):r.concat(pn({key:`${o}[1]`,value:n[1],valueSpec:e,style:t.style,styleSpec:t.styleSpec}))}function p(t,s){const o=wr(t.value),l=ot(t.value),u=null!==t.value?t.value:s;if(n){if(o!==n)return [new it(t.key,u,`${o} stop domain type must match previous stop domain type ${n}`)]}else n=o;if("number"!==o&&"string"!==o&&"boolean"!==o)return [new it(t.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==o&&"categorical"!==r){let n=`number expected, ${o} found`;return xr(e)&&void 0===r&&(n+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new it(t.key,u,n)]}return "categorical"!==r||"number"!==o||isFinite(l)&&Math.floor(l)===l?"categorical"!==r&&"number"===o&&void 0!==i&&l<i?[new it(t.key,u,"stop domain values must appear in ascending order")]:(i=l,"categorical"===r&&l in a?[new it(t.key,u,"stop domain values must be unique")]:(a[l]=!0,[])):[new it(t.key,u,`integer expected, found ${l}`)]}}function qr(t){const e=("property"===t.expressionContext?Tr:Vr)(lt(t.value),t.valueSpec);if("error"===e.result)return e.value.map((e=>new it(`${t.key}${e.key}`,t.value,e.message)));const r=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!r.outputDefined())return [new it(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!xe(r))return [new it(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!xe(r))return [new it(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!ve(r,["zoom","feature-state"]))return [new it(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!ge(r))return [new it(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return []}function jr(t){const e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(ot(r))&&i.push(new it(e,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(n.values).indexOf(ot(r))&&i.push(new it(e,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),i}function Nr(t){if(!0===t||!1===t)return !0;if(!Array.isArray(t)||0===t.length)return !1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return !1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!Nr(e)&&"boolean"!=typeof e)return !1;return !0;default:return !0}}const Kr={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Zr(t){if(null==t)return {filter:()=>!0,needGeometry:!1};Nr(t)||(t=Xr(t));const e=Vr(t,Kr);if("error"===e.result)throw new Error(e.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return {filter:(t,r,n)=>e.value.evaluate(t,r,{},n),needGeometry:Jr(t)}}function Gr(t,e){return t<e?-1:t>e?1:0}function Jr(t){if(!Array.isArray(t))return !1;if("within"===t[0])return !0;for(let e=1;e<t.length;e++)if(Jr(t[e]))return !0;return !1}function Xr(t){if(!t)return !0;const e=t[0];return t.length<=1?"any"!==e:"=="===e?Yr(t[1],t[2],"=="):"!="===e?Qr(Yr(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?Yr(t[1],t[2],e):"any"===e?(r=t.slice(1),["any"].concat(r.map(Xr))):"all"===e?["all"].concat(t.slice(1).map(Xr)):"none"===e?["all"].concat(t.slice(1).map(Xr).map(Qr)):"in"===e?Hr(t[1],t.slice(2)):"!in"===e?Qr(Hr(t[1],t.slice(2))):"has"===e?Wr(t[1]):"!has"===e?Qr(Wr(t[1])):"within"!==e||t;var r;}function Yr(t,e,r){switch(t){case"$type":return [`filter-type-${r}`,e];case"$id":return [`filter-id-${r}`,e];default:return [`filter-${r}`,t,e]}}function Hr(t,e){if(0===e.length)return !1;switch(t){case"$type":return ["filter-type-in",["literal",e]];case"$id":return ["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort(Gr)]]:["filter-in-small",t,["literal",e]]}}function Wr(t){switch(t){case"$type":return !0;case"$id":return ["filter-has-id"];default:return ["filter-has",t]}}function Qr(t){return ["!",t]}function tn(t){return Nr(lt(t.value))?qr(at({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):en(t)}function en(t){const e=t.value,r=t.key;if("array"!==wr(e))return [new it(r,e,`array expected, ${wr(e)} found`)];const n=t.styleSpec;let i,s=[];if(e.length<1)return [new it(r,e,"filter array must have at least 1 element")];switch(s=s.concat(jr({key:`${r}[0]`,value:e[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec})),ot(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===ot(e[1])&&s.push(new it(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":3!==e.length&&s.push(new it(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(i=wr(e[1]),"string"!==i&&s.push(new it(`${r}[1]`,e[1],`string expected, ${i} found`)));for(let a=2;a<e.length;a++)i=wr(e[a]),"$type"===ot(e[1])?s=s.concat(jr({key:`${r}[${a}]`,value:e[a],valueSpec:n.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==i&&"number"!==i&&"boolean"!==i&&s.push(new it(`${r}[${a}]`,e[a],`string, number, or boolean expected, ${i} found`));break;case"any":case"all":case"none":for(let n=1;n<e.length;n++)s=s.concat(en({key:`${r}[${n}]`,value:e[n],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":i=wr(e[1]),2!==e.length?s.push(new it(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):"string"!==i&&s.push(new it(`${r}[1]`,e[1],`string expected, ${i} found`));break;case"within":i=wr(e[1]),2!==e.length?s.push(new it(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):"object"!==i&&s.push(new it(`${r}[1]`,e[1],`object expected, ${i} found`));}return s}function rn(t,e){const r=t.key,n=t.style,i=t.styleSpec,s=t.value,a=t.objectKey,o=i[`${e}_${t.layerType}`];if(!o)return [];const l=a.match(/^(.*)-transition$/);if("paint"===e&&l&&o[l[1]]&&o[l[1]].transition)return pn({key:r,value:s,valueSpec:i.transition,style:n,styleSpec:i});const u=t.valueSpec||o[a];if(!u)return [new it(r,s,`unknown property "${a}"`)];let c;if("string"===wr(s)&&xr(u)&&!u.tokens&&(c=/^{([^}]+)}$/.exec(s)))return [new it(r,s,`"${a}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(c[1])} }\`.`)];const h=[];return "symbol"===t.layerType&&("text-field"===a&&n&&!n.glyphs&&h.push(new it(r,s,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&_r(lt(s))&&"identity"===ot(s.type)&&h.push(new it(r,s,'"text-font" does not support identity functions'))),h.concat(pn({key:t.key,value:s,valueSpec:u,style:n,styleSpec:i,expressionContext:"property",propertyType:e,propertyKey:a}))}function nn(t){return rn(t,"paint")}function sn(t){return rn(t,"layout")}function an(t){let e=[];const r=t.value,n=t.key,i=t.style,s=t.styleSpec;r.type||r.ref||e.push(new it(n,r,'either "type" or "ref" is required'));let a=ot(r.type);const o=ot(r.ref);if(r.id){const s=ot(r.id);for(let a=0;a<t.arrayIndex;a++){const t=i.layers[a];ot(t.id)===s&&e.push(new it(n,r.id,`duplicate layer id "${r.id}", previously used at line ${t.id.__line__}`));}}if("ref"in r){let t;["type","source","source-layer","filter","layout"].forEach((t=>{t in r&&e.push(new it(n,r[t],`"${t}" is prohibited for ref layers`));})),i.layers.forEach((e=>{ot(e.id)===o&&(t=e);})),t?t.ref?e.push(new it(n,r.ref,"ref cannot reference another ref layer")):a=ot(t.type):e.push(new it(n,r.ref,`ref layer "${o}" not found`));}else if("background"!==a)if(r.source){const t=i.sources&&i.sources[r.source],s=t&&ot(t.type);t?"vector"===s&&"raster"===a?e.push(new it(n,r.source,`layer "${r.id}" requires a raster source`)):"raster"===s&&"raster"!==a?e.push(new it(n,r.source,`layer "${r.id}" requires a vector source`)):"vector"!==s||r["source-layer"]?"raster-dem"===s&&"hillshade"!==a?e.push(new it(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==a||!r.paint||!r.paint["line-gradient"]||"geojson"===s&&t.lineMetrics||e.push(new it(n,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new it(n,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new it(n,r.source,`source "${r.source}" not found`));}else e.push(new it(n,r,'missing required property "source"'));return e=e.concat($r({key:n,value:r,valueSpec:s.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":()=>[],type:()=>pn({key:`${n}.type`,value:r.type,valueSpec:s.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"}),filter:tn,layout:t=>$r({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":t=>sn(at({layerType:a},t))}}),paint:t=>$r({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":t=>nn(at({layerType:a},t))}})}})),e}function on(t){const e=t.value,r=t.key,n=wr(e);return "string"!==n?[new it(r,e,`string expected, ${n} found`)]:[]}const ln={promoteId:function({key:t,value:e}){if("string"===wr(e))return on({key:t,value:e});{const r=[];for(const n in e)r.push(...on({key:`${t}.${n}`,value:e[n]}));return r}}};function un(t){const e=t.value,r=t.key,n=t.styleSpec,i=t.style;if(!e.type)return [new it(r,e,'"type" is required')];const s=ot(e.type);let a;switch(s){case"vector":case"raster":case"raster-dem":return a=$r({key:r,value:e,valueSpec:n[`source_${s.replace("-","_")}`],style:t.style,styleSpec:n,objectElementValidators:ln}),a;case"geojson":if(a=$r({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,objectElementValidators:ln}),e.cluster)for(const t in e.clusterProperties){const[n,i]=e.clusterProperties[t],s="string"==typeof n?[n,["accumulated"],["get",t]]:n;a.push(...qr({key:`${r}.${t}.map`,value:i,expressionContext:"cluster-map"})),a.push(...qr({key:`${r}.${t}.reduce`,value:s,expressionContext:"cluster-reduce"}));}return a;case"video":return $r({key:r,value:e,valueSpec:n.source_video,style:i,styleSpec:n});case"image":return $r({key:r,value:e,valueSpec:n.source_image,style:i,styleSpec:n});case"canvas":return [new it(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return jr({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,styleSpec:n})}}function cn(t){const e=t.value,r=t.styleSpec,n=r.light,i=t.style;let s=[];const a=wr(e);if(void 0===e)return s;if("object"!==a)return s=s.concat([new it("light",e,`object expected, ${a} found`)]),s;for(const t in e){const a=t.match(/^(.*)-transition$/);s=s.concat(a&&n[a[1]]&&n[a[1]].transition?pn({key:t,value:e[t],valueSpec:r.transition,style:i,styleSpec:r}):n[t]?pn({key:t,value:e[t],valueSpec:n[t],style:i,styleSpec:r}):[new it(t,e[t],`unknown property "${t}"`)]);}return s}const hn={"*":()=>[],array:Or,boolean:function(t){const e=t.value,r=t.key,n=wr(e);return "boolean"!==n?[new it(r,e,`boolean expected, ${n} found`)]:[]},number:Rr,color:function(t){const e=t.key,r=t.value,n=wr(r);return "string"!==n?[new it(e,r,`color expected, ${n} found`)]:null===It(r)?[new it(e,r,`color expected, "${r}" found`)]:[]},constants:st,enum:jr,filter:tn,function:Ur,layer:an,object:$r,source:un,light:cn,string:on,formatted:function(t){return 0===on(t).length?[]:qr(t)},resolvedImage:function(t){return 0===on(t).length?[]:qr(t)}};function pn(t){const e=t.value,r=t.valueSpec,n=t.styleSpec;return r.expression&&_r(ot(e))?Ur(t):r.expression&&Pr(lt(e))?qr(t):r.type&&hn[r.type]?hn[r.type](t):$r(at({},t,{valueSpec:r.type?n[r.type]:r}))}function fn(t){const e=t.value,r=t.key,n=on(t);return n.length||(-1===e.indexOf("{fontstack}")&&n.push(new it(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new it(r,e,'"glyphs" url must include a "{range}" token'))),n}function dn(t,e=nt){let r=[];return r=r.concat(pn({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:fn,"*":()=>[]}})),t.constants&&(r=r.concat(st({key:"constants",value:t.constants,style:t,styleSpec:e}))),yn(r)}function yn(t){return [].concat(t).sort(((t,e)=>t.line-e.line))}function mn(t){return function(...e){return yn(t.apply(this,e))}}dn.source=mn(un),dn.light=mn(cn),dn.layer=mn(an),dn.filter=mn(tn),dn.paintProperty=mn(nn),dn.layoutProperty=mn(sn);const gn=dn,xn=gn.light,vn=gn.paintProperty,bn=gn.layoutProperty;function wn(t,e){let r=!1;if(e&&e.length)for(const n of e)t.fire(new et(new Error(n.message))),r=!0;return r}class _n{constructor(t,e,r){const n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;const i=new Int32Array(this.arrayBuffer);t=i[0],this.d=(e=i[1])+2*(r=i[2]);for(let t=0;t<this.d*this.d;t++){const e=i[3+t],r=i[3+t+1];n.push(e===r?null:i.subarray(e,r));}const s=i[3+n.length+1];this.keys=i.subarray(i[3+n.length],s),this.bboxes=i.subarray(s),this.insert=this._insertReadonly;}else {this.d=e+2*r;for(let t=0;t<this.d*this.d;t++)n.push([]);this.keys=[],this.bboxes=[];}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;const i=r/e*t;this.min=-i,this.max=t+i;}insert(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertCell,this.uid++,void 0,void 0),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i);}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(t,e,r,n,i,s){this.cells[i].push(s);}query(t,e,r,n,i){const s=this.min,a=this.max;if(t<=s&&e<=s&&a<=r&&a<=n&&!i)return Array.prototype.slice.call(this.keys);{const s=[];return this._forEachCell(t,e,r,n,this._queryCell,s,{},i),s}}_queryCell(t,e,r,n,i,s,a,o){const l=this.cells[i];if(null!==l){const i=this.keys,u=this.bboxes;for(let c=0;c<l.length;c++){const h=l[c];if(void 0===a[h]){const l=4*h;(o?o(u[l+0],u[l+1],u[l+2],u[l+3]):t<=u[l+2]&&e<=u[l+3]&&r>=u[l+0]&&n>=u[l+1])?(a[h]=!0,s.push(i[h])):a[h]=!1;}}}}_forEachCell(t,e,r,n,i,s,a,o){const l=this._convertToCellCoord(t),u=this._convertToCellCoord(e),c=this._convertToCellCoord(r),h=this._convertToCellCoord(n);for(let p=l;p<=c;p++)for(let l=u;l<=h;l++){const u=this.d*l+p;if((!o||o(this._convertFromCellCoord(p),this._convertFromCellCoord(l),this._convertFromCellCoord(p+1),this._convertFromCellCoord(l+1)))&&i.call(this,t,e,r,n,u,s,a,o))return}}_convertFromCellCoord(t){return (t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const t=this.cells,e=3+this.cells.length+1+1;let r=0;for(let t=0;t<this.cells.length;t++)r+=this.cells[t].length;const n=new Int32Array(e+r+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;let i=e;for(let e=0;e<t.length;e++){const r=t[e];n[3+e]=i,n.set(r,i),i+=r.length;}return n[3+t.length]=i,n.set(this.keys,i),i+=this.keys.length,n[3+t.length+1]=i,n.set(this.bboxes,i),i+=this.bboxes.length,n.buffer}static serialize(t,e){const r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}}static deserialize(t){return new _n(t.buffer)}}const An={};function kn(t,e,r={}){Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),An[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]};}kn("Object",Object),kn("TransferableGridIndex",_n),kn("Color",Et),kn("Error",Error),kn("ResolvedImage",Dt),kn("StylePropertyFunction",Lr),kn("StyleExpression",Br,{omit:["_evaluator"]}),kn("ZoomDependentExpression",Fr),kn("ZoomConstantExpression",Er),kn("CompoundExpression",Wt,{omit:["_evaluate"]});for(const t in hr)hr[t]._classRegistryKey||kn(`Expression_${t}`,hr[t]);function Sn(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function zn(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(Sn(t))return e&&e.push(t),t;if(A(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){const r=t;return e&&e.push(r.buffer),r}if(t instanceof ImageData)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){const r=[];for(const n of t)r.push(zn(n,e));return r}if("object"==typeof t){const r=t.constructor,n=r._classRegistryKey;if(!n)throw new Error("can't serialize object of unregistered class");const i=r.serialize?r.serialize(t,e):{};if(!r.serialize){for(const r in t){if(!t.hasOwnProperty(r))continue;if(An[n].omit.indexOf(r)>=0)continue;const s=t[r];i[r]=An[n].shallow.indexOf(r)>=0?s:zn(s,e);}t instanceof Error&&(i.message=t.message);}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return "Object"!==n&&(i.$name=n),i}throw new Error("can't serialize object of type "+typeof t)}function In(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||Sn(t)||A(t)||ArrayBuffer.isView(t)||t instanceof ImageData)return t;if(Array.isArray(t))return t.map(In);if("object"==typeof t){const e=t.$name||"Object";if(!An[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:r}=An[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(t);const n=Object.create(r.prototype);for(const r of Object.keys(t)){if("$name"===r)continue;const i=t[r];n[r]=An[e].shallow.indexOf(r)>=0?i:In(i);}return n}throw new Error("can't deserialize object of type "+typeof t)}class Mn{constructor(){this.first=!0;}update(t,e){const r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))}}const Cn={"Latin-1 Supplement":t=>t>=128&&t<=255,Arabic:t=>t>=1536&&t<=1791,"Arabic Supplement":t=>t>=1872&&t<=1919,"Arabic Extended-A":t=>t>=2208&&t<=2303,"Hangul Jamo":t=>t>=4352&&t<=4607,"Unified Canadian Aboriginal Syllabics":t=>t>=5120&&t<=5759,Khmer:t=>t>=6016&&t<=6143,"Unified Canadian Aboriginal Syllabics Extended":t=>t>=6320&&t<=6399,"General Punctuation":t=>t>=8192&&t<=8303,"Letterlike Symbols":t=>t>=8448&&t<=8527,"Number Forms":t=>t>=8528&&t<=8591,"Miscellaneous Technical":t=>t>=8960&&t<=9215,"Control Pictures":t=>t>=9216&&t<=9279,"Optical Character Recognition":t=>t>=9280&&t<=9311,"Enclosed Alphanumerics":t=>t>=9312&&t<=9471,"Geometric Shapes":t=>t>=9632&&t<=9727,"Miscellaneous Symbols":t=>t>=9728&&t<=9983,"Miscellaneous Symbols and Arrows":t=>t>=11008&&t<=11263,"CJK Radicals Supplement":t=>t>=11904&&t<=12031,"Kangxi Radicals":t=>t>=12032&&t<=12255,"Ideographic Description Characters":t=>t>=12272&&t<=12287,"CJK Symbols and Punctuation":t=>t>=12288&&t<=12351,Hiragana:t=>t>=12352&&t<=12447,Katakana:t=>t>=12448&&t<=12543,Bopomofo:t=>t>=12544&&t<=12591,"Hangul Compatibility Jamo":t=>t>=12592&&t<=12687,Kanbun:t=>t>=12688&&t<=12703,"Bopomofo Extended":t=>t>=12704&&t<=12735,"CJK Strokes":t=>t>=12736&&t<=12783,"Katakana Phonetic Extensions":t=>t>=12784&&t<=12799,"Enclosed CJK Letters and Months":t=>t>=12800&&t<=13055,"CJK Compatibility":t=>t>=13056&&t<=13311,"CJK Unified Ideographs Extension A":t=>t>=13312&&t<=19903,"Yijing Hexagram Symbols":t=>t>=19904&&t<=19967,"CJK Unified Ideographs":t=>t>=19968&&t<=40959,"Yi Syllables":t=>t>=40960&&t<=42127,"Yi Radicals":t=>t>=42128&&t<=42191,"Hangul Jamo Extended-A":t=>t>=43360&&t<=43391,"Hangul Syllables":t=>t>=44032&&t<=55215,"Hangul Jamo Extended-B":t=>t>=55216&&t<=55295,"Private Use Area":t=>t>=57344&&t<=63743,"CJK Compatibility Ideographs":t=>t>=63744&&t<=64255,"Arabic Presentation Forms-A":t=>t>=64336&&t<=65023,"Vertical Forms":t=>t>=65040&&t<=65055,"CJK Compatibility Forms":t=>t>=65072&&t<=65103,"Small Form Variants":t=>t>=65104&&t<=65135,"Arabic Presentation Forms-B":t=>t>=65136&&t<=65279,"Halfwidth and Fullwidth Forms":t=>t>=65280&&t<=65519};function Bn(t){for(const e of t)if(En(e.charCodeAt(0)))return !0;return !1}function Pn(t){for(const e of t)if(!Vn(e.charCodeAt(0)))return !1;return !0}function Vn(t){return !(Cn.Arabic(t)||Cn["Arabic Supplement"](t)||Cn["Arabic Extended-A"](t)||Cn["Arabic Presentation Forms-A"](t)||Cn["Arabic Presentation Forms-B"](t))}function En(t){return !(746!==t&&747!==t&&(t<4352||!(Cn["Bopomofo Extended"](t)||Cn.Bopomofo(t)||Cn["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Cn["CJK Compatibility Ideographs"](t)||Cn["CJK Compatibility"](t)||Cn["CJK Radicals Supplement"](t)||Cn["CJK Strokes"](t)||!(!Cn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Cn["CJK Unified Ideographs Extension A"](t)||Cn["CJK Unified Ideographs"](t)||Cn["Enclosed CJK Letters and Months"](t)||Cn["Hangul Compatibility Jamo"](t)||Cn["Hangul Jamo Extended-A"](t)||Cn["Hangul Jamo Extended-B"](t)||Cn["Hangul Jamo"](t)||Cn["Hangul Syllables"](t)||Cn.Hiragana(t)||Cn["Ideographic Description Characters"](t)||Cn.Kanbun(t)||Cn["Kangxi Radicals"](t)||Cn["Katakana Phonetic Extensions"](t)||Cn.Katakana(t)&&12540!==t||!(!Cn["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Cn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Cn["Unified Canadian Aboriginal Syllabics"](t)||Cn["Unified Canadian Aboriginal Syllabics Extended"](t)||Cn["Vertical Forms"](t)||Cn["Yijing Hexagram Symbols"](t)||Cn["Yi Syllables"](t)||Cn["Yi Radicals"](t))))}function Fn(t){return !(En(t)||function(t){return !!(Cn["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Cn["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||Cn["Letterlike Symbols"](t)||Cn["Number Forms"](t)||Cn["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||Cn["Control Pictures"](t)&&9251!==t||Cn["Optical Character Recognition"](t)||Cn["Enclosed Alphanumerics"](t)||Cn["Geometric Shapes"](t)||Cn["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Cn["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Cn["CJK Symbols and Punctuation"](t)||Cn.Katakana(t)||Cn["Private Use Area"](t)||Cn["CJK Compatibility Forms"](t)||Cn["Small Form Variants"](t)||Cn["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Tn(t){return t>=1424&&t<=2303||Cn["Arabic Presentation Forms-A"](t)||Cn["Arabic Presentation Forms-B"](t)}function Ln(t,e){return !(!e&&Tn(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Cn.Khmer(t))}function Dn(t){for(const e of t)if(Tn(e.charCodeAt(0)))return !0;return !1}const $n="deferred",On="loading",Rn="loaded";let Un=null,qn="unavailable",jn=null;const Nn=function(t){t&&"string"==typeof t&&t.indexOf("NetworkError")>-1&&(qn="error"),Un&&Un(t);};function Kn(){Zn.fire(new tt("pluginStateChange",{pluginStatus:qn,pluginURL:jn}));}const Zn=new rt,Gn=function(){return qn},Jn=function(){if(qn!==$n||!jn)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");qn=On,Kn(),jn&&Z({url:jn},(t=>{t?Nn(t):(qn=Rn,Kn());}));},Xn={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>qn===Rn||null!=Xn.applyArabicShaping,isLoading:()=>qn===On,setState(t){qn=t.pluginStatus,jn=t.pluginURL;},isParsed:()=>null!=Xn.applyArabicShaping&&null!=Xn.processBidirectionalText&&null!=Xn.processStyledBidirectionalText,getPluginURL:()=>jn};class Yn{constructor(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Mn,this.transition={});}isSupportedScript(t){return function(t,e){for(const r of t)if(!Ln(r.charCodeAt(0),e))return !1;return !0}(t,Xn.isLoaded())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}}}class Hn{constructor(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(_r(t))return new Lr(t,e);if(Pr(t)){const r=Tr(t,e);if("error"===r.result)throw new Error(r.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return r.value}{let r=t;return "string"==typeof t&&"color"===e.type&&(r=Et.parse(t)),{kind:"constant",evaluate:()=>r}}}(void 0===e?t.specification.default:e,t.specification);}isDataDriven(){return "source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)}}class Wn{constructor(t){this.property=t,this.value=new Hn(t,void 0);}transitioned(t,e){return new ti(this.property,this.value,e,o({},t.transition,this.transition),t.now)}untransitioned(){return new ti(this.property,this.value,null,{},0)}}class Qn{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues);}getValue(t){return p(this._values[t].value.value)}setValue(t,e){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new Wn(this._values[t].property)),this._values[t].value=new Hn(this._values[t].property,null===e?void 0:p(e));}getTransition(t){return p(this._values[t].transition)}setTransition(t,e){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new Wn(this._values[t].property)),this._values[t].transition=p(e)||void 0;}serialize(){const t={};for(const e of Object.keys(this._values)){const r=this.getValue(e);void 0!==r&&(t[e]=r);const n=this.getTransition(e);void 0!==n&&(t[`${e}-transition`]=n);}return t}transitioned(t,e){const r=new ei(this._properties);for(const n of Object.keys(this._values))r._values[n]=this._values[n].transitioned(t,e._values[n]);return r}untransitioned(){const t=new ei(this._properties);for(const e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}}class ti{constructor(t,e,r,n,i){this.property=t,this.value=e,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=r);}possiblyEvaluate(t,e,r){const n=t.now||0,i=this.value.possiblyEvaluate(t,e,r),s=this.prior;if(s){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n<this.begin)return s.possiblyEvaluate(t,e,r);{const a=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(s.possiblyEvaluate(t,e,r),i,function(t){if(t<=0)return 0;if(t>=1)return 1;const e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(a))}}return i}}class ei{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues);}possiblyEvaluate(t,e,r){const n=new ii(this._properties);for(const i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(t,e,r);return n}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return !0;return !1}}class ri{constructor(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues);}getValue(t){return p(this._values[t].value)}setValue(t,e){this._values[t]=new Hn(this._values[t].property,null===e?void 0:p(e));}serialize(){const t={};for(const e of Object.keys(this._values)){const r=this.getValue(e);void 0!==r&&(t[e]=r);}return t}possiblyEvaluate(t,e,r){const n=new ii(this._properties);for(const i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(t,e,r);return n}}class ni{constructor(t,e,r){this.property=t,this.value=e,this.parameters=r;}isConstant(){return "constant"===this.value.kind}constantOr(t){return "constant"===this.value.kind?this.value.value:t}evaluate(t,e,r,n){return this.property.evaluate(this.value,this.parameters,t,e,r,n)}}class ii{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues);}get(t){return this._values[t]}}class si{constructor(t){this.specification=t;}possiblyEvaluate(t,e){return t.expression.evaluate(e)}interpolate(t,e,r){const n=ze[this.specification.type];return n?n(t,e,r):t}}class ai{constructor(t,e){this.specification=t,this.overrides=e;}possiblyEvaluate(t,e,r,n){return new ni(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},r,n)}:t.expression,e)}interpolate(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new ni(this,{kind:"constant",value:void 0},t.parameters);const n=ze[this.specification.type];return n?new ni(this,{kind:"constant",value:n(t.value.value,e.value.value,r)},t.parameters):t}evaluate(t,e,r,n,i,s){return "constant"===t.kind?t.value:t.evaluate(e,r,n,i,s)}}class oi extends ai{possiblyEvaluate(t,e,r,n){if(void 0===t.value)return new ni(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){const i=t.expression.evaluate(e,null,{},r,n),s="resolvedImage"===t.property.specification.type&&"string"!=typeof i?i.name:i,a=this._calculate(s,s,s,e);return new ni(this,{kind:"constant",value:a},e)}if("camera"===t.expression.kind){const r=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new ni(this,{kind:"constant",value:r},e)}return new ni(this,t.expression,e)}evaluate(t,e,r,n,i,s){if("source"===t.kind){const a=t.evaluate(e,r,n,i,s);return this._calculate(a,a,a,e)}return "composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,n),t.evaluate({zoom:Math.floor(e.zoom)},r,n),t.evaluate({zoom:Math.floor(e.zoom)+1},r,n),e):t.value}_calculate(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}}class li{constructor(t){this.specification=t;}possiblyEvaluate(t,e,r,n){if(void 0!==t.value){if("constant"===t.expression.kind){const i=t.expression.evaluate(e,null,{},r,n);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new Yn(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Yn(Math.floor(e.zoom),e)),t.expression.evaluate(new Yn(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}}interpolate(t){return t}}class ui{constructor(t){this.specification=t;}possiblyEvaluate(t,e,r,n){return !!t.expression.evaluate(e,null,{},r,n)}interpolate(){return !1}}class ci{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const e in t){const r=t[e];r.specification.overridable&&this.overridableProperties.push(e);const n=this.defaultPropertyValues[e]=new Hn(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new Wn(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({});}}}kn("DataDrivenProperty",ai),kn("DataConstantProperty",si),kn("CrossFadedDataDrivenProperty",oi),kn("CrossFadedProperty",li),kn("ColorRampProperty",ui);const hi="-transition";class pi extends rt{constructor(t,e){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1},"custom"!==t.type&&(this.metadata=(t=t).metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),e.layout&&(this._unevaluatedLayout=new ri(e.layout)),e.paint)){this._transitionablePaint=new Qn(e.paint);for(const e in t.paint)this.setPaintProperty(e,t.paint[e],{validate:!1});for(const e in t.layout)this.setLayoutProperty(e,t.layout[e],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ii(e.paint);}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return "visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,e,r={}){null!=e&&this._validate(bn,`layers.${this.id}.layout.${t}`,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e);}getPaintProperty(t){return t.endsWith(hi)?this._transitionablePaint.getTransition(t.slice(0,-hi.length)):this._transitionablePaint.getValue(t)}setPaintProperty(t,e,r={}){if(null!=e&&this._validate(vn,`layers.${this.id}.paint.${t}`,t,e,r))return !1;if(t.endsWith(hi))return this._transitionablePaint.setTransition(t.slice(0,-hi.length),e||void 0),!1;{const r=this._transitionablePaint._values[t],n="cross-faded-data-driven"===r.property.specification["property-type"],i=r.value.isDataDriven(),s=r.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);const a=this._transitionablePaint._values[t].value;return a.isDataDriven()||i||n||this._handleOverridablePaintPropertyUpdate(t,s,a)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,e,r){return !1}isHidden(t){return !!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint);}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e);}serialize(){const t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),h(t,((t,e)=>!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)))}_validate(t,e,r,n,i={}){return (!i||!1!==i.validate)&&wn(this,t.call(gn,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:nt,style:{glyphs:!0,sprite:!0}}))}is3D(){return !1}isTileClipped(){return !1}hasOffscreenPass(){return !1}resize(){}isStateDependent(){for(const t in this.paint._values){const e=this.paint.get(t);if(e instanceof ni&&xr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return !0}return !1}}const fi={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class di{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8;}}class yi{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0);}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews());}clear(){this.length=0;}resize(t){this.reserve(t),this.length=t;}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const e=this.uint8;this._refreshViews(),e&&this.uint8.set(e);}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function mi(t,e=1){let r=0,n=0;return {members:t.map((t=>{const i=fi[t.type].BYTES_PER_ELEMENT,s=r=gi(r,Math.max(e,i)),a=t.components||1;return n=Math.max(n,i),r+=i*a,{name:t.name,type:t.type,components:a,offset:s}})),size:gi(r,Math.max(n,e)),alignment:e}}function gi(t,e){return Math.ceil(t/e)*e}class xi extends yi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);}emplaceBack(t,e){const r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){const n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t}}xi.prototype.bytesPerElement=4,kn("StructArrayLayout2i4",xi);class vi extends yi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);}emplaceBack(t,e,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)}emplace(t,e,r,n,i){const s=4*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,t}}vi.prototype.bytesPerElement=8,kn("StructArrayLayout4i8",vi);class bi extends yi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i,s){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,s)}emplace(t,e,r,n,i,s,a){const o=6*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,this.int16[o+4]=s,this.int16[o+5]=a,t}}bi.prototype.bytesPerElement=12,kn("StructArrayLayout2i4i12",bi);class wi extends yi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i,s){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,s)}emplace(t,e,r,n,i,s,a){const o=4*t,l=8*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=s,this.uint8[l+7]=a,t}}wi.prototype.bytesPerElement=8,kn("StructArrayLayout2i4ub8",wi);class _i extends yi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);}emplaceBack(t,e){const r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){const n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t}}_i.prototype.bytesPerElement=8,kn("StructArrayLayout2f8",_i);class Ai extends yi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i,s,a,o,l,u){const c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,s,a,o,l,u)}emplace(t,e,r,n,i,s,a,o,l,u,c){const h=10*t;return this.uint16[h+0]=e,this.uint16[h+1]=r,this.uint16[h+2]=n,this.uint16[h+3]=i,this.uint16[h+4]=s,this.uint16[h+5]=a,this.uint16[h+6]=o,this.uint16[h+7]=l,this.uint16[h+8]=u,this.uint16[h+9]=c,t}}Ai.prototype.bytesPerElement=20,kn("StructArrayLayout10ui20",Ai);class ki extends yi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i,s,a,o,l,u,c,h){const p=this.length;return this.resize(p+1),this.emplace(p,t,e,r,n,i,s,a,o,l,u,c,h)}emplace(t,e,r,n,i,s,a,o,l,u,c,h,p){const f=12*t;return this.int16[f+0]=e,this.int16[f+1]=r,this.int16[f+2]=n,this.int16[f+3]=i,this.uint16[f+4]=s,this.uint16[f+5]=a,this.uint16[f+6]=o,this.uint16[f+7]=l,this.int16[f+8]=u,this.int16[f+9]=c,this.int16[f+10]=h,this.int16[f+11]=p,t}}ki.prototype.bytesPerElement=24,kn("StructArrayLayout4i4ui4i24",ki);class Si extends yi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t}}Si.prototype.bytesPerElement=12,kn("StructArrayLayout3f12",Si);class zi extends yi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer);}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint32[1*t+0]=e,t}}zi.prototype.bytesPerElement=4,kn("StructArrayLayout1ul4",zi);class Ii extends yi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i,s,a,o,l){const u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,s,a,o,l)}emplace(t,e,r,n,i,s,a,o,l,u){const c=10*t,h=5*t;return this.int16[c+0]=e,this.int16[c+1]=r,this.int16[c+2]=n,this.int16[c+3]=i,this.int16[c+4]=s,this.int16[c+5]=a,this.uint32[h+3]=o,this.uint16[c+8]=l,this.uint16[c+9]=u,t}}Ii.prototype.bytesPerElement=20,kn("StructArrayLayout6i1ul2ui20",Ii);class Mi extends yi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i,s){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,n,i,s)}emplace(t,e,r,n,i,s,a){const o=6*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,this.int16[o+4]=s,this.int16[o+5]=a,t}}Mi.prototype.bytesPerElement=12,kn("StructArrayLayout2i2i2i12",Mi);class Ci extends yi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i){const s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,n,i)}emplace(t,e,r,n,i,s){const a=4*t,o=8*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.int16[o+6]=i,this.int16[o+7]=s,t}}Ci.prototype.bytesPerElement=16,kn("StructArrayLayout2f1f2i16",Ci);class Bi extends yi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);}emplaceBack(t,e,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)}emplace(t,e,r,n,i){const s=12*t,a=3*t;return this.uint8[s+0]=e,this.uint8[s+1]=r,this.float32[a+1]=n,this.float32[a+2]=i,t}}Bi.prototype.bytesPerElement=12,kn("StructArrayLayout2ub2f12",Bi);class Pi extends yi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t}}Pi.prototype.bytesPerElement=6,kn("StructArrayLayout3ui6",Pi);class Vi extends yi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i,s,a,o,l,u,c,h,p,f,d,y,m){const g=this.length;return this.resize(g+1),this.emplace(g,t,e,r,n,i,s,a,o,l,u,c,h,p,f,d,y,m)}emplace(t,e,r,n,i,s,a,o,l,u,c,h,p,f,d,y,m,g){const x=24*t,v=12*t,b=48*t;return this.int16[x+0]=e,this.int16[x+1]=r,this.uint16[x+2]=n,this.uint16[x+3]=i,this.uint32[v+2]=s,this.uint32[v+3]=a,this.uint32[v+4]=o,this.uint16[x+10]=l,this.uint16[x+11]=u,this.uint16[x+12]=c,this.float32[v+7]=h,this.float32[v+8]=p,this.uint8[b+36]=f,this.uint8[b+37]=d,this.uint8[b+38]=y,this.uint32[v+10]=m,this.int16[x+22]=g,t}}Vi.prototype.bytesPerElement=48,kn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Vi);class Ei extends yi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);}emplaceBack(t,e,r,n,i,s,a,o,l,u,c,h,p,f,d,y,m,g,x,v,b,w,_,A,k,S,z,I){const M=this.length;return this.resize(M+1),this.emplace(M,t,e,r,n,i,s,a,o,l,u,c,h,p,f,d,y,m,g,x,v,b,w,_,A,k,S,z,I)}emplace(t,e,r,n,i,s,a,o,l,u,c,h,p,f,d,y,m,g,x,v,b,w,_,A,k,S,z,I,M){const C=34*t,B=17*t;return this.int16[C+0]=e,this.int16[C+1]=r,this.int16[C+2]=n,this.int16[C+3]=i,this.int16[C+4]=s,this.int16[C+5]=a,this.int16[C+6]=o,this.int16[C+7]=l,this.uint16[C+8]=u,this.uint16[C+9]=c,this.uint16[C+10]=h,this.uint16[C+11]=p,this.uint16[C+12]=f,this.uint16[C+13]=d,this.uint16[C+14]=y,this.uint16[C+15]=m,this.uint16[C+16]=g,this.uint16[C+17]=x,this.uint16[C+18]=v,this.uint16[C+19]=b,this.uint16[C+20]=w,this.uint16[C+21]=_,this.uint16[C+22]=A,this.uint32[B+12]=k,this.float32[B+13]=S,this.float32[B+14]=z,this.float32[B+15]=I,this.float32[B+16]=M,t}}Ei.prototype.bytesPerElement=68,kn("StructArrayLayout8i15ui1ul4f68",Ei);class Fi extends yi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.float32[1*t+0]=e,t}}Fi.prototype.bytesPerElement=4,kn("StructArrayLayout1f4",Fi);class Ti extends yi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t}}Ti.prototype.bytesPerElement=6,kn("StructArrayLayout3i6",Ti);class Li extends yi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);}emplaceBack(t,e,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)}emplace(t,e,r,n){const i=4*t;return this.uint32[2*t+0]=e,this.uint16[i+2]=r,this.uint16[i+3]=n,t}}Li.prototype.bytesPerElement=8,kn("StructArrayLayout1ul2ui8",Li);class Di extends yi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);}emplaceBack(t,e){const r=this.length;return this.resize(r+1),this.emplace(r,t,e)}emplace(t,e,r){const n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t}}Di.prototype.bytesPerElement=4,kn("StructArrayLayout2ui4",Di);class $i extends yi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint16[1*t+0]=e,t}}$i.prototype.bytesPerElement=2,kn("StructArrayLayout1ui2",$i);class Oi extends yi{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);}emplaceBack(t,e,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)}emplace(t,e,r,n,i){const s=4*t;return this.float32[s+0]=e,this.float32[s+1]=r,this.float32[s+2]=n,this.float32[s+3]=i,t}}Oi.prototype.bytesPerElement=16,kn("StructArrayLayout4f16",Oi);class Ri extends di{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new S(this.anchorPointX,this.anchorPointY)}}Ri.prototype.size=20;class Ui extends Ii{get(t){return new Ri(this,t)}}kn("CollisionBoxArray",Ui);class qi extends di{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t;}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t;}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t;}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}qi.prototype.size=48;class ji extends Vi{get(t){return new qi(this,t)}}kn("PlacedSymbolArray",ji);class Ni extends di{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t;}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}}Ni.prototype.size=68;class Ki extends Ei{get(t){return new Ni(this,t)}}kn("SymbolInstanceArray",Ki);class Zi extends Fi{getoffsetX(t){return this.float32[1*t+0]}}kn("GlyphOffsetArray",Zi);class Gi extends Ti{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}kn("SymbolLineVertexArray",Gi);class Ji extends di{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}Ji.prototype.size=8;class Xi extends Li{get(t){return new Ji(this,t)}}kn("FeatureIndexArray",Xi);class Yi extends xi{}class Hi extends xi{}class Wi extends bi{}class Qi extends wi{}class ts extends _i{}class es extends Ai{}class rs extends ki{}class ns extends Si{}class is extends zi{}class ss extends Mi{}class as extends Bi{}class os extends Pi{}class ls extends Di{}const us=mi([{name:"a_pos",components:2,type:"Int16"}],4),{members:cs}=us;class hs{constructor(t=[]){this.segments=t;}prepareSegment(t,e,r,n){let i=this.segments[this.segments.length-1];return t>hs.MAX_VERTEX_ARRAY_LENGTH&&d(`Max vertices per segment is ${hs.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!i||i.vertexLength+t>hs.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i}get(){return this.segments}destroy(){for(const t of this.segments)for(const e in t.vaos)t.vaos[e].destroy();}static simpleSegment(t,e,r,n){return new hs([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])}}function ps(t,e){return 256*(t=s(Math.floor(t),0,255))+s(Math.floor(e),0,255)}hs.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,kn("SegmentVector",hs);const fs=mi([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var ds={exports:{}},ys={exports:{}};ys.exports=function(t,e){var r,n,i,s,a,o,l,u;for(n=t.length-(r=3&t.length),i=e,a=3432918353,o=461845907,u=0;u<n;)l=255&t.charCodeAt(u)|(255&t.charCodeAt(++u))<<8|(255&t.charCodeAt(++u))<<16|(255&t.charCodeAt(++u))<<24,++u,i=27492+(65535&(s=5*(65535&(i=(i^=l=(65535&(l=(l=(65535&l)*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(s>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&t.charCodeAt(u+2))<<16;case 2:l^=(255&t.charCodeAt(u+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(u)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*o+(((l>>>16)*o&65535)<<16)&4294967295;}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0};var ms={exports:{}};ms.exports=function(t,e){for(var r,n=t.length,i=e^n,s=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(s)|(255&t.charCodeAt(++s))<<8|(255&t.charCodeAt(++s))<<16|(255&t.charCodeAt(++s))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++s;switch(n){case 3:i^=(255&t.charCodeAt(s+2))<<16;case 2:i^=(255&t.charCodeAt(s+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(s)))+((1540483477*(i>>>16)&65535)<<16);}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0};var gs=ys.exports,xs=ms.exports;ds.exports=gs,ds.exports.murmur3=gs,ds.exports.murmur2=xs;var vs=ds.exports;class bs{constructor(){this.ids=[],this.positions=[],this.indexed=!1;}add(t,e,r,n){this.ids.push(ws(t)),this.positions.push(e,r,n);}getPositions(t){const e=ws(t);let r=0,n=this.ids.length-1;for(;r<n;){const t=r+n>>1;this.ids[t]>=e?n=t:r=t+1;}const i=[];for(;this.ids[r]===e;)i.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return i}static serialize(t,e){const r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return _s(r,n,0,r.length-1),e&&e.push(r.buffer,n.buffer),{ids:r,positions:n}}static deserialize(t){const e=new bs;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e}}function ws(t){const e=+t;return !isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:vs(String(t))}function _s(t,e,r,n){for(;r<n;){const i=t[r+n>>1];let s=r-1,a=n+1;for(;;){do{s++;}while(t[s]<i);do{a--;}while(t[a]>i);if(s>=a)break;As(t,s,a),As(e,3*s,3*a),As(e,3*s+1,3*a+1),As(e,3*s+2,3*a+2);}a-r<n-a?(_s(t,e,r,a),r=a+1):(_s(t,e,a+1,n),n=a);}}function As(t,e,r){const n=t[e];t[e]=t[r],t[r]=n;}kn("FeaturePositionMap",bs);class ks{constructor(t,e){this.gl=t.gl,this.location=e;}}class Ss extends ks{constructor(t,e){super(t,e),this.current=0;}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t));}}class zs extends ks{constructor(t,e){super(t,e),this.current=[0,0,0,0];}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]));}}class Is extends ks{constructor(t,e){super(t,e),this.current=Et.transparent;}set(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a));}}const Ms=new Float32Array(16);function Cs(t){return [ps(255*t.r,255*t.g),ps(255*t.b,255*t.a)]}class Bs{constructor(t,e,r){this.value=t,this.uniformNames=e.map((t=>`u_${t}`)),this.type=r;}setUniform(t,e,r){t.set(r.constantOr(this.value));}getBinding(t,e,r){return "color"===this.type?new Is(t,e):new Ss(t,e)}}class Ps{constructor(t,e){this.uniformNames=e.map((t=>`u_${t}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1;}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr;}setUniform(t,e,r,n){const i="u_pattern_to"===n?this.patternTo:"u_pattern_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;i&&t.set(i);}getBinding(t,e,r){return "u_pattern"===r.substr(0,9)?new zs(t,e):new Ss(t,e)}}class Vs{constructor(t,e,r,n){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===r?2:1,offset:0}))),this.paintVertexArray=new n;}populatePaintArray(t,e,r,n,i){const s=this.paintVertexArray.length,a=this.expression.evaluate(new Yn(0),e,{},n,[],i);this.paintVertexArray.resize(t),this._setPaintValue(s,t,a);}updatePaintArray(t,e,r,n){const i=this.expression.evaluate({zoom:0},r,n);this._setPaintValue(t,e,i);}_setPaintValue(t,e,r){if("color"===this.type){const n=Cs(r);for(let r=t;r<e;r++)this.paintVertexArray.emplace(r,n[0],n[1]);}else {for(let n=t;n<e;n++)this.paintVertexArray.emplace(n,r);this.maxValue=Math.max(this.maxValue,Math.abs(r));}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent));}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy();}}class Es{constructor(t,e,r,n,i,s){this.expression=t,this.uniformNames=e.map((t=>`u_${t}_t`)),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===r?4:2,offset:0}))),this.paintVertexArray=new s;}populatePaintArray(t,e,r,n,i){const s=this.expression.evaluate(new Yn(this.zoom),e,{},n,[],i),a=this.expression.evaluate(new Yn(this.zoom+1),e,{},n,[],i),o=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(o,t,s,a);}updatePaintArray(t,e,r,n){const i=this.expression.evaluate({zoom:this.zoom},r,n),s=this.expression.evaluate({zoom:this.zoom+1},r,n);this._setPaintValue(t,e,i,s);}_setPaintValue(t,e,r,n){if("color"===this.type){const i=Cs(r),s=Cs(n);for(let r=t;r<e;r++)this.paintVertexArray.emplace(r,i[0],i[1],s[0],s[1]);}else {for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,r,n);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(n));}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent));}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy();}setUniform(t,e){const r=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,n=s(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);t.set(n);}getBinding(t,e,r){return new Ss(t,e)}}class Fs{constructor(t,e,r,n,i,s){this.expression=t,this.type=e,this.useIntegerZoom=r,this.zoom=n,this.layerId=s,this.zoomInPaintVertexArray=new i,this.zoomOutPaintVertexArray=new i;}populatePaintArray(t,e,r){const n=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(n,t,e.patterns&&e.patterns[this.layerId],r);}updatePaintArray(t,e,r,n,i){this._setPaintValues(t,e,r.patterns&&r.patterns[this.layerId],i);}_setPaintValues(t,e,r,n){if(!n||!r)return;const{min:i,mid:s,max:a}=r,o=n[i],l=n[s],u=n[a];if(o&&l&&u)for(let r=t;r<e;r++)this.zoomInPaintVertexArray.emplace(r,l.tl[0],l.tl[1],l.br[0],l.br[1],o.tl[0],o.tl[1],o.br[0],o.br[1],l.pixelRatio,o.pixelRatio),this.zoomOutPaintVertexArray.emplace(r,l.tl[0],l.tl[1],l.br[0],l.br[1],u.tl[0],u.tl[1],u.br[0],u.br[1],l.pixelRatio,u.pixelRatio);}upload(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,fs.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,fs.members,this.expression.isStateDependent));}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy();}}class Ts{constructor(t,e,r){this.binders={},this._buffers=[];const n=[];for(const i in t.paint._values){if(!r(i))continue;const s=t.paint.get(i);if(!(s instanceof ni&&xr(s.property.specification)))continue;const a=Ds(i,t.type),o=s.value,l=s.property.specification.type,u=s.property.useIntegerZoom,c=s.property.specification["property-type"],h="cross-faded"===c||"cross-faded-data-driven"===c;if("constant"===o.kind)this.binders[i]=h?new Ps(o.value,a):new Bs(o.value,a,l),n.push(`/u_${i}`);else if("source"===o.kind||h){const r=$s(i,l,"source");this.binders[i]=h?new Fs(o,l,u,e,r,t.id):new Vs(o,a,l,r),n.push(`/a_${i}`);}else {const t=$s(i,l,"composite");this.binders[i]=new Es(o,a,l,u,e,t),n.push(`/z_${i}`);}}this.cacheKey=n.sort().join("");}getMaxValue(t){const e=this.binders[t];return e instanceof Vs||e instanceof Es?e.maxValue:0}populatePaintArrays(t,e,r,n,i){for(const s in this.binders){const a=this.binders[s];(a instanceof Vs||a instanceof Es||a instanceof Fs)&&a.populatePaintArray(t,e,r,n,i);}}setConstantPatternPositions(t,e){for(const r in this.binders){const n=this.binders[r];n instanceof Ps&&n.setConstantPatternPositions(t,e);}}updatePaintArrays(t,e,r,n,i){let s=!1;for(const a in t){const o=e.getPositions(a);for(const e of o){const o=r.feature(e.index);for(const r in this.binders){const l=this.binders[r];if((l instanceof Vs||l instanceof Es||l instanceof Fs)&&!0===l.expression.isStateDependent){const u=n.paint.get(r);l.expression=u.value,l.updatePaintArray(e.start,e.end,o,t[a],i),s=!0;}}}}return s}defines(){const t=[];for(const e in this.binders){const r=this.binders[e];(r instanceof Bs||r instanceof Ps)&&t.push(...r.uniformNames.map((t=>`#define HAS_UNIFORM_${t}`)));}return t}getBinderAttributes(){const t=[];for(const e in this.binders){const r=this.binders[e];if(r instanceof Vs||r instanceof Es)for(let e=0;e<r.paintVertexAttributes.length;e++)t.push(r.paintVertexAttributes[e].name);else if(r instanceof Fs)for(let e=0;e<fs.members.length;e++)t.push(fs.members[e].name);}return t}getBinderUniforms(){const t=[];for(const e in this.binders){const r=this.binders[e];if(r instanceof Bs||r instanceof Ps||r instanceof Es)for(const e of r.uniformNames)t.push(e);}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,e){const r=[];for(const n in this.binders){const i=this.binders[n];if(i instanceof Bs||i instanceof Ps||i instanceof Es)for(const s of i.uniformNames)if(e[s]){const a=i.getBinding(t,e[s],s);r.push({name:s,property:n,binding:a});}}return r}setUniforms(t,e,r,n){for(const{name:t,property:i,binding:s}of e)this.binders[i].setUniform(s,n,r.get(i),t);}updatePaintBuffers(t){this._buffers=[];for(const e in this.binders){const r=this.binders[e];if(t&&r instanceof Fs){const e=2===t.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;e&&this._buffers.push(e);}else (r instanceof Vs||r instanceof Es)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer);}}upload(t){for(const e in this.binders){const r=this.binders[e];(r instanceof Vs||r instanceof Es||r instanceof Fs)&&r.upload(t);}this.updatePaintBuffers();}destroy(){for(const t in this.binders){const e=this.binders[t];(e instanceof Vs||e instanceof Es||e instanceof Fs)&&e.destroy();}}}class Ls{constructor(t,e,r=(()=>!0)){this.programConfigurations={};for(const n of t)this.programConfigurations[n.id]=new Ts(n,e,r);this.needsUpload=!1,this._featureMap=new bs,this._bufferOffset=0;}populatePaintArrays(t,e,r,n,i,s){for(const r in this.programConfigurations)this.programConfigurations[r].populatePaintArrays(t,e,n,i,s);void 0!==e.id&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0;}updatePaintArrays(t,e,r,n){for(const i of r)this.needsUpload=this.programConfigurations[i.id].updatePaintArrays(t,this._featureMap,e,i,n)||this.needsUpload;}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1;}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy();}}function Ds(t,e){return {"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}function $s(t,e,r){const n={color:{source:_i,composite:Oi},number:{source:Fi,composite:_i}},i=function(t){return {"line-pattern":{source:es,composite:es},"fill-pattern":{source:es,composite:es},"fill-extrusion-pattern":{source:es,composite:es}}[t]}(t);return i&&i[r]||n[e][r]}kn("ConstantBinder",Bs),kn("CrossFadedConstantBinder",Ps),kn("SourceExpressionBinder",Vs),kn("CrossFadedCompositeBinder",Fs),kn("CompositeExpressionBinder",Es),kn("ProgramConfiguration",Ts,{omit:["_buffers"]}),kn("ProgramConfigurationSet",Ls);var Os=8192;const Rs=Math.pow(2,14)-1,Us=-Rs-1;function qs(t){const e=Os/t.extent,r=t.loadGeometry();for(let t=0;t<r.length;t++){const n=r[t];for(let t=0;t<n.length;t++){const r=n[t],i=Math.round(r.x*e),a=Math.round(r.y*e);r.x=s(i,Us,Rs),r.y=s(a,Us,Rs),(i<r.x||i>r.x+1||a<r.y||a>r.y+1)&&d("Geometry exceeds allowed extent, reduce your vector tile buffer size");}}return r}function js(t,e){return {type:t.type,id:t.id,properties:t.properties,geometry:e?qs(t):[]}}function Ns(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2);}class Ks{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Yi,this.indexArray=new os,this.segments=new hs,this.programConfigurations=new Ls(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id));}populate(t,e,r){const n=this.layers[0],i=[];let s=null,a=!1;"circle"===n.type&&(s=n.layout.get("circle-sort-key"),a=!s.isConstant());for(const{feature:e,id:n,index:o,sourceLayerIndex:l}of t){const t=this.layers[0]._featureFilter.needGeometry,u=js(e,t);if(!this.layers[0]._featureFilter.filter(new Yn(this.zoom),u,r))continue;const c=a?s.evaluate(u,{},r):void 0,h={id:n,properties:e.properties,type:e.type,sourceLayerIndex:l,index:o,geometry:t?u.geometry:qs(e),patterns:{},sortKey:c};i.push(h);}a&&i.sort(((t,e)=>t.sortKey-e.sortKey));for(const n of i){const{geometry:i,index:s,sourceLayerIndex:a}=n,o=t[s].feature;this.addFeature(n,i,s,r),e.featureIndex.insert(o,i,s,a,this.index);}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r);}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return !this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,cs),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0;}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy());}addFeature(t,e,r,n){for(const r of e)for(const e of r){const r=e.x,n=e.y;if(r<0||r>=Os||n<0||n>=Os)continue;const i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),s=i.vertexLength;Ns(this.layoutVertexArray,r,n,-1,-1),Ns(this.layoutVertexArray,r,n,1,-1),Ns(this.layoutVertexArray,r,n,1,1),Ns(this.layoutVertexArray,r,n,-1,1),this.indexArray.emplaceBack(s,s+1,s+2),this.indexArray.emplaceBack(s,s+3,s+2),i.vertexLength+=4,i.primitiveLength+=2;}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},n);}}function Zs(t,e){for(let r=0;r<t.length;r++)if(ea(e,t[r]))return !0;for(let r=0;r<e.length;r++)if(ea(t,e[r]))return !0;return !!Ys(t,e)}function Gs(t,e,r){return !!ea(t,e)||!!Ws(e,t,r)}function Js(t,e){if(1===t.length)return ta(e,t[0]);for(let r=0;r<e.length;r++){const n=e[r];for(let e=0;e<n.length;e++)if(ea(t,n[e]))return !0}for(let r=0;r<t.length;r++)if(ta(e,t[r]))return !0;for(let r=0;r<e.length;r++)if(Ys(t,e[r]))return !0;return !1}function Xs(t,e,r){if(t.length>1){if(Ys(t,e))return !0;for(let n=0;n<e.length;n++)if(Ws(e[n],t,r))return !0}for(let n=0;n<t.length;n++)if(Ws(t[n],e,r))return !0;return !1}function Ys(t,e){if(0===t.length||0===e.length)return !1;for(let r=0;r<t.length-1;r++){const n=t[r],i=t[r+1];for(let t=0;t<e.length-1;t++)if(Hs(n,i,e[t],e[t+1]))return !0}return !1}function Hs(t,e,r,n){return y(t,r,n)!==y(e,r,n)&&y(t,e,r)!==y(t,e,n)}function Ws(t,e,r){const n=r*r;if(1===e.length)return t.distSqr(e[0])<n;for(let r=1;r<e.length;r++)if(Qs(t,e[r-1],e[r])<n)return !0;return !1}function Qs(t,e,r){const n=e.distSqr(r);if(0===n)return t.distSqr(e);const i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return t.distSqr(i<0?e:i>1?r:r.sub(e)._mult(i)._add(e))}function ta(t,e){let r,n,i,s=!1;for(let a=0;a<t.length;a++){r=t[a];for(let t=0,a=r.length-1;t<r.length;a=t++)n=r[t],i=r[a],n.y>e.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(s=!s);}return s}function ea(t,e){let r=!1;for(let n=0,i=t.length-1;n<t.length;i=n++){const s=t[n],a=t[i];s.y>e.y!=a.y>e.y&&e.x<(a.x-s.x)*(e.y-s.y)/(a.y-s.y)+s.x&&(r=!r);}return r}function ra(t,e,r){const n=r[0],i=r[2];if(t.x<n.x&&e.x<n.x||t.x>i.x&&e.x>i.x||t.y<n.y&&e.y<n.y||t.y>i.y&&e.y>i.y)return !1;const s=y(t,e,r[0]);return s!==y(t,e,r[1])||s!==y(t,e,r[2])||s!==y(t,e,r[3])}function na(t,e,r){const n=e.paint.get(t).value;return "constant"===n.kind?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}function ia(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function sa(t,e,r,n,i){if(!e[0]&&!e[1])return t;const s=S.convert(e)._mult(i);"viewport"===r&&s._rotate(-n);const a=[];for(let e=0;e<t.length;e++)a.push(t[e].sub(s));return a}kn("CircleBucket",Ks,{omit:["layers"]});const aa=new ci({"circle-sort-key":new ai(nt.layout_circle["circle-sort-key"])});var oa={paint:new ci({"circle-radius":new ai(nt.paint_circle["circle-radius"]),"circle-color":new ai(nt.paint_circle["circle-color"]),"circle-blur":new ai(nt.paint_circle["circle-blur"]),"circle-opacity":new ai(nt.paint_circle["circle-opacity"]),"circle-translate":new si(nt.paint_circle["circle-translate"]),"circle-translate-anchor":new si(nt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new si(nt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new si(nt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new ai(nt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new ai(nt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new ai(nt.paint_circle["circle-stroke-opacity"])}),layout:aa},la="undefined"!=typeof Float32Array?Float32Array:Array;function ua(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ca(t,e,r){var n=e[0],i=e[1],s=e[2],a=e[3],o=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],y=e[12],m=e[13],g=e[14],x=e[15],v=r[0],b=r[1],w=r[2],_=r[3];return t[0]=v*n+b*o+w*h+_*y,t[1]=v*i+b*l+w*p+_*m,t[2]=v*s+b*u+w*f+_*g,t[3]=v*a+b*c+w*d+_*x,t[4]=(v=r[4])*n+(b=r[5])*o+(w=r[6])*h+(_=r[7])*y,t[5]=v*i+b*l+w*p+_*m,t[6]=v*s+b*u+w*f+_*g,t[7]=v*a+b*c+w*d+_*x,t[8]=(v=r[8])*n+(b=r[9])*o+(w=r[10])*h+(_=r[11])*y,t[9]=v*i+b*l+w*p+_*m,t[10]=v*s+b*u+w*f+_*g,t[11]=v*a+b*c+w*d+_*x,t[12]=(v=r[12])*n+(b=r[13])*o+(w=r[14])*h+(_=r[15])*y,t[13]=v*i+b*l+w*p+_*m,t[14]=v*s+b*u+w*f+_*g,t[15]=v*a+b*c+w*d+_*x,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var ha=ca;function pa(){var t=new la(4);return la!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function fa(t,e,r,n){var i=new la(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function da(t,e,r){var n=e[0],i=e[1],s=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*s+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*s+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*s+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*s+r[15]*a,t}function ya(t,e){const r=da(pa(),fa(t.x,t.y,0,1),e);return new S(r[0]/r[3],r[1]/r[3])}pa();class ma extends Ks{}kn("HeatmapBucket",ma,{omit:["layers"]});var ga={paint:new ci({"heatmap-radius":new ai(nt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new ai(nt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new si(nt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new ui(nt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new si(nt.paint_heatmap["heatmap-opacity"])})};function xa(t,{width:e,height:r},n,i){if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==e*r*n)throw new RangeError("mismatched image size")}else i=new Uint8Array(e*r*n);return t.width=e,t.height=r,t.data=i,t}function va(t,{width:e,height:r},n){if(e===t.width&&r===t.height)return;const i=xa({},{width:e,height:r},n);ba(t,i,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,r)},n),t.width=e,t.height=r,t.data=i.data;}function ba(t,e,r,n,i,s){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");const a=t.data,o=e.data;for(let l=0;l<i.height;l++){const u=((r.y+l)*t.width+r.x)*s,c=((n.y+l)*e.width+n.x)*s;for(let t=0;t<i.width*s;t++)o[c+t]=a[u+t];}return e}class wa{constructor(t,e){xa(this,t,1,e);}resize(t){va(this,t,1);}clone(){return new wa({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,r,n,i){ba(t,e,r,n,i,1);}}class _a{constructor(t,e){xa(this,t,4,e);}resize(t){va(this,t,4);}replace(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t;}clone(){return new _a({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,r,n,i){ba(t,e,r,n,i,4);}}function Aa(t){const e={},r=t.resolution||256,n=t.clips?t.clips.length:1,i=t.image||new _a({width:r,height:n}),s=(r,n,s)=>{e[t.evaluationKey]=s;const a=t.expression.evaluate(e);i.data[r+n+0]=Math.floor(255*a.r/a.a),i.data[r+n+1]=Math.floor(255*a.g/a.a),i.data[r+n+2]=Math.floor(255*a.b/a.a),i.data[r+n+3]=Math.floor(255*a.a);};if(t.clips)for(let e=0,i=0;e<n;++e,i+=4*r)for(let n=0,a=0;n<r;n++,a+=4){const o=n/(r-1),{start:l,end:u}=t.clips[e];s(i,a,l*(1-o)+u*o);}else for(let t=0,e=0;t<r;t++,e+=4)s(0,e,t/(r-1));return i}kn("AlphaImage",wa),kn("RGBAImage",_a);var ka={paint:new ci({"hillshade-illumination-direction":new si(nt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new si(nt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new si(nt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new si(nt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new si(nt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new si(nt.paint_hillshade["hillshade-accent-color"])})};const Sa=mi([{name:"a_pos",components:2,type:"Int16"}],4),{members:za}=Sa;var Ia={exports:{}};function Ma(t,e,r){r=r||2;var n,i,s,a,o,l,u,c=e&&e.length,h=c?e[0]*r:t.length,p=Ca(t,0,h,r,!0),f=[];if(!p||p.next===p.prev)return f;if(c&&(p=function(t,e,r,n){var i,s,a,o=[];for(i=0,s=e.length;i<s;i++)(a=Ca(t,e[i]*n,i<s-1?e[i+1]*n:t.length,n,!1))===a.next&&(a.steiner=!0),o.push(Ra(a));for(o.sort(La),i=0;i<o.length;i++)r=Ba(r=Da(o[i],r),r.next);return r}(t,e,p,r)),t.length>80*r){n=s=t[0],i=a=t[1];for(var d=r;d<h;d+=r)(o=t[d])<n&&(n=o),(l=t[d+1])<i&&(i=l),o>s&&(s=o),l>a&&(a=l);u=0!==(u=Math.max(s-n,a-i))?1/u:0;}return Pa(p,f,r,n,i,u),f}function Ca(t,e,r,n,i){var s,a;if(i===Qa(t,e,r,n)>0)for(s=e;s<r;s+=n)a=Ya(s,t[s],t[s+1],a);else for(s=r-n;s>=e;s-=n)a=Ya(s,t[s],t[s+1],a);return a&&Na(a,a.next)&&(Ha(a),a=a.next),a}function Ba(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!Na(n,n.next)&&0!==ja(n.prev,n,n.next))n=n.next;else {if(Ha(n),(n=e=n.prev)===n.next)break;r=!0;}}while(r||n!==e);return e}function Pa(t,e,r,n,i,s,a){if(t){!a&&s&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=Oa(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,s,a,o,l,u=1;do{for(r=t,t=null,s=null,a=0;r;){for(a++,n=r,o=0,e=0;e<u&&(o++,n=n.nextZ);e++);for(l=u;o>0||l>0&&n;)0!==o&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,o--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:t=i,i.prevZ=s,s=i;r=n;}s.nextZ=null,u*=2;}while(a>1)}(i);}(t,n,i,s);for(var o,l,u=t;t.prev!==t.next;)if(o=t.prev,l=t.next,s?Ea(t,n,i,s):Va(t))e.push(o.i/r),e.push(t.i/r),e.push(l.i/r),Ha(t),t=l.next,u=l.next;else if((t=l)===u){a?1===a?Pa(t=Fa(Ba(t),e,r),e,r,n,i,s,2):2===a&&Ta(t,e,r,n,i,s):Pa(Ba(t),e,r,n,i,s,1);break}}}function Va(t){var e=t.prev,r=t,n=t.next;if(ja(e,r,n)>=0)return !1;for(var i=t.next.next;i!==t.prev;){if(Ua(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&ja(i.prev,i,i.next)>=0)return !1;i=i.next;}return !0}function Ea(t,e,r,n){var i=t.prev,s=t,a=t.next;if(ja(i,s,a)>=0)return !1;for(var o=i.x>s.x?i.x>a.x?i.x:a.x:s.x>a.x?s.x:a.x,l=i.y>s.y?i.y>a.y?i.y:a.y:s.y>a.y?s.y:a.y,u=Oa(i.x<s.x?i.x<a.x?i.x:a.x:s.x<a.x?s.x:a.x,i.y<s.y?i.y<a.y?i.y:a.y:s.y<a.y?s.y:a.y,e,r,n),c=Oa(o,l,e,r,n),h=t.prevZ,p=t.nextZ;h&&h.z>=u&&p&&p.z<=c;){if(h!==t.prev&&h!==t.next&&Ua(i.x,i.y,s.x,s.y,a.x,a.y,h.x,h.y)&&ja(h.prev,h,h.next)>=0)return !1;if(h=h.prevZ,p!==t.prev&&p!==t.next&&Ua(i.x,i.y,s.x,s.y,a.x,a.y,p.x,p.y)&&ja(p.prev,p,p.next)>=0)return !1;p=p.nextZ;}for(;h&&h.z>=u;){if(h!==t.prev&&h!==t.next&&Ua(i.x,i.y,s.x,s.y,a.x,a.y,h.x,h.y)&&ja(h.prev,h,h.next)>=0)return !1;h=h.prevZ;}for(;p&&p.z<=c;){if(p!==t.prev&&p!==t.next&&Ua(i.x,i.y,s.x,s.y,a.x,a.y,p.x,p.y)&&ja(p.prev,p,p.next)>=0)return !1;p=p.nextZ;}return !0}function Fa(t,e,r){var n=t;do{var i=n.prev,s=n.next.next;!Na(i,s)&&Ka(i,n,n.next,s)&&Ja(i,s)&&Ja(s,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(s.i/r),Ha(n),Ha(n.next),n=t=s),n=n.next;}while(n!==t);return Ba(n)}function Ta(t,e,r,n,i,s){var a=t;do{for(var o=a.next.next;o!==a.prev;){if(a.i!==o.i&&qa(a,o)){var l=Xa(a,o);return a=Ba(a,a.next),l=Ba(l,l.next),Pa(a,e,r,n,i,s),void Pa(l,e,r,n,i,s)}o=o.next;}a=a.next;}while(a!==t)}function La(t,e){return t.x-e.x}function Da(t,e){var r=function(t,e){var r,n=e,i=t.x,s=t.y,a=-1/0;do{if(s<=n.y&&s>=n.next.y&&n.next.y!==n.y){var o=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(o<=i&&o>a){if(a=o,o===i){if(s===n.y)return n;if(s===n.next.y)return n.next}r=n.x<n.next.x?n:n.next;}}n=n.next;}while(n!==e);if(!r)return null;if(i===a)return r;var l,u=r,c=r.x,h=r.y,p=1/0;n=r;do{i>=n.x&&n.x>=c&&i!==n.x&&Ua(s<h?i:a,s,c,h,s<h?a:i,s,n.x,n.y)&&(l=Math.abs(s-n.y)/(i-n.x),Ja(n,t)&&(l<p||l===p&&(n.x>r.x||n.x===r.x&&$a(r,n)))&&(r=n,p=l)),n=n.next;}while(n!==u);return r}(t,e);if(!r)return e;var n=Xa(r,t),i=Ba(r,r.next);return Ba(n,n.next),e===r?i:e}function $a(t,e){return ja(t.prev,t,e.prev)<0&&ja(e.next,t,t.next)<0}function Oa(t,e,r,n,i){return (t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Ra(t){var e=t,r=t;do{(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;}while(e!==t);return r}function Ua(t,e,r,n,i,s,a,o){return (i-a)*(e-o)-(t-a)*(s-o)>=0&&(t-a)*(n-o)-(r-a)*(e-o)>=0&&(r-a)*(s-o)-(i-a)*(n-o)>=0}function qa(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Ka(r,r.next,t,e))return !0;r=r.next;}while(r!==t);return !1}(t,e)&&(Ja(t,e)&&Ja(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,s=(t.y+e.y)/2;do{r.y>s!=r.next.y>s&&r.next.y!==r.y&&i<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;}while(r!==t);return n}(t,e)&&(ja(t.prev,t,e.prev)||ja(t,e.prev,e))||Na(t,e)&&ja(t.prev,t,t.next)>0&&ja(e.prev,e,e.next)>0)}function ja(t,e,r){return (e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Na(t,e){return t.x===e.x&&t.y===e.y}function Ka(t,e,r,n){var i=Ga(ja(t,e,r)),s=Ga(ja(t,e,n)),a=Ga(ja(r,n,t)),o=Ga(ja(r,n,e));return i!==s&&a!==o||!(0!==i||!Za(t,r,e))||!(0!==s||!Za(t,n,e))||!(0!==a||!Za(r,t,n))||!(0!==o||!Za(r,e,n))}function Za(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Ga(t){return t>0?1:t<0?-1:0}function Ja(t,e){return ja(t.prev,t,t.next)<0?ja(t,e,t.next)>=0&&ja(t,t.prev,e)>=0:ja(t,e,t.prev)<0||ja(t,t.next,e)<0}function Xa(t,e){var r=new Wa(t.i,t.x,t.y),n=new Wa(e.i,e.x,e.y),i=t.next,s=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,s.next=n,n.prev=s,n}function Ya(t,e,r,n){var i=new Wa(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Ha(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ);}function Wa(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1;}function Qa(t,e,r,n){for(var i=0,s=e,a=r-n;s<r;s+=n)i+=(t[a]-t[s])*(t[s+1]+t[a+1]),a=s;return i}Ia.exports=Ma,Ia.exports.default=Ma,Ma.deviation=function(t,e,r,n){var i=e&&e.length,s=Math.abs(Qa(t,0,i?e[0]*r:t.length,r));if(i)for(var a=0,o=e.length;a<o;a++)s-=Math.abs(Qa(t,e[a]*r,a<o-1?e[a+1]*r:t.length,r));var l=0;for(a=0;a<n.length;a+=3){var u=n[a]*r,c=n[a+1]*r,h=n[a+2]*r;l+=Math.abs((t[u]-t[h])*(t[c+1]-t[u+1])-(t[u]-t[c])*(t[h+1]-t[u+1]));}return 0===s&&0===l?0:Math.abs((l-s)/s)},Ma.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var s=0;s<t[i].length;s++)for(var a=0;a<e;a++)r.vertices.push(t[i][s][a]);i>0&&r.holes.push(n+=t[i-1].length);}return r};var to=Ia.exports;function eo(t,e,r,n,i){ro(t,e,r||0,n||t.length-1,i||io);}function ro(t,e,r,n,i){for(;n>r;){if(n-r>600){var s=n-r+1,a=e-r+1,o=Math.log(s),l=.5*Math.exp(2*o/3),u=.5*Math.sqrt(o*l*(s-l)/s)*(a-s/2<0?-1:1);ro(t,e,Math.max(r,Math.floor(e-a*l/s+u)),Math.min(n,Math.floor(e+(s-a)*l/s+u)),i);}var c=t[e],h=r,p=n;for(no(t,r,e),i(t[n],c)>0&&no(t,r,n);h<p;){for(no(t,h,p),h++,p--;i(t[h],c)<0;)h++;for(;i(t[p],c)>0;)p--;}0===i(t[r],c)?no(t,r,p):no(t,++p,n),p<=e&&(r=p+1),e<=p&&(n=p-1);}}function no(t,e,r){var n=t[e];t[e]=t[r],t[r]=n;}function io(t,e){return t<e?-1:t>e?1:0}function so(t,e){const r=t.length;if(r<=1)return [t];const n=[];let i,s;for(let e=0;e<r;e++){const r=m(t[e]);0!==r&&(t[e].area=Math.abs(r),void 0===s&&(s=r<0),s===r<0?(i&&n.push(i),i=[t[e]]):i.push(t[e]));}if(i&&n.push(i),e>1)for(let t=0;t<n.length;t++)n[t].length<=e||(eo(n[t],e,1,n[t].length-1,ao),n[t]=n[t].slice(0,e));return n}function ao(t,e){return e.area-t.area}function oo(t,e,r){const n=r.patternDependencies;let i=!1;for(const r of e){const e=r.paint.get(`${t}-pattern`);e.isConstant()||(i=!0);const s=e.constantOr(null);s&&(i=!0,n[s.to]=!0,n[s.from]=!0);}return i}function lo(t,e,r,n,i){const s=i.patternDependencies;for(const a of e){const e=a.paint.get(`${t}-pattern`).value;if("constant"!==e.kind){let t=e.evaluate({zoom:n-1},r,{},i.availableImages),o=e.evaluate({zoom:n},r,{},i.availableImages),l=e.evaluate({zoom:n+1},r,{},i.availableImages);t=t&&t.name?t.name:t,o=o&&o.name?o.name:o,l=l&&l.name?l.name:l,s[t]=!0,s[o]=!0,s[l]=!0,r.patterns[a.id]={min:t,mid:o,max:l};}}return r}class uo{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Hi,this.indexArray=new os,this.indexArray2=new ls,this.programConfigurations=new Ls(t.layers,t.zoom),this.segments=new hs,this.segments2=new hs,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id));}populate(t,e,r){this.hasPattern=oo("fill",this.layers,e);const n=this.layers[0].layout.get("fill-sort-key"),i=!n.isConstant(),s=[];for(const{feature:a,id:o,index:l,sourceLayerIndex:u}of t){const t=this.layers[0]._featureFilter.needGeometry,c=js(a,t);if(!this.layers[0]._featureFilter.filter(new Yn(this.zoom),c,r))continue;const h=i?n.evaluate(c,{},r,e.availableImages):void 0,p={id:o,properties:a.properties,type:a.type,sourceLayerIndex:u,index:l,geometry:t?c.geometry:qs(a),patterns:{},sortKey:h};s.push(p);}i&&s.sort(((t,e)=>t.sortKey-e.sortKey));for(const n of s){const{geometry:i,index:s,sourceLayerIndex:a}=n;if(this.hasPattern){const t=lo("fill",this.layers,n,this.zoom,e);this.patternFeatures.push(t);}else this.addFeature(n,i,s,r,{});e.featureIndex.insert(t[s].feature,i,s,a,this.index);}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r);}addFeatures(t,e,r){for(const t of this.patternFeatures)this.addFeature(t,t.geometry,t.index,e,r);}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return !this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,za),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0;}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy());}addFeature(t,e,r,n,i){for(const t of so(e,500)){let e=0;for(const r of t)e+=r.length;const r=this.segments.prepareSegment(e,this.layoutVertexArray,this.indexArray),n=r.vertexLength,i=[],s=[];for(const e of t){if(0===e.length)continue;e!==t[0]&&s.push(i.length/2);const r=this.segments2.prepareSegment(e.length,this.layoutVertexArray,this.indexArray2),n=r.vertexLength;this.layoutVertexArray.emplaceBack(e[0].x,e[0].y),this.indexArray2.emplaceBack(n+e.length-1,n),i.push(e[0].x),i.push(e[0].y);for(let t=1;t<e.length;t++)this.layoutVertexArray.emplaceBack(e[t].x,e[t].y),this.indexArray2.emplaceBack(n+t-1,n+t),i.push(e[t].x),i.push(e[t].y);r.vertexLength+=e.length,r.primitiveLength+=e.length;}const a=to(i,s);for(let t=0;t<a.length;t+=3)this.indexArray.emplaceBack(n+a[t],n+a[t+1],n+a[t+2]);r.vertexLength+=e,r.primitiveLength+=a.length/3;}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n);}}kn("FillBucket",uo,{omit:["layers","patternFeatures"]});const co=new ci({"fill-sort-key":new ai(nt.layout_fill["fill-sort-key"])});var ho={paint:new ci({"fill-antialias":new si(nt.paint_fill["fill-antialias"]),"fill-opacity":new ai(nt.paint_fill["fill-opacity"]),"fill-color":new ai(nt.paint_fill["fill-color"]),"fill-outline-color":new ai(nt.paint_fill["fill-outline-color"]),"fill-translate":new si(nt.paint_fill["fill-translate"]),"fill-translate-anchor":new si(nt.paint_fill["fill-translate-anchor"]),"fill-pattern":new oi(nt.paint_fill["fill-pattern"])}),layout:co};const po=mi([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),{members:fo}=po;var yo={},mo=S,go=xo;function xo(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(vo,this,e);}function vo(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i;}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos);}function bo(t){for(var e,r,n=0,i=0,s=t.length,a=s-1;i<s;a=i++)n+=((r=t[a]).x-(e=t[i]).x)*(e.y+r.y);return n}xo.types=["Unknown","Point","LineString","Polygon"],xo.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,i=0,s=0,a=0,o=[];t.pos<r;){if(i<=0){var l=t.readVarint();n=7&l,i=l>>3;}if(i--,1===n||2===n)s+=t.readSVarint(),a+=t.readSVarint(),1===n&&(e&&o.push(e),e=[]),e.push(new mo(s,a));else {if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone());}}return e&&o.push(e),o},xo.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,s=0,a=1/0,o=-1/0,l=1/0,u=-1/0;t.pos<e;){if(n<=0){var c=t.readVarint();r=7&c,n=c>>3;}if(n--,1===r||2===r)(i+=t.readSVarint())<a&&(a=i),i>o&&(o=i),(s+=t.readSVarint())<l&&(l=s),s>u&&(u=s);else if(7!==r)throw new Error("unknown command "+r)}return [a,l,o,u]},xo.prototype.toGeoJSON=function(t,e,r){var n,i,s=this.extent*Math.pow(2,r),a=this.extent*t,o=this.extent*e,l=this.loadGeometry(),u=xo.types[this.type];function c(t){for(var e=0;e<t.length;e++){var r=t[e];t[e]=[360*(r.x+a)/s-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+o)/s)*Math.PI/180))-90];}}switch(this.type){case 1:var h=[];for(n=0;n<l.length;n++)h[n]=l[n][0];c(l=h);break;case 2:for(n=0;n<l.length;n++)c(l[n]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return [t];for(var r,n,i=[],s=0;s<e;s++){var a=bo(t[s]);0!==a&&(void 0===n&&(n=a<0),n===a<0?(r&&i.push(r),r=[t[s]]):r.push(t[s]));}return r&&i.push(r),i}(l),n=0;n<l.length;n++)for(i=0;i<l[n].length;i++)c(l[n][i]);}1===l.length?l=l[0]:u="Multi"+u;var p={type:"Feature",geometry:{type:u,coordinates:l},properties:this.properties};return "id"in this&&(p.id=this.id),p};var wo=go,_o=Ao;function Ao(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(ko,this,e),this.length=this._features.length;}function ko(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null;}return e}(r));}Ao.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new wo(this._pbf,e,this.extent,this._keys,this._values)};var So=_o;function zo(t,e,r){if(3===t){var n=new So(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n);}}yo.VectorTile=function(t,e){this.layers=t.readFields(zo,{},e);},yo.VectorTileFeature=go,yo.VectorTileLayer=_o;const Io=yo.VectorTileFeature.types,Mo=Math.pow(2,13);function Co(t,e,r,n,i,s,a,o){t.emplaceBack(e,r,2*Math.floor(n*Mo)+a,i*Mo*2,s*Mo*2,Math.round(o));}class Bo{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Wi,this.indexArray=new os,this.programConfigurations=new Ls(t.layers,t.zoom),this.segments=new hs,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id));}populate(t,e,r){this.features=[],this.hasPattern=oo("fill-extrusion",this.layers,e);for(const{feature:n,id:i,index:s,sourceLayerIndex:a}of t){const t=this.layers[0]._featureFilter.needGeometry,o=js(n,t);if(!this.layers[0]._featureFilter.filter(new Yn(this.zoom),o,r))continue;const l={id:i,sourceLayerIndex:a,index:s,geometry:t?o.geometry:qs(n),properties:n.properties,type:n.type,patterns:{}};this.hasPattern?this.features.push(lo("fill-extrusion",this.layers,l,this.zoom,e)):this.addFeature(l,l.geometry,s,r,{}),e.featureIndex.insert(n,l.geometry,s,a,this.index,!0);}}addFeatures(t,e,r){for(const t of this.features){const{geometry:n}=t;this.addFeature(t,n,t.index,e,r);}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r);}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return !this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,fo),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0;}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy());}addFeature(t,e,r,n,i){for(const r of so(e,500)){let e=0;for(const t of r)e+=t.length;let n=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const t of r){if(0===t.length)continue;if(Vo(t))continue;let e=0;for(let r=0;r<t.length;r++){const i=t[r];if(r>=1){const s=t[r-1];if(!Po(i,s)){n.vertexLength+4>hs.MAX_VERTEX_ARRAY_LENGTH&&(n=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const t=i.sub(s)._perp()._unit(),r=s.dist(i);e+r>32768&&(e=0),Co(this.layoutVertexArray,i.x,i.y,t.x,t.y,0,0,e),Co(this.layoutVertexArray,i.x,i.y,t.x,t.y,0,1,e),e+=r,Co(this.layoutVertexArray,s.x,s.y,t.x,t.y,0,0,e),Co(this.layoutVertexArray,s.x,s.y,t.x,t.y,0,1,e);const a=n.vertexLength;this.indexArray.emplaceBack(a,a+2,a+1),this.indexArray.emplaceBack(a+1,a+2,a+3),n.vertexLength+=4,n.primitiveLength+=2;}}}}if(n.vertexLength+e>hs.MAX_VERTEX_ARRAY_LENGTH&&(n=this.segments.prepareSegment(e,this.layoutVertexArray,this.indexArray)),"Polygon"!==Io[t.type])continue;const i=[],s=[],a=n.vertexLength;for(const t of r)if(0!==t.length){t!==r[0]&&s.push(i.length/2);for(let e=0;e<t.length;e++){const r=t[e];Co(this.layoutVertexArray,r.x,r.y,0,0,1,1,0),i.push(r.x),i.push(r.y);}}const o=to(i,s);for(let t=0;t<o.length;t+=3)this.indexArray.emplaceBack(a+o[t],a+o[t+2],a+o[t+1]);n.primitiveLength+=o.length/3,n.vertexLength+=e;}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n);}}function Po(t,e){return t.x===e.x&&(t.x<0||t.x>Os)||t.y===e.y&&(t.y<0||t.y>Os)}function Vo(t){return t.every((t=>t.x<0))||t.every((t=>t.x>Os))||t.every((t=>t.y<0))||t.every((t=>t.y>Os))}kn("FillExtrusionBucket",Bo,{omit:["layers","features"]});var Eo={paint:new ci({"fill-extrusion-opacity":new si(nt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new ai(nt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new si(nt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new si(nt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new oi(nt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new ai(nt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new ai(nt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new si(nt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function Fo(t,e){return t.x*e.x+t.y*e.y}function To(t,e){if(1===t.length){let r=0;const n=e[r++];let i;for(;!i||n.equals(i);)if(i=e[r++],!i)return 1/0;for(;r<e.length;r++){const s=e[r],a=t[0],o=i.sub(n),l=s.sub(n),u=a.sub(n),c=Fo(o,o),h=Fo(o,l),p=Fo(l,l),f=Fo(u,o),d=Fo(u,l),y=c*p-h*h,m=(p*f-h*d)/y,g=(c*d-h*f)/y,x=n.z*(1-m-g)+i.z*m+s.z*g;if(isFinite(x))return x}return 1/0}{let t=1/0;for(const r of e)t=Math.min(t,r.z);return t}}const Lo=mi([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Do}=Lo,$o=mi([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Oo}=$o,Ro=yo.VectorTileFeature.types,Uo=Math.cos(Math.PI/180*37.5),qo=Math.pow(2,14)/.5;class jo{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((t=>{this.gradients[t.id]={};})),this.layoutVertexArray=new Qi,this.layoutVertexArray2=new ts,this.indexArray=new os,this.programConfigurations=new Ls(t.layers,t.zoom),this.segments=new hs,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id));}populate(t,e,r){this.hasPattern=oo("line",this.layers,e);const n=this.layers[0].layout.get("line-sort-key"),i=!n.isConstant(),s=[];for(const{feature:e,id:a,index:o,sourceLayerIndex:l}of t){const t=this.layers[0]._featureFilter.needGeometry,u=js(e,t);if(!this.layers[0]._featureFilter.filter(new Yn(this.zoom),u,r))continue;const c=i?n.evaluate(u,{},r):void 0,h={id:a,properties:e.properties,type:e.type,sourceLayerIndex:l,index:o,geometry:t?u.geometry:qs(e),patterns:{},sortKey:c};s.push(h);}i&&s.sort(((t,e)=>t.sortKey-e.sortKey));for(const n of s){const{geometry:i,index:s,sourceLayerIndex:a}=n;if(this.hasPattern){const t=lo("line",this.layers,n,this.zoom,e);this.patternFeatures.push(t);}else this.addFeature(n,i,s,r,{});e.featureIndex.insert(t[s].feature,i,s,a,this.index);}}update(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r);}addFeatures(t,e,r){for(const t of this.patternFeatures)this.addFeature(t,t.geometry,t.index,e,r);}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return !this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,Oo)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Do),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0;}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy());}lineFeatureClips(t){if(t.properties&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_end"))return {start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,e,r,n,i){const s=this.layers[0].layout,a=s.get("line-join").evaluate(t,{}),o=s.get("line-cap"),l=s.get("line-miter-limit"),u=s.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const r of e)this.addLine(r,t,a,o,l,u);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,i,n);}addLine(t,e,r,n,i,s){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let e=0;e<t.length-1;e++)this.totalDistance+=t[e].dist(t[e+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance);}const a="Polygon"===Ro[e.type];let o=t.length;for(;o>=2&&t[o-1].equals(t[o-2]);)o--;let l=0;for(;l<o-1&&t[l].equals(t[l+1]);)l++;if(o<(a?3:2))return;"bevel"===r&&(i=1.05);const u=this.overscaling<=16?122880/(512*this.overscaling):0,c=this.segments.prepareSegment(10*o,this.layoutVertexArray,this.indexArray);let h,p,f,d,y;this.e1=this.e2=-1,a&&(h=t[o-2],y=t[l].sub(h)._unit()._perp());for(let e=l;e<o;e++){if(f=e===o-1?a?t[l+1]:void 0:t[e+1],f&&t[e].equals(f))continue;y&&(d=y),h&&(p=h),h=t[e],y=f?f.sub(h)._unit()._perp():d,d=d||y;let m=d.add(y);0===m.x&&0===m.y||m._unit();const g=d.x*y.x+d.y*y.y,x=m.x*y.x+m.y*y.y,v=0!==x?1/x:1/0,b=2*Math.sqrt(2-2*x),w=x<Uo&&p&&f,_=d.x*y.y-d.y*y.x>0;if(w&&e>l){const t=h.dist(p);if(t>2*u){const e=h.sub(h.sub(p)._mult(u/t)._round());this.updateDistance(p,e),this.addCurrentVertex(e,d,0,0,c),p=e;}}const A=p&&f;let k=A?r:a?"butt":n;if(A&&"round"===k&&(v<s?k="miter":v<=2&&(k="fakeround")),"miter"===k&&v>i&&(k="bevel"),"bevel"===k&&(v>2&&(k="flipbevel"),v<i&&(k="miter")),p&&this.updateDistance(p,h),"miter"===k)m._mult(v),this.addCurrentVertex(h,m,0,0,c);else if("flipbevel"===k){if(v>100)m=y.mult(-1);else {const t=v*d.add(y).mag()/d.sub(y).mag();m._perp()._mult(t*(_?-1:1));}this.addCurrentVertex(h,m,0,0,c),this.addCurrentVertex(h,m.mult(-1),0,0,c);}else if("bevel"===k||"fakeround"===k){const t=-Math.sqrt(v*v-1),e=_?t:0,r=_?0:t;if(p&&this.addCurrentVertex(h,d,e,r,c),"fakeround"===k){const t=Math.round(180*b/Math.PI/20);for(let e=1;e<t;e++){let r=e/t;if(.5!==r){const t=r-.5;r+=r*t*(r-1)*((1.0904+g*(g*(3.55645-1.43519*g)-3.2452))*t*t+(.848013+g*(.215638*g-1.06021)));}const n=y.sub(d)._mult(r)._add(d)._unit()._mult(_?-1:1);this.addHalfVertex(h,n.x,n.y,!1,_,0,c);}}f&&this.addCurrentVertex(h,y,-e,-r,c);}else if("butt"===k)this.addCurrentVertex(h,m,0,0,c);else if("square"===k){const t=p?1:-1;this.addCurrentVertex(h,m,t,t,c);}else "round"===k&&(p&&(this.addCurrentVertex(h,d,0,0,c),this.addCurrentVertex(h,d,1,1,c,!0)),f&&(this.addCurrentVertex(h,y,-1,-1,c,!0),this.addCurrentVertex(h,y,0,0,c)));if(w&&e<o-1){const t=h.dist(f);if(t>2*u){const e=h.add(f.sub(h)._mult(u/t)._round());this.updateDistance(h,e),this.addCurrentVertex(e,y,0,0,c),h=e;}}}}addCurrentVertex(t,e,r,n,i,s=!1){const a=e.y*n-e.x,o=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,s,!1,r,i),this.addHalfVertex(t,a,o,s,!0,-n,i),this.distance>qo/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,s));}addHalfVertex({x:t,y:e},r,n,i,s,a,o){const l=.5*(this.lineClips?this.scaledDistance*(qo-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t<<1)+(i?1:0),(e<<1)+(s?1:0),Math.round(63*r)+128,Math.round(63*n)+128,1+(0===a?0:a<0?-1:1)|(63&l)<<2,l>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),o.primitiveLength++),s?this.e2=u:this.e1=u;}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance;}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance();}}kn("LineBucket",jo,{omit:["layers","patternFeatures"]});const No=new ci({"line-cap":new si(nt.layout_line["line-cap"]),"line-join":new ai(nt.layout_line["line-join"]),"line-miter-limit":new si(nt.layout_line["line-miter-limit"]),"line-round-limit":new si(nt.layout_line["line-round-limit"]),"line-sort-key":new ai(nt.layout_line["line-sort-key"])});var Ko={paint:new ci({"line-opacity":new ai(nt.paint_line["line-opacity"]),"line-color":new ai(nt.paint_line["line-color"]),"line-translate":new si(nt.paint_line["line-translate"]),"line-translate-anchor":new si(nt.paint_line["line-translate-anchor"]),"line-width":new ai(nt.paint_line["line-width"]),"line-gap-width":new ai(nt.paint_line["line-gap-width"]),"line-offset":new ai(nt.paint_line["line-offset"]),"line-blur":new ai(nt.paint_line["line-blur"]),"line-dasharray":new li(nt.paint_line["line-dasharray"]),"line-pattern":new oi(nt.paint_line["line-pattern"]),"line-gradient":new ui(nt.paint_line["line-gradient"])}),layout:No};const Zo=new class extends ai{possiblyEvaluate(t,e){return e=new Yn(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,r,n){return e=o({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,r,n)}}(Ko.paint.properties["line-width"].specification);function Go(t,e){return e>0?e+2*t:t}Zo.useIntegerZoom=!0;const Jo=mi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Xo=mi([{name:"a_projected_pos",components:3,type:"Float32"}],4);mi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Yo=mi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);mi([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Ho=mi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Wo=mi([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Qo(t,e,r){return t.sections.forEach((t=>{t.text=function(t,e,r){const n=e.layout.get("text-transform").evaluate(r,{});return "uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),Xn.applyArabicShaping&&(t=Xn.applyArabicShaping(t)),t}(t.text,e,r);})),t}mi([{name:"triangle",components:3,type:"Uint16"}]),mi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),mi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),mi([{type:"Float32",name:"offsetX"}]),mi([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);const tl={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var el=24,rl=sl,nl=function(t,e,r,n,i){var s,a,o=8*i-n-1,l=(1<<o)-1,u=l>>1,c=-7,h=r?i-1:0,p=r?-1:1,f=t[e+h];for(h+=p,s=f&(1<<-c)-1,f>>=-c,c+=o;c>0;s=256*s+t[e+h],h+=p,c-=8);for(a=s&(1<<-c)-1,s>>=-c,c+=n;c>0;a=256*a+t[e+h],h+=p,c-=8);if(0===s)s=1-u;else {if(s===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),s-=u;}return (f?-1:1)*a*Math.pow(2,s-n)},il=function(t,e,r,n,i,s){var a,o,l,u=8*s-i-1,c=(1<<u)-1,h=c>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:s-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=c?(o=0,a=c):a+h>=1?(o=(e*l-1)*Math.pow(2,i),a+=h):(o=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&o,f+=d,o/=256,i-=8);for(a=a<<i|o,u+=i;u>0;t[r+f]=255&a,f+=d,a/=256,u-=8);t[r+f-d]|=128*y;};function sl(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length;}sl.Varint=0,sl.Fixed64=1,sl.Bytes=2,sl.Fixed32=5;var al,ol=4294967296,ll=1/ol,ul="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function cl(t){return t.type===sl.Bytes?t.readVarint()+t.pos:t.pos+1}function hl(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function pl(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i];}function fl(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r]);}function dl(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r]);}function yl(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r]);}function ml(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r]);}function gl(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r]);}function xl(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r]);}function vl(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r]);}function bl(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r]);}function wl(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r]);}function _l(t,e){return (t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Al(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24;}function kl(t,e){return (t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Sl(t,e,r){1===t&&r.readMessage(zl,e);}function zl(t,e,r){if(3===t){const{id:t,bitmap:n,width:i,height:s,left:a,top:o,advance:l}=r.readMessage(Il,{});e.push({id:t,bitmap:new wa({width:i+6,height:s+6},n),metrics:{width:i,height:s,left:a,top:o,advance:l}});}}function Il(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint());}function Ml(t){let e=0,r=0;for(const n of t)e+=n.w*n.h,r=Math.max(r,n.w);t.sort(((t,e)=>e.h-t.h));const n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}];let i=0,s=0;for(const e of t)for(let t=n.length-1;t>=0;t--){const r=n[t];if(!(e.w>r.w||e.h>r.h)){if(e.x=r.x,e.y=r.y,s=Math.max(s,e.y+e.h),i=Math.max(i,e.x+e.w),e.w===r.w&&e.h===r.h){const e=n.pop();t<n.length&&(n[t]=e);}else e.h===r.h?(r.x+=e.w,r.w-=e.w):e.w===r.w?(r.y+=e.h,r.h-=e.h):(n.push({x:r.x+e.w,y:r.y,w:r.w-e.w,h:e.h}),r.y+=e.h,r.h-=e.h);break}}return {w:i,h:s,fill:e/(i*s)||0}}sl.prototype={destroy:function(){this.buf=null;},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,s=this.pos;this.type=7&n,t(i,e,this),this.pos===s&&this.skip(n);}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=_l(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=kl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=_l(this.buf,this.pos)+_l(this.buf,this.pos+4)*ol;return this.pos+=8,t},readSFixed64:function(){var t=_l(this.buf,this.pos)+kl(this.buf,this.pos+4)*ol;return this.pos+=8,t},readFloat:function(){var t=nl(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=nl(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,s=r.buf;if(n=(112&(i=s[r.pos++]))>>4,i<128)return hl(t,n,e);if(n|=(127&(i=s[r.pos++]))<<3,i<128)return hl(t,n,e);if(n|=(127&(i=s[r.pos++]))<<10,i<128)return hl(t,n,e);if(n|=(127&(i=s[r.pos++]))<<17,i<128)return hl(t,n,e);if(n|=(127&(i=s[r.pos++]))<<24,i<128)return hl(t,n,e);if(n|=(1&(i=s[r.pos++]))<<31,i<128)return hl(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&ul?function(t,e,r){return ul.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var n="",i=e;i<r;){var s,a,o,l=t[i],u=null,c=l>239?4:l>223?3:l>191?2:1;if(i+c>r)break;1===c?l<128&&(u=l):2===c?128==(192&(s=t[i+1]))&&(u=(31&l)<<6|63&s)<=127&&(u=null):3===c?(a=t[i+2],128==(192&(s=t[i+1]))&&128==(192&a)&&((u=(15&l)<<12|(63&s)<<6|63&a)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(a=t[i+2],o=t[i+3],128==(192&(s=t[i+1]))&&128==(192&a)&&128==(192&o)&&((u=(15&l)<<18|(63&s)<<12|(63&a)<<6|63&o)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),i+=c;}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==sl.Bytes)return t.push(this.readVarint(e));var r=cl(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==sl.Bytes)return t.push(this.readSVarint());var e=cl(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==sl.Bytes)return t.push(this.readBoolean());var e=cl(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==sl.Bytes)return t.push(this.readFloat());var e=cl(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==sl.Bytes)return t.push(this.readDouble());var e=cl(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==sl.Bytes)return t.push(this.readFixed32());var e=cl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==sl.Bytes)return t.push(this.readSFixed32());var e=cl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==sl.Bytes)return t.push(this.readFixed64());var e=cl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==sl.Bytes)return t.push(this.readSFixed64());var e=cl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===sl.Varint)for(;this.buf[this.pos++]>127;);else if(e===sl.Bytes)this.pos=this.readVarint()+this.pos;else if(e===sl.Fixed32)this.pos+=4;else {if(e!==sl.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8;}},writeTag:function(t,e){this.writeVarint(t<<3|e);},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e;}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Al(this.buf,t,this.pos),this.pos+=4;},writeSFixed32:function(t){this.realloc(4),Al(this.buf,t,this.pos),this.pos+=4;},writeFixed64:function(t){this.realloc(8),Al(this.buf,-1&t,this.pos),Al(this.buf,Math.floor(t*ll),this.pos+4),this.pos+=8;},writeSFixed64:function(t){this.realloc(8),Al(this.buf,-1&t,this.pos),Al(this.buf,Math.floor(t*ll),this.pos+4),this.pos+=8;},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,r.buf[r.pos]=127&(t>>>=7);}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))));}(n,e);}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))));},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t);},writeBoolean:function(t){this.writeVarint(Boolean(t));},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,s=0;s<e.length;s++){if((n=e.charCodeAt(s))>55295&&n<57344){if(!i){n>56319||s+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null;}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128);}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&pl(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r;},writeFloat:function(t){this.realloc(4),il(this.buf,t,this.pos,!0,23,4),this.pos+=4;},writeDouble:function(t){this.realloc(8),il(this.buf,t,this.pos,!0,52,8),this.pos+=8;},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r];},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&pl(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n;},writeMessage:function(t,e,r){this.writeTag(t,sl.Bytes),this.writeRawMessage(e,r);},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,fl,e);},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,dl,e);},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,gl,e);},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,yl,e);},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ml,e);},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,xl,e);},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,vl,e);},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,bl,e);},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,wl,e);},writeBytesField:function(t,e){this.writeTag(t,sl.Bytes),this.writeBytes(e);},writeFixed32Field:function(t,e){this.writeTag(t,sl.Fixed32),this.writeFixed32(e);},writeSFixed32Field:function(t,e){this.writeTag(t,sl.Fixed32),this.writeSFixed32(e);},writeFixed64Field:function(t,e){this.writeTag(t,sl.Fixed64),this.writeFixed64(e);},writeSFixed64Field:function(t,e){this.writeTag(t,sl.Fixed64),this.writeSFixed64(e);},writeVarintField:function(t,e){this.writeTag(t,sl.Varint),this.writeVarint(e);},writeSVarintField:function(t,e){this.writeTag(t,sl.Varint),this.writeSVarint(e);},writeStringField:function(t,e){this.writeTag(t,sl.Bytes),this.writeString(e);},writeFloatField:function(t,e){this.writeTag(t,sl.Fixed32),this.writeFloat(e);},writeDoubleField:function(t,e){this.writeTag(t,sl.Fixed64),this.writeDouble(e);},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e));}};class Cl{constructor(t,{pixelRatio:e,version:r,stretchX:n,stretchY:i,content:s}){this.paddedRect=t,this.pixelRatio=e,this.stretchX=n,this.stretchY=i,this.content=s,this.version=r;}get tl(){return [this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return [this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return [(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class Bl{constructor(t,e){const r={},n={};this.haveRenderCallbacks=[];const i=[];this.addImages(t,r,i),this.addImages(e,n,i);const{w:s,h:a}=Ml(i),o=new _a({width:s||1,height:a||1});for(const e in t){const n=t[e],i=r[e].paddedRect;_a.copy(n.data,o,{x:0,y:0},{x:i.x+1,y:i.y+1},n.data);}for(const t in e){const r=e[t],i=n[t].paddedRect,s=i.x+1,a=i.y+1,l=r.data.width,u=r.data.height;_a.copy(r.data,o,{x:0,y:0},{x:s,y:a},r.data),_a.copy(r.data,o,{x:0,y:u-1},{x:s,y:a-1},{width:l,height:1}),_a.copy(r.data,o,{x:0,y:0},{x:s,y:a+u},{width:l,height:1}),_a.copy(r.data,o,{x:l-1,y:0},{x:s-1,y:a},{width:1,height:u}),_a.copy(r.data,o,{x:0,y:0},{x:s+l,y:a},{width:1,height:u});}this.image=o,this.iconPositions=r,this.patternPositions=n;}addImages(t,e,r){for(const n in t){const i=t[n],s={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(s),e[n]=new Cl(s,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n);}}patchUpdatedImages(t,e){t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const r in t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e);}patchUpdatedImage(t,e,r){if(!t||!e)return;if(t.version===e.version)return;t.version=e.version;const[n,i]=t.tl;r.update(e.data,void 0,{x:n,y:i});}}kn("ImagePosition",Cl),kn("ImageAtlas",Bl),t.WritingMode=void 0,(al=t.WritingMode||(t.WritingMode={}))[al.none=0]="none",al[al.horizontal=1]="horizontal",al[al.vertical=2]="vertical",al[al.horizontalOnly=3]="horizontalOnly";const Pl=-17;class Vl{constructor(){this.scale=1,this.fontStack="",this.imageName=null;}static forText(t,e){const r=new Vl;return r.scale=t||1,r.fontStack=e,r}static forImage(t){const e=new Vl;return e.imageName=t,e}}class El{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null;}static fromFeature(t,e){const r=new El;for(let n=0;n<t.sections.length;n++){const i=t.sections[n];i.image?r.addImageSection(i):r.addTextSection(i,e);}return r}length(){return this.text.length}getSection(t){return this.sections[this.sectionIndex[t]]}getSectionIndex(t){return this.sectionIndex[t]}getCharCode(t){return this.text.charCodeAt(t)}verticalizePunctuation(){this.text=function(t){let e="";for(let r=0;r<t.length;r++){const n=t.charCodeAt(r+1)||null,i=t.charCodeAt(r-1)||null;e+=n&&Fn(n)&&!tl[t[r+1]]||i&&Fn(i)&&!tl[t[r-1]]||!tl[t[r]]?t[r]:tl[t[r]];}return e}(this.text);}trim(){let t=0;for(let e=0;e<this.text.length&&Tl[this.text.charCodeAt(e)];e++)t++;let e=this.text.length;for(let r=this.text.length-1;r>=0&&r>=t&&Tl[this.text.charCodeAt(r)];r--)e--;this.text=this.text.substring(t,e),this.sectionIndex=this.sectionIndex.slice(t,e);}substring(t,e){const r=new El;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((t,e)=>Math.max(t,this.sections[e].scale)),0)}addTextSection(t,e){this.text+=t.text,this.sections.push(Vl.forText(t.scale,t.fontStack||e));const r=this.sections.length-1;for(let e=0;e<t.text.length;++e)this.sectionIndex.push(r);}addImageSection(t){const e=t.image?t.image.name:"";if(0===e.length)return void d("Can't add FormattedSection with an empty image.");const r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(Vl.forImage(e)),this.sectionIndex.push(this.sections.length-1)):d("Reached maximum number of images 6401");}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Fl(e,r,n,i,s,a,o,l,u,c,h,p,f,d,y,m){const g=El.fromFeature(e,s);let x;p===t.WritingMode.vertical&&g.verticalizePunctuation();const{processBidirectionalText:v,processStyledBidirectionalText:b}=Xn;if(v&&1===g.sections.length){x=[];const t=v(g.toString(),ql(g,c,a,r,i,d,y));for(const e of t){const t=new El;t.text=e,t.sections=g.sections;for(let r=0;r<e.length;r++)t.sectionIndex.push(0);x.push(t);}}else if(b){x=[];const t=b(g.text,g.sectionIndex,ql(g,c,a,r,i,d,y));for(const e of t){const t=new El;t.text=e[0],t.sectionIndex=e[1],t.sections=g.sections,x.push(t);}}else x=function(t,e){const r=[],n=t.text;let i=0;for(const n of e)r.push(t.substring(i,n)),i=n;return i<n.length&&r.push(t.substring(i,n.length)),r}(g,ql(g,c,a,r,i,d,y));const w=[],_={positionedLines:w,text:g.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:p,iconsInText:!1,verticalizable:!1};return function(e,r,n,i,s,a,o,l,u,c,h,p){let f=0,d=Pl,y=0,m=0;const g="right"===l?1:"left"===l?0:.5;let x=0;for(const o of s){o.trim();const s=o.getMaxScale(),l=(s-1)*el,b={positionedGlyphs:[],lineOffset:0};e.positionedLines[x]=b;const w=b.positionedGlyphs;let _=0;if(!o.length()){d+=a,++x;continue}for(let a=0;a<o.length();a++){const y=o.getSection(a),m=o.getSectionIndex(a),g=o.getCharCode(a);let x=0,b=null,A=null,k=null,S=el;const z=!(u===t.WritingMode.horizontal||!h&&!En(g)||h&&(Tl[g]||(v=g,Cn.Arabic(v)||Cn["Arabic Supplement"](v)||Cn["Arabic Extended-A"](v)||Cn["Arabic Presentation Forms-A"](v)||Cn["Arabic Presentation Forms-B"](v))));if(y.imageName){const t=i[y.imageName];if(!t)continue;k=y.imageName,e.iconsInText=e.iconsInText||!0,A=t.paddedRect;const r=t.displaySize;y.scale=y.scale*el/p,b={width:r[0],height:r[1],left:1,top:-3,advance:z?r[1]:r[0]},x=l+(el-r[1]*y.scale),S=b.advance;const n=z?r[0]*y.scale-el*s:r[1]*y.scale-el*s;n>0&&n>_&&(_=n);}else {const t=n[y.fontStack],e=t&&t[g];if(e&&e.rect)A=e.rect,b=e.metrics;else {const t=r[y.fontStack],e=t&&t[g];if(!e)continue;b=e.metrics;}x=(s-y.scale)*el;}z?(e.verticalizable=!0,w.push({glyph:g,imageName:k,x:f,y:d+x,vertical:z,scale:y.scale,fontStack:y.fontStack,sectionIndex:m,metrics:b,rect:A}),f+=S*y.scale+c):(w.push({glyph:g,imageName:k,x:f,y:d+x,vertical:z,scale:y.scale,fontStack:y.fontStack,sectionIndex:m,metrics:b,rect:A}),f+=b.advance*y.scale+c);}0!==w.length&&(y=Math.max(f-c,y),Nl(w,0,w.length-1,g,_)),f=0;const A=a*s+_;b.lineOffset=Math.max(_,l),d+=A,m=Math.max(A,m),++x;}var v;const b=d-Pl,{horizontalAlign:w,verticalAlign:_}=jl(o);((function(t,e,r,n,i,s,a,o,l){const u=(e-r)*i;let c=0;c=s!==a?-o*n-Pl:(-n*l+.5)*a;for(const e of t)for(const t of e.positionedGlyphs)t.x+=u,t.y+=c;}))(e.positionedLines,g,w,_,y,m,a,b,s.length),e.top+=-_*b,e.bottom=e.top+b,e.left+=-w*y,e.right=e.left+y;}(_,r,n,i,x,o,l,u,p,c,f,m),!function(t){for(const e of t)if(0!==e.positionedGlyphs.length)return !1;return !0}(w)&&_}const Tl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Ll={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Dl(t,e,r,n,i,s){if(e.imageName){const t=n[e.imageName];return t?t.displaySize[0]*e.scale*el/s+i:0}{const n=r[e.fontStack],s=n&&n[t];return s?s.metrics.advance*e.scale+i:0}}function $l(t,e,r,n){const i=Math.pow(t-e,2);return n?t<e?i/2:2*i:i+Math.abs(r)*r}function Ol(t,e,r){let n=0;return 10===t&&(n-=1e4),r&&(n+=150),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function Rl(t,e,r,n,i,s){let a=null,o=$l(e,r,i,s);for(const t of n){const n=$l(e-t.x,r,i,s)+t.badness;n<=o&&(a=t,o=n);}return {index:t,x:e,priorBreak:a,badness:o}}function Ul(t){return t?Ul(t.priorBreak).concat(t.index):[]}function ql(t,e,r,n,i,s,a){if("point"!==s)return [];if(!t)return [];const o=[],l=function(t,e,r,n,i,s){let a=0;for(let r=0;r<t.length();r++){const o=t.getSection(r);a+=Dl(t.getCharCode(r),o,n,i,e,s);}return a/Math.max(1,Math.ceil(a/r))}(t,e,r,n,i,a),u=t.text.indexOf("​")>=0;let c=0;for(let r=0;r<t.length();r++){const s=t.getSection(r),p=t.getCharCode(r);if(Tl[p]||(c+=Dl(p,s,n,i,e,a)),r<t.length()-1){const e=!((h=p)<11904||!(Cn["Bopomofo Extended"](h)||Cn.Bopomofo(h)||Cn["CJK Compatibility Forms"](h)||Cn["CJK Compatibility Ideographs"](h)||Cn["CJK Compatibility"](h)||Cn["CJK Radicals Supplement"](h)||Cn["CJK Strokes"](h)||Cn["CJK Symbols and Punctuation"](h)||Cn["CJK Unified Ideographs Extension A"](h)||Cn["CJK Unified Ideographs"](h)||Cn["Enclosed CJK Letters and Months"](h)||Cn["Halfwidth and Fullwidth Forms"](h)||Cn.Hiragana(h)||Cn["Ideographic Description Characters"](h)||Cn["Kangxi Radicals"](h)||Cn["Katakana Phonetic Extensions"](h)||Cn.Katakana(h)||Cn["Vertical Forms"](h)||Cn["Yi Radicals"](h)||Cn["Yi Syllables"](h)));(Ll[p]||e||s.imageName)&&o.push(Rl(r+1,c,l,o,Ol(p,t.getCharCode(r+1),e&&u),!1));}}var h;return Ul(Rl(t.length(),c,l,o,0,!0))}function jl(t){let e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0;}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0;}return {horizontalAlign:e,verticalAlign:r}}function Nl(t,e,r,n,i){if(!n&&!i)return;const s=t[r],a=(t[r].x+s.metrics.advance*s.scale)*n;for(let n=e;n<=r;n++)t[n].x-=a,t[n].y+=i;}function Kl(t,e,r){const{horizontalAlign:n,verticalAlign:i}=jl(r),s=e[0]-t.displaySize[0]*n,a=e[1]-t.displaySize[1]*i;return {image:t,top:a,bottom:a+t.displaySize[1],left:s,right:s+t.displaySize[0]}}function Zl(t,e,r,n,i,s){const a=t.image;let o;if(a.content){const t=a.content,e=a.pixelRatio||1;o=[t[0]/e,t[1]/e,a.displaySize[0]-t[2]/e,a.displaySize[1]-t[3]/e];}const l=e.left*s,u=e.right*s;let c,h,p,f;"width"===r||"both"===r?(f=i[0]+l-n[3],h=i[0]+u+n[1]):(f=i[0]+(l+u-a.displaySize[0])/2,h=f+a.displaySize[0]);const d=e.top*s,y=e.bottom*s;return "height"===r||"both"===r?(c=i[1]+d-n[0],p=i[1]+y+n[2]):(c=i[1]+(d+y-a.displaySize[1])/2,p=c+a.displaySize[1]),{image:a,top:c,right:h,bottom:p,left:f,collisionPadding:o}}const Gl=128;function Jl(t,e){const{expression:r}=e;if("constant"===r.kind)return {kind:"constant",layoutSize:r.evaluate(new Yn(t+1))};if("source"===r.kind)return {kind:"source"};{const{zoomStops:e,interpolationType:n}=r;let i=0;for(;i<e.length&&e[i]<=t;)i++;i=Math.max(0,i-1);let s=i;for(;s<e.length&&e[s]<t+1;)s++;s=Math.min(e.length-1,s);const a=e[i],o=e[s];return "composite"===r.kind?{kind:"composite",minZoom:a,maxZoom:o,interpolationType:n}:{kind:"camera",minZoom:a,maxZoom:o,minSize:r.evaluate(new Yn(a)),maxSize:r.evaluate(new Yn(o)),interpolationType:n}}}function Xl(t,{uSize:e,uSizeT:r},{lowerSize:n,upperSize:i}){return "source"===t.kind?n/Gl:"composite"===t.kind?Se(n/Gl,i/Gl,r):e}function Yl(t,e){let r=0,n=0;if("constant"===t.kind)n=t.layoutSize;else if("source"!==t.kind){const{interpolationType:i,minZoom:a,maxZoom:o}=t,l=i?s(Ne.interpolationFactor(i,e,a,o),0,1):0;"camera"===t.kind?n=Se(t.minSize,t.maxSize,l):r=l;}return {uSizeT:r,uSize:n}}var Hl=Object.freeze({__proto__:null,getSizeData:Jl,evaluateSizeForFeature:Xl,evaluateSizeForZoom:Yl,SIZE_PACK_FACTOR:Gl});class Wl extends S{constructor(t,e,r,n){super(t,e),this.angle=r,void 0!==n&&(this.segment=n);}clone(){return new Wl(this.x,this.y,this.angle,this.segment)}}function Ql(t,e,r,n,i){if(void 0===e.segment)return !0;let s=e,a=e.segment+1,o=0;for(;o>-r/2;){if(a--,a<0)return !1;o-=t[a].dist(s),s=t[a];}o+=t[a].dist(t[a+1]),a++;const l=[];let u=0;for(;o<r/2;){const e=t[a],r=t[a+1];if(!r)return !1;let s=t[a-1].angleTo(e)-e.angleTo(r);for(s=Math.abs((s+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:o,angleDelta:s}),u+=s;o-l[0].distance>n;)u-=l.shift().angleDelta;if(u>i)return !1;a++,o+=e.dist(r);}return !0}function tu(t){let e=0;for(let r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function eu(t,e,r){return t?.6*e*r:0}function ru(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function nu(t,e,r,n,i,s){const a=eu(r,i,s),o=ru(r,n)*s;let l=0;const u=tu(t)/2;for(let r=0;r<t.length-1;r++){const n=t[r],i=t[r+1],s=n.dist(i);if(l+s>u){const c=(u-l)/s,h=Se(n.x,i.x,c),p=Se(n.y,i.y,c),f=new Wl(h,p,i.angleTo(n),r);return f._round(),!a||Ql(t,f,o,a,e)?f:void 0}l+=s;}}function iu(t,e,r,n,i,s,a,o,l){const u=eu(n,s,a),c=ru(n,i),h=c*a,p=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-h<e/4&&(e=h+e/4),su(t,p?e/2*o%e:(c/2+2*s)*a*o%e,e,u,r,h,p,!1,l)}function su(t,e,r,n,i,s,a,o,l){const u=s/2,c=tu(t);let h=0,p=e-r,f=[];for(let e=0;e<t.length-1;e++){const a=t[e],o=t[e+1],d=a.dist(o),y=o.angleTo(a);for(;p+r<h+d;){p+=r;const m=(p-h)/d,g=Se(a.x,o.x,m),x=Se(a.y,o.y,m);if(g>=0&&g<l&&x>=0&&x<l&&p-u>=0&&p+u<=c){const r=new Wl(g,x,y,e);r._round(),n&&!Ql(t,r,s,n,i)||f.push(r);}}h+=d;}return o||f.length||a||(f=su(t,h/2,r,n,i,s,a,!0,l)),f}function au(t,e,r,n,i){const s=[];for(let a=0;a<t.length;a++){const o=t[a];let l;for(let t=0;t<o.length-1;t++){let a=o[t],u=o[t+1];a.x<e&&u.x<e||(a.x<e?a=new S(e,a.y+(e-a.x)/(u.x-a.x)*(u.y-a.y))._round():u.x<e&&(u=new S(e,a.y+(e-a.x)/(u.x-a.x)*(u.y-a.y))._round()),a.y<r&&u.y<r||(a.y<r?a=new S(a.x+(r-a.y)/(u.y-a.y)*(u.x-a.x),r)._round():u.y<r&&(u=new S(a.x+(r-a.y)/(u.y-a.y)*(u.x-a.x),r)._round()),a.x>=n&&u.x>=n||(a.x>=n?a=new S(n,a.y+(n-a.x)/(u.x-a.x)*(u.y-a.y))._round():u.x>=n&&(u=new S(n,a.y+(n-a.x)/(u.x-a.x)*(u.y-a.y))._round()),a.y>=i&&u.y>=i||(a.y>=i?a=new S(a.x+(i-a.y)/(u.y-a.y)*(u.x-a.x),i)._round():u.y>=i&&(u=new S(a.x+(i-a.y)/(u.y-a.y)*(u.x-a.x),i)._round()),l&&a.equals(l[l.length-1])||(l=[a],s.push(l)),l.push(u)))));}}return s}function ou(t,e,r,n){const i=[],s=t.image,a=s.pixelRatio,o=s.paddedRect.w-2,l=s.paddedRect.h-2,u=t.right-t.left,c=t.bottom-t.top,h=s.stretchX||[[0,o]],p=s.stretchY||[[0,l]],f=(t,e)=>t+e[1]-e[0],d=h.reduce(f,0),y=p.reduce(f,0),m=o-d,g=l-y;let x=0,v=d,b=0,w=y,_=0,A=m,k=0,z=g;if(s.content&&n){const t=s.content;x=lu(h,0,t[0]),b=lu(p,0,t[1]),v=lu(h,t[0],t[2]),w=lu(p,t[1],t[3]),_=t[0]-x,k=t[1]-b,A=t[2]-t[0]-v,z=t[3]-t[1]-w;}const I=(n,i,o,l)=>{const h=cu(n.stretch-x,v,u,t.left),p=hu(n.fixed-_,A,n.stretch,d),f=cu(i.stretch-b,w,c,t.top),m=hu(i.fixed-k,z,i.stretch,y),g=cu(o.stretch-x,v,u,t.left),I=hu(o.fixed-_,A,o.stretch,d),M=cu(l.stretch-b,w,c,t.top),C=hu(l.fixed-k,z,l.stretch,y),B=new S(h,f),P=new S(g,f),V=new S(g,M),E=new S(h,M),F=new S(p/a,m/a),T=new S(I/a,C/a),L=e*Math.PI/180;if(L){const t=Math.sin(L),e=Math.cos(L),r=[e,-t,t,e];B._matMult(r),P._matMult(r),E._matMult(r),V._matMult(r);}const D=n.stretch+n.fixed,$=i.stretch+i.fixed;return {tl:B,tr:P,bl:E,br:V,tex:{x:s.paddedRect.x+1+D,y:s.paddedRect.y+1+$,w:o.stretch+o.fixed-D,h:l.stretch+l.fixed-$},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:F,pixelOffsetBR:T,minFontScaleX:A/a/u,minFontScaleY:z/a/c,isSDF:r}};if(n&&(s.stretchX||s.stretchY)){const t=uu(h,m,d),e=uu(p,g,y);for(let r=0;r<t.length-1;r++){const n=t[r],s=t[r+1];for(let t=0;t<e.length-1;t++)i.push(I(n,e[t],s,e[t+1]));}}else i.push(I({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:o+1},{fixed:0,stretch:l+1}));return i}function lu(t,e,r){let n=0;for(const i of t)n+=Math.max(e,Math.min(r,i[1]))-Math.max(e,Math.min(r,i[0]));return n}function uu(t,e,r){const n=[{fixed:-1,stretch:0}];for(const[e,r]of t){const t=n[n.length-1];n.push({fixed:e-t.stretch,stretch:t.stretch}),n.push({fixed:e-t.stretch,stretch:t.stretch+(r-e)});}return n.push({fixed:e+1,stretch:r}),n}function cu(t,e,r,n){return t/e*r+n}function hu(t,e,r,n){return t-e*r/n}kn("Anchor",Wl);class pu{constructor(t,e,r,n,i,s,a,o,l,u){if(this.boxStartIndex=t.length,l){let t=s.top,e=s.bottom;const r=s.collisionPadding;r&&(t-=r[1],e+=r[3]);let n=e-t;n>0&&(n=Math.max(10,n),this.circleDiameter=n);}else {let l=s.top*a-o,c=s.bottom*a+o,h=s.left*a-o,p=s.right*a+o;const f=s.collisionPadding;if(f&&(h-=f[0]*a,l-=f[1]*a,p+=f[2]*a,c+=f[3]*a),u){const t=new S(h,l),e=new S(p,l),r=new S(h,c),n=new S(p,c),i=u*Math.PI/180;t._rotate(i),e._rotate(i),r._rotate(i),n._rotate(i),h=Math.min(t.x,e.x,r.x,n.x),p=Math.max(t.x,e.x,r.x,n.x),l=Math.min(t.y,e.y,r.y,n.y),c=Math.max(t.y,e.y,r.y,n.y);}t.emplaceBack(e.x,e.y,h,l,p,c,r,n,i);}this.boxEndIndex=t.length;}}class fu{constructor(t=[],e=du){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t);}push(t){this.data.push(t),this.length++,this._up(this.length-1);}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:r}=this,n=e[t];for(;t>0;){const i=t-1>>1,s=e[i];if(r(n,s)>=0)break;e[t]=s,t=i;}e[t]=n;}_down(t){const{data:e,compare:r}=this,n=this.length>>1,i=e[t];for(;t<n;){let n=1+(t<<1),s=e[n];const a=n+1;if(a<this.length&&r(e[a],s)<0&&(n=a,s=e[a]),r(s,i)>=0)break;e[t]=s,t=n;}e[t]=i;}}function du(t,e){return t<e?-1:t>e?1:0}function yu(t,e=1,r=!1){let n=1/0,i=1/0,s=-1/0,a=-1/0;const o=t[0];for(let t=0;t<o.length;t++){const e=o[t];(!t||e.x<n)&&(n=e.x),(!t||e.y<i)&&(i=e.y),(!t||e.x>s)&&(s=e.x),(!t||e.y>a)&&(a=e.y);}const l=Math.min(s-n,a-i);let u=l/2;const c=new fu([],mu);if(0===l)return new S(n,i);for(let e=n;e<s;e+=l)for(let r=i;r<a;r+=l)c.push(new gu(e+u,r+u,u,t));let h=function(t){let e=0,r=0,n=0;const i=t[0];for(let t=0,s=i.length,a=s-1;t<s;a=t++){const s=i[t],o=i[a],l=s.x*o.y-o.x*s.y;r+=(s.x+o.x)*l,n+=(s.y+o.y)*l,e+=3*l;}return new gu(r/e,n/e,0,t)}(t),p=c.length;for(;c.length;){const n=c.pop();(n.d>h.d||!h.d)&&(h=n,r&&console.log("found best %d after %d probes",Math.round(1e4*n.d)/1e4,p)),n.max-h.d<=e||(u=n.h/2,c.push(new gu(n.p.x-u,n.p.y-u,u,t)),c.push(new gu(n.p.x+u,n.p.y-u,u,t)),c.push(new gu(n.p.x-u,n.p.y+u,u,t)),c.push(new gu(n.p.x+u,n.p.y+u,u,t)),p+=4);}return r&&(console.log(`num probes: ${p}`),console.log(`best distance: ${h.d}`)),h.p}function mu(t,e){return e.max-t.max}function gu(t,e,r,n){this.p=new S(t,e),this.h=r,this.d=function(t,e){let r=!1,n=1/0;for(let i=0;i<e.length;i++){const s=e[i];for(let e=0,i=s.length,a=i-1;e<i;a=e++){const i=s[e],o=s[a];i.y>t.y!=o.y>t.y&&t.x<(o.x-i.x)*(t.y-i.y)/(o.y-i.y)+i.x&&(r=!r),n=Math.min(n,Qs(t,i,o));}}return (r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2;}const xu=Number.POSITIVE_INFINITY;function vu(t,e){return e[1]!==xu?function(t,e,r){let n=0,i=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r;}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e;}return [n,i]}(t,e[0],e[1]):function(t,e){let r=0,n=0;e<0&&(e=0);const i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-e;break;case"top":n=e-7;}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e;}return [r,n]}(t,e[0])}function bu(t){switch(t){case"right":case"top-right":case"bottom-right":return "right";case"left":case"top-left":case"bottom-left":return "left"}return "center"}function wu(e,r,n,i,s,a,o,l,u,c,h){let p=a.textMaxSize.evaluate(r,{});void 0===p&&(p=o);const f=e.layers[0].layout,y=f.get("icon-offset").evaluate(r,{},h),m=ku(n.horizontal),g=o/24,x=e.tilePixelRatio*g,v=e.tilePixelRatio*p/24,b=e.tilePixelRatio*l,w=e.tilePixelRatio*f.get("symbol-spacing"),_=f.get("text-padding")*e.tilePixelRatio,A=f.get("icon-padding")*e.tilePixelRatio,k=f.get("text-max-angle")/180*Math.PI,S="map"===f.get("text-rotation-alignment")&&"point"!==f.get("symbol-placement"),z="map"===f.get("icon-rotation-alignment")&&"point"!==f.get("symbol-placement"),I=f.get("symbol-placement"),M=w/2,C=f.get("icon-text-fit");let B;i&&"none"!==C&&(e.allowVerticalPlacement&&n.vertical&&(B=Zl(i,n.vertical,C,f.get("icon-text-fit-padding"),y,g)),m&&(i=Zl(i,m,C,f.get("icon-text-fit-padding"),y,g)));const P=(l,p)=>{p.x<0||p.x>=Os||p.y<0||p.y>=Os||function(e,r,n,i,s,a,o,l,u,c,h,p,f,y,m,g,x,v,b,w,_,A,k,S,z){const I=e.addToLineVertexArray(r,n);let M,C,B,P,V=0,E=0,F=0,T=0,L=-1,D=-1;const $={};let O=vs(""),R=0,U=0;if(void 0===l._unevaluatedLayout.getValue("text-radial-offset")?[R,U]=l.layout.get("text-offset").evaluate(_,{},S).map((t=>t*el)):(R=l.layout.get("text-radial-offset").evaluate(_,{},S)*el,U=xu),e.allowVerticalPlacement&&i.vertical){const t=l.layout.get("text-rotate").evaluate(_,{},S)+90;B=new pu(u,r,c,h,p,i.vertical,f,y,m,t),o&&(P=new pu(u,r,c,h,p,o,x,v,m,t));}if(s){const n=l.layout.get("icon-rotate").evaluate(_,{}),i="none"!==l.layout.get("icon-text-fit"),a=ou(s,n,k,i),f=o?ou(o,n,k,i):void 0;C=new pu(u,r,c,h,p,s,x,v,!1,n),V=4*a.length;const y=e.iconSizeData;let m=null;"source"===y.kind?(m=[Gl*l.layout.get("icon-size").evaluate(_,{})],m[0]>_u&&d(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===y.kind&&(m=[Gl*A.compositeIconSizes[0].evaluate(_,{},S),Gl*A.compositeIconSizes[1].evaluate(_,{},S)],(m[0]>_u||m[1]>_u)&&d(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),e.addSymbols(e.icon,a,m,w,b,_,t.WritingMode.none,r,I.lineStartIndex,I.lineLength,-1,S),L=e.icon.placedSymbolArray.length-1,f&&(E=4*f.length,e.addSymbols(e.icon,f,m,w,b,_,t.WritingMode.vertical,r,I.lineStartIndex,I.lineLength,-1,S),D=e.icon.placedSymbolArray.length-1);}const q=Object.keys(i.horizontal);for(const n of q){const s=i.horizontal[n];if(!M){O=vs(s.text);const t=l.layout.get("text-rotate").evaluate(_,{},S);M=new pu(u,r,c,h,p,s,f,y,m,t);}const o=1===s.positionedLines.length;if(F+=Au(e,r,s,a,l,m,_,g,I,i.vertical?t.WritingMode.horizontal:t.WritingMode.horizontalOnly,o?q:[n],$,L,A,S),o)break}i.vertical&&(T+=Au(e,r,i.vertical,a,l,m,_,g,I,t.WritingMode.vertical,["vertical"],$,D,A,S));const j=M?M.boxStartIndex:e.collisionBoxArray.length,N=M?M.boxEndIndex:e.collisionBoxArray.length,K=B?B.boxStartIndex:e.collisionBoxArray.length,Z=B?B.boxEndIndex:e.collisionBoxArray.length,G=C?C.boxStartIndex:e.collisionBoxArray.length,J=C?C.boxEndIndex:e.collisionBoxArray.length,X=P?P.boxStartIndex:e.collisionBoxArray.length,Y=P?P.boxEndIndex:e.collisionBoxArray.length;let H=-1;const W=(t,e)=>t&&t.circleDiameter?Math.max(t.circleDiameter,e):e;H=W(M,H),H=W(B,H),H=W(C,H),H=W(P,H);const Q=H>-1?1:0;Q&&(H*=z/el),e.glyphOffsetArray.length>=Eu.MAX_GLYPHS&&d("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==_.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,_.sortKey),e.symbolInstances.emplaceBack(r.x,r.y,$.right>=0?$.right:-1,$.center>=0?$.center:-1,$.left>=0?$.left:-1,$.vertical||-1,L,D,O,j,N,K,Z,G,J,X,Y,c,F,T,V,E,Q,0,f,R,U,H);}(e,p,l,n,i,s,B,e.layers[0],e.collisionBoxArray,r.index,r.sourceLayerIndex,e.index,x,_,S,u,b,A,z,y,r,a,c,h,o);};if("line"===I)for(const t of au(r.geometry,0,0,Os,Os)){const r=iu(t,w,k,n.vertical||m,i,24,v,e.overscaling,Os);for(const n of r){const r=m;r&&Su(e,r.text,M,n)||P(t,n);}}else if("line-center"===I){for(const t of r.geometry)if(t.length>1){const e=nu(t,k,n.vertical||m,i,24,v);e&&P(t,e);}}else if("Polygon"===r.type)for(const t of so(r.geometry,0)){const e=yu(t,16);P(t[0],new Wl(e.x,e.y,0));}else if("LineString"===r.type)for(const t of r.geometry)P(t,new Wl(t[0].x,t[0].y,0));else if("Point"===r.type)for(const t of r.geometry)for(const e of t)P([e],new Wl(e.x,e.y,0));}const _u=32640;function Au(t,e,r,n,i,s,a,o,l,u,c,h,p,f,y){const m=function(t,e,r,n,i,s,a,o){const l=n.layout.get("text-rotate").evaluate(s,{})*Math.PI/180,u=[];for(const t of e.positionedLines)for(const n of t.positionedGlyphs){if(!n.rect)continue;const s=n.rect||{};let c=4,h=!0,p=1,f=0;const d=(i||o)&&n.vertical,y=n.metrics.advance*n.scale/2;if(o&&e.verticalizable){const e=(n.scale-1)*el,r=(el-n.metrics.width*n.scale)/2;f=t.lineOffset/2-(n.imageName?-r:e);}if(n.imageName){const t=a[n.imageName];h=t.sdf,p=t.pixelRatio,c=1/p;}const m=i?[n.x+y,n.y]:[0,0];let g=i?[0,0]:[n.x+y+r[0],n.y+r[1]-f],x=[0,0];d&&(x=g,g=[0,0]);const v=(n.metrics.left-c)*n.scale-y+g[0],b=(-n.metrics.top-c)*n.scale+g[1],w=v+s.w*n.scale/p,_=b+s.h*n.scale/p,A=new S(v,b),k=new S(w,b),z=new S(v,_),I=new S(w,_);if(d){const t=new S(-y,y-Pl),e=-Math.PI/2,r=12-y,i=new S(22-r,-(n.imageName?r:0)),s=new S(...x);A._rotateAround(e,t)._add(i)._add(s),k._rotateAround(e,t)._add(i)._add(s),z._rotateAround(e,t)._add(i)._add(s),I._rotateAround(e,t)._add(i)._add(s);}if(l){const t=Math.sin(l),e=Math.cos(l),r=[e,-t,t,e];A._matMult(r),k._matMult(r),z._matMult(r),I._matMult(r);}const M=new S(0,0),C=new S(0,0);u.push({tl:A,tr:k,bl:z,br:I,tex:s,writingMode:e.writingMode,glyphOffset:m,sectionIndex:n.sectionIndex,isSDF:h,pixelOffsetTL:M,pixelOffsetBR:C,minFontScaleX:0,minFontScaleY:0});}return u}(0,r,o,i,s,a,n,t.allowVerticalPlacement),g=t.textSizeData;let x=null;"source"===g.kind?(x=[Gl*i.layout.get("text-size").evaluate(a,{})],x[0]>_u&&d(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===g.kind&&(x=[Gl*f.compositeTextSizes[0].evaluate(a,{},y),Gl*f.compositeTextSizes[1].evaluate(a,{},y)],(x[0]>_u||x[1]>_u)&&d(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),t.addSymbols(t.text,m,x,o,s,a,u,e,l.lineStartIndex,l.lineLength,p,y);for(const e of c)h[e]=t.text.placedSymbolArray.length-1;return 4*m.length}function ku(t){for(const e in t)return t[e];return null}function Su(t,e,r,n){const i=t.compareText;if(e in i){const t=i[e];for(let e=t.length-1;e>=0;e--)if(n.dist(t[e])<r)return !0}else i[e]=[];return i[e].push(n),!1}const zu=yo.VectorTileFeature.types,Iu=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Mu(t,e,r,n,i,s,a,o,l,u,c,h,p){const f=o?Math.min(_u,Math.round(o[0])):0,d=o?Math.min(_u,Math.round(o[1])):0;t.emplaceBack(e,r,Math.round(32*n),Math.round(32*i),s,a,(f<<1)+(l?1:0),d,16*u,16*c,256*h,256*p);}function Cu(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r);}function Bu(t){for(const e of t.sections)if(Dn(e.text))return !0;return !1}class Pu{constructor(t){this.layoutVertexArray=new rs,this.indexArray=new os,this.programConfigurations=t,this.segments=new hs,this.dynamicLayoutVertexArray=new ns,this.opacityVertexArray=new is,this.placedSymbolArray=new ji;}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(t,e,r,n){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Jo.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Xo.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,Iu,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(t));}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy());}}kn("SymbolBuffers",Pu);class Vu{constructor(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new hs,this.collisionVertexArray=new as;}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Yo.members,!0);}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy());}}kn("CollisionBuffers",Vu);class Eu{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=ua([]),this.placementViewportMatrix=ua([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Jl(this.zoom,r["text-size"]),this.iconSizeData=Jl(this.zoom,r["icon-size"]);const n=this.layers[0].layout,i=n.get("symbol-sort-key"),s=n.get("symbol-z-order");this.canOverlap=n.get("text-allow-overlap")||n.get("icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==s&&!i.isConstant(),this.sortFeaturesByY=("viewport-y"===s||"auto"===s&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===n.get("symbol-placement")&&(this.writingModes=n.get("text-writing-mode").map((e=>t.WritingMode[e]))),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.sourceID=e.sourceID;}createArrays(){this.text=new Pu(new Ls(this.layers,this.zoom,(t=>/^text/.test(t)))),this.icon=new Pu(new Ls(this.layers,this.zoom,(t=>/^icon/.test(t)))),this.glyphOffsetArray=new Zi,this.lineVertexArray=new Gi,this.symbolInstances=new Ki;}calculateGlyphDependencies(t,e,r,n,i){for(let s=0;s<t.length;s++)if(e[t.charCodeAt(s)]=!0,(r||n)&&i){const r=tl[t.charAt(s)];r&&(e[r.charCodeAt(0)]=!0);}}populate(e,r,n){const i=this.layers[0],s=i.layout,a=s.get("text-font"),o=s.get("text-field"),l=s.get("icon-image"),u=("constant"!==o.value.kind||o.value.value instanceof Lt&&!o.value.value.isEmpty()||o.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),c="constant"!==l.value.kind||!!l.value.value||Object.keys(l.parameters).length>0,h=s.get("symbol-sort-key");if(this.features=[],!u&&!c)return;const p=r.iconDependencies,f=r.glyphDependencies,d=r.availableImages,y=new Yn(this.zoom);for(const{feature:r,id:o,index:l,sourceLayerIndex:m}of e){const e=i._featureFilter.needGeometry,g=js(r,e);if(!i._featureFilter.filter(y,g,n))continue;let x,v;if(e||(g.geometry=qs(r)),u){const t=i.getValueAndResolveTokens("text-field",g,n,d),e=Lt.factory(t);Bu(e)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===Gn()||this.hasRTLText&&Xn.isParsed())&&(x=Qo(e,i,g));}if(c){const t=i.getValueAndResolveTokens("icon-image",g,n,d);v=t instanceof Dt?t:Dt.fromString(t);}if(!x&&!v)continue;const b=this.sortFeaturesByKey?h.evaluate(g,{},n):void 0;if(this.features.push({id:o,text:x,icon:v,index:l,sourceLayerIndex:m,geometry:g.geometry,properties:r.properties,type:zu[r.type],sortKey:b}),v&&(p[v.name]=!0),x){const e=a.evaluate(g,{},n).join(","),r="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(t.WritingMode.vertical)>=0;for(const t of x.sections)if(t.image)p[t.image.name]=!0;else {const n=Bn(x.toString()),i=t.fontStack||e,s=f[i]=f[i]||{};this.calculateGlyphDependencies(t.text,s,r,this.allowVerticalPlacement,n);}}}"line"===s.get("symbol-placement")&&(this.features=function(t){const e={},r={},n=[];let i=0;function s(e){n.push(t[e]),i++;}function a(t,e,i){const s=r[t];return delete r[t],r[e]=s,n[s].geometry[0].pop(),n[s].geometry[0]=n[s].geometry[0].concat(i[0]),s}function o(t,r,i){const s=e[r];return delete e[r],e[t]=s,n[s].geometry[0].shift(),n[s].geometry[0]=i[0].concat(n[s].geometry[0]),s}function l(t,e,r){const n=r?e[0][e[0].length-1]:e[0][0];return `${t}:${n.x}:${n.y}`}for(let u=0;u<t.length;u++){const c=t[u],h=c.geometry,p=c.text?c.text.toString():null;if(!p){s(u);continue}const f=l(p,h),d=l(p,h,!0);if(f in r&&d in e&&r[f]!==e[d]){const t=o(f,d,h),i=a(f,d,n[t].geometry);delete e[f],delete r[d],r[l(p,n[i].geometry,!0)]=i,n[t].geometry=null;}else f in r?a(f,d,h):d in e?o(f,d,h):(s(u),e[f]=i-1,r[d]=i-1);}return n.filter((t=>t.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((t,e)=>t.sortKey-e.sortKey));}update(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r));}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return !this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0;}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy();}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData();}addToLineVertexArray(t,e){const r=this.lineVertexArray.length;if(void 0!==t.segment){let r=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]);const i={};for(let n=t.segment+1;n<e.length;n++)i[n]={x:e[n].x,y:e[n].y,tileUnitDistanceFromAnchor:r},n<e.length-1&&(r+=e[n+1].dist(e[n]));for(let r=t.segment||0;r>=0;r--)i[r]={x:e[r].x,y:e[r].y,tileUnitDistanceFromAnchor:n},r>0&&(n+=e[r-1].dist(e[r]));for(let t=0;t<e.length;t++){const e=i[t];this.lineVertexArray.emplaceBack(e.x,e.y,e.tileUnitDistanceFromAnchor);}}return {lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(e,r,n,i,s,a,o,l,u,c,h,p){const f=e.indexArray,d=e.layoutVertexArray,y=e.segments.prepareSegment(4*r.length,d,f,this.canOverlap?a.sortKey:void 0),m=this.glyphOffsetArray.length,g=y.vertexLength,x=this.allowVerticalPlacement&&o===t.WritingMode.vertical?Math.PI/2:0,v=a.text&&a.text.sections;for(let t=0;t<r.length;t++){const{tl:i,tr:s,bl:o,br:u,tex:c,pixelOffsetTL:h,pixelOffsetBR:m,minFontScaleX:g,minFontScaleY:b,glyphOffset:w,isSDF:_,sectionIndex:A}=r[t],k=y.vertexLength,S=w[1];Mu(d,l.x,l.y,i.x,S+i.y,c.x,c.y,n,_,h.x,h.y,g,b),Mu(d,l.x,l.y,s.x,S+s.y,c.x+c.w,c.y,n,_,m.x,h.y,g,b),Mu(d,l.x,l.y,o.x,S+o.y,c.x,c.y+c.h,n,_,h.x,m.y,g,b),Mu(d,l.x,l.y,u.x,S+u.y,c.x+c.w,c.y+c.h,n,_,m.x,m.y,g,b),Cu(e.dynamicLayoutVertexArray,l,x),f.emplaceBack(k,k+1,k+2),f.emplaceBack(k+1,k+2,k+3),y.vertexLength+=4,y.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(w[0]),t!==r.length-1&&A===r[t+1].sectionIndex||e.programConfigurations.populatePaintArrays(d.length,a,a.index,{},p,v&&v[A]);}e.placedSymbolArray.emplaceBack(l.x,l.y,m,this.glyphOffsetArray.length-m,g,u,c,l.segment,n?n[0]:0,n?n[1]:0,i[0],i[1],o,0,!1,0,h);}_addCollisionDebugVertex(t,e,r,n,i,s){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,n,i,Math.round(s.x),Math.round(s.y))}addCollisionDebugVertices(t,e,r,n,i,s,a){const o=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),l=o.vertexLength,u=i.layoutVertexArray,c=i.collisionVertexArray,h=a.anchorX,p=a.anchorY;this._addCollisionDebugVertex(u,c,s,h,p,new S(t,e)),this._addCollisionDebugVertex(u,c,s,h,p,new S(r,e)),this._addCollisionDebugVertex(u,c,s,h,p,new S(r,n)),this._addCollisionDebugVertex(u,c,s,h,p,new S(t,n)),o.vertexLength+=4;const f=i.indexArray;f.emplaceBack(l,l+1),f.emplaceBack(l+1,l+2),f.emplaceBack(l+2,l+3),f.emplaceBack(l+3,l),o.primitiveLength+=4;}addDebugCollisionBoxes(t,e,r,n){for(let i=t;i<e;i++){const t=this.collisionBoxArray.get(i);this.addCollisionDebugVertices(t.x1,t.y1,t.x2,t.y2,n?this.textCollisionBox:this.iconCollisionBox,t.anchorPoint,r);}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Vu(ss,Ho.members,ls),this.iconCollisionBox=new Vu(ss,Ho.members,ls);for(let t=0;t<this.symbolInstances.length;t++){const e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1);}}_deserializeCollisionBoxesForSymbol(t,e,r,n,i,s,a,o,l){const u={};for(let n=e;n<r;n++){const e=t.get(n);u.textBox={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,anchorPointX:e.anchorPointX,anchorPointY:e.anchorPointY},u.textFeatureIndex=e.featureIndex;break}for(let e=n;e<i;e++){const r=t.get(e);u.verticalTextBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},u.verticalTextFeatureIndex=r.featureIndex;break}for(let e=s;e<a;e++){const r=t.get(e);u.iconBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},u.iconFeatureIndex=r.featureIndex;break}for(let e=o;e<l;e++){const r=t.get(e);u.verticalIconBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},u.verticalIconFeatureIndex=r.featureIndex;break}return u}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let e=0;e<this.symbolInstances.length;e++){const r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex));}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,e){const r=t.placedSymbolArray.get(e),n=r.vertexStartIndex+4*r.numGlyphs;for(let e=r.vertexStartIndex;e<n;e+=4)t.indexArray.emplaceBack(e,e+1,e+2),t.indexArray.emplaceBack(e+1,e+2,e+3);}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const e=Math.sin(t),r=Math.cos(t),n=[],i=[],s=[];for(let t=0;t<this.symbolInstances.length;++t){s.push(t);const a=this.symbolInstances.get(t);n.push(0|Math.round(e*a.anchorX+r*a.anchorY)),i.push(a.featureIndex);}return s.sort(((t,e)=>n[t]-n[e]||i[e]-i[t])),s}addToSortKeyRanges(t,e){const r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1});}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const t of this.symbolInstanceIndexes){const e=this.symbolInstances.get(t);this.featureSortOrder.push(e.featureIndex),[e.rightJustifiedTextSymbolIndex,e.centerJustifiedTextSymbolIndex,e.leftJustifiedTextSymbolIndex].forEach(((t,e,r)=>{t>=0&&r.indexOf(t)===e&&this.addIndicesForPlacedSymbol(this.text,t);})),e.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,e.verticalPlacedTextSymbolIndex),e.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.placedIconSymbolIndex),e.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.verticalPlacedIconSymbolIndex);}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray);}}}kn("SymbolBucket",Eu,{omit:["layers","collisionBoxArray","features","compareText"]}),Eu.MAX_GLYPHS=65535,Eu.addDynamicAttributes=Cu;const Fu=new ci({"symbol-placement":new si(nt.layout_symbol["symbol-placement"]),"symbol-spacing":new si(nt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new si(nt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new ai(nt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new si(nt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new si(nt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new si(nt.layout_symbol["icon-ignore-placement"]),"icon-optional":new si(nt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new si(nt.layout_symbol["icon-rotation-alignment"]),"icon-size":new ai(nt.layout_symbol["icon-size"]),"icon-text-fit":new si(nt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new si(nt.layout_symbol["icon-text-fit-padding"]),"icon-image":new ai(nt.layout_symbol["icon-image"]),"icon-rotate":new ai(nt.layout_symbol["icon-rotate"]),"icon-padding":new si(nt.layout_symbol["icon-padding"]),"icon-keep-upright":new si(nt.layout_symbol["icon-keep-upright"]),"icon-offset":new ai(nt.layout_symbol["icon-offset"]),"icon-anchor":new ai(nt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new si(nt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new si(nt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new si(nt.layout_symbol["text-rotation-alignment"]),"text-field":new ai(nt.layout_symbol["text-field"]),"text-font":new ai(nt.layout_symbol["text-font"]),"text-size":new ai(nt.layout_symbol["text-size"]),"text-max-width":new ai(nt.layout_symbol["text-max-width"]),"text-line-height":new si(nt.layout_symbol["text-line-height"]),"text-letter-spacing":new ai(nt.layout_symbol["text-letter-spacing"]),"text-justify":new ai(nt.layout_symbol["text-justify"]),"text-radial-offset":new ai(nt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new si(nt.layout_symbol["text-variable-anchor"]),"text-anchor":new ai(nt.layout_symbol["text-anchor"]),"text-max-angle":new si(nt.layout_symbol["text-max-angle"]),"text-writing-mode":new si(nt.layout_symbol["text-writing-mode"]),"text-rotate":new ai(nt.layout_symbol["text-rotate"]),"text-padding":new si(nt.layout_symbol["text-padding"]),"text-keep-upright":new si(nt.layout_symbol["text-keep-upright"]),"text-rotate-to-line":new si(nt.layout_symbol["text-rotate-to-line"]),"text-transform":new ai(nt.layout_symbol["text-transform"]),"text-offset":new ai(nt.layout_symbol["text-offset"]),"text-allow-overlap":new si(nt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new si(nt.layout_symbol["text-ignore-placement"]),"text-optional":new si(nt.layout_symbol["text-optional"])});var Tu={paint:new ci({"icon-opacity":new ai(nt.paint_symbol["icon-opacity"]),"icon-color":new ai(nt.paint_symbol["icon-color"]),"icon-halo-color":new ai(nt.paint_symbol["icon-halo-color"]),"icon-halo-width":new ai(nt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new ai(nt.paint_symbol["icon-halo-blur"]),"icon-translate":new si(nt.paint_symbol["icon-translate"]),"icon-translate-anchor":new si(nt.paint_symbol["icon-translate-anchor"]),"text-opacity":new ai(nt.paint_symbol["text-opacity"]),"text-color":new ai(nt.paint_symbol["text-color"],{runtimeType:yt,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new ai(nt.paint_symbol["text-halo-color"]),"text-halo-width":new ai(nt.paint_symbol["text-halo-width"]),"text-halo-blur":new ai(nt.paint_symbol["text-halo-blur"]),"text-translate":new si(nt.paint_symbol["text-translate"]),"text-translate-anchor":new si(nt.paint_symbol["text-translate-anchor"])}),layout:Fu};class Lu{constructor(t){this.type=t.property.overrides?t.property.overrides.runtimeType:ht,this.defaultValue=t;}evaluate(t){if(t.formattedSection){const e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression);}outputDefined(){return !1}serialize(){return null}}kn("FormatSectionOverride",Lu,{omit:["defaultValue"]});class Du extends pi{constructor(t){super(t,Tu);}recalculate(t,e){if(super.recalculate(t,e),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){const t=this.layout.get("text-writing-mode");if(t){const e=[];for(const r of t)e.indexOf(r)<0&&e.push(r);this.layout._values["text-writing-mode"]=e;}else this.layout._values["text-writing-mode"]=["horizontal"];}this._setPaintOverrides();}getValueAndResolveTokens(t,e,r,n){const i=this.layout.get(t).evaluate(e,{},r,n),s=this._unevaluatedLayout._values[t];return s.isDataDriven()||Pr(s.value)||!i?i:function(t,e){return e.replace(/{([^{}]+)}/g,((e,r)=>r in t?String(t[r]):""))}(e.properties,i)}createBucket(t){return new Eu(t)}queryRadius(){return 0}queryIntersectsFeature(){return !1}_setPaintOverrides(){for(const t of Tu.paint.overridableProperties){if(!Du.hasPaintOverride(this.layout,t))continue;const e=this.paint.get(t),r=new Lu(e),n=new Br(r,e.property.specification);let i=null;i="constant"===e.value.kind||"source"===e.value.kind?new Er("source",n):new Fr("composite",n,e.value.zoomStops,e.value._interpolationType),this.paint._values[t]=new ni(e.property,i,e.parameters);}}_handleOverridablePaintPropertyUpdate(t,e,r){return !(!this.layout||e.isDataDriven()||r.isDataDriven())&&Du.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,e){const r=t.get("text-field"),n=Tu.paint.properties[e];let i=!1;const s=t=>{for(const e of t)if(n.overrides&&n.overrides.hasOverride(e))return void(i=!0)};if("constant"===r.value.kind&&r.value.value instanceof Lt)s(r.value.value.sections);else if("source"===r.value.kind){const t=e=>{i||(e instanceof qt&&Rt(e.value)===vt?s(e.value.sections):e instanceof Zt?s(e.sections):e.eachChild(t));},e=r.value;e._styleExpression&&t(e._styleExpression.expression);}return i}}var $u={paint:new ci({"background-color":new si(nt.paint_background["background-color"]),"background-pattern":new li(nt.paint_background["background-pattern"]),"background-opacity":new si(nt.paint_background["background-opacity"])})},Ou={paint:new ci({"raster-opacity":new si(nt.paint_raster["raster-opacity"]),"raster-hue-rotate":new si(nt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new si(nt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new si(nt.paint_raster["raster-brightness-max"]),"raster-saturation":new si(nt.paint_raster["raster-saturation"]),"raster-contrast":new si(nt.paint_raster["raster-contrast"]),"raster-resampling":new si(nt.paint_raster["raster-resampling"]),"raster-fade-duration":new si(nt.paint_raster["raster-fade-duration"])})};class Ru extends pi{constructor(t){super(t,{}),this.onAdd=t=>{this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl);},this.onRemove=t=>{this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl);},this.implementation=t;}is3D(){return "3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return !1}serialize(){}}const Uu={circle:class extends pi{constructor(t){super(t,oa);}createBucket(t){return new Ks(t)}queryRadius(t){const e=t;return na("circle-radius",this,e)+na("circle-stroke-width",this,e)+ia(this.paint.get("circle-translate"))}queryIntersectsFeature(t,e,r,n,i,s,a,o){const l=sa(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),s.angle,a),u=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),c="map"===this.paint.get("circle-pitch-alignment"),h=c?l:function(t,e){return t.map((t=>ya(t,e)))}(l,o),p=c?u*a:u;for(const t of n)for(const e of t){const t=c?e:ya(e,o);let r=p;const n=da(pa(),fa(e.x,e.y,0,1),o);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?r*=n[3]/s.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(r*=s.cameraToCenterDistance/n[3]),Gs(h,t,r))return !0}return !1}},heatmap:class extends pi{constructor(t){super(t,ga),this._updateColorRamp();}createBucket(t){return new ma(t)}_handleSpecialPaintPropertyUpdate(t){"heatmap-color"===t&&this._updateColorRamp();}_updateColorRamp(){this.colorRamp=Aa({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null;}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null);}queryRadius(){return 0}queryIntersectsFeature(){return !1}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}},hillshade:class extends pi{constructor(t){super(t,ka);}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}},fill:class extends pi{constructor(t){super(t,ho);}recalculate(t,e){super.recalculate(t,e);const r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"]);}createBucket(t){return new uo(t)}queryRadius(){return ia(this.paint.get("fill-translate"))}queryIntersectsFeature(t,e,r,n,i,s,a){return Js(sa(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),s.angle,a),n)}isTileClipped(){return !0}},"fill-extrusion":class extends pi{constructor(t){super(t,Eo);}createBucket(t){return new Bo(t)}queryRadius(){return ia(this.paint.get("fill-extrusion-translate"))}is3D(){return !0}queryIntersectsFeature(t,e,r,n,i,s,a,o){const l=sa(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),s.angle,a),u=this.paint.get("fill-extrusion-height").evaluate(e,r),c=this.paint.get("fill-extrusion-base").evaluate(e,r),h=function(t,e,r,n){const i=[];for(const r of t){const t=fa(r.x,r.y,0,1);da(t,t,e),i.push(new S(t[0]/t[3],t[1]/t[3]));}return i}(l,o),p=function(t,e,r,n){const i=[],s=[],a=n[8]*e,o=n[9]*e,l=n[10]*e,u=n[11]*e,c=n[8]*r,h=n[9]*r,p=n[10]*r,f=n[11]*r;for(const e of t){const t=[],r=[];for(const i of e){const e=i.x,s=i.y,d=n[0]*e+n[4]*s+n[12],y=n[1]*e+n[5]*s+n[13],m=n[2]*e+n[6]*s+n[14],g=n[3]*e+n[7]*s+n[15],x=m+l,v=g+u,b=d+c,w=y+h,_=m+p,A=g+f,k=new S((d+a)/v,(y+o)/v);k.z=x/v,t.push(k);const z=new S(b/A,w/A);z.z=_/A,r.push(z);}i.push(t),s.push(r);}return [i,s]}(n,c,u,o);return function(t,e,r){let n=1/0;Js(r,e)&&(n=To(r,e[0]));for(let i=0;i<e.length;i++){const s=e[i],a=t[i];for(let t=0;t<s.length-1;t++){const e=s[t],i=[e,s[t+1],a[t+1],a[t],e];Zs(r,i)&&(n=Math.min(n,To(r,i)));}}return n!==1/0&&n}(p[0],p[1],h)}},line:class extends pi{constructor(t){super(t,Ko),this.gradientVersion=0;}_handleSpecialPaintPropertyUpdate(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof ke,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER);}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=Zo.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t);}createBucket(t){return new jo(t)}queryRadius(t){const e=t,r=Go(na("line-width",this,e),na("line-gap-width",this,e)),n=na("line-offset",this,e);return r/2+Math.abs(n)+ia(this.paint.get("line-translate"))}queryIntersectsFeature(t,e,r,n,i,s,a){const o=sa(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),s.angle,a),l=a/2*Go(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),u=this.paint.get("line-offset").evaluate(e,r);return u&&(n=function(t,e){const r=[],n=new S(0,0);for(let i=0;i<t.length;i++){const s=t[i],a=[];for(let t=0;t<s.length;t++){const r=s[t-1],i=s[t],o=s[t+1],l=0===t?n:i.sub(r)._unit()._perp(),u=t===s.length-1?n:o.sub(i)._unit()._perp(),c=l._add(u)._unit();c._mult(1/(c.x*u.x+c.y*u.y)),a.push(c._mult(e)._add(i));}r.push(a);}return r}(n,u*a)),function(t,e,r){for(let n=0;n<e.length;n++){const i=e[n];if(t.length>=3)for(let e=0;e<i.length;e++)if(ea(t,i[e]))return !0;if(Xs(t,i,r))return !0}return !1}(o,n,l)}isTileClipped(){return !0}},symbol:Du,background:class extends pi{constructor(t){super(t,$u);}},raster:class extends pi{constructor(t){super(t,Ou);}}};class qu{constructor(t){this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback();});}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._callback();}),0));}remove(){delete this._channel,this._callback=()=>{};}}const ju=6371008.8;class Nu{constructor(t,e){if(isNaN(t)||isNaN(e))throw new Error(`Invalid LngLat object: (${t}, ${e})`);if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Nu(a(this.lng,-180,180),this.lat)}toArray(){return [this.lng,this.lat]}toString(){return `LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const e=Math.PI/180,r=this.lat*e,n=t.lat*e,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return ju*Math.acos(Math.min(i,1))}toBounds(t=0){const e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new Ku(new Nu(this.lng-r,this.lat-e),new Nu(this.lng+r,this.lat+e))}static convert(t){if(t instanceof Nu)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Nu(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Nu(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}class Ku{constructor(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]));}setNorthEast(t){return this._ne=t instanceof Nu?new Nu(t.lng,t.lat):Nu.convert(t),this}setSouthWest(t){return this._sw=t instanceof Nu?new Nu(t.lng,t.lat):Nu.convert(t),this}extend(t){const e=this._sw,r=this._ne;let n,i;if(t instanceof Nu)n=t,i=t;else {if(!(t instanceof Ku))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(Ku.convert(t)):this.extend(Nu.convert(t)):this;if(n=t._sw,i=t._ne,!n||!i)return this}return e||r?(e.lng=Math.min(n.lng,e.lng),e.lat=Math.min(n.lat,e.lat),r.lng=Math.max(i.lng,r.lng),r.lat=Math.max(i.lat,r.lat)):(this._sw=new Nu(n.lng,n.lat),this._ne=new Nu(i.lng,i.lat)),this}getCenter(){return new Nu((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new Nu(this.getWest(),this.getNorth())}getSouthEast(){return new Nu(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return [this._sw.toArray(),this._ne.toArray()]}toString(){return `LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return !(this._sw&&this._ne)}contains(t){const{lng:e,lat:r}=Nu.convert(t);let n=this._sw.lng<=e&&e<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=e&&e>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&n}static convert(t){return t instanceof Ku?t:t?new Ku(t):t}}const Zu=2*Math.PI*ju;function Gu(t){return Zu*Math.cos(t*Math.PI/180)}function Ju(t){return (180+t)/360}function Xu(t){return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Yu(t,e){return t/Gu(e)}function Hu(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}class Wu{constructor(t,e,r=0){this.x=+t,this.y=+e,this.z=+r;}static fromLngLat(t,e=0){const r=Nu.convert(t);return new Wu(Ju(r.lng),Xu(r.lat),Yu(e,r.lat))}toLngLat(){return new Nu(360*this.x-180,Hu(this.y))}toAltitude(){return this.z*Gu(Hu(this.y))}meterInMercatorCoordinateUnits(){return 1/Zu*(t=Hu(this.y),1/Math.cos(t*Math.PI/180));var t;}}function Qu(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return [t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}class tc{constructor(t,e,r){this.z=t,this.x=e,this.y=r,this.key=nc(0,t,t,e,r);}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e){const r=(i=this.y,s=this.z,a=Qu(256*(n=this.x),256*(i=Math.pow(2,s)-i-1),s),o=Qu(256*(n+1),256*(i+1),s),a[0]+","+a[1]+","+o[0]+","+o[1]);var n,i,s,a,o;const l=function(t,e,r){let n,i="";for(let s=t;s>0;s--)n=1<<s-1,i+=(e&n?1:0)+(r&n?2:0);return i}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,devicePixelRatio>1?"@2x":"").replace(/{quadkey}/g,l).replace(/{bbox-epsg-3857}/g,r)}getTilePoint(t){const e=Math.pow(2,this.z);return new S((t.x*e-this.x)*Os,(t.y*e-this.y)*Os)}toString(){return `${this.z}/${this.x}/${this.y}`}}class ec{constructor(t,e){this.wrap=t,this.canonical=e,this.key=nc(t,e.z,e.z,e.x,e.y);}}class rc{constructor(t,e,r,n,i){this.overscaledZ=t,this.wrap=e,this.canonical=new tc(r,+n,+i),this.key=nc(e,t,r,n,i);}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){const e=this.canonical.z-t;return t>this.canonical.z?new rc(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new rc(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)}calculateScaledKey(t,e){const r=this.canonical.z-t;return t>this.canonical.z?nc(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):nc(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)}isChildOf(t){if(t.wrap!==this.wrap)return !1;const e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e}children(t){if(this.overscaledZ>=t)return [new rc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return [new rc(e,this.wrap,e,r,n),new rc(e,this.wrap,e,r+1,n),new rc(e,this.wrap,e,r,n+1),new rc(e,this.wrap,e,r+1,n+1)]}isLessThan(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))}wrapped(){return new rc(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new rc(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new ec(this.wrap,this.canonical)}toString(){return `${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(t){return this.canonical.getTilePoint(new Wu(t.x-this.wrap,t.y))}}function nc(t,e,r,n,i){(t*=2)<0&&(t=-1*t-1);const s=1<<r;return (s*s*t+s*i+n).toString(36)+r.toString(36)+e.toString(36)}kn("CanonicalTileID",tc),kn("OverscaledTileID",rc,{omit:["posMatrix"]});class ic{constructor(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return void d(`"${r}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=e.height;const n=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=r||"mapbox";for(let t=0;t<n;t++)this.data[this._idx(-1,t)]=this.data[this._idx(0,t)],this.data[this._idx(n,t)]=this.data[this._idx(n-1,t)],this.data[this._idx(t,-1)]=this.data[this._idx(t,0)],this.data[this._idx(t,n)]=this.data[this._idx(t,n-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(n,-1)]=this.data[this._idx(n-1,0)],this.data[this._idx(-1,n)]=this.data[this._idx(0,n-1)],this.data[this._idx(n,n)]=this.data[this._idx(n-1,n-1)];}get(t,e){const r=new Uint8Array(this.data.buffer),n=4*this._idx(t,e);return ("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(r[n],r[n+1],r[n+2])}getUnpackVector(){return "terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]}_idx(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return (e+1)*this.stride+(t+1)}_unpackMapbox(t,e,r){return (256*t*256+256*e+r)/10-1e4}_unpackTerrarium(t,e,r){return 256*t+e+r/256-32768}getPixels(){return new _a({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let n=e*this.dim,i=e*this.dim+this.dim,s=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1;}switch(r){case-1:s=a-1;break;case 1:a=s+1;}const o=-e*this.dim,l=-r*this.dim;for(let e=s;e<a;e++)for(let r=n;r<i;r++)this.data[this._idx(r,e)]=t.data[this._idx(r+o,e+l)];}}kn("DEMData",ic);class sc{constructor(t){this._stringToNumber={},this._numberToString=[];for(let e=0;e<t.length;e++){const r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r;}}encode(t){return this._stringToNumber[t]}decode(t){return this._numberToString[t]}}var ac;class oc{constructor(t,e,r,n,i){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,this.id=i;}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(t){this._geometry=t;}toJSON(){const t=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);}return r}(this,["_geometry","_vectorTileFeature"]);return t.geometry=this.geometry,t}}class lc{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new _n(Os,16,0),this.grid3D=new _n(Os,16,0),this.featureIndexArray=new Xi,this.promoteId=e;}insert(t,e,r,n,i,s){const a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);const o=s?this.grid3D:this.grid;for(let t=0;t<e.length;t++){const r=e[t],n=[1/0,1/0,-1/0,-1/0];for(let t=0;t<r.length;t++){const e=r[t];n[0]=Math.min(n[0],e.x),n[1]=Math.min(n[1],e.y),n[2]=Math.max(n[2],e.x),n[3]=Math.max(n[3],e.y);}n[0]<Os&&n[1]<Os&&n[2]>=0&&n[3]>=0&&o.insert(a,n[0],n[1],n[2],n[3]);}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new yo.VectorTile(new rl(this.rawTileData)).layers,this.sourceLayerCoder=new sc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,e,r,n){this.loadVTLayers();const i=t.params||{},s=Os/t.tileSize/t.scale,a=Zr(i.filter),o=t.queryGeometry,l=t.queryPadding*s,u=cc(o),c=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),h=cc(t.cameraQueryGeometry),p=this.grid3D.query(h.minX-l,h.minY-l,h.maxX+l,h.maxY+l,((e,r,n,i)=>function(t,e,r,n,i){for(const s of t)if(e<=s.x&&r<=s.y&&n>=s.x&&i>=s.y)return !0;const s=[new S(e,r),new S(e,i),new S(n,i),new S(n,r)];if(t.length>2)for(const e of s)if(ea(t,e))return !0;for(let e=0;e<t.length-1;e++)if(ra(t[e],t[e+1],s))return !0;return !1}(t.cameraQueryGeometry,e-l,r-l,n+l,i+l)));for(const t of p)c.push(t);c.sort(hc);const f={};let d;for(let l=0;l<c.length;l++){const u=c[l];if(u===d)continue;d=u;const h=this.featureIndexArray.get(u);let p=null;this.loadMatchingFeature(f,h.bucketIndex,h.sourceLayerIndex,h.featureIndex,a,i.layers,i.availableImages,e,r,n,((e,r,n)=>(p||(p=qs(e)),r.queryIntersectsFeature(o,e,n,p,this.z,t.transform,s,t.pixelPosMatrix))));}return f}loadMatchingFeature(t,e,r,n,i,s,a,l,u,c,h){const p=this.bucketLayerIDs[e];if(s&&!function(t,e){for(let r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return !0;return !1}(s,p))return;const f=this.sourceLayerCoder.decode(r),d=this.vtLayers[f].feature(n);if(i.needGeometry){const t=js(d,!0);if(!i.filter(new Yn(this.tileID.overscaledZ),t,this.tileID.canonical))return}else if(!i.filter(new Yn(this.tileID.overscaledZ),d))return;const y=this.getId(d,f);for(let e=0;e<p.length;e++){const r=p[e];if(s&&s.indexOf(r)<0)continue;const i=l[r];if(!i)continue;let f={};y&&c&&(f=c.getState(i.sourceLayer||"_geojsonTileLayer",y));const m=o({},u[r]);m.paint=uc(m.paint,i.paint,d,f,a),m.layout=uc(m.layout,i.layout,d,f,a);const g=!h||h(d,i,f);if(!g)continue;const x=new oc(d,this.z,this.x,this.y,y);x.layer=m;let v=t[r];void 0===v&&(v=t[r]=[]),v.push({featureIndex:n,feature:x,intersectionZ:g});}}lookupSymbolFeatures(t,e,r,n,i,s,a,o){const l={};this.loadVTLayers();const u=Zr(i);for(const i of t)this.loadMatchingFeature(l,r,n,i,u,s,a,o,e);return l}hasLayer(t){for(const e of this.bucketLayerIDs)for(const r of e)if(t===r)return !0;return !1}getId(t,e){let r=t.id;return this.promoteId&&(r=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]],"boolean"==typeof r&&(r=Number(r))),r}}function uc(t,e,r,n,i){return c(t,((t,s)=>{const a=e instanceof ii?e.get(s):null;return a&&a.evaluate?a.evaluate(r,n,i):a}))}function cc(t){let e=1/0,r=1/0,n=-1/0,i=-1/0;for(const s of t)e=Math.min(e,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),i=Math.max(i,s.y);return {minX:e,minY:r,maxX:n,maxY:i}}function hc(t,e){return e-t}kn("FeatureIndex",lc,{omit:["rawTileData","sourceLayerCoder"]}),function(t){t.create="create",t.load="load",t.fullLoad="fullLoad";}(ac||(ac={})),t.ARRAY_TYPE=la,t.Actor=class{constructor(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},u(["receive","process"],this),this.invoker=new qu(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=g()?t:window;}send(t,e,r,n,i=!1){const s=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[s]=r);const a=_(this.globalScope)?void 0:[];return this.target.postMessage({id:s,type:t,hasCallback:!!r,targetMapId:n,mustQueue:i,sourceMapId:this.mapId,data:zn(e,a)},a),{cancel:()=>{r&&delete this.callbacks[s],this.target.postMessage({id:s,type:"<cancel>",targetMapId:n,sourceMapId:this.mapId});}}}receive(t){const e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){delete this.tasks[r];const t=this.cancelCallbacks[r];delete this.cancelCallbacks[r],t&&t();}else g()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e);}process(){if(!this.taskQueue.length)return;const t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e);}processTask(t,e){if("<response>"===e.type){const r=this.callbacks[t];delete this.callbacks[t],r&&(e.error?r(In(e.error)):r(null,In(e.data)));}else {let r=!1;const n=_(this.globalScope)?void 0:[],i=e.hasCallback?(e,i)=>{r=!0,delete this.cancelCallbacks[t],this.target.postMessage({id:t,type:"<response>",sourceMapId:this.mapId,error:e?zn(e):null,data:zn(i,n)},n);}:t=>{r=!0;};let s=null;const a=In(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,a,i);else if(this.parent.getWorkerSource){const t=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,t[0],a.source)[t[1]](a,i);}else i(new Error(`Could not find function ${e.type}`));!r&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel);}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1);}},t.AlphaImage=wa,t.CanonicalTileID=tc,t.CollisionBoxArray=Ui,t.CollisionCircleLayoutArray=class extends Ci{},t.Color=Et,t.DEMData=ic,t.DataConstantProperty=si,t.DictionaryCoder=sc,t.EXTENT=Os,t.ErrorEvent=et,t.EvaluationParameters=Yn,t.Event=tt,t.Evented=rt,t.FeatureIndex=lc,t.FillBucket=uo,t.FillExtrusionBucket=Bo,t.GeoJSONFeature=oc,t.ImageAtlas=Bl,t.ImagePosition=Cl,t.LineBucket=jo,t.LineStripIndexArray=class extends $i{},t.LngLat=Nu,t.LngLatBounds=Ku,t.MercatorCoordinate=Wu,t.ONE_EM=el,t.OverscaledTileID=rc,t.PosArray=class extends xi{},t.Properties=ci,t.QuadTriangleArray=class extends Pi{},t.RGBAImage=_a,t.RasterBoundsArray=class extends vi{},t.RequestPerformance=class{constructor(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},performance.mark(this._marks.start);}finish(){performance.mark(this._marks.end);let t=performance.getEntriesByName(this._marks.measure);return 0===t.length&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),t=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),t}},t.ResourceType=U,t.SegmentVector=hs,t.SymbolBucket=Eu,t.Transitionable=Qn,t.TriangleIndexArray=os,t.Uniform1f=Ss,t.Uniform1i=class extends ks{constructor(t,e){super(t,e),this.current=0;}set(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t));}},t.Uniform2f=class extends ks{constructor(t,e){super(t,e),this.current=[0,0];}set(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]));}},t.Uniform3f=class extends ks{constructor(t,e){super(t,e),this.current=[0,0,0];}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]));}},t.Uniform4f=zs,t.UniformColor=Is,t.UniformMatrix4f=class extends ks{constructor(t,e){super(t,e),this.current=Ms;}set(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(let e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}}},t.UnwrappedTileID=ec,t.ValidationError=it,t.ZoomHistory=Mn,t.addDynamicAttributes=Cu,t.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);let n=t.length;const i=new Array(t.length);let s=null;t.forEach(((t,a)=>{e(t,((t,e)=>{t&&(s=t),i[a]=e,0==--n&&r(s,i);}));}));},t.bezier=n,t.bindAll=u,t.cacheEntryPossiblyAdded=function(t){F++,F>V&&(t.getActor().send("enforceCacheSizeLimit",P),F=0);},t.clamp=s,t.clearTileCache=function(t){const e=caches.delete(M);t&&e.catch(t).then((()=>t()));},t.clipLine=au,t.clone=function(t){var e=new la(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=p,t.collisionCircleLayout=Wo,t.config=I,t.create=function(){var t=new la(16);return la!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.createExpression=Vr,t.createFilter=Zr,t.createLayout=mi,t.createStyleLayer=function(t){return "custom"===t.type?new Ru(t):new Uu[t.type](t)},t.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},t.ease=i,t.emitValidationErrors=wn,t.enforceCacheSizeLimit=function(t){E(),C&&C.then((e=>{e.keys().then((r=>{for(let n=0;n<r.length-t;n++)e.delete(r[n]);}));}));},t.evaluateSizeForFeature=Xl,t.evaluateSizeForZoom=Yl,t.evaluateVariableOffset=vu,t.evented=Zn,t.exported=k,t.exported$1=T,t.extend=o,t.filterObject=h,t.fromValues=fa,t.getAnchorAlignment=jl,t.getAnchorJustification=bu,t.getArrayBuffer=Z,t.getImage=H,t.getJSON=function(t,e){return K(o(t,{type:"json"}),e)},t.getRTLTextPluginStatus=Gn,t.getReferrer=j,t.getVideo=function(t,e){const r=window.document.createElement("video");r.muted=!0,r.onloadstart=function(){e(null,r);};for(let e=0;e<t.length;e++){const n=window.document.createElement("source");G(t[e])||(r.crossOrigin="Anonymous"),n.src=t[e],r.appendChild(n);}return {cancel:()=>{}}},t.identity=ua,t.invert=function(t,e){var r=e[0],n=e[1],i=e[2],s=e[3],a=e[4],o=e[5],l=e[6],u=e[7],c=e[8],h=e[9],p=e[10],f=e[11],d=e[12],y=e[13],m=e[14],g=e[15],x=r*o-n*a,v=r*l-i*a,b=r*u-s*a,w=n*l-i*o,_=n*u-s*o,A=i*u-s*l,k=c*y-h*d,S=c*m-p*d,z=c*g-f*d,I=h*m-p*y,M=h*g-f*y,C=p*g-f*m,B=x*C-v*M+b*I+w*z-_*S+A*k;return B?(t[0]=(o*C-l*M+u*I)*(B=1/B),t[1]=(i*M-n*C-s*I)*B,t[2]=(y*A-m*_+g*w)*B,t[3]=(p*_-h*A-f*w)*B,t[4]=(l*z-a*C-u*S)*B,t[5]=(r*C-i*z+s*S)*B,t[6]=(m*b-d*A-g*v)*B,t[7]=(c*A-p*b+f*v)*B,t[8]=(a*M-o*z+u*k)*B,t[9]=(n*z-r*M-s*k)*B,t[10]=(d*_-y*b+g*x)*B,t[11]=(h*b-c*_-f*x)*B,t[12]=(o*S-a*I-l*k)*B,t[13]=(r*I-n*S+i*k)*B,t[14]=(y*v-d*w-m*x)*B,t[15]=(c*w-h*v+p*x)*B,t):null},t.isImageBitmap=A,t.keysDifference=function(t,e){const r=[];for(const n in t)n in e||r.push(n);return r},t.lazyLoadRTLTextPlugin=function(){Xn.isLoading()||Xn.isLoaded()||"deferred"!==Gn()||Jn();},t.makeRequest=K,t.mapObject=c,t.mercatorXfromLng=Ju,t.mercatorYfromLat=Xu,t.mercatorZfromAltitude=Yu,t.mul=ha,t.multiply=ca,t.nextPowerOfTwo=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},t.number=Se,t.ortho=function(t,e,r,n,i,s,a){var o=1/(e-r),l=1/(n-i),u=1/(s-a);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*o,t[13]=(i+n)*l,t[14]=(a+s)*u,t[15]=1,t},t.parseCacheControl=x,t.parseGlyphPBF=function(t){return new rl(t).readFields(Sl,[])},t.pbf=rl,t.performSymbolLayout=function(e,r,n,i,s,a,o){e.createArrays(),e.tilePixelRatio=Os/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;const l=e.layers[0].layout,u=e.layers[0]._unevaluatedLayout._values,c={layoutIconSize:u["icon-size"].possiblyEvaluate(new Yn(e.zoom+1),o),layoutTextSize:u["text-size"].possiblyEvaluate(new Yn(e.zoom+1),o),textMaxSize:u["text-size"].possiblyEvaluate(new Yn(18))};if("composite"===e.textSizeData.kind){const{minZoom:t,maxZoom:r}=e.textSizeData;c.compositeTextSizes=[u["text-size"].possiblyEvaluate(new Yn(t),o),u["text-size"].possiblyEvaluate(new Yn(r),o)];}if("composite"===e.iconSizeData.kind){const{minZoom:t,maxZoom:r}=e.iconSizeData;c.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new Yn(t),o),u["icon-size"].possiblyEvaluate(new Yn(r),o)];}const h=l.get("text-line-height")*el,p="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),f=l.get("text-keep-upright"),y=l.get("text-size");for(const a of e.features){const u=l.get("text-font").evaluate(a,{},o).join(","),m=y.evaluate(a,{},o),g=c.layoutTextSize.evaluate(a,{},o),x=c.layoutIconSize.evaluate(a,{},o),v={horizontal:{},vertical:void 0},b=a.text;let w,_=[0,0];if(b){const i=b.toString(),c=l.get("text-letter-spacing").evaluate(a,{},o)*el,d=Pn(i)?c:0,y=l.get("text-anchor").evaluate(a,{},o),x=l.get("text-variable-anchor");if(!x){const t=l.get("text-radial-offset").evaluate(a,{},o);_=t?vu(y,[t*el,xu]):l.get("text-offset").evaluate(a,{},o).map((t=>t*el));}let w=p?"center":l.get("text-justify").evaluate(a,{},o);const A=l.get("symbol-placement"),k="point"===A?l.get("text-max-width").evaluate(a,{},o)*el:0,S=()=>{e.allowVerticalPlacement&&Bn(i)&&(v.vertical=Fl(b,r,n,s,u,k,h,y,"left",d,_,t.WritingMode.vertical,!0,A,g,m));};if(!p&&x){const e="auto"===w?x.map((t=>bu(t))):[w];let i=!1;for(let a=0;a<e.length;a++){const o=e[a];if(!v.horizontal[o])if(i)v.horizontal[o]=v.horizontal[0];else {const e=Fl(b,r,n,s,u,k,h,"center",o,d,_,t.WritingMode.horizontal,!1,A,g,m);e&&(v.horizontal[o]=e,i=1===e.positionedLines.length);}}S();}else {"auto"===w&&(w=bu(y));const e=Fl(b,r,n,s,u,k,h,y,w,d,_,t.WritingMode.horizontal,!1,A,g,m);e&&(v.horizontal[w]=e),S(),Bn(i)&&p&&f&&(v.vertical=Fl(b,r,n,s,u,k,h,y,w,d,_,t.WritingMode.vertical,!1,A,g,m));}}let A=!1;if(a.icon&&a.icon.name){const t=i[a.icon.name];t&&(w=Kl(s[a.icon.name],l.get("icon-offset").evaluate(a,{},o),l.get("icon-anchor").evaluate(a,{},o)),A=!!t.sdf,void 0===e.sdfIcons?e.sdfIcons=A:e.sdfIcons!==A&&d("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(t.pixelRatio!==e.pixelRatio||0!==l.get("icon-rotate").constantOr(1))&&(e.iconsNeedLinear=!0));}const k=ku(v.horizontal)||v.vertical;e.iconsInText=!!k&&k.iconsInText,(k||w)&&wu(e,a,v,w,i,c,g,x,_,A,o);}a&&e.generateCollisionDebugBuffers();},t.perspective=function(t,e,r,n,i){var s,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+n)*(s=1/(n-i)),t[14]=2*i*n*s):(t[10]=-1,t[14]=-2*n),t},t.pick=function(t,e){const r={};for(let n=0;n<e.length;n++){const i=e[n];i in t&&(r[i]=t[i]);}return r},t.plugin=Xn,t.pointGeometry=S,t.polygonIntersectsPolygon=Zs,t.potpack=Ml,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=kn,t.registerForPluginStateChange=function(t){return t({pluginStatus:qn,pluginURL:jn}),Zn.on("pluginStateChange",t),t},t.renderColorRamp=Aa,t.rotateX=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),s=e[4],a=e[5],o=e[6],l=e[7],u=e[8],c=e[9],h=e[10],p=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*i+u*n,t[5]=a*i+c*n,t[6]=o*i+h*n,t[7]=l*i+p*n,t[8]=u*i-s*n,t[9]=c*i-a*n,t[10]=h*i-o*n,t[11]=p*i-l*n,t},t.rotateZ=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),s=e[0],a=e[1],o=e[2],l=e[3],u=e[4],c=e[5],h=e[6],p=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*i+u*n,t[1]=a*i+c*n,t[2]=o*i+h*n,t[3]=l*i+p*n,t[4]=u*i-s*n,t[5]=c*i-a*n,t[6]=h*i-o*n,t[7]=p*i-l*n,t},t.scale=function(t,e,r){var n=r[0],i=r[1],s=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.scale$1=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},t.setCacheLimits=function(t,e){P=t,V=e;},t.setRTLTextPlugin=function(t,e,r=!1){if(qn===$n||qn===On||qn===Rn)throw new Error("setRTLTextPlugin cannot be called multiple times.");jn=k.resolveURL(t),qn=$n,Un=e,Kn(),r||Jn();},t.spec=nt,t.sphericalToCartesian=function([t,e,r]){return e+=90,e*=Math.PI/180,r*=Math.PI/180,{x:t*Math.cos(e)*Math.sin(r),y:t*Math.sin(e)*Math.sin(r),z:t*Math.cos(r)}},t.symbolSize=Hl,t.toEvaluationFeature=js,t.transformMat4=da,t.translate=function(t,e,r){var n,i,s,a,o,l,u,c,h,p,f,d,y=r[0],m=r[1],g=r[2];return e===t?(t[12]=e[0]*y+e[4]*m+e[8]*g+e[12],t[13]=e[1]*y+e[5]*m+e[9]*g+e[13],t[14]=e[2]*y+e[6]*m+e[10]*g+e[14],t[15]=e[3]*y+e[7]*m+e[11]*g+e[15]):(i=e[1],s=e[2],a=e[3],o=e[4],l=e[5],u=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=n=e[0],t[1]=i,t[2]=s,t[3]=a,t[4]=o,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=n*y+o*m+h*g+e[12],t[13]=i*y+l*m+p*g+e[13],t[14]=s*y+u*m+f*g+e[14],t[15]=a*y+c*m+d*g+e[15]),t},t.triggerPluginCompletionEvent=Nn,t.unicodeBlockLookup=Cn,t.uniqueId=function(){return l++},t.validateCustomStyleLayer=function(t){const e=[],r=t.id;return void 0===r&&e.push({message:`layers.${r}: missing required property "id"`}),void 0===t.render&&e.push({message:`layers.${r}: missing required method "render"`}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:`layers.${r}: property "renderingMode" must be either "2d" or "3d"`}),e},t.validateLight=xn,t.validateStyle=gn,t.vectorTile=yo,t.warnOnce=d,t.wrap=a;}));
define(["./shared"],(function(e){"use strict";function t(e){const o=typeof e;if("number"===o||"boolean"===o||"string"===o||null==e)return JSON.stringify(e);if(Array.isArray(e)){let o="[";for(const i of e)o+=`${t(i)},`;return `${o}]`}const i=Object.keys(e).sort();let r="{";for(let o=0;o<i.length;o++)r+=`${JSON.stringify(i[o])}:${t(e[i[o]])},`;return `${r}}`}function o(o){let i="";for(const r of e.refProperties)i+=`/${t(o[r])}`;return i}class i{constructor(e){this.keyCache={},e&&this.replace(e);}replace(e){this._layerConfigs={},this._layers={},this.update(e,[]);}update(t,i){for(const o of t){this._layerConfigs[o.id]=o;const t=this._layers[o.id]=e.createStyleLayer(o);t._featureFilter=e.createFilter(t.filter),this.keyCache[o.id]&&delete this.keyCache[o.id];}for(const e of i)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};const r=function(e,t){const i={};for(let r=0;r<e.length;r++){const n=t&&t[e[r].id]||o(e[r]);t&&(t[e[r].id]=n);let s=i[n];s||(s=i[n]=[]),s.push(e[r]);}const r=[];for(const e in i)r.push(i[e]);return r}(Object.values(this._layerConfigs),this.keyCache);for(const e of r){const t=e.map((e=>this._layers[e.id])),o=t[0];if("none"===o.visibility)continue;const i=o.source||"";let r=this.familiesBySource[i];r||(r=this.familiesBySource[i]={});const n=o.sourceLayer||"_geojsonTileLayer";let s=r[n];s||(s=r[n]=[]),s.push(t);}}}class r{constructor(t){const o={},i=[];for(const e in t){const r=t[e],n=o[e]={};for(const e in r){const t=r[+e];if(!t||0===t.bitmap.width||0===t.bitmap.height)continue;const o={x:0,y:0,w:t.bitmap.width+2,h:t.bitmap.height+2};i.push(o),n[e]={rect:o,metrics:t.metrics};}}const{w:r,h:n}=e.potpack(i),s=new e.AlphaImage({width:r||1,height:n||1});for(const i in t){const r=t[i];for(const t in r){const n=r[+t];if(!n||0===n.bitmap.width||0===n.bitmap.height)continue;const a=o[i][t].rect;e.AlphaImage.copy(n.bitmap,s,{x:0,y:0},{x:a.x+1,y:a.y+1},n.bitmap);}}this.image=s,this.positions=o;}}e.register("GlyphAtlas",r);class n{constructor(t){this.tileID=new e.OverscaledTileID(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId;}parse(t,o,i,n,a){this.status="parsing",this.data=t,this.collisionBoxArray=new e.CollisionBoxArray;const l=new e.DictionaryCoder(Object.keys(t.layers).sort()),c=new e.FeatureIndex(this.tileID,this.promoteId);c.bucketLayerIDs=[];const u={},h={featureIndex:c,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:i},p=o.familiesBySource[this.source];for(const o in p){const r=t.layers[o];if(!r)continue;1===r.version&&e.warnOnce(`Vector tile source "${this.source}" layer "${o}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const n=l.encode(o),a=[];for(let e=0;e<r.length;e++){const t=r.feature(e),i=c.getId(t,o);a.push({feature:t,id:i,index:e,sourceLayerIndex:n});}for(const e of p[o]){const t=e[0];t.minzoom&&this.zoom<Math.floor(t.minzoom)||t.maxzoom&&this.zoom>=t.maxzoom||"none"!==t.visibility&&(s(e,this.zoom,i),(u[t.id]=t.createBucket({index:c.bucketLayerIDs.length,layers:e,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:n,sourceID:this.source})).populate(a,h,this.tileID.canonical),c.bucketLayerIDs.push(e.map((e=>e.id))));}}let f,d,g,m;const y=e.mapObject(h.glyphDependencies,(e=>Object.keys(e).map(Number)));Object.keys(y).length?n.send("getGlyphs",{uid:this.uid,stacks:y},((e,t)=>{f||(f=e,d=t,w.call(this));})):d={};const v=Object.keys(h.iconDependencies);v.length?n.send("getImages",{icons:v,source:this.source,tileID:this.tileID,type:"icons"},((e,t)=>{f||(f=e,g=t,w.call(this));})):g={};const x=Object.keys(h.patternDependencies);function w(){if(f)return a(f);if(d&&g&&m){const t=new r(d),o=new e.ImageAtlas(g,m);for(const r in u){const n=u[r];n instanceof e.SymbolBucket?(s(n.layers,this.zoom,i),e.performSymbolLayout(n,d,t.positions,g,o.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):n.hasPattern&&(n instanceof e.LineBucket||n instanceof e.FillBucket||n instanceof e.FillExtrusionBucket)&&(s(n.layers,this.zoom,i),n.addFeatures(h,this.tileID.canonical,o.patternPositions));}this.status="done",a(null,{buckets:Object.values(u).filter((e=>!e.isEmpty())),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:o,glyphMap:this.returnDependencies?d:null,iconMap:this.returnDependencies?g:null,glyphPositions:this.returnDependencies?t.positions:null});}}x.length?n.send("getImages",{icons:x,source:this.source,tileID:this.tileID,type:"patterns"},((e,t)=>{f||(f=e,m=t,w.call(this));})):m={},w.call(this);}}function s(t,o,i){const r=new e.EvaluationParameters(o);for(const e of t)e.recalculate(r,i);}function a(t,o){const i=e.getArrayBuffer(t.request,((t,i,r,n)=>{t?o(t):i&&o(null,{vectorTile:new e.vectorTile.VectorTile(new e.pbf(i)),rawData:i,cacheControl:r,expires:n});}));return ()=>{i.cancel(),o();}}class l{constructor(e,t,o,i){this.actor=e,this.layerIndex=t,this.availableImages=o,this.loadVectorData=i||a,this.loading={},this.loaded={};}loadTile(t,o){const i=t.uid;this.loading||(this.loading={});const r=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.RequestPerformance(t.request),s=this.loading[i]=new n(t);s.abort=this.loadVectorData(t,((t,n)=>{if(delete this.loading[i],t||!n)return s.status="done",this.loaded[i]=s,o(t);const a=n.rawData,l={};n.expires&&(l.expires=n.expires),n.cacheControl&&(l.cacheControl=n.cacheControl);const c={};if(r){const e=r.finish();e&&(c.resourceTiming=JSON.parse(JSON.stringify(e)));}s.vectorTile=n.vectorTile,s.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor,((t,i)=>{if(t||!i)return o(t);o(null,e.extend({rawTileData:a.slice(0)},i,l,c));})),this.loaded=this.loaded||{},this.loaded[i]=s;}));}reloadTile(e,t){const o=this.loaded,i=e.uid,r=this;if(o&&o[i]){const n=o[i];n.showCollisionBoxes=e.showCollisionBoxes;const s=(e,o)=>{const i=n.reloadCallback;i&&(delete n.reloadCallback,n.parse(n.vectorTile,r.layerIndex,this.availableImages,r.actor,i)),t(e,o);};"parsing"===n.status?n.reloadCallback=s:"done"===n.status&&(n.vectorTile?n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s());}}abortTile(e,t){const o=this.loading,i=e.uid;o&&o[i]&&o[i].abort&&(o[i].abort(),delete o[i]),t();}removeTile(e,t){const o=this.loaded,i=e.uid;o&&o[i]&&delete o[i],t();}}class c{constructor(){this.loaded={};}loadTile(t,o){const{uid:i,encoding:r,rawImageData:n}=t,s=e.isImageBitmap(n)?this.getImageData(n):n,a=new e.DEMData(i,s,r);this.loaded=this.loaded||{},this.loaded[i]=a,o(null,a);}getImageData(t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(t.width,t.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=t.width,this.offscreenCanvas.height=t.height,this.offscreenCanvasContext.drawImage(t,0,0,t.width,t.height);const o=this.offscreenCanvasContext.getImageData(-1,-1,t.width+2,t.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new e.RGBAImage({width:o.width,height:o.height},o.data)}removeTile(e){const t=this.loaded,o=e.uid;t&&t[o]&&delete t[o];}}var u=function e(t,o){var i,r=t&&t.type;if("FeatureCollection"===r)for(i=0;i<t.features.length;i++)e(t.features[i],o);else if("GeometryCollection"===r)for(i=0;i<t.geometries.length;i++)e(t.geometries[i],o);else if("Feature"===r)e(t.geometry,o);else if("Polygon"===r)h(t.coordinates,o);else if("MultiPolygon"===r)for(i=0;i<t.coordinates.length;i++)h(t.coordinates[i],o);return t};function h(e,t){if(0!==e.length){p(e[0],t);for(var o=1;o<e.length;o++)p(e[o],!t);}}function p(e,t){for(var o=0,i=0,r=0,n=e.length,s=n-1;r<n;s=r++){var a=(e[r][0]-e[s][0])*(e[s][1]+e[r][1]),l=o+a;i+=Math.abs(o)>=Math.abs(a)?o-l+a:a-l+o,o=l;}o+i>=0!=!!t&&e.reverse();}const f=e.vectorTile.VectorTileFeature.prototype.toGeoJSON;class d{constructor(t){this._feature=t,this.extent=e.EXTENT,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10));}loadGeometry(){if(1===this._feature.type){const t=[];for(const o of this._feature.geometry)t.push([new e.pointGeometry(o[0],o[1])]);return t}{const t=[];for(const o of this._feature.geometry){const i=[];for(const t of o)i.push(new e.pointGeometry(t[0],t[1]));t.push(i);}return t}}toGeoJSON(e,t,o){return f.call(this,e,t,o)}}class g{constructor(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=e.EXTENT,this.length=t.length,this._features=t;}feature(e){return new d(this._features[e])}}var m={exports:{}},y=e.pointGeometry,v=e.vectorTile.VectorTileFeature,x=w;function w(e,t){this.options=t||{},this.features=e,this.length=e.length;}function S(e,t){this.id="number"==typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096;}w.prototype.feature=function(e){return new S(this.features[e],this.options.extent)},S.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var t=0;t<e.length;t++){for(var o=e[t],i=[],r=0;r<o.length;r++)i.push(new y(o[r][0],o[r][1]));this.geometry.push(i);}return this.geometry},S.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,o=-1/0,i=1/0,r=-1/0,n=0;n<e.length;n++)for(var s=e[n],a=0;a<s.length;a++){var l=s[a];t=Math.min(t,l.x),o=Math.max(o,l.x),i=Math.min(i,l.y),r=Math.max(r,l.y);}return [t,i,o,r]},S.prototype.toGeoJSON=v.prototype.toGeoJSON;var I=e.pbf,M=x;function b(e){var t=new I;return function(e,t){for(var o in e.layers)t.writeMessage(3,k,e.layers[o]);}(e,t),t.finish()}function k(e,t){var o;t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);var i={keys:[],values:[],keycache:{},valuecache:{}};for(o=0;o<e.length;o++)i.feature=e.feature(o),t.writeMessage(2,_,i);var r=i.keys;for(o=0;o<r.length;o++)t.writeStringField(3,r[o]);var n=i.values;for(o=0;o<n.length;o++)t.writeMessage(4,L,n[o]);}function _(e,t){var o=e.feature;void 0!==o.id&&t.writeVarintField(1,o.id),t.writeMessage(2,P,e),t.writeVarintField(3,o.type),t.writeMessage(4,D,o);}function P(e,t){var o=e.feature,i=e.keys,r=e.values,n=e.keycache,s=e.valuecache;for(var a in o.properties){var l=o.properties[a],c=n[a];if(null!==l){void 0===c&&(i.push(a),n[a]=c=i.length-1),t.writeVarint(c);var u=typeof l;"string"!==u&&"boolean"!==u&&"number"!==u&&(l=JSON.stringify(l));var h=u+":"+l,p=s[h];void 0===p&&(r.push(l),s[h]=p=r.length-1),t.writeVarint(p);}}}function T(e,t){return (t<<3)+(7&e)}function C(e){return e<<1^e>>31}function D(e,t){for(var o=e.loadGeometry(),i=e.type,r=0,n=0,s=o.length,a=0;a<s;a++){var l=o[a],c=1;1===i&&(c=l.length),t.writeVarint(T(1,c));for(var u=3===i?l.length-1:l.length,h=0;h<u;h++){1===h&&1!==i&&t.writeVarint(T(2,u-1));var p=l[h].x-r,f=l[h].y-n;t.writeVarint(C(p)),t.writeVarint(C(f)),r+=p,n+=f;}3===i&&t.writeVarint(T(7,1));}}function L(e,t){var o=typeof e;"string"===o?t.writeStringField(1,e):"boolean"===o?t.writeBooleanField(7,e):"number"===o&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e));}m.exports=b,m.exports.fromVectorTileJs=b,m.exports.fromGeojsonVt=function(e,t){t=t||{};var o={};for(var i in e)o[i]=new M(e[i].features,t),o[i].name=i,o[i].version=t.version,o[i].extent=t.extent;return b({layers:o})},m.exports.GeoJSONWrapper=M;var z=m.exports;function O(e,t,o,i,r,n){if(r-i<=o)return;const s=i+r>>1;E(e,t,s,i,r,n%2),O(e,t,o,i,s-1,n+1),O(e,t,o,s+1,r,n+1);}function E(e,t,o,i,r,n){for(;r>i;){if(r-i>600){const s=r-i+1,a=o-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(s-c)/s)*(a-s/2<0?-1:1);E(e,t,o,Math.max(i,Math.floor(o-a*c/s+u)),Math.min(r,Math.floor(o+(s-a)*c/s+u)),n);}const s=t[2*o+n];let a=i,l=r;for(F(e,t,i,o),t[2*r+n]>s&&F(e,t,i,r);a<l;){for(F(e,t,a,l),a++,l--;t[2*a+n]<s;)a++;for(;t[2*l+n]>s;)l--;}t[2*i+n]===s?F(e,t,i,l):(l++,F(e,t,l,r)),l<=o&&(i=l+1),o<=l&&(r=l-1);}}function F(e,t,o,i){N(e,o,i),N(t,2*o,2*i),N(t,2*o+1,2*i+1);}function N(e,t,o){const i=e[t];e[t]=e[o],e[o]=i;}function A(e,t,o,i){const r=e-o,n=t-i;return r*r+n*n}const G=e=>e[0],J=e=>e[1];class Z{constructor(e,t=G,o=J,i=64,r=Float64Array){this.nodeSize=i,this.points=e;const n=e.length<65536?Uint16Array:Uint32Array,s=this.ids=new n(e.length),a=this.coords=new r(2*e.length);for(let i=0;i<e.length;i++)s[i]=i,a[2*i]=t(e[i]),a[2*i+1]=o(e[i]);O(s,a,i,0,s.length-1,0);}range(e,t,o,i){return function(e,t,o,i,r,n,s){const a=[0,e.length-1,0],l=[];let c,u;for(;a.length;){const h=a.pop(),p=a.pop(),f=a.pop();if(p-f<=s){for(let s=f;s<=p;s++)c=t[2*s],u=t[2*s+1],c>=o&&c<=r&&u>=i&&u<=n&&l.push(e[s]);continue}const d=Math.floor((f+p)/2);c=t[2*d],u=t[2*d+1],c>=o&&c<=r&&u>=i&&u<=n&&l.push(e[d]);const g=(h+1)%2;(0===h?o<=c:i<=u)&&(a.push(f),a.push(d-1),a.push(g)),(0===h?r>=c:n>=u)&&(a.push(d+1),a.push(p),a.push(g));}return l}(this.ids,this.coords,e,t,o,i,this.nodeSize)}within(e,t,o){return function(e,t,o,i,r,n){const s=[0,e.length-1,0],a=[],l=r*r;for(;s.length;){const c=s.pop(),u=s.pop(),h=s.pop();if(u-h<=n){for(let r=h;r<=u;r++)A(t[2*r],t[2*r+1],o,i)<=l&&a.push(e[r]);continue}const p=Math.floor((h+u)/2),f=t[2*p],d=t[2*p+1];A(f,d,o,i)<=l&&a.push(e[p]);const g=(c+1)%2;(0===c?o-r<=f:i-r<=d)&&(s.push(h),s.push(p-1),s.push(g)),(0===c?o+r>=f:i+r>=d)&&(s.push(p+1),s.push(u),s.push(g));}return a}(this.ids,this.coords,e,t,o,this.nodeSize)}}const B={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},j=Math.fround||(Y=new Float32Array(1),e=>(Y[0]=+e,Y[0]));var Y;class V{constructor(e){this.options=K(Object.create(B),e),this.trees=new Array(this.options.maxZoom+1);}load(e){const{log:t,minZoom:o,maxZoom:i,nodeSize:r}=this.options;t&&console.time("total time");const n=`prepare ${e.length} points`;t&&console.time(n),this.points=e;let s=[];for(let t=0;t<e.length;t++)e[t].geometry&&s.push(W(e[t],t));this.trees[i+1]=new Z(s,Q,ee,r,Float32Array),t&&console.timeEnd(n);for(let e=i;e>=o;e--){const o=+Date.now();s=this._cluster(s,e),this.trees[e]=new Z(s,Q,ee,r,Float32Array),t&&console.log("z%d: %d clusters in %dms",e,s.length,+Date.now()-o);}return t&&console.timeEnd("total time"),this}getClusters(e,t){let o=((e[0]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,e[1]));let r=180===e[2]?180:((e[2]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)o=-180,r=180;else if(o>r){const e=this.getClusters([o,i,180,n],t),s=this.getClusters([-180,i,r,n],t);return e.concat(s)}const s=this.trees[this._limitZoom(t)],a=s.range(q(o),U(n),q(r),U(i)),l=[];for(const e of a){const t=s.points[e];l.push(t.numPoints?R(t):this.points[t.index]);}return l}getChildren(e){const t=this._getOriginId(e),o=this._getOriginZoom(e),i="No cluster with the specified id.",r=this.trees[o];if(!r)throw new Error(i);const n=r.points[t];if(!n)throw new Error(i);const s=this.options.radius/(this.options.extent*Math.pow(2,o-1)),a=r.within(n.x,n.y,s),l=[];for(const t of a){const o=r.points[t];o.parentId===e&&l.push(o.numPoints?R(o):this.points[o.index]);}if(0===l.length)throw new Error(i);return l}getLeaves(e,t,o){const i=[];return this._appendLeaves(i,e,t=t||10,o=o||0,0),i}getTile(e,t,o){const i=this.trees[this._limitZoom(e)],r=Math.pow(2,e),{extent:n,radius:s}=this.options,a=s/n,l=(o-a)/r,c=(o+1+a)/r,u={features:[]};return this._addTileFeatures(i.range((t-a)/r,l,(t+1+a)/r,c),i.points,t,o,r,u),0===t&&this._addTileFeatures(i.range(1-a/r,l,1,c),i.points,r,o,r,u),t===r-1&&this._addTileFeatures(i.range(0,l,a/r,c),i.points,-1,o,r,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const o=this.getChildren(e);if(t++,1!==o.length)break;e=o[0].properties.cluster_id;}return t}_appendLeaves(e,t,o,i,r){const n=this.getChildren(t);for(const t of n){const n=t.properties;if(n&&n.cluster?r+n.point_count<=i?r+=n.point_count:r=this._appendLeaves(e,n.cluster_id,o,i,r):r<i?r++:e.push(t),e.length===o)break}return r}_addTileFeatures(e,t,o,i,r,n){for(const s of e){const e=t[s],a=e.numPoints;let l,c,u;if(a)l=$(e),c=e.x,u=e.y;else {const t=this.points[e.index];l=t.properties,c=q(t.geometry.coordinates[0]),u=U(t.geometry.coordinates[1]);}const h={type:1,geometry:[[Math.round(this.options.extent*(c*r-o)),Math.round(this.options.extent*(u*r-i))]],tags:l};let p;a?p=e.id:this.options.generateId?p=e.index:this.points[e.index].id&&(p=this.points[e.index].id),void 0!==p&&(h.id=p),n.features.push(h);}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(+e,this.options.maxZoom+1))}_cluster(e,t){const o=[],{radius:i,extent:r,reduce:n,minPoints:s}=this.options,a=i/(r*Math.pow(2,t));for(let i=0;i<e.length;i++){const r=e[i];if(r.zoom<=t)continue;r.zoom=t;const l=this.trees[t+1],c=l.within(r.x,r.y,a),u=r.numPoints||1;let h=u;for(const e of c){const o=l.points[e];o.zoom>t&&(h+=o.numPoints||1);}if(h>u&&h>=s){let e=r.x*u,s=r.y*u,a=n&&u>1?this._map(r,!0):null;const p=(i<<5)+(t+1)+this.points.length;for(const o of c){const i=l.points[o];if(i.zoom<=t)continue;i.zoom=t;const c=i.numPoints||1;e+=i.x*c,s+=i.y*c,i.parentId=p,n&&(a||(a=this._map(r,!0)),n(a,this._map(i)));}r.parentId=p,o.push(X(e/h,s/h,p,h,a));}else if(o.push(r),h>1)for(const e of c){const i=l.points[e];i.zoom<=t||(i.zoom=t,o.push(i));}}return o}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return (e-this.points.length)%32}_map(e,t){if(e.numPoints)return t?K({},e.properties):e.properties;const o=this.points[e.index].properties,i=this.options.map(o);return t&&i===o?K({},i):i}}function X(e,t,o,i,r){return {x:j(e),y:j(t),zoom:1/0,id:o,parentId:-1,numPoints:i,properties:r}}function W(e,t){const[o,i]=e.geometry.coordinates;return {x:j(q(o)),y:j(U(i)),zoom:1/0,index:t,parentId:-1}}function R(e){return {type:"Feature",id:e.id,properties:$(e),geometry:{type:"Point",coordinates:[(t=e.x,360*(t-.5)),H(e.y)]}};var t;}function $(e){const t=e.numPoints,o=t>=1e4?`${Math.round(t/1e3)}k`:t>=1e3?Math.round(t/100)/10+"k":t;return K(K({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:o})}function q(e){return e/360+.5}function U(e){const t=Math.sin(e*Math.PI/180),o=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return o<0?0:o>1?1:o}function H(e){const t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function K(e,t){for(const o in t)e[o]=t[o];return e}function Q(e){return e.x}function ee(e){return e.y}function te(e,t,o,i){for(var r,n=i,s=o-t>>1,a=o-t,l=e[t],c=e[t+1],u=e[o],h=e[o+1],p=t+3;p<o;p+=3){var f=oe(e[p],e[p+1],l,c,u,h);if(f>n)r=p,n=f;else if(f===n){var d=Math.abs(p-s);d<a&&(r=p,a=d);}}n>i&&(r-t>3&&te(e,t,r,i),e[r+2]=n,o-r>3&&te(e,r,o,i));}function oe(e,t,o,i,r,n){var s=r-o,a=n-i;if(0!==s||0!==a){var l=((e-o)*s+(t-i)*a)/(s*s+a*a);l>1?(o=r,i=n):l>0&&(o+=s*l,i+=a*l);}return (s=e-o)*s+(a=t-i)*a}function ie(e,t,o,i){var r={id:void 0===e?null:e,type:t,geometry:o,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(e){var t=e.geometry,o=e.type;if("Point"===o||"MultiPoint"===o||"LineString"===o)re(e,t);else if("Polygon"===o||"MultiLineString"===o)for(var i=0;i<t.length;i++)re(e,t[i]);else if("MultiPolygon"===o)for(i=0;i<t.length;i++)for(var r=0;r<t[i].length;r++)re(e,t[i][r]);}(r),r}function re(e,t){for(var o=0;o<t.length;o+=3)e.minX=Math.min(e.minX,t[o]),e.minY=Math.min(e.minY,t[o+1]),e.maxX=Math.max(e.maxX,t[o]),e.maxY=Math.max(e.maxY,t[o+1]);}function ne(e,t,o,i){if(t.geometry){var r=t.geometry.coordinates,n=t.geometry.type,s=Math.pow(o.tolerance/((1<<o.maxZoom)*o.extent),2),a=[],l=t.id;if(o.promoteId?l=t.properties[o.promoteId]:o.generateId&&(l=i||0),"Point"===n)se(r,a);else if("MultiPoint"===n)for(var c=0;c<r.length;c++)se(r[c],a);else if("LineString"===n)ae(r,a,s,!1);else if("MultiLineString"===n){if(o.lineMetrics){for(c=0;c<r.length;c++)ae(r[c],a=[],s,!1),e.push(ie(l,"LineString",a,t.properties));return}le(r,a,s,!1);}else if("Polygon"===n)le(r,a,s,!0);else {if("MultiPolygon"!==n){if("GeometryCollection"===n){for(c=0;c<t.geometry.geometries.length;c++)ne(e,{id:l,geometry:t.geometry.geometries[c],properties:t.properties},o,i);return}throw new Error("Input data is not a valid GeoJSON object.")}for(c=0;c<r.length;c++){var u=[];le(r[c],u,s,!0),a.push(u);}}e.push(ie(l,n,a,t.properties));}}function se(e,t){t.push(ce(e[0])),t.push(ue(e[1])),t.push(0);}function ae(e,t,o,i){for(var r,n,s=0,a=0;a<e.length;a++){var l=ce(e[a][0]),c=ue(e[a][1]);t.push(l),t.push(c),t.push(0),a>0&&(s+=i?(r*c-l*n)/2:Math.sqrt(Math.pow(l-r,2)+Math.pow(c-n,2))),r=l,n=c;}var u=t.length-3;t[2]=1,te(t,0,u,o),t[u+2]=1,t.size=Math.abs(s),t.start=0,t.end=t.size;}function le(e,t,o,i){for(var r=0;r<e.length;r++){var n=[];ae(e[r],n,o,i),t.push(n);}}function ce(e){return e/360+.5}function ue(e){var t=Math.sin(e*Math.PI/180),o=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return o<0?0:o>1?1:o}function he(e,t,o,i,r,n,s,a){if(i/=t,n>=(o/=t)&&s<i)return e;if(s<o||n>=i)return null;for(var l=[],c=0;c<e.length;c++){var u=e[c],h=u.geometry,p=u.type,f=0===r?u.minX:u.minY,d=0===r?u.maxX:u.maxY;if(f>=o&&d<i)l.push(u);else if(!(d<o||f>=i)){var g=[];if("Point"===p||"MultiPoint"===p)pe(h,g,o,i,r);else if("LineString"===p)fe(h,g,o,i,r,!1,a.lineMetrics);else if("MultiLineString"===p)ge(h,g,o,i,r,!1);else if("Polygon"===p)ge(h,g,o,i,r,!0);else if("MultiPolygon"===p)for(var m=0;m<h.length;m++){var y=[];ge(h[m],y,o,i,r,!0),y.length&&g.push(y);}if(g.length){if(a.lineMetrics&&"LineString"===p){for(m=0;m<g.length;m++)l.push(ie(u.id,p,g[m],u.tags));continue}"LineString"!==p&&"MultiLineString"!==p||(1===g.length?(p="LineString",g=g[0]):p="MultiLineString"),"Point"!==p&&"MultiPoint"!==p||(p=3===g.length?"Point":"MultiPoint"),l.push(ie(u.id,p,g,u.tags));}}}return l.length?l:null}function pe(e,t,o,i,r){for(var n=0;n<e.length;n+=3){var s=e[n+r];s>=o&&s<=i&&(t.push(e[n]),t.push(e[n+1]),t.push(e[n+2]));}}function fe(e,t,o,i,r,n,s){for(var a,l,c=de(e),u=0===r?ye:ve,h=e.start,p=0;p<e.length-3;p+=3){var f=e[p],d=e[p+1],g=e[p+2],m=e[p+3],y=e[p+4],v=0===r?f:d,x=0===r?m:y,w=!1;s&&(a=Math.sqrt(Math.pow(f-m,2)+Math.pow(d-y,2))),v<o?x>o&&(l=u(c,f,d,m,y,o),s&&(c.start=h+a*l)):v>i?x<i&&(l=u(c,f,d,m,y,i),s&&(c.start=h+a*l)):me(c,f,d,g),x<o&&v>=o&&(l=u(c,f,d,m,y,o),w=!0),x>i&&v<=i&&(l=u(c,f,d,m,y,i),w=!0),!n&&w&&(s&&(c.end=h+a*l),t.push(c),c=de(e)),s&&(h+=a);}var S=e.length-3;f=e[S],d=e[S+1],g=e[S+2],(v=0===r?f:d)>=o&&v<=i&&me(c,f,d,g),S=c.length-3,n&&S>=3&&(c[S]!==c[0]||c[S+1]!==c[1])&&me(c,c[0],c[1],c[2]),c.length&&t.push(c);}function de(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function ge(e,t,o,i,r,n){for(var s=0;s<e.length;s++)fe(e[s],t,o,i,r,n,!1);}function me(e,t,o,i){e.push(t),e.push(o),e.push(i);}function ye(e,t,o,i,r,n){var s=(n-t)/(i-t);return e.push(n),e.push(o+(r-o)*s),e.push(1),s}function ve(e,t,o,i,r,n){var s=(n-o)/(r-o);return e.push(t+(i-t)*s),e.push(n),e.push(1),s}function xe(e,t){for(var o=[],i=0;i<e.length;i++){var r,n=e[i],s=n.type;if("Point"===s||"MultiPoint"===s||"LineString"===s)r=we(n.geometry,t);else if("MultiLineString"===s||"Polygon"===s){r=[];for(var a=0;a<n.geometry.length;a++)r.push(we(n.geometry[a],t));}else if("MultiPolygon"===s)for(r=[],a=0;a<n.geometry.length;a++){for(var l=[],c=0;c<n.geometry[a].length;c++)l.push(we(n.geometry[a][c],t));r.push(l);}o.push(ie(n.id,s,r,n.tags));}return o}function we(e,t){var o=[];o.size=e.size,void 0!==e.start&&(o.start=e.start,o.end=e.end);for(var i=0;i<e.length;i+=3)o.push(e[i]+t,e[i+1],e[i+2]);return o}function Se(e,t){if(e.transformed)return e;var o,i,r,n=1<<e.z,s=e.x,a=e.y;for(o=0;o<e.features.length;o++){var l=e.features[o],c=l.geometry,u=l.type;if(l.geometry=[],1===u)for(i=0;i<c.length;i+=2)l.geometry.push(Ie(c[i],c[i+1],t,n,s,a));else for(i=0;i<c.length;i++){var h=[];for(r=0;r<c[i].length;r+=2)h.push(Ie(c[i][r],c[i][r+1],t,n,s,a));l.geometry.push(h);}}return e.transformed=!0,e}function Ie(e,t,o,i,r,n){return [Math.round(o*(e*i-r)),Math.round(o*(t*i-n))]}function Me(e,t,o,i,r){for(var n=t===r.maxZoom?0:r.tolerance/((1<<t)*r.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:o,y:i,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},a=0;a<e.length;a++){s.numFeatures++,be(s,e[a],n,r);var l=e[a].minX,c=e[a].minY,u=e[a].maxX,h=e[a].maxY;l<s.minX&&(s.minX=l),c<s.minY&&(s.minY=c),u>s.maxX&&(s.maxX=u),h>s.maxY&&(s.maxY=h);}return s}function be(e,t,o,i){var r=t.geometry,n=t.type,s=[];if("Point"===n||"MultiPoint"===n)for(var a=0;a<r.length;a+=3)s.push(r[a]),s.push(r[a+1]),e.numPoints++,e.numSimplified++;else if("LineString"===n)ke(s,r,e,o,!1,!1);else if("MultiLineString"===n||"Polygon"===n)for(a=0;a<r.length;a++)ke(s,r[a],e,o,"Polygon"===n,0===a);else if("MultiPolygon"===n)for(var l=0;l<r.length;l++){var c=r[l];for(a=0;a<c.length;a++)ke(s,c[a],e,o,!0,0===a);}if(s.length){var u=t.tags||null;if("LineString"===n&&i.lineMetrics){for(var h in u={},t.tags)u[h]=t.tags[h];u.mapbox_clip_start=r.start/r.size,u.mapbox_clip_end=r.end/r.size;}var p={geometry:s,type:"Polygon"===n||"MultiPolygon"===n?3:"LineString"===n||"MultiLineString"===n?2:1,tags:u};null!==t.id&&(p.id=t.id),e.features.push(p);}}function ke(e,t,o,i,r,n){var s=i*i;if(i>0&&t.size<(r?s:i))o.numPoints+=t.length/3;else {for(var a=[],l=0;l<t.length;l+=3)(0===i||t[l+2]>s)&&(o.numSimplified++,a.push(t[l]),a.push(t[l+1])),o.numPoints++;r&&function(e,t){for(var o=0,i=0,r=e.length,n=r-2;i<r;n=i,i+=2)o+=(e[i]-e[n])*(e[i+1]+e[n+1]);if(o>0===t)for(i=0,r=e.length;i<r/2;i+=2){var s=e[i],a=e[i+1];e[i]=e[r-2-i],e[i+1]=e[r-1-i],e[r-2-i]=s,e[r-1-i]=a;}}(a,n),e.push(a);}}function _e(e,t){var o=(t=this.options=function(e,t){for(var o in t)e[o]=t[o];return e}(Object.create(this.options),t)).debug;if(o&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var i=function(e,t){var o=[];if("FeatureCollection"===e.type)for(var i=0;i<e.features.length;i++)ne(o,e.features[i],t,i);else ne(o,"Feature"===e.type?e:{geometry:e},t);return o}(e,t);this.tiles={},this.tileCoords=[],o&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),i=function(e,t){var o=t.buffer/t.extent,i=e,r=he(e,1,-1-o,o,0,-1,2,t),n=he(e,1,1-o,2+o,0,-1,2,t);return (r||n)&&(i=he(e,1,-o,1+o,0,-1,2,t)||[],r&&(i=xe(r,1).concat(i)),n&&(i=i.concat(xe(n,-1)))),i}(i,t),i.length&&this.splitTile(i,0,0,0),o&&(i.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)));}function Pe(e,t,o){return 32*((1<<e)*o+t)+e}function Te(e,t){const o=e.tileID.canonical;if(!this._geoJSONIndex)return t(null,null);const i=this._geoJSONIndex.getTile(o.z,o.x,o.y);if(!i)return t(null,null);const r=new g(i.features);let n=z(r);0===n.byteOffset&&n.byteLength===n.buffer.byteLength||(n=new Uint8Array(n)),t(null,{vectorTile:r,rawData:n.buffer});}_e.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},_e.prototype.splitTile=function(e,t,o,i,r,n,s){for(var a=[e,t,o,i],l=this.options,c=l.debug;a.length;){i=a.pop(),o=a.pop(),t=a.pop(),e=a.pop();var u=1<<t,h=Pe(t,o,i),p=this.tiles[h];if(!p&&(c>1&&console.time("creation"),p=this.tiles[h]=Me(e,t,o,i,l),this.tileCoords.push({z:t,x:o,y:i}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,o,i,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var f="z"+t;this.stats[f]=(this.stats[f]||0)+1,this.total++;}if(p.source=e,r){if(t===l.maxZoom||t===r)continue;var d=1<<r-t;if(o!==Math.floor(n/d)||i!==Math.floor(s/d))continue}else if(t===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue;if(p.source=null,0!==e.length){c>1&&console.time("clipping");var g,m,y,v,x,w,S=.5*l.buffer/l.extent,I=.5-S,M=.5+S,b=1+S;g=m=y=v=null,x=he(e,u,o-S,o+M,0,p.minX,p.maxX,l),w=he(e,u,o+I,o+b,0,p.minX,p.maxX,l),e=null,x&&(g=he(x,u,i-S,i+M,1,p.minY,p.maxY,l),m=he(x,u,i+I,i+b,1,p.minY,p.maxY,l),x=null),w&&(y=he(w,u,i-S,i+M,1,p.minY,p.maxY,l),v=he(w,u,i+I,i+b,1,p.minY,p.maxY,l),w=null),c>1&&console.timeEnd("clipping"),a.push(g||[],t+1,2*o,2*i),a.push(m||[],t+1,2*o,2*i+1),a.push(y||[],t+1,2*o+1,2*i),a.push(v||[],t+1,2*o+1,2*i+1);}}},_e.prototype.getTile=function(e,t,o){var i=this.options,r=i.extent,n=i.debug;if(e<0||e>24)return null;var s=1<<e,a=Pe(e,t=(t%s+s)%s,o);if(this.tiles[a])return Se(this.tiles[a],r);n>1&&console.log("drilling down to z%d-%d-%d",e,t,o);for(var l,c=e,u=t,h=o;!l&&c>0;)c--,u=Math.floor(u/2),h=Math.floor(h/2),l=this.tiles[Pe(c,u,h)];return l&&l.source?(n>1&&console.log("found parent tile z%d-%d-%d",c,u,h),n>1&&console.time("drilling down"),this.splitTile(l.source,c,u,h,e,t,o),n>1&&console.timeEnd("drilling down"),this.tiles[a]?Se(this.tiles[a],r):null):null};class Ce extends l{constructor(e,t,o,i){super(e,t,o,Te),i&&(this.loadGeoJSON=i);}loadData(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=t,this._pendingLoadDataParams=e,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData());}_loadData(){if(!this._pendingCallback||!this._pendingLoadDataParams)return;const t=this._pendingCallback,o=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;const i=!!(o&&o.request&&o.request.collectResourceTiming)&&new e.RequestPerformance(o.request);this.loadGeoJSON(o,((r,n)=>{if(r||!n)return t(r);if("object"!=typeof n)return t(new Error(`Input data given to '${o.source}' is not a valid GeoJSON object.`));{u(n,!0);try{if(o.filter){const t=e.createExpression(o.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===t.result)throw new Error(t.value.map((e=>`${e.key}: ${e.message}`)).join(", "));const i=n.features.filter((e=>t.value.evaluate({zoom:0},e)));n={type:"FeatureCollection",features:i};}this._geoJSONIndex=o.cluster?new V(function({superclusterOptions:t,clusterProperties:o}){if(!o||!t)return t;const i={},r={},n={accumulated:null,zoom:0},s={properties:null},a=Object.keys(o);for(const t of a){const[n,s]=o[t],a=e.createExpression(s),l=e.createExpression("string"==typeof n?[n,["accumulated"],["get",t]]:n);i[t]=a.value,r[t]=l.value;}return t.map=e=>{s.properties=e;const t={};for(const e of a)t[e]=i[e].evaluate(n,s);return t},t.reduce=(e,t)=>{s.properties=t;for(const t of a)n.accumulated=e[t],e[t]=r[t].evaluate(n,s);},t}(o)).load(n.features):function(e,t){return new _e(e,t)}(n,o.geojsonVtOptions);}catch(r){return t(r)}this.loaded={};const s={};if(i){const e=i.finish();e&&(s.resourceTiming={},s.resourceTiming[o.source]=JSON.parse(JSON.stringify(e)));}t(null,s);}}));}coalesce(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData());}reloadTile(e,t){const o=this.loaded;return o&&o[e.uid]?super.reloadTile(e,t):this.loadTile(e,t)}loadGeoJSON(t,o){if(t.request)e.getJSON(t.request,o);else {if("string"!=typeof t.data)return o(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`));try{return o(null,JSON.parse(t.data))}catch(e){return o(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`))}}}removeSource(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),t();}getClusterExpansionZoom(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId));}catch(e){t(e);}}getClusterChildren(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId));}catch(e){t(e);}}getClusterLeaves(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset));}catch(e){t(e);}}}class De{constructor(t){this.self=t,this.actor=new e.Actor(t,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:l,geojson:Ce},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(e,t)=>{if(this.workerSourceTypes[e])throw new Error(`Worker source with name "${e}" already registered.`);this.workerSourceTypes[e]=t;},this.self.registerRTLTextPlugin=t=>{if(e.plugin.isParsed())throw new Error("RTL text plugin already registered.");e.plugin.applyArabicShaping=t.applyArabicShaping,e.plugin.processBidirectionalText=t.processBidirectionalText,e.plugin.processStyledBidirectionalText=t.processStyledBidirectionalText;};}setReferrer(e,t){this.referrer=t;}setImages(e,t,o){this.availableImages[e]=t;for(const o in this.workerSources[e]){const i=this.workerSources[e][o];for(const e in i)i[e].availableImages=t;}o();}setLayers(e,t,o){this.getLayerIndex(e).replace(t),o();}updateLayers(e,t,o){this.getLayerIndex(e).update(t.layers,t.removedIds),o();}loadTile(e,t,o){this.getWorkerSource(e,t.type,t.source).loadTile(t,o);}loadDEMTile(e,t,o){this.getDEMWorkerSource(e,t.source).loadTile(t,o);}reloadTile(e,t,o){this.getWorkerSource(e,t.type,t.source).reloadTile(t,o);}abortTile(e,t,o){this.getWorkerSource(e,t.type,t.source).abortTile(t,o);}removeTile(e,t,o){this.getWorkerSource(e,t.type,t.source).removeTile(t,o);}removeDEMTile(e,t){this.getDEMWorkerSource(e,t.source).removeTile(t);}removeSource(e,t,o){if(!this.workerSources[e]||!this.workerSources[e][t.type]||!this.workerSources[e][t.type][t.source])return;const i=this.workerSources[e][t.type][t.source];delete this.workerSources[e][t.type][t.source],void 0!==i.removeSource?i.removeSource(t,o):o();}loadWorkerSource(e,t,o){try{this.self.importScripts(t.url),o();}catch(e){o(e.toString());}}syncRTLPluginState(t,o,i){try{e.plugin.setState(o);const t=e.plugin.getPluginURL();if(e.plugin.isLoaded()&&!e.plugin.isParsed()&&null!=t){this.self.importScripts(t);const o=e.plugin.isParsed();i(o?void 0:new Error(`RTL Text Plugin failed to import scripts from ${t}`),o);}}catch(e){i(e.toString());}}getAvailableImages(e){let t=this.availableImages[e];return t||(t=[]),t}getLayerIndex(e){let t=this.layerIndexes[e];return t||(t=this.layerIndexes[e]=new i),t}getWorkerSource(e,t,o){if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][o]){const i={send:(t,o,i)=>{this.actor.send(t,o,i,e);}};this.workerSources[e][t][o]=new this.workerSourceTypes[t](i,this.getLayerIndex(e),this.getAvailableImages(e));}return this.workerSources[e][t][o]}getDEMWorkerSource(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new c),this.demWorkerSources[e][t]}enforceCacheSizeLimit(t,o){e.enforceCacheSizeLimit(o);}}return "undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new De(self)),De}));
define(["./shared"],(function(t){"use strict";var e=i;function i(t){return !function(t){return "undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return !1;var t,e,i=new Blob([""],{type:"text/javascript"}),o=URL.createObjectURL(i);try{e=new Worker(o),t=!0;}catch(e){t=!1;}return e&&e.terminate(),URL.revokeObjectURL(o),t}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(!e)return !1;var i=e.getImageData(0,0,1,1);return i&&i.width===t.width}()?(void 0===o[e=t&&t.failIfMajorPerformanceCaveat]&&(o[e]=function(t){var e,o=function(t){var e=document.createElement("canvas"),o=Object.create(i.webGLContextAttributes);return o.failIfMajorPerformanceCaveat=t,e.getContext("webgl",o)||e.getContext("experimental-webgl",o)}(t);if(!o)return !1;try{e=o.createShader(o.VERTEX_SHADER);}catch(t){return !1}return !(!e||o.isContextLost())&&(o.shaderSource(e,"void main() {}"),o.compileShader(e),!0===o.getShaderParameter(e,o.COMPILE_STATUS))}(e)),o[e]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var e;}(t)}var o={};function a(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return !1;for(let i=0;i<t.length;i++)if(!a(t[i],e[i]))return !1;return !0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return !1;if(Object.keys(t).length!==Object.keys(e).length)return !1;for(const i in t)if(!a(t[i],e[i]))return !1;return !0}return t===e}i.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};class s{static testProp(t){if(!s.docStyle)return t[0];for(let e=0;e<t.length;e++)if(t[e]in s.docStyle)return t[e];return t[0]}static create(t,e,i){const o=window.document.createElement(t);return void 0!==e&&(o.className=e),i&&i.appendChild(o),o}static createNS(t,e){return window.document.createElementNS(t,e)}static disableDrag(){s.docStyle&&s.selectProp&&(s.userSelect=s.docStyle[s.selectProp],s.docStyle[s.selectProp]="none");}static enableDrag(){s.docStyle&&s.selectProp&&(s.docStyle[s.selectProp]=s.userSelect);}static setTransform(t,e){t.style[s.transformProp]=e;}static addEventListener(t,e,i,o={}){t.addEventListener(e,i,"passive"in o?o:o.capture);}static removeEventListener(t,e,i,o={}){t.removeEventListener(e,i,"passive"in o?o:o.capture);}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",s.suppressClickInternal,!0);}static suppressClick(){window.addEventListener("click",s.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener("click",s.suppressClickInternal,!0);}),0);}static mousePos(e,i){const o=e.getBoundingClientRect();return new t.pointGeometry(i.clientX-o.left-e.clientLeft,i.clientY-o.top-e.clientTop)}static touchPos(e,i){const o=e.getBoundingClientRect(),a=[];for(let s=0;s<i.length;s++)a.push(new t.pointGeometry(i[s].clientX-o.left-e.clientLeft,i[s].clientY-o.top-e.clientTop));return a}static mouseButton(t){return t.button}static remove(t){t.parentNode&&t.parentNode.removeChild(t);}}s.docStyle="undefined"!=typeof window&&window.document&&window.document.documentElement.style,s.selectProp=s.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),s.transformProp=s.testProp(["transform","WebkitTransform"]);class r{constructor(t){this._transformRequestFn=t;}transformRequest(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}}normalizeSpriteURL(t,e,i){const o=function(t){const e=t.match(n);if(!e)throw new Error(`Unable to parse URL "${t}"`);return {protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}(t);return o.path+=`${e}${i}`,function(t){const e=t.params.length?`?${t.params.join("&")}`:"";return `${t.protocol}://${t.authority}${t.path}${e}`}(o)}setTransformRequest(t){this._transformRequestFn=t;}}const n=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function l(e){var i=new t.ARRAY_TYPE(3);return i[0]=e[0],i[1]=e[1],i[2]=e[2],i}function c(e,i,o){var a=new t.ARRAY_TYPE(3);return a[0]=e,a[1]=i,a[2]=o,a}var h,u=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t};h=new t.ARRAY_TYPE(3),t.ARRAY_TYPE!=Float32Array&&(h[0]=0,h[1]=0,h[2]=0);var d=function(t){var e=t[0],i=t[1];return e*e+i*i};!function(){var e=new t.ARRAY_TYPE(2);t.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0);}();class _{constructor(t,e,i,o){this.context=t,this.format=i,this.texture=t.gl.createTexture(),this.update(e,o);}update(e,i,o){const{width:a,height:s}=e,r=!(this.size&&this.size[0]===a&&this.size[1]===s||o),{context:n}=this,{gl:l}=n;if(this.useMipmap=Boolean(i&&i.useMipmap),l.bindTexture(l.TEXTURE_2D,this.texture),n.pixelStoreUnpackFlipY.set(!1),n.pixelStoreUnpack.set(1),n.pixelStoreUnpackPremultiplyAlpha.set(this.format===l.RGBA&&(!i||!1!==i.premultiply)),r)this.size=[a,s],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||t.isImageBitmap(e)?l.texImage2D(l.TEXTURE_2D,0,this.format,this.format,l.UNSIGNED_BYTE,e):l.texImage2D(l.TEXTURE_2D,0,this.format,a,s,0,this.format,l.UNSIGNED_BYTE,e.data);else {const{x:i,y:r}=o||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||t.isImageBitmap(e)?l.texSubImage2D(l.TEXTURE_2D,0,i,r,l.RGBA,l.UNSIGNED_BYTE,e):l.texSubImage2D(l.TEXTURE_2D,0,i,r,a,s,l.RGBA,l.UNSIGNED_BYTE,e.data);}this.useMipmap&&this.isSizePowerOfTwo()&&l.generateMipmap(l.TEXTURE_2D);}bind(t,e,i){const{context:o}=this,{gl:a}=o;a.bindTexture(a.TEXTURE_2D,this.texture),i!==a.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(i=a.LINEAR),t!==this.filter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,t),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,i||t),this.filter=t),e!==this.wrap&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,e),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,e),this.wrap=e);}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null;}}function m(t){const{userImage:e}=t;return !!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}class p extends t.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0;}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:t,callback:e}of this.requestors)this._notify(t,e);this.requestors=[];}}getImage(t){return this.images[t]}addImage(t,e){this._validate(t,e)&&(this.images[t]=e);}_validate(e,i){let o=!0;return this._validateStretch(i.stretchX,i.data&&i.data.width)||(this.fire(new t.ErrorEvent(new Error(`Image "${e}" has invalid "stretchX" value`))),o=!1),this._validateStretch(i.stretchY,i.data&&i.data.height)||(this.fire(new t.ErrorEvent(new Error(`Image "${e}" has invalid "stretchY" value`))),o=!1),this._validateContent(i.content,i)||(this.fire(new t.ErrorEvent(new Error(`Image "${e}" has invalid "content" value`))),o=!1),o}_validateStretch(t,e){if(!t)return !0;let i=0;for(const o of t){if(o[0]<i||o[1]<o[0]||e<o[1])return !1;i=o[1];}return !0}_validateContent(t,e){return !(t&&(4!==t.length||t[0]<0||e.data.width<t[0]||t[1]<0||e.data.height<t[1]||t[2]<0||e.data.width<t[2]||t[3]<0||e.data.height<t[3]||t[2]<t[0]||t[3]<t[1]))}updateImage(t,e){e.version=this.images[t].version+1,this.images[t]=e,this.updatedImages[t]=!0;}removeImage(t){const e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove();}listImages(){return Object.keys(this.images)}getImages(t,e){let i=!0;if(!this.isLoaded())for(const e of t)this.images[e]||(i=!1);this.isLoaded()||i?this._notify(t,e):this.requestors.push({ids:t,callback:e});}_notify(e,i){const o={};for(const i of e){this.images[i]||this.fire(new t.Event("styleimagemissing",{id:i}));const e=this.images[i];e?o[i]={data:e.data.clone(),pixelRatio:e.pixelRatio,sdf:e.sdf,version:e.version,stretchX:e.stretchX,stretchY:e.stretchY,content:e.content,hasRenderCallback:Boolean(e.userImage&&e.userImage.render)}:t.warnOnce(`Image "${i}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`);}i(null,o);}getPixelSize(){const{width:t,height:e}=this.atlasImage;return {width:t,height:e}}getPattern(e){const i=this.patterns[e],o=this.getImage(e);if(!o)return null;if(i&&i.position.version===o.version)return i.position;if(i)i.position.version=o.version;else {const i={w:o.data.width+2,h:o.data.height+2,x:0,y:0},a=new t.ImagePosition(i,o);this.patterns[e]={bin:i,position:a};}return this._updatePatternAtlas(),this.patterns[e].position}bind(t){const e=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new _(t,this.atlasImage,e.RGBA),this.atlasTexture.bind(e.LINEAR,e.CLAMP_TO_EDGE);}_updatePatternAtlas(){const e=[];for(const t in this.patterns)e.push(this.patterns[t].bin);const{w:i,h:o}=t.potpack(e),a=this.atlasImage;a.resize({width:i||1,height:o||1});for(const e in this.patterns){const{bin:i}=this.patterns[e],o=i.x+1,s=i.y+1,r=this.images[e].data,n=r.width,l=r.height;t.RGBAImage.copy(r,a,{x:0,y:0},{x:o,y:s},{width:n,height:l}),t.RGBAImage.copy(r,a,{x:0,y:l-1},{x:o,y:s-1},{width:n,height:1}),t.RGBAImage.copy(r,a,{x:0,y:0},{x:o,y:s+l},{width:n,height:1}),t.RGBAImage.copy(r,a,{x:n-1,y:0},{x:o-1,y:s},{width:1,height:l}),t.RGBAImage.copy(r,a,{x:0,y:0},{x:o+n,y:s},{width:1,height:l});}this.dirty=!0;}beginFrame(){this.callbackDispatchedThisFrame={};}dispatchRenderCallbacks(t){for(const e of t){if(this.callbackDispatchedThisFrame[e])continue;this.callbackDispatchedThisFrame[e]=!0;const t=this.images[e];m(t)&&this.updateImage(e,t);}}}const f=1e20;function g(t,e,i,o,a,s,r,n,l){for(let c=e;c<e+o;c++)x(t,i*s+c,s,a,r,n,l);for(let c=i;c<i+a;c++)x(t,c*s+e,1,o,r,n,l);}function x(t,e,i,o,a,s,r){s[0]=0,r[0]=-f,r[1]=f,a[0]=t[e];for(let n=1,l=0,c=0;n<o;n++){a[n]=t[e+n*i];const o=n*n;do{const t=s[l];c=(a[n]-a[t]+o-t*t)/(n-t)/2;}while(c<=r[l]&&--l>-1);l++,s[l]=n,r[l]=c,r[l+1]=f;}for(let n=0,l=0;n<o;n++){for(;r[l+1]<n;)l++;const o=s[l],c=n-o;t[e+n*i]=a[o]+c*c;}}class v{constructor(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={};}setURL(t){this.url=t;}getGlyphs(e,i){const o=[];for(const t in e)for(const i of e[t])o.push({stack:t,id:i});t.asyncAll(o,(({stack:t,id:e},i)=>{let o=this.entries[t];o||(o=this.entries[t]={glyphs:{},requests:{},ranges:{}});let a=o.glyphs[e];if(void 0!==a)return void i(null,{stack:t,id:e,glyph:a});if(a=this._tinySDF(o,t,e),a)return o.glyphs[e]=a,void i(null,{stack:t,id:e,glyph:a});const s=Math.floor(e/256);if(256*s>65535)return void i(new Error("glyphs > 65535 not supported"));if(o.ranges[s])return void i(null,{stack:t,id:e,glyph:a});let r=o.requests[s];r||(r=o.requests[s]=[],v.loadGlyphRange(t,s,this.url,this.requestManager,((t,e)=>{if(e){for(const t in e)this._doesCharSupportLocalGlyph(+t)||(o.glyphs[+t]=e[+t]);o.ranges[s]=!0;}for(const i of r)i(t,e);delete o.requests[s];}))),r.push(((o,a)=>{o?i(o):a&&i(null,{stack:t,id:e,glyph:a[e]||null});}));}),((t,e)=>{if(t)i(t);else if(e){const t={};for(const{stack:i,id:o,glyph:a}of e)(t[i]||(t[i]={}))[o]=a&&{id:a.id,bitmap:a.bitmap.clone(),metrics:a.metrics};i(null,t);}}));}_doesCharSupportLocalGlyph(e){return !!this.localIdeographFontFamily&&(t.unicodeBlockLookup["CJK Unified Ideographs"](e)||t.unicodeBlockLookup["Hangul Syllables"](e)||t.unicodeBlockLookup.Hiragana(e)||t.unicodeBlockLookup.Katakana(e))}_tinySDF(e,i,o){const a=this.localIdeographFontFamily;if(!a)return;if(!this._doesCharSupportLocalGlyph(o))return;let s=e.tinySDF;if(!s){let t="400";/bold/i.test(i)?t="900":/medium/i.test(i)?t="500":/light/i.test(i)&&(t="200"),s=e.tinySDF=new v.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:a,fontWeight:t});}return {id:o,bitmap:new t.AlphaImage({width:30,height:30},s.draw(String.fromCharCode(o)).data),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}}v.loadGlyphRange=function(e,i,o,a,s){const r=256*i,n=r+255,l=a.transformRequest(o.replace("{fontstack}",e).replace("{range}",`${r}-${n}`),t.ResourceType.Glyphs);t.getArrayBuffer(l,((e,i)=>{if(e)s(e);else if(i){const e={};for(const o of t.parseGlyphPBF(i))e[o.id]=o;s(null,e);}}));},v.TinySDF=class{constructor({fontSize:t=24,buffer:e=3,radius:i=8,cutoff:o=.25,fontFamily:a="sans-serif",fontWeight:s="normal",fontStyle:r="normal"}){this.buffer=e,this.cutoff=o,this.radius=i;const n=this.size=t+4*e,l=this._createCanvas(n),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${r} ${s} ${t}px ${a}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(n*n),this.gridInner=new Float64Array(n*n),this.f=new Float64Array(n),this.z=new Float64Array(n+1),this.v=new Uint16Array(n);}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){const{width:e,actualBoundingBoxAscent:i,actualBoundingBoxDescent:o,actualBoundingBoxLeft:a,actualBoundingBoxRight:s}=this.ctx.measureText(t),r=Math.floor(i),n=Math.min(this.size-this.buffer,Math.ceil(s-a)),l=Math.min(this.size-this.buffer,Math.ceil(i)+Math.ceil(o)),c=n+2*this.buffer,h=l+2*this.buffer,u=c*h,d=new Uint8ClampedArray(u),_={data:d,width:c,height:h,glyphWidth:n,glyphHeight:l,glyphTop:r,glyphLeft:0,glyphAdvance:e};if(0===n||0===l)return _;const{ctx:m,buffer:p,gridInner:x,gridOuter:v}=this;m.clearRect(p,p,n,l),m.fillText(t,p,p+r+1);const y=m.getImageData(p,p,n,l);v.fill(f,0,u),x.fill(0,0,u);for(let t=0;t<l;t++)for(let e=0;e<n;e++){const i=y.data[4*(t*n+e)+3]/255;if(0===i)continue;const o=(t+p)*c+e+p;if(1===i)v[o]=0,x[o]=f;else {const t=.5-i;v[o]=t>0?t*t:0,x[o]=t<0?t*t:0;}}g(v,0,0,c,h,c,this.f,this.v,this.z),g(x,p,p,n,l,c,this.f,this.v,this.z);for(let t=0;t<u;t++){const e=Math.sqrt(v[t])-Math.sqrt(x[t]);d[t]=Math.round(255-255*(e/this.radius+this.cutoff));}return _}};const y=new t.Properties({anchor:new t.DataConstantProperty(t.spec.light.anchor),position:new class{constructor(){this.specification=t.spec.light.position;}possiblyEvaluate(e,i){return t.sphericalToCartesian(e.expression.evaluate(i))}interpolate(e,i,o){return {x:t.number(e.x,i.x,o),y:t.number(e.y,i.y,o),z:t.number(e.z,i.z,o)}}},color:new t.DataConstantProperty(t.spec.light.color),intensity:new t.DataConstantProperty(t.spec.light.intensity)}),b="-transition";class w extends t.Evented{constructor(e){super(),this._transitionable=new t.Transitionable(y),this.setLight(e),this._transitioning=this._transitionable.untransitioned();}getLight(){return this._transitionable.serialize()}setLight(e,i={}){if(!this._validate(t.validateLight,e,i))for(const t in e){const i=e[t];t.endsWith(b)?this._transitionable.setTransition(t.slice(0,-b.length),i):this._transitionable.setValue(t,i);}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning);}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t);}_validate(e,i,o){return (!o||!1!==o.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:i,style:{glyphs:!0,sprite:!0},styleSpec:t.spec})))}}class T{constructor(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={};}getDash(t,e){const i=t.join(",")+String(e);return this.dashEntry[i]||(this.dashEntry[i]=this.addDash(t,e)),this.dashEntry[i]}getDashRanges(t,e,i){const o=[];let a=t.length%2==1?-t[t.length-1]*i:0,s=t[0]*i,r=!0;o.push({left:a,right:s,isDash:r,zeroLength:0===t[0]});let n=t[0];for(let e=1;e<t.length;e++){r=!r;const l=t[e];a=n*i,n+=l,s=n*i,o.push({left:a,right:s,isDash:r,zeroLength:0===l});}return o}addRoundDash(t,e,i){const o=e/2;for(let e=-i;e<=i;e++){const a=this.width*(this.nextRow+i+e);let s=0,r=t[s];for(let n=0;n<this.width;n++){n/r.right>1&&(r=t[++s]);const l=Math.abs(n-r.left),c=Math.abs(n-r.right),h=Math.min(l,c);let u;const d=e/i*(o+1);if(r.isDash){const t=o-Math.abs(d);u=Math.sqrt(h*h+t*t);}else u=o-Math.sqrt(h*h+d*d);this.data[a+n]=Math.max(0,Math.min(255,u+128));}}}addRegularDash(t){for(let e=t.length-1;e>=0;--e){const i=t[e],o=t[e+1];i.zeroLength?t.splice(e,1):o&&o.isDash===i.isDash&&(o.left=i.left,t.splice(e,1));}const e=t[0],i=t[t.length-1];e.isDash===i.isDash&&(e.left=i.left-this.width,i.right=e.right+this.width);const o=this.width*this.nextRow;let a=0,s=t[a];for(let e=0;e<this.width;e++){e/s.right>1&&(s=t[++a]);const i=Math.abs(e-s.left),r=Math.abs(e-s.right),n=Math.min(i,r);this.data[o+e]=Math.max(0,Math.min(255,(s.isDash?n:-n)+128));}}addDash(e,i){const o=i?7:0,a=2*o+1;if(this.nextRow+a>this.height)return t.warnOnce("LineAtlas out of space"),null;let s=0;for(let t=0;t<e.length;t++)s+=e[t];if(0!==s){const t=this.width/s,a=this.getDashRanges(e,this.width,t);i?this.addRoundDash(a,t,o):this.addRegularDash(a);}const r={y:(this.nextRow+o+.5)/this.height,height:2*o/this.height,width:s};return this.nextRow+=a,this.dirty=!0,r}bind(t){const e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.ALPHA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,this.width,this.height,0,e.ALPHA,e.UNSIGNED_BYTE,this.data));}}class E{constructor(e,i){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=t.uniqueId();const o=this.workerPool.acquire(this.id);for(let t=0;t<o.length;t++){const e=new E.Actor(o[t],i,this.id);e.name=`Worker ${t}`,this.actors.push(e);}}broadcast(e,i,o){t.asyncAll(this.actors,((t,o)=>{t.send(e,i,o);}),o=o||function(){});}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach((t=>{t.remove();})),this.actors=[],this.workerPool.release(this.id);}}function I(e,i,o){const a=function(i,a){if(i)return o(i);if(a){const i=t.pick(t.extend(a,e),["tiles","minzoom","maxzoom","attribution","maplibreLogo","bounds","scheme","tileSize","encoding"]);a.vector_layers&&(i.vectorLayers=a.vector_layers,i.vectorLayerIds=i.vectorLayers.map((t=>t.id))),o(null,i);}};return e.url?t.getJSON(i.transformRequest(e.url,t.ResourceType.Source),a):t.exported.frame((()=>a(null,e)))}E.Actor=t.Actor;class S{constructor(e,i,o){this.bounds=t.LngLatBounds.convert(this.validateBounds(e)),this.minzoom=i||0,this.maxzoom=o||24;}validateBounds(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(e){const i=Math.pow(2,e.z),o=Math.floor(t.mercatorXfromLng(this.bounds.getWest())*i),a=Math.floor(t.mercatorYfromLat(this.bounds.getNorth())*i),s=Math.ceil(t.mercatorXfromLng(this.bounds.getEast())*i),r=Math.ceil(t.mercatorYfromLat(this.bounds.getSouth())*i);return e.x>=o&&e.x<s&&e.y>=a&&e.y<r}}class C extends t.Evented{constructor(e,i,o,a){super(),this.id=e,this.dispatcher=o,this.setEventedParent(a),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.extend({type:"raster"},i),t.extend(this,t.pick(i,["url","scheme","tileSize"]));}load(){this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=I(this._options,this.map._requestManager,((e,i)=>{this._tileJSONRequest=null,this._loaded=!0,e?this.fire(new t.ErrorEvent(e)):i&&(t.extend(this,i),i.bounds&&(this.tileBounds=new S(i.bounds,this.minzoom,this.maxzoom)),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})));}));}loaded(){return this._loaded}onAdd(t){this.map=t,this.load();}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null);}serialize(){return t.extend({},this._options)}hasTile(t){return !this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(e,i){const o=e.tileID.canonical.url(this.tiles,this.scheme);e.request=t.getImage(this.map._requestManager.transformRequest(o,t.ResourceType.Tile),((o,a)=>{if(delete e.request,e.aborted)e.state="unloaded",i(null);else if(o)e.state="errored",i(o);else if(a){this.map._refreshExpiredTiles&&e.setExpiryData(a),delete a.cacheControl,delete a.expires;const o=this.map.painter.context,s=o.gl;e.texture=this.map.painter.getTileTexture(a.width),e.texture?e.texture.update(a,{useMipmap:!0}):(e.texture=new _(o,a,s.RGBA,{useMipmap:!0}),e.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),o.extTextureFilterAnisotropic&&s.texParameterf(s.TEXTURE_2D,o.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,o.extTextureFilterAnisotropicMax)),e.state="loaded",t.cacheEntryPossiblyAdded(this.dispatcher),i(null);}}));}abortTile(t,e){t.request&&(t.request.cancel(),delete t.request),e();}unloadTile(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e();}hasTransition(){return !1}}let P;var z=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class D extends t.Evented{constructor(t,e,i,o){super(),this.id=t,this.dispatcher=i,this.coordinates=e.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(o),this.options=e;}load(e,i){this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),((o,a)=>{this._loaded=!0,o?this.fire(new t.ErrorEvent(o)):a&&(this.image=a,e&&(this.coordinates=e),i&&i(),this._finishLoading());}));}loaded(){return this._loaded}updateImage(t){return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(()=>{this.texture=null;})),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})));}onAdd(t){this.map=t,this.load();}setCoordinates(e){this.coordinates=e;const i=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){let i=1/0,o=1/0,a=-1/0,s=-1/0;for(const t of e)i=Math.min(i,t.x),o=Math.min(o,t.y),a=Math.max(a,t.x),s=Math.max(s,t.y);const r=Math.max(a-i,s-o),n=Math.max(0,Math.floor(-Math.log(r)/Math.LN2)),l=Math.pow(2,n);return new t.CanonicalTileID(n,Math.floor((i+a)/2*l),Math.floor((o+s)/2*l))}(i),this.minzoom=this.maxzoom=this.tileID.z;const o=i.map((t=>this.tileID.getTilePoint(t)._round()));return this._boundsArray=new t.RasterBoundsArray,this._boundsArray.emplaceBack(o[0].x,o[0].y,0,0),this._boundsArray.emplaceBack(o[1].x,o[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(o[3].x,o[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(o[2].x,o[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const e=this.map.painter.context,i=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,z.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new _(e,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture);}}loadTile(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null));}serialize(){return {type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return !1}}const A={vector:class extends t.Evented{constructor(e,i,o,a){if(super(),this.id=e,this.dispatcher=o,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.extend(this,t.pick(i,["url","scheme","tileSize","promoteId"])),this._options=t.extend({type:"vector"},i),this._collectResourceTiming=i.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(a);}load(){this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=I(this._options,this.map._requestManager,((e,i)=>{this._tileJSONRequest=null,this._loaded=!0,e?this.fire(new t.ErrorEvent(e)):i&&(t.extend(this,i),i.bounds&&(this.tileBounds=new S(i.bounds,this.minzoom,this.maxzoom)),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})));}));}loaded(){return this._loaded}hasTile(t){return !this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load();}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.map.style.sourceCaches[this.id].clearTiles(),this.load();}setTiles(t){return this.setSourceProperty((()=>{this._options.tiles=t;})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t;})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null);}serialize(){return t.extend({},this._options)}loadTile(e,i){const o=e.tileID.canonical.url(this.tiles,this.scheme),a={request:this.map._requestManager.transformRequest(o,t.ResourceType.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function s(o,a){return delete e.request,e.aborted?i(null):o&&404!==o.status?i(o):(a&&a.resourceTiming&&(e.resourceTiming=a.resourceTiming),this.map._refreshExpiredTiles&&a&&e.setExpiryData(a),e.loadVectorData(a,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),i(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}a.request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state?"loading"===e.state?e.reloadCallback=i:e.request=e.actor.send("reloadTile",a,s.bind(this)):(e.actor=this.dispatcher.getActor(),e.request=e.actor.send("loadTile",a,s.bind(this)));}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0);}unloadTile(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0);}hasTransition(){return !1}},raster:C,"raster-dem":class extends C{constructor(e,i,o,a){super(e,i,o,a),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},i),this.encoding=i.encoding||"mapbox";}serialize(){return {type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}}loadTile(e,i){const o=e.tileID.canonical.url(this.tiles,this.scheme);function a(t,o){t&&(e.state="errored",i(t)),o&&(e.dem=o,e.needsHillshadePrepare=!0,e.state="loaded",i(null));}e.request=t.getImage(this.map._requestManager.transformRequest(o,t.ResourceType.Tile),function(o,s){if(delete e.request,e.aborted)e.state="unloaded",i(null);else if(o)e.state="errored",i(o);else if(s){this.map._refreshExpiredTiles&&e.setExpiryData(s),delete s.cacheControl,delete s.expires;const i=t.isImageBitmap(s)&&(null==P&&(P="undefined"!=typeof OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),P)?s:t.exported.getImageData(s,1),o={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:i,encoding:this.encoding};e.actor&&"expired"!==e.state||(e.actor=this.dispatcher.getActor(),e.actor.send("loadDEMTile",o,a.bind(this)));}}.bind(this)),e.neighboringTiles=this._getNeighboringTiles(e.tileID);}_getNeighboringTiles(e){const i=e.canonical,o=Math.pow(2,i.z),a=(i.x-1+o)%o,s=0===i.x?e.wrap-1:e.wrap,r=(i.x+1+o)%o,n=i.x+1===o?e.wrap+1:e.wrap,l={};return l[new t.OverscaledTileID(e.overscaledZ,s,i.z,a,i.y).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,n,i.z,r,i.y).key]={backfilled:!1},i.y>0&&(l[new t.OverscaledTileID(e.overscaledZ,s,i.z,a,i.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,n,i.z,r,i.y-1).key]={backfilled:!1}),i.y+1<o&&(l[new t.OverscaledTileID(e.overscaledZ,s,i.z,a,i.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,n,i.z,r,i.y+1).key]={backfilled:!1}),l}unloadTile(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id});}},geojson:class extends t.Evented{constructor(e,i,o,a){super(),this.id=e,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=o.getActor(),this.setEventedParent(a),this._data=i.data,this._options=t.extend({},i),this._collectResourceTiming=i.collectResourceTiming,void 0!==i.maxzoom&&(this.maxzoom=i.maxzoom),i.type&&(this.type=i.type),i.attribution&&(this.attribution=i.attribution),this.promoteId=i.promoteId;const s=t.EXTENT/this.tileSize;this.workerOptions=t.extend({source:this.id,cluster:i.cluster||!1,geojsonVtOptions:{buffer:(void 0!==i.buffer?i.buffer:128)*s,tolerance:(void 0!==i.tolerance?i.tolerance:.375)*s,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1,generateId:i.generateId||!1},superclusterOptions:{maxZoom:void 0!==i.clusterMaxZoom?i.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,i.clusterMinPoints||2),extent:t.EXTENT,radius:(i.clusterRadius||50)*s,log:!1,generateId:i.generateId||!1},clusterProperties:i.clusterProperties,filter:i.filter},i.workerOptions);}load(){this._updateWorkerData("metadata");}onAdd(t){this.map=t,this.load();}setData(t){return this._data=t,this._updateWorkerData("content"),this}getClusterExpansionZoom(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this}getClusterChildren(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this}getClusterLeaves(t,e,i,o){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:i},o),this}_updateWorkerData(e){const i=t.extend({},this.workerOptions),o=this._data;"string"==typeof o?(i.request=this.map._requestManager.transformRequest(t.exported.resolveURL(o),t.ResourceType.Source),i.request.collectResourceTiming=this._collectResourceTiming):i.data=JSON.stringify(o),this._pendingLoads++,this.fire(new t.Event("dataloading",{dataType:"source"})),this.actor.send(`${this.type}.loadData`,i,((o,a)=>{if(this._pendingLoads--,this._removed||a&&a.abandoned)return;let s=null;if(a&&a.resourceTiming&&a.resourceTiming[this.id]&&(s=a.resourceTiming[this.id].slice(0)),this.actor.send(`${this.type}.coalesce`,{source:i.source},null),o)return void this.fire(new t.ErrorEvent(o));const r={dataType:"source",sourceDataType:e};this._collectResourceTiming&&s&&s.length>0&&t.extend(r,{resourceTiming:s}),this.fire(new t.Event("data",r));}));}loaded(){return 0===this._pendingLoads}loadTile(t,e){const i=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const o={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.request=this.actor.send(i,o,((o,a)=>(delete t.request,t.unloadVectorData(),t.aborted?e(null):o?e(o):(t.loadVectorData(a,this.map.painter,"reloadTile"===i),e(null)))));}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0;}unloadTile(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id});}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id});}serialize(){return t.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return !1}},video:class extends D{constructor(t,e,i,o){super(t,e,i,o),this.roundZoom=!0,this.type="video",this.options=e;}load(){this._loaded=!1;const e=this.options;this.urls=[];for(const i of e.urls)this.urls.push(this.map._requestManager.transformRequest(i,t.ResourceType.Source).url);t.getVideo(this.urls,((e,i)=>{this._loaded=!0,e?this.fire(new t.ErrorEvent(e)):i&&(this.video=i,this.video.loop=!0,this.video.addEventListener("playing",(()=>{this.map.triggerRepaint();})),this.map&&this.video.play(),this._finishLoading());}));}pause(){this.video&&this.video.pause();}play(){this.video&&this.video.play();}seek(e){if(this.video){const i=this.video.seekable;e<i.start(0)||e>i.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${i.start(0)} and ${i.end(0)}-second mark.`))):this.video.currentTime=e;}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)));}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const e=this.map.painter.context,i=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,z.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new _(e,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture);}}serialize(){return {type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:D,canvas:class extends D{constructor(e,i,o,a){super(e,i,o,a),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some((t=>!Array.isArray(t)||2!==t.length||t.some((t=>"number"!=typeof t))))||this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError(`sources.${e}`,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate;}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint();},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1);},this._finishLoading());}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play();}onRemove(){this.pause();}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const i=this.map.painter.context,o=i.gl;this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,z.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new _(i,this.canvas,o.RGBA,{premultiply:!0});for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture);}}serialize(){return {type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of [this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return !0;return !1}}};function L(e,i){const o=t.create();return t.translate(o,o,[1,1,0]),t.scale(o,o,[.5*e.width,.5*e.height,1]),t.multiply(o,o,e.calculatePosMatrix(i.toUnwrapped()))}function M(t,e,i,o,a,s){const r=function(t,e,i){if(t)for(const o of t){const t=e[o];if(t&&t.source===i&&"fill-extrusion"===t.type)return !0}else for(const t in e){const o=e[t];if(o.source===i&&"fill-extrusion"===o.type)return !0}return !1}(a&&a.layers,e,t.id),n=s.maxPitchScaleFactor(),l=t.tilesIn(o,n,r);l.sort(R);const c=[];for(const o of l)c.push({wrappedTileID:o.tileID.wrapped().key,queryResults:o.tile.queryRenderedFeatures(e,i,t._state,o.queryGeometry,o.cameraQueryGeometry,o.scale,a,s,n,L(t.transform,o.tileID))});const h=function(t){const e={},i={};for(const o of t){const t=o.queryResults,a=o.wrappedTileID,s=i[a]=i[a]||{};for(const i in t){const o=t[i],a=s[i]=s[i]||{},r=e[i]=e[i]||[];for(const t of o)a[t.featureIndex]||(a[t.featureIndex]=!0,r.push(t));}}return e}(c);for(const e in h)h[e].forEach((e=>{const i=e.feature,o=t.getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=o;}));return h}function R(t,e){const i=t.tileID,o=e.tileID;return i.overscaledZ-o.overscaledZ||i.canonical.y-o.canonical.y||i.wrap-o.wrap||i.canonical.x-o.canonical.x}class k{constructor(e,i){this.tileID=e,this.uid=t.uniqueId(),this.uses=0,this.tileSize=i,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading";}registerFadeDuration(e){const i=e+this.timeAdded;i<t.exported.now()||this.fadeEndTime&&i<this.fadeEndTime||(this.fadeEndTime=i);}wasRequested(){return "errored"===this.state||"loaded"===this.state||"reloading"===this.state}loadVectorData(e,i,o){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=function(t,e){const i={};if(!e)return i;for(const o of t){const t=o.layerIds.map((t=>e.getLayer(t))).filter(Boolean);if(0!==t.length){o.layers=t,o.stateDependentLayerIds&&(o.stateDependentLayers=o.stateDependentLayerIds.map((e=>t.filter((t=>t.id===e))[0])));for(const e of t)i[e.id]=o;}}return i}(e.buckets,i.style),this.hasSymbolBuckets=!1;for(const e in this.buckets){const i=this.buckets[e];if(i instanceof t.SymbolBucket){if(this.hasSymbolBuckets=!0,!o)break;i.justReloaded=!0;}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const e in this.buckets){const i=this.buckets[e];if(i instanceof t.SymbolBucket&&i.hasRTLText){this.hasRTLText=!0,t.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(const t in this.buckets){const e=this.buckets[t];this.queryPadding=Math.max(this.queryPadding,i.style.getLayer(t).queryRadius(e));}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage);}else this.collisionBoxArray=new t.CollisionBoxArray;}unloadVectorData(){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded";}getBucket(t){return this.buckets[t.id]}upload(t){for(const e in this.buckets){const i=this.buckets[e];i.uploadPending()&&i.upload(t);}const e=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new _(t,this.imageAtlas.image,e.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new _(t,this.glyphAtlasImage,e.ALPHA),this.glyphAtlasImage=null);}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture);}queryRenderedFeatures(t,e,i,o,a,s,r,n,l,c){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:o,cameraQueryGeometry:a,scale:s,tileSize:this.tileSize,pixelPosMatrix:c,transform:n,params:r,queryPadding:this.queryPadding*l},t,e,i):{}}querySourceFeatures(e,i){const o=this.latestFeatureIndex;if(!o||!o.rawTileData)return;const a=o.loadVTLayers(),s=i?i.sourceLayer:"",r=a._geojsonTileLayer||a[s];if(!r)return;const n=t.createFilter(i&&i.filter),{z:l,x:c,y:h}=this.tileID.canonical,u={z:l,x:c,y:h};for(let i=0;i<r.length;i++){const a=r.feature(i);if(n.needGeometry){const e=t.toEvaluationFeature(a,!0);if(!n.filter(new t.EvaluationParameters(this.tileID.overscaledZ),e,this.tileID.canonical))continue}else if(!n.filter(new t.EvaluationParameters(this.tileID.overscaledZ),a))continue;const d=o.getId(a,s),_=new t.GeoJSONFeature(a,l,c,h,d);_.tile=u,e.push(_);}}hasData(){return "loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){const i=this.expirationTime;if(e.cacheControl){const i=t.parseCacheControl(e.cacheControl);i["max-age"]&&(this.expirationTime=Date.now()+1e3*i["max-age"]);}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){const t=Date.now();let e=!1;if(this.expirationTime>t)e=!1;else if(i)if(this.expirationTime<i)e=!0;else {const o=this.expirationTime-i;o?this.expirationTime=t+Math.max(o,3e4):e=!0;}else e=!0;e?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0;}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)}setFeatureState(t,e){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(t).length)return;const i=this.latestFeatureIndex.loadVTLayers();for(const o in this.buckets){if(!e.style.hasLayer(o))continue;const a=this.buckets[o],s=a.layers[0].sourceLayer||"_geojsonTileLayer",r=i[s],n=t[s];if(!r||!n||0===Object.keys(n).length)continue;a.update(n,r,this.imageAtlas&&this.imageAtlas.patternPositions||{});const l=e&&e.style&&e.style.getLayer(o);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(a)));}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return !this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<t.exported.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0;}setHoldDuration(e){this.symbolFadeHoldUntil=t.exported.now()+e;}setDependencies(t,e){const i={};for(const t of e)i[t]=!0;this.dependencies[t]=i;}hasDependency(t,e){for(const i of t){const t=this.dependencies[i];if(t)for(const i of e)if(t[i])return !0}return !1}}class B{constructor(t,e){this.max=t,this.onRemove=e,this.reset();}reset(){for(const t in this.data)for(const e of this.data[t])e.timeout&&clearTimeout(e.timeout),this.onRemove(e.value);return this.data={},this.order=[],this}add(t,e,i){const o=t.wrapped().key;void 0===this.data[o]&&(this.data[o]=[]);const a={value:e,timeout:void 0};if(void 0!==i&&(a.timeout=setTimeout((()=>{this.remove(t,a);}),i)),this.data[o].push(a),this.order.push(o),this.order.length>this.max){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t);}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){const e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value}getByKey(t){const e=this.data[t];return e?e[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,e){if(!this.has(t))return this;const i=t.wrapped().key,o=void 0===e?0:this.data[i].indexOf(e),a=this.data[i][o];return this.data[i].splice(o,1),a.timeout&&clearTimeout(a.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(a.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t);}return this}filter(t){const e=[];for(const i in this.data)for(const o of this.data[i])t(o.value)||e.push(o);for(const t of e)this.remove(t.value.tileID,t);}}class F{constructor(){this.state={},this.stateChanges={},this.deletedStates={};}updateState(e,i,o){const a=String(i);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][a]=this.stateChanges[e][a]||{},t.extend(this.stateChanges[e][a],o),null===this.deletedStates[e]){this.deletedStates[e]={};for(const t in this.state[e])t!==a&&(this.deletedStates[e][t]=null);}else if(this.deletedStates[e]&&null===this.deletedStates[e][a]){this.deletedStates[e][a]={};for(const t in this.state[e][a])o[t]||(this.deletedStates[e][a][t]=null);}else for(const t in o)this.deletedStates[e]&&this.deletedStates[e][a]&&null===this.deletedStates[e][a][t]&&delete this.deletedStates[e][a][t];}removeFeatureState(t,e,i){if(null===this.deletedStates[t])return;const o=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},i&&void 0!==e)null!==this.deletedStates[t][o]&&(this.deletedStates[t][o]=this.deletedStates[t][o]||{},this.deletedStates[t][o][i]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][o])for(i in this.deletedStates[t][o]={},this.stateChanges[t][o])this.deletedStates[t][o][i]=null;else this.deletedStates[t][o]=null;else this.deletedStates[t]=null;}getState(e,i){const o=String(i),a=t.extend({},(this.state[e]||{})[o],(this.stateChanges[e]||{})[o]);if(null===this.deletedStates[e])return {};if(this.deletedStates[e]){const t=this.deletedStates[e][i];if(null===t)return {};for(const e in t)delete a[e];}return a}initializeTileState(t,e){t.setFeatureState(this.state,e);}coalesceChanges(e,i){const o={};for(const e in this.stateChanges){this.state[e]=this.state[e]||{};const i={};for(const o in this.stateChanges[e])this.state[e][o]||(this.state[e][o]={}),t.extend(this.state[e][o],this.stateChanges[e][o]),i[o]=this.state[e][o];o[e]=i;}for(const e in this.deletedStates){this.state[e]=this.state[e]||{};const i={};if(null===this.deletedStates[e])for(const t in this.state[e])i[t]={},this.state[e][t]={};else for(const t in this.deletedStates[e]){if(null===this.deletedStates[e][t])this.state[e][t]={};else for(const i of Object.keys(this.deletedStates[e][t]))delete this.state[e][t][i];i[t]=this.state[e][t];}o[e]=o[e]||{},t.extend(o[e],i);}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(o).length)for(const t in e)e[t].setFeatureState(o,i);}}class O extends t.Evented{constructor(e,i,o){super(),this.id=e,this.dispatcher=o,this.on("data",(t=>{"source"===t.dataType&&"metadata"===t.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform));})),this.on("error",(()=>{this._sourceErrored=!0;})),this._source=function(e,i,o,a){const s=new A[i.type](e,i,o,a);if(s.id!==e)throw new Error(`Expected Source id to be ${e} instead of ${s.id}`);return t.bindAll(["load","abort","unload","serialize","prepare"],s),s}(e,i,o,this),this._tiles={},this._cache=new B(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new F;}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t);}onRemove(t){this._source&&this._source.onRemove&&this._source.onRemove(t);}loaded(){if(this._sourceErrored)return !0;if(!this._sourceLoaded)return !1;if(!this._source.loaded())return !1;for(const t in this._tiles){const e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return !1}return !0}getSource(){return this._source}pause(){this._paused=!0;}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform);}_loadTile(t,e){return this._source.loadTile(t,e)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,(()=>{}))}_abortTile(t){if(this._source.abortTile)return this._source.abortTile(t,(()=>{}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const e in this._tiles){const i=this._tiles[e];i.upload(t),i.prepare(this.map.style.imageManager);}}getIds(){return Object.values(this._tiles).map((t=>t.tileID)).sort(U).map((t=>t.key))}getRenderableIds(e){const i=[];for(const t in this._tiles)this._isIdRenderable(t,e)&&i.push(this._tiles[t]);return e?i.sort(((e,i)=>{const o=e.tileID,a=i.tileID,s=new t.pointGeometry(o.canonical.x,o.canonical.y)._rotate(this.transform.angle),r=new t.pointGeometry(a.canonical.x,a.canonical.y)._rotate(this.transform.angle);return o.overscaledZ-a.overscaledZ||r.y-s.y||r.x-s.x})).map((t=>t.tileID.key)):i.map((t=>t.tileID)).sort(U).map((t=>t.key))}hasRenderableParent(t){const e=this.findLoadedParent(t,0);return !!e&&this._isIdRenderable(e.tileID.key)}_isIdRenderable(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else {this._cache.reset();for(const t in this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading");}}_reloadTile(t,e){const i=this._tiles[t];i&&("loading"!==i.state&&(i.state=e),this._loadTile(i,this._tileLoaded.bind(this,i,t,e)));}_tileLoaded(e,i,o,a){if(a)return e.state="errored",void(404!==a.status?this._source.fire(new t.ErrorEvent(a,{tile:e})):this.update(this.transform));e.timeAdded=t.exported.now(),"expired"===o&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(i,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:e,coord:e.tileID}));}_backfillDEM(t){const e=this.getRenderableIds();for(let o=0;o<e.length;o++){const a=e[o];if(t.neighboringTiles&&t.neighboringTiles[a]){const e=this.getTileByID(a);i(t,e),i(e,t);}}function i(t,e){t.needsHillshadePrepare=!0;let i=e.tileID.canonical.x-t.tileID.canonical.x;const o=e.tileID.canonical.y-t.tileID.canonical.y,a=Math.pow(2,t.tileID.canonical.z),s=e.tileID.key;0===i&&0===o||Math.abs(o)>1||(Math.abs(i)>1&&(1===Math.abs(i+a)?i+=a:1===Math.abs(i-a)&&(i-=a)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,i,o),t.neighboringTiles&&t.neighboringTiles[s]&&(t.neighboringTiles[s].backfilled=!0)));}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,e,i,o){for(const a in this._tiles){let s=this._tiles[a];if(o[a]||!s.hasData()||s.tileID.overscaledZ<=e||s.tileID.overscaledZ>i)continue;let r=s.tileID;for(;s&&s.tileID.overscaledZ>e+1;){const t=s.tileID.scaledTo(s.tileID.overscaledZ-1);s=this._tiles[t.key],s&&s.hasData()&&(r=t);}let n=r;for(;n.overscaledZ>e;)if(n=n.scaledTo(n.overscaledZ-1),t[n.key]){o[r.key]=r;break}}}findLoadedParent(t,e){if(t.key in this._loadedParentTiles){const i=this._loadedParentTiles[t.key];return i&&i.tileID.overscaledZ>=e?i:null}for(let i=t.overscaledZ-1;i>=e;i--){const e=t.scaledTo(i),o=this._getLoadedTile(e);if(o)return o}}_getLoadedTile(t){const e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const e=Math.ceil(t.width/this._source.tileSize)+1,i=Math.ceil(t.height/this._source.tileSize)+1,o=Math.floor(e*i*5),a="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,o):o;this._cache.setMaxSize(a);}handleWrapJump(t){const e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){const t={};for(const i in this._tiles){const o=this._tiles[i];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+e),t[o.tileID.key]=o;}this._tiles=t;for(const t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(const t in this._tiles)this._setTileReloadTimer(t,this._tiles[t]);}}update(e){if(this.transform=e,!this._sourceLoaded||this._paused)return;let i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((e=>new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y))):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((t=>this._source.hasTile(t))))):i=[];const o=e.coveringZoomLevel(this._source),a=Math.max(o-O.maxOverzooming,this._source.minzoom),s=Math.max(o+O.maxUnderzooming,this._source.minzoom),r=this._updateRetainedTiles(i,o);if(N(this._source.type)){const e={},i={},n=Object.keys(r);for(const o of n){const s=r[o],n=this._tiles[o];if(!n||n.fadeEndTime&&n.fadeEndTime<=t.exported.now())continue;const l=this.findLoadedParent(s,a);l&&(this._addTile(l.tileID),e[l.tileID.key]=l.tileID),i[o]=s;}this._retainLoadedChildren(i,o,s,r);for(const t in e)r[t]||(this._coveredTiles[t]=!0,r[t]=e[t]);}for(const t in r)this._tiles[t].clearFadeHold();const n=t.keysDifference(this._tiles,r);for(const t of n){const e=this._tiles[t];e.hasSymbolBuckets&&!e.holdingForFade()?e.setHoldDuration(this.map._fadeDuration):e.hasSymbolBuckets&&!e.symbolFadeFinished()||this._removeTile(t);}this._updateLoadedParentTileCache();}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t);}_updateRetainedTiles(t,e){const i={},o={},a=Math.max(e-O.maxOverzooming,this._source.minzoom),s=Math.max(e+O.maxUnderzooming,this._source.minzoom),r={};for(const o of t){const t=this._addTile(o);i[o.key]=o,t.hasData()||e<this._source.maxzoom&&(r[o.key]=o);}this._retainLoadedChildren(r,e,s,i);for(const s of t){let t=this._tiles[s.key];if(t.hasData())continue;if(e+1>this._source.maxzoom){const t=s.children(this._source.maxzoom)[0],e=this.getTile(t);if(e&&e.hasData()){i[t.key]=t;continue}}else {const t=s.children(this._source.maxzoom);if(i[t[0].key]&&i[t[1].key]&&i[t[2].key]&&i[t[3].key])continue}let r=t.wasRequested();for(let e=s.overscaledZ-1;e>=a;--e){const a=s.scaledTo(e);if(o[a.key])break;if(o[a.key]=!0,t=this.getTile(a),!t&&r&&(t=this._addTile(a)),t&&(i[a.key]=a,r=t.wasRequested(),t.hasData()))break}}return i}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const e=[];let i,o=this._tiles[t].tileID;for(;o.overscaledZ>0;){if(o.key in this._loadedParentTiles){i=this._loadedParentTiles[o.key];break}e.push(o.key);const t=o.scaledTo(o.overscaledZ-1);if(i=this._getLoadedTile(t),i)break;o=t;}for(const t of e)this._loadedParentTiles[t]=i;}}_addTile(e){let i=this._tiles[e.key];if(i)return i;i=this._cache.getAndRemove(e),i&&(this._setTileReloadTimer(e.key,i),i.tileID=e,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,i)));const o=i;return i||(i=new k(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(i,this._tileLoaded.bind(this,i,e.key,i.state))),i.uses++,this._tiles[e.key]=i,o||this._source.fire(new t.Event("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i}_setTileReloadTimer(t,e){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const i=e.getExpiryTimeout();i&&(this._timers[t]=setTimeout((()=>{this._reloadTile(t,"expired"),delete this._timers[t];}),i));}_removeTile(t){const e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))));}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(t);this._cache.reset();}tilesIn(e,i,o){const a=[],s=this.transform;if(!s)return a;const r=o?s.getCameraQueryGeometry(e):e,n=e.map((t=>s.pointCoordinate(t))),l=r.map((t=>s.pointCoordinate(t))),c=this.getIds();let h=1/0,u=1/0,d=-1/0,_=-1/0;for(const t of l)h=Math.min(h,t.x),u=Math.min(u,t.y),d=Math.max(d,t.x),_=Math.max(_,t.y);for(let e=0;e<c.length;e++){const o=this._tiles[c[e]];if(o.holdingForFade())continue;const r=o.tileID,m=Math.pow(2,s.zoom-o.tileID.overscaledZ),p=i*o.queryPadding*t.EXTENT/o.tileSize/m,f=[r.getTilePoint(new t.MercatorCoordinate(h,u)),r.getTilePoint(new t.MercatorCoordinate(d,_))];if(f[0].x-p<t.EXTENT&&f[0].y-p<t.EXTENT&&f[1].x+p>=0&&f[1].y+p>=0){const t=n.map((t=>r.getTilePoint(t))),e=l.map((t=>r.getTilePoint(t)));a.push({tile:o,tileID:r,queryGeometry:t,cameraQueryGeometry:e,scale:m});}}return a}getVisibleCoordinates(t){const e=this.getRenderableIds(t).map((t=>this._tiles[t].tileID));for(const t of e)t.posMatrix=this.transform.calculatePosMatrix(t.toUnwrapped());return e}hasTransition(){if(this._source.hasTransition())return !0;if(N(this._source.type))for(const e in this._tiles){const i=this._tiles[e];if(void 0!==i.fadeEndTime&&i.fadeEndTime>=t.exported.now())return !0}return !1}setFeatureState(t,e,i){this._state.updateState(t=t||"_geojsonTileLayer",e,i);}removeFeatureState(t,e,i){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,i);}getFeatureState(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)}setDependencies(t,e,i){const o=this._tiles[t];o&&o.setDependencies(e,i);}reloadTilesForDependencies(t,e){for(const i in this._tiles)this._tiles[i].hasDependency(t,e)&&this._reloadTile(i,"reloading");this._cache.filter((i=>!i.hasDependency(t,e)));}}function U(t,e){const i=Math.abs(2*t.wrap)-+(t.wrap<0),o=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||o-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function N(t){return "raster"===t||"image"===t||"video"===t}O.maxOverzooming=10,O.maxUnderzooming=3;const G="mapboxgl_preloaded_worker_pool";class Z{constructor(){this.active={};}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<Z.workerCount;)this.workers.push(new Worker(_a.workerUrl));return this.active[t]=!0,this.workers.slice()}release(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach((t=>{t.terminate();})),this.workers=null);}isPreloaded(){return !!this.active[G]}numActive(){return Object.keys(this.active).length}}const q=Math.floor(t.exported.hardwareConcurrency/2);let V;function j(){return V||(V=new Z),V}function $(e,i){const o={};for(const t in e)"ref"!==t&&(o[t]=e[t]);return t.refProperties.forEach((t=>{t in i&&(o[t]=i[t]);})),o}function W(t){t=t.slice();const e=Object.create(null);for(let i=0;i<t.length;i++)e[t[i].id]=t[i];for(let i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=$(t[i],e[t[i].ref]));return t}Z.workerCount=Math.max(Math.min(q,6),1);const X={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function H(t,e,i){i.push({command:X.addSource,args:[t,e[t]]});}function K(t,e,i){e.push({command:X.removeSource,args:[t]}),i[t]=!0;}function Y(t,e,i,o){K(t,i,o),H(t,e,i);}function J(t,e,i){let o;for(o in t[i])if(Object.prototype.hasOwnProperty.call(t[i],o)&&"data"!==o&&!a(t[i][o],e[i][o]))return !1;for(o in e[i])if(Object.prototype.hasOwnProperty.call(e[i],o)&&"data"!==o&&!a(t[i][o],e[i][o]))return !1;return !0}function Q(t,e,i,o,s,r){let n;for(n in e=e||{},t=t||{})Object.prototype.hasOwnProperty.call(t,n)&&(a(t[n],e[n])||i.push({command:r,args:[o,n,e[n],s]}));for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&!Object.prototype.hasOwnProperty.call(t,n)&&(a(t[n],e[n])||i.push({command:r,args:[o,n,e[n],s]}));}function tt(t){return t.id}function et(t,e){return t[e.id]=e,t}class it{constructor(t,e){this.reset(t,e);}reset(t,e){this.points=t||[],this._distances=[0];for(let t=1;t<this.points.length;t++)this._distances[t]=this._distances[t-1]+this.points[t].dist(this.points[t-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(e||0,.5*this.length),this.paddedLength=this.length-2*this.padding;}lerp(e){if(1===this.points.length)return this.points[0];e=t.clamp(e,0,1);let i=1,o=this._distances[i];const a=e*this.paddedLength+this.padding;for(;o<a&&i<this._distances.length;)o=this._distances[++i];const s=i-1,r=this._distances[s],n=o-r,l=n>0?(a-r)/n:0;return this.points[s].mult(1-l).add(this.points[i].mult(l))}}class ot{constructor(t,e,i){const o=this.boxCells=[],a=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(e/i);for(let t=0;t<this.xCellCount*this.yCellCount;t++)o.push([]),a.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0;}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,e,i,o,a){this._forEachCell(e,i,o,a,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(o),this.bboxes.push(a);}insertCircle(t,e,i,o){this._forEachCell(e-o,i-o,e+o,i+o,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(i),this.circles.push(o);}_insertBoxCell(t,e,i,o,a,s){this.boxCells[a].push(s);}_insertCircleCell(t,e,i,o,a,s){this.circleCells[a].push(s);}_query(t,e,i,o,a,s){if(i<0||t>this.width||o<0||e>this.height)return [];const r=[];if(t<=0&&e<=0&&this.width<=i&&this.height<=o){if(a)return [{key:null,x1:t,y1:e,x2:i,y2:o}];for(let t=0;t<this.boxKeys.length;t++)r.push({key:this.boxKeys[t],x1:this.bboxes[4*t],y1:this.bboxes[4*t+1],x2:this.bboxes[4*t+2],y2:this.bboxes[4*t+3]});for(let t=0;t<this.circleKeys.length;t++){const e=this.circles[3*t],i=this.circles[3*t+1],o=this.circles[3*t+2];r.push({key:this.circleKeys[t],x1:e-o,y1:i-o,x2:e+o,y2:i+o});}}else this._forEachCell(t,e,i,o,this._queryCell,r,{hitTest:a,seenUids:{box:{},circle:{}}},s);return r}query(t,e,i,o){return this._query(t,e,i,o,!1,null)}hitTest(t,e,i,o,a){return this._query(t,e,i,o,!0,a).length>0}hitTestCircle(t,e,i,o){const a=t-i,s=t+i,r=e-i,n=e+i;if(s<0||a>this.width||n<0||r>this.height)return !1;const l=[];return this._forEachCell(a,r,s,n,this._queryCellCircle,l,{hitTest:!0,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}},o),l.length>0}_queryCell(t,e,i,o,a,s,r,n){const{seenUids:l,hitTest:c}=r,h=this.boxCells[a];if(null!==h){const a=this.bboxes;for(const r of h)if(!l.box[r]){l.box[r]=!0;const h=4*r,u=this.boxKeys[r];if(t<=a[h+2]&&e<=a[h+3]&&i>=a[h+0]&&o>=a[h+1]&&(!n||n(u))&&(s.push({key:u,x1:a[h],y1:a[h+1],x2:a[h+2],y2:a[h+3]}),c))return !0}}const u=this.circleCells[a];if(null!==u){const a=this.circles;for(const r of u)if(!l.circle[r]){l.circle[r]=!0;const h=3*r,u=this.circleKeys[r];if(this._circleAndRectCollide(a[h],a[h+1],a[h+2],t,e,i,o)&&(!n||n(u))){const t=a[h],e=a[h+1],i=a[h+2];if(s.push({key:u,x1:t-i,y1:e-i,x2:t+i,y2:e+i}),c)return !0}}}return !1}_queryCellCircle(t,e,i,o,a,s,r,n){const{circle:l,seenUids:c}=r,h=this.boxCells[a];if(null!==h){const t=this.bboxes;for(const e of h)if(!c.box[e]){c.box[e]=!0;const i=4*e,o=this.boxKeys[e];if(this._circleAndRectCollide(l.x,l.y,l.radius,t[i+0],t[i+1],t[i+2],t[i+3])&&(!n||n(o)))return s.push(!0),!0}}const u=this.circleCells[a];if(null!==u){const t=this.circles;for(const e of u)if(!c.circle[e]){c.circle[e]=!0;const i=3*e,o=this.circleKeys[e];if(this._circlesCollide(t[i],t[i+1],t[i+2],l.x,l.y,l.radius)&&(!n||n(o)))return s.push(!0),!0}}}_forEachCell(t,e,i,o,a,s,r,n){const l=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),h=this._convertToXCellCoord(i),u=this._convertToYCellCoord(o);for(let d=l;d<=h;d++)for(let l=c;l<=u;l++)if(a.call(this,t,e,i,o,this.xCellCount*l+d,s,r,n))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,e,i,o,a,s){const r=o-t,n=a-e,l=i+s;return l*l>r*r+n*n}_circleAndRectCollide(t,e,i,o,a,s,r){const n=(s-o)/2,l=Math.abs(t-(o+n));if(l>n+i)return !1;const c=(r-a)/2,h=Math.abs(e-(a+c));if(h>c+i)return !1;if(l<=n||h<=c)return !0;const u=l-n,d=h-c;return u*u+d*d<=i*i}}function at(e,i,o,a,s){const r=t.create();return i?(t.scale(r,r,[1/s,1/s,1]),o||t.rotateZ(r,r,a.angle)):t.multiply(r,a.labelPlaneMatrix,e),r}function st(e,i,o,a,s){if(i){const i=t.clone(e);return t.scale(i,i,[s,s,1]),o||t.rotateZ(i,i,-a.angle),i}return a.glCoordMatrix}function rt(e,i){const o=t.fromValues(e.x,e.y,0,1);gt(o,o,i);const a=o[3];return {point:new t.pointGeometry(o[0]/a,o[1]/a),signedDistanceFromCamera:a}}function nt(t,e){return .5+t/e*.5}function lt(t,e){const i=t[0]/t[3],o=t[1]/t[3];return i>=-e[0]&&i<=e[0]&&o>=-e[1]&&o<=e[1]}function ct(e,i,o,a,s,r,n,l,c){const h=a?e.textSizeData:e.iconSizeData,u=t.evaluateSizeForZoom(h,o.transform.zoom),d=[256/o.width*2+1,256/o.height*2+1],_=a?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;_.clear();const m=e.lineVertexArray,p=a?e.text.placedSymbolArray:e.icon.placedSymbolArray,f=o.transform.width/o.transform.height;let g=!1;for(let a=0;a<p.length;a++){const x=p.get(a);if(x.hidden||x.writingMode===t.WritingMode.vertical&&!g){ft(x.numGlyphs,_);continue}g=!1;const v=t.fromValues(x.anchorX,x.anchorY,0,1);if(t.transformMat4(v,v,i),!lt(v,d)){ft(x.numGlyphs,_);continue}const y=nt(o.transform.cameraToCenterDistance,v[3]),b=t.evaluateSizeForFeature(h,u,x),w=n?b/y:b*y,T=new t.pointGeometry(x.anchorX,x.anchorY),E=rt(T,s).point,I={},S=dt(x,w,!1,l,i,s,r,e.glyphOffsetArray,m,_,E,T,I,f,c);g=S.useVertical,(S.notEnoughRoom||g||S.needsFlipping&&dt(x,w,!0,l,i,s,r,e.glyphOffsetArray,m,_,E,T,I,f,c).notEnoughRoom)&&ft(x.numGlyphs,_);}a?e.text.dynamicLayoutVertexBuffer.updateData(_):e.icon.dynamicLayoutVertexBuffer.updateData(_);}function ht(t,e,i,o,a,s,r,n,l,c,h,u){const d=n.glyphStartIndex+n.numGlyphs,_=n.lineStartIndex,m=n.lineStartIndex+n.lineLength,p=e.getoffsetX(n.glyphStartIndex),f=e.getoffsetX(d-1),g=mt(t*p,i,o,a,s,r,n.segment,_,m,l,c,h,u);if(!g)return null;const x=mt(t*f,i,o,a,s,r,n.segment,_,m,l,c,h,u);return x?{first:g,last:x}:null}function ut(e,i,o,a){return e===t.WritingMode.horizontal&&Math.abs(o.y-i.y)>Math.abs(o.x-i.x)*a?{useVertical:!0}:(e===t.WritingMode.vertical?i.y<o.y:i.x>o.x)?{needsFlipping:!0}:null}function dt(e,i,o,a,s,r,n,l,c,h,u,d,_,m,p){const f=i/24,g=e.lineOffsetX*f,x=e.lineOffsetY*f;let v;if(e.numGlyphs>1){const t=e.glyphStartIndex+e.numGlyphs,i=e.lineStartIndex,s=e.lineStartIndex+e.lineLength,h=ht(f,l,g,x,o,u,d,e,c,r,_,p);if(!h)return {notEnoughRoom:!0};const y=rt(h.first.point,n).point,b=rt(h.last.point,n).point;if(a&&!o){const t=ut(e.writingMode,y,b,m);if(t)return t}v=[h.first];for(let a=e.glyphStartIndex+1;a<t-1;a++)v.push(mt(f*l.getoffsetX(a),g,x,o,u,d,e.segment,i,s,c,r,_,p));v.push(h.last);}else {if(a&&!o){const i=rt(d,s).point,o=e.lineStartIndex+e.segment+1,a=new t.pointGeometry(c.getx(o),c.gety(o)),r=rt(a,s),n=r.signedDistanceFromCamera>0?r.point:_t(d,a,i,1,s),l=ut(e.writingMode,i,n,m);if(l)return l}const i=mt(f*l.getoffsetX(e.glyphStartIndex),g,x,o,u,d,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,r,_,p);if(!i)return {notEnoughRoom:!0};v=[i];}for(const e of v)t.addDynamicAttributes(h,e.point,e.angle);return {}}function _t(t,e,i,o,a){const s=rt(t.add(t.sub(e)._unit()),a).point,r=i.sub(s);return i.add(r._mult(o/r.mag()))}function mt(e,i,o,a,s,r,n,l,c,h,u,d,_){const m=a?e-i:e+i;let p=m>0?1:-1,f=0;a&&(p*=-1,f=Math.PI),p<0&&(f+=Math.PI);let g=p>0?l+n:l+n+1,x=s,v=s,y=0,b=0;const w=Math.abs(m),T=[];for(;y+b<=w;){if(g+=p,g<l||g>=c)return null;if(v=x,T.push(x),x=d[g],void 0===x){const e=new t.pointGeometry(h.getx(g),h.gety(g)),i=rt(e,u);if(i.signedDistanceFromCamera>0)x=d[g]=i.point;else {const i=g-p;x=_t(0===y?r:new t.pointGeometry(h.getx(i),h.gety(i)),e,v,w-y+1,u);}}y+=b,b=v.dist(x);}const E=(w-y)/b,I=x.sub(v),S=I.mult(E)._add(v);S._add(I._unit()._perp()._mult(o*p));const C=f+Math.atan2(x.y-v.y,x.x-v.x);return T.push(S),{point:S,angle:_?C:0,path:T}}const pt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ft(t,e){for(let i=0;i<t;i++){const t=e.length;e.resize(t+4),e.float32.set(pt,3*t);}}function gt(t,e,i){const o=e[0],a=e[1];return t[0]=i[0]*o+i[4]*a+i[12],t[1]=i[1]*o+i[5]*a+i[13],t[3]=i[3]*o+i[7]*a+i[15],t}const xt=100;class vt{constructor(t,e=new ot(t.width+200,t.height+200,25),i=new ot(t.width+200,t.height+200,25)){this.transform=t,this.grid=e,this.ignoredGrid=i,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+xt,this.screenBottomBoundary=t.height+xt,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200;}placeCollisionBox(t,e,i,o,a){const s=this.projectAndGetPerspectiveRatio(o,t.anchorPointX,t.anchorPointY),r=i*s.perspectiveRatio,n=t.x1*r+s.point.x,l=t.y1*r+s.point.y,c=t.x2*r+s.point.x,h=t.y2*r+s.point.y;return !this.isInsideGrid(n,l,c,h)||!e&&this.grid.hitTest(n,l,c,h,a)?{box:[],offscreen:!1}:{box:[n,l,c,h],offscreen:this.isOffscreen(n,l,c,h)}}placeCollisionCircles(e,i,o,a,s,r,n,l,c,h,u,d,_){const m=[],p=new t.pointGeometry(i.anchorX,i.anchorY),f=rt(p,r),g=nt(this.transform.cameraToCenterDistance,f.signedDistanceFromCamera),x=(h?s/g:s*g)/t.ONE_EM,v=rt(p,n).point,y=ht(x,a,i.lineOffsetX*x,i.lineOffsetY*x,!1,v,p,i,o,n,{},!1);let b=!1,w=!1,T=!0;if(y){const i=.5*d*g+_,o=new t.pointGeometry(-100,-100),a=new t.pointGeometry(this.screenRightBoundary,this.screenBottomBoundary),s=new it,r=y.first,n=y.last;let h=[];for(let t=r.path.length-1;t>=1;t--)h.push(r.path[t]);for(let t=1;t<n.path.length;t++)h.push(n.path[t]);const p=2.5*i;if(l){const t=h.map((t=>rt(t,l)));h=t.some((t=>t.signedDistanceFromCamera<=0))?[]:t.map((t=>t.point));}let f=[];if(h.length>0){const e=h[0].clone(),i=h[0].clone();for(let t=1;t<h.length;t++)e.x=Math.min(e.x,h[t].x),e.y=Math.min(e.y,h[t].y),i.x=Math.max(i.x,h[t].x),i.y=Math.max(i.y,h[t].y);f=e.x>=o.x&&i.x<=a.x&&e.y>=o.y&&i.y<=a.y?[h]:i.x<o.x||e.x>a.x||i.y<o.y||e.y>a.y?[]:t.clipLine([h],o.x,o.y,a.x,a.y);}for(const t of f){s.reset(t,.25*i);let o=0;o=s.length<=.5*i?1:Math.ceil(s.paddedLength/p)+1;for(let t=0;t<o;t++){const a=t/Math.max(o-1,1),r=s.lerp(a),n=r.x+xt,l=r.y+xt;m.push(n,l,i,0);const h=n-i,d=l-i,_=n+i,p=l+i;if(T=T&&this.isOffscreen(h,d,_,p),w=w||this.isInsideGrid(h,d,_,p),!e&&this.grid.hitTestCircle(n,l,i,u)&&(b=!0,!c))return {circles:[],offscreen:!1,collisionDetected:b}}}}return {circles:!c&&b||!w?[]:m,offscreen:T,collisionDetected:b}}queryRenderedSymbols(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return {};const i=[];let o=1/0,a=1/0,s=-1/0,r=-1/0;for(const n of e){const e=new t.pointGeometry(n.x+xt,n.y+xt);o=Math.min(o,e.x),a=Math.min(a,e.y),s=Math.max(s,e.x),r=Math.max(r,e.y),i.push(e);}const n=this.grid.query(o,a,s,r).concat(this.ignoredGrid.query(o,a,s,r)),l={},c={};for(const e of n){const o=e.key;if(void 0===l[o.bucketInstanceId]&&(l[o.bucketInstanceId]={}),l[o.bucketInstanceId][o.featureIndex])continue;const a=[new t.pointGeometry(e.x1,e.y1),new t.pointGeometry(e.x2,e.y1),new t.pointGeometry(e.x2,e.y2),new t.pointGeometry(e.x1,e.y2)];t.polygonIntersectsPolygon(i,a)&&(l[o.bucketInstanceId][o.featureIndex]=!0,void 0===c[o.bucketInstanceId]&&(c[o.bucketInstanceId]=[]),c[o.bucketInstanceId].push(o.featureIndex));}return c}insertCollisionBox(t,e,i,o,a){(e?this.ignoredGrid:this.grid).insert({bucketInstanceId:i,featureIndex:o,collisionGroupID:a},t[0],t[1],t[2],t[3]);}insertCollisionCircles(t,e,i,o,a){const s=e?this.ignoredGrid:this.grid,r={bucketInstanceId:i,featureIndex:o,collisionGroupID:a};for(let e=0;e<t.length;e+=4)s.insertCircle(r,t[e],t[e+1],t[e+2]);}projectAndGetPerspectiveRatio(e,i,o){const a=t.fromValues(i,o,0,1);return gt(a,a,e),{point:new t.pointGeometry((a[0]/a[3]+1)/2*this.transform.width+xt,(-a[1]/a[3]+1)/2*this.transform.height+xt),perspectiveRatio:.5+this.transform.cameraToCenterDistance/a[3]*.5}}isOffscreen(t,e,i,o){return i<xt||t>=this.screenRightBoundary||o<xt||e>this.screenBottomBoundary}isInsideGrid(t,e,i,o){return i>=0&&t<this.gridRightBoundary&&o>=0&&e<this.gridBottomBoundary}getViewportMatrix(){const e=t.identity([]);return t.translate(e,e,[-100,-100,0]),e}}function yt(e,i,o){return i*(t.EXTENT/(e.tileSize*Math.pow(2,o-e.tileID.overscaledZ)))}class bt{constructor(t,e,i,o){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):o&&i?1:0,this.placed=i;}isHidden(){return 0===this.opacity&&!this.placed}}class wt{constructor(t,e,i,o,a){this.text=new bt(t?t.text:null,e,i,a),this.icon=new bt(t?t.icon:null,e,o,a);}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Tt{constructor(t,e,i){this.text=t,this.icon=e,this.skipFade=i;}}class Et{constructor(){this.invProjMatrix=t.create(),this.viewportMatrix=t.create(),this.circles=[];}}class It{constructor(t,e,i,o,a){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=i,this.bucketIndex=o,this.tileID=a;}}class St{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={};}get(t){if(this.crossSourceCollisions)return {ID:0,predicate:null};if(!this.collisionGroups[t]){const e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:t=>t.collisionGroupID===e};}return this.collisionGroups[t]}}function Ct(e,i,o,a,s){const{horizontalAlign:r,verticalAlign:n}=t.getAnchorAlignment(e),l=-(r-.5)*i,c=-(n-.5)*o,h=t.evaluateVariableOffset(e,a);return new t.pointGeometry(l+h[0]*s,c+h[1]*s)}function Pt(e,i,o,a,s,r){const{x1:n,x2:l,y1:c,y2:h,anchorPointX:u,anchorPointY:d}=e,_=new t.pointGeometry(i,o);return a&&_._rotate(s?r:-r),{x1:n+_.x,y1:c+_.y,x2:l+_.x,y2:h+_.y,anchorPointX:u,anchorPointY:d}}class zt{constructor(t,e,i,o){this.transform=t.clone(),this.collisionIndex=new vt(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new St(i),this.collisionCircleArrays={},this.prevPlacement=o,o&&(o.prevPlacement=void 0),this.placedOrientations={};}getBucketParts(e,i,o,a){const s=o.getBucket(i),r=o.latestFeatureIndex;if(!s||!r||i.id!==s.layerIds[0])return;const n=o.collisionBoxArray,l=s.layers[0].layout,c=Math.pow(2,this.transform.zoom-o.tileID.overscaledZ),h=o.tileSize/t.EXTENT,u=this.transform.calculatePosMatrix(o.tileID.toUnwrapped()),d="map"===l.get("text-pitch-alignment"),_="map"===l.get("text-rotation-alignment"),m=yt(o,1,this.transform.zoom),p=at(u,d,_,this.transform,m);let f=null;if(d){const e=st(u,d,_,this.transform,m);f=t.multiply([],this.transform.labelPlaneMatrix,e);}this.retainedQueryData[s.bucketInstanceId]=new It(s.bucketInstanceId,r,s.sourceLayerIndex,s.index,o.tileID);const g={bucket:s,layout:l,posMatrix:u,textLabelPlaneMatrix:p,labelToScreenMatrix:f,scale:c,textPixelRatio:h,holdingForFade:o.holdingForFade(),collisionBoxArray:n,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(s.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(s.sourceID)};if(a)for(const t of s.sortKeyRanges){const{sortKey:i,symbolInstanceStart:o,symbolInstanceEnd:a}=t;e.push({sortKey:i,symbolInstanceStart:o,symbolInstanceEnd:a,parameters:g});}else e.push({symbolInstanceStart:0,symbolInstanceEnd:s.symbolInstances.length,parameters:g});}attemptAnchorPlacement(t,e,i,o,a,s,r,n,l,c,h,u,d,_,m){const p=[u.textOffset0,u.textOffset1],f=Ct(t,i,o,p,a),g=this.collisionIndex.placeCollisionBox(Pt(e,f.x,f.y,s,r,this.transform.angle),h,n,l,c.predicate);if((!m||0!==this.collisionIndex.placeCollisionBox(Pt(m,f.x,f.y,s,r,this.transform.angle),h,n,l,c.predicate).box.length)&&g.box.length>0){let e;return this.prevPlacement&&this.prevPlacement.variableOffsets[u.crossTileID]&&this.prevPlacement.placements[u.crossTileID]&&this.prevPlacement.placements[u.crossTileID].text&&(e=this.prevPlacement.variableOffsets[u.crossTileID].anchor),this.variableOffsets[u.crossTileID]={textOffset:p,width:i,height:o,anchor:t,textBoxScale:a,prevAnchor:e},this.markUsedJustification(d,t,u,_),d.allowVerticalPlacement&&(this.markUsedOrientation(d,_,u),this.placedOrientations[u.crossTileID]=_),{shift:f,placedGlyphBoxes:g}}}placeLayerBucketPart(e,i,o){const{bucket:a,layout:s,posMatrix:r,textLabelPlaneMatrix:n,labelToScreenMatrix:l,textPixelRatio:c,holdingForFade:h,collisionBoxArray:u,partiallyEvaluatedTextSize:d,collisionGroup:_}=e.parameters,m=s.get("text-optional"),p=s.get("icon-optional"),f=s.get("text-allow-overlap"),g=s.get("icon-allow-overlap"),x="map"===s.get("text-rotation-alignment"),v="map"===s.get("text-pitch-alignment"),y="none"!==s.get("icon-text-fit"),b="viewport-y"===s.get("symbol-z-order"),w=f&&(g||!a.hasIconData()||p),T=g&&(f||!a.hasTextData()||m);!a.collisionArrays&&u&&a.deserializeCollisionBoxes(u);const E=(e,u)=>{if(i[e.crossTileID])return;if(h)return void(this.placements[e.crossTileID]=new Tt(!1,!1,!1));let b=!1,E=!1,I=!0,S=null,C={box:null,offscreen:null},P={box:null,offscreen:null},z=null,D=null,A=null,L=0,M=0,R=0;u.textFeatureIndex?L=u.textFeatureIndex:e.useRuntimeCollisionCircles&&(L=e.featureIndex),u.verticalTextFeatureIndex&&(M=u.verticalTextFeatureIndex);const k=u.textBox;if(k){const i=i=>{let o=t.WritingMode.horizontal;if(a.allowVerticalPlacement&&!i&&this.prevPlacement){const t=this.prevPlacement.placedOrientations[e.crossTileID];t&&(this.placedOrientations[e.crossTileID]=t,o=t,this.markUsedOrientation(a,o,e));}return o},o=(i,o)=>{if(a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&u.verticalTextBox){for(const e of a.writingModes)if(e===t.WritingMode.vertical?(C=o(),P=C):C=i(),C&&C.box&&C.box.length)break}else C=i();};if(s.get("text-variable-anchor")){let n=s.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[e.crossTileID]){const t=this.prevPlacement.variableOffsets[e.crossTileID];n.indexOf(t.anchor)>0&&(n=n.filter((e=>e!==t.anchor)),n.unshift(t.anchor));}const l=(t,i,o)=>{const s=t.x2-t.x1,l=t.y2-t.y1,h=e.textBoxScale,u=y&&!g?i:null;let d={box:[],offscreen:!1};const m=f?2*n.length:n.length;for(let i=0;i<m;++i){const m=this.attemptAnchorPlacement(n[i%n.length],t,s,l,h,x,v,c,r,_,i>=n.length,e,a,o,u);if(m&&(d=m.placedGlyphBoxes,d&&d.box&&d.box.length)){b=!0,S=m.shift;break}}return d};o((()=>l(k,u.iconBox,t.WritingMode.horizontal)),(()=>{const i=u.verticalTextBox;return a.allowVerticalPlacement&&!(C&&C.box&&C.box.length)&&e.numVerticalGlyphVertices>0&&i?l(i,u.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),C&&(b=C.box,I=C.offscreen);const h=i(C&&C.box);if(!b&&this.prevPlacement){const t=this.prevPlacement.variableOffsets[e.crossTileID];t&&(this.variableOffsets[e.crossTileID]=t,this.markUsedJustification(a,t.anchor,e,h));}}else {const s=(t,i)=>{const o=this.collisionIndex.placeCollisionBox(t,f,c,r,_.predicate);return o&&o.box&&o.box.length&&(this.markUsedOrientation(a,i,e),this.placedOrientations[e.crossTileID]=i),o};o((()=>s(k,t.WritingMode.horizontal)),(()=>{const i=u.verticalTextBox;return a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&i?s(i,t.WritingMode.vertical):{box:null,offscreen:null}})),i(C&&C.box&&C.box.length);}}if(z=C,b=z&&z.box&&z.box.length>0,I=z&&z.offscreen,e.useRuntimeCollisionCircles){const i=a.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),c=t.evaluateSizeForFeature(a.textSizeData,d,i),h=s.get("text-padding");D=this.collisionIndex.placeCollisionCircles(f,i,a.lineVertexArray,a.glyphOffsetArray,c,r,n,l,o,v,_.predicate,e.collisionCircleDiameter,h),b=f||D.circles.length>0&&!D.collisionDetected,I=I&&D.offscreen;}if(u.iconFeatureIndex&&(R=u.iconFeatureIndex),u.iconBox){const t=t=>{const e=y&&S?Pt(t,S.x,S.y,x,v,this.transform.angle):t;return this.collisionIndex.placeCollisionBox(e,g,c,r,_.predicate)};P&&P.box&&P.box.length&&u.verticalIconBox?(A=t(u.verticalIconBox),E=A.box.length>0):(A=t(u.iconBox),E=A.box.length>0),I=I&&A.offscreen;}const B=m||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,F=p||0===e.numIconVertices;if(B||F?F?B||(E=E&&b):b=E&&b:E=b=E&&b,b&&z&&z.box&&this.collisionIndex.insertCollisionBox(z.box,s.get("text-ignore-placement"),a.bucketInstanceId,P&&P.box&&M?M:L,_.ID),E&&A&&this.collisionIndex.insertCollisionBox(A.box,s.get("icon-ignore-placement"),a.bucketInstanceId,R,_.ID),D&&(b&&this.collisionIndex.insertCollisionCircles(D.circles,s.get("text-ignore-placement"),a.bucketInstanceId,L,_.ID),o)){const t=a.bucketInstanceId;let e=this.collisionCircleArrays[t];void 0===e&&(e=this.collisionCircleArrays[t]=new Et);for(let t=0;t<D.circles.length;t+=4)e.circles.push(D.circles[t+0]),e.circles.push(D.circles[t+1]),e.circles.push(D.circles[t+2]),e.circles.push(D.collisionDetected?1:0);}this.placements[e.crossTileID]=new Tt(b||w,E||T,I||a.justReloaded),i[e.crossTileID]=!0;};if(b){const t=a.getSortedSymbolIndexes(this.transform.angle);for(let e=t.length-1;e>=0;--e){const i=t[e];E(a.symbolInstances.get(i),a.collisionArrays[i]);}}else for(let t=e.symbolInstanceStart;t<e.symbolInstanceEnd;t++)E(a.symbolInstances.get(t),a.collisionArrays[t]);if(o&&a.bucketInstanceId in this.collisionCircleArrays){const e=this.collisionCircleArrays[a.bucketInstanceId];t.invert(e.invProjMatrix,r),e.viewportMatrix=this.collisionIndex.getViewportMatrix();}a.justReloaded=!1;}markUsedJustification(e,i,o,a){let s;s=a===t.WritingMode.vertical?o.verticalPlacedTextSymbolIndex:{left:o.leftJustifiedTextSymbolIndex,center:o.centerJustifiedTextSymbolIndex,right:o.rightJustifiedTextSymbolIndex}[t.getAnchorJustification(i)];const r=[o.leftJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.rightJustifiedTextSymbolIndex,o.verticalPlacedTextSymbolIndex];for(const t of r)t>=0&&(e.text.placedSymbolArray.get(t).crossTileID=s>=0&&t!==s?0:o.crossTileID);}markUsedOrientation(e,i,o){const a=i===t.WritingMode.horizontal||i===t.WritingMode.horizontalOnly?i:0,s=i===t.WritingMode.vertical?i:0,r=[o.leftJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.rightJustifiedTextSymbolIndex];for(const t of r)e.text.placedSymbolArray.get(t).placedOrientation=a;o.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).placedOrientation=s);}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const e=this.prevPlacement;let i=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;const o=e?e.symbolFadeChange(t):1,a=e?e.opacities:{},s=e?e.variableOffsets:{},r=e?e.placedOrientations:{};for(const t in this.placements){const e=this.placements[t],s=a[t];s?(this.opacities[t]=new wt(s,o,e.text,e.icon),i=i||e.text!==s.text.placed||e.icon!==s.icon.placed):(this.opacities[t]=new wt(null,o,e.text,e.icon,e.skipFade),i=i||e.text||e.icon);}for(const t in a){const e=a[t];if(!this.opacities[t]){const a=new wt(e,o,!1,!1);a.isHidden()||(this.opacities[t]=a,i=i||e.text.placed||e.icon.placed);}}for(const t in s)this.variableOffsets[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.variableOffsets[t]=s[t]);for(const t in r)this.placedOrientations[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.placedOrientations[t]=r[t]);i?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t);}updateLayerOpacities(t,e){const i={};for(const o of e){const e=o.getBucket(t);e&&o.latestFeatureIndex&&t.id===e.layerIds[0]&&this.updateBucketOpacities(e,i,o.collisionBoxArray);}}updateBucketOpacities(e,i,o){e.hasTextData()&&e.text.opacityVertexArray.clear(),e.hasIconData()&&e.icon.opacityVertexArray.clear(),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();const a=e.layers[0].layout,s=new wt(null,0,!1,!1,!0),r=a.get("text-allow-overlap"),n=a.get("icon-allow-overlap"),l=a.get("text-variable-anchor"),c="map"===a.get("text-rotation-alignment"),h="map"===a.get("text-pitch-alignment"),u="none"!==a.get("icon-text-fit"),d=new wt(null,0,r&&(n||!e.hasIconData()||a.get("icon-optional")),n&&(r||!e.hasTextData()||a.get("text-optional")),!0);!e.collisionArrays&&o&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(o);const _=(t,e,i)=>{for(let o=0;o<e/4;o++)t.opacityVertexArray.emplaceBack(i);};for(let o=0;o<e.symbolInstances.length;o++){const a=e.symbolInstances.get(o),{numHorizontalGlyphVertices:r,numVerticalGlyphVertices:n,crossTileID:m}=a;let p=this.opacities[m];i[m]?p=s:p||(p=d,this.opacities[m]=p),i[m]=!0;const f=a.numIconVertices>0,g=this.placedOrientations[a.crossTileID],x=g===t.WritingMode.vertical,v=g===t.WritingMode.horizontal||g===t.WritingMode.horizontalOnly;if(r>0||n>0){const t=Ot(p.text);_(e.text,r,x?Ut:t),_(e.text,n,v?Ut:t);const i=p.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((t=>{t>=0&&(e.text.placedSymbolArray.get(t).hidden=i||x?1:0);})),a.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=i||v?1:0);const o=this.variableOffsets[a.crossTileID];o&&this.markUsedJustification(e,o.anchor,a,g);const s=this.placedOrientations[a.crossTileID];s&&(this.markUsedJustification(e,"left",a,s),this.markUsedOrientation(e,s,a));}if(f){const t=Ot(p.icon),i=!(u&&a.verticalPlacedIconSymbolIndex&&x);a.placedIconSymbolIndex>=0&&(_(e.icon,a.numIconVertices,i?t:Ut),e.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=p.icon.isHidden()),a.verticalPlacedIconSymbolIndex>=0&&(_(e.icon,a.numVerticalIconVertices,i?Ut:t),e.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=p.icon.isHidden());}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){const i=e.collisionArrays[o];if(i){let o=new t.pointGeometry(0,0);if(i.textBox||i.verticalTextBox){let t=!0;if(l){const e=this.variableOffsets[m];e?(o=Ct(e.anchor,e.width,e.height,e.textOffset,e.textBoxScale),c&&o._rotate(h?this.transform.angle:-this.transform.angle)):t=!1;}i.textBox&&Dt(e.textCollisionBox.collisionVertexArray,p.text.placed,!t||x,o.x,o.y),i.verticalTextBox&&Dt(e.textCollisionBox.collisionVertexArray,p.text.placed,!t||v,o.x,o.y);}const a=Boolean(!v&&i.verticalIconBox);i.iconBox&&Dt(e.iconCollisionBox.collisionVertexArray,p.icon.placed,a,u?o.x:0,u?o.y:0),i.verticalIconBox&&Dt(e.iconCollisionBox.collisionVertexArray,p.icon.placed,!a,u?o.x:0,u?o.y:0);}}}if(e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.bucketInstanceId in this.collisionCircleArrays){const t=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=t.invProjMatrix,e.placementViewportMatrix=t.viewportMatrix,e.collisionCircleArray=t.circles,delete this.collisionCircleArrays[e.bucketInstanceId];}}symbolFadeChange(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(t,e){const i=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*i>t}setStale(){this.stale=!0;}}function Dt(t,e,i,o,a){t.emplaceBack(e?1:0,i?1:0,o||0,a||0),t.emplaceBack(e?1:0,i?1:0,o||0,a||0),t.emplaceBack(e?1:0,i?1:0,o||0,a||0),t.emplaceBack(e?1:0,i?1:0,o||0,a||0);}const At=Math.pow(2,25),Lt=Math.pow(2,24),Mt=Math.pow(2,17),Rt=Math.pow(2,16),kt=Math.pow(2,9),Bt=Math.pow(2,8),Ft=Math.pow(2,1);function Ot(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;const e=t.placed?1:0,i=Math.floor(127*t.opacity);return i*At+e*Lt+i*Mt+e*Rt+i*kt+e*Bt+i*Ft+e}const Ut=0;class Nt{constructor(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[];}continuePlacement(t,e,i,o,a){const s=this._bucketParts;for(;this._currentTileIndex<t.length;)if(e.getBucketParts(s,o,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,a())return !0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,s.sort(((t,e)=>t.sortKey-e.sortKey)));this._currentPartIndex<s.length;)if(e.placeLayerBucketPart(s[this._currentPartIndex],this._seenCrossTileIDs,i),this._currentPartIndex++,a())return !0;return !1}}class Gt{constructor(t,e,i,o,a,s,r){this.placement=new zt(t,a,s,r),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=i,this._showCollisionBoxes=o,this._done=!1;}isDone(){return this._done}continuePlacement(e,i,o){const a=t.exported.now(),s=()=>{const e=t.exported.now()-a;return !this._forceFullPlacement&&e>2};for(;this._currentPlacementIndex>=0;){const t=i[e[this._currentPlacementIndex]],a=this.placement.collisionIndex.transform.zoom;if("symbol"===t.type&&(!t.minzoom||t.minzoom<=a)&&(!t.maxzoom||t.maxzoom>a)){if(this._inProgressLayer||(this._inProgressLayer=new Nt(t)),this._inProgressLayer.continuePlacement(o[t.source],this.placement,this._showCollisionBoxes,t,s))return;delete this._inProgressLayer;}this._currentPlacementIndex--;}this._done=!0;}commit(t){return this.placement.commit(t),this.placement}}const Zt=512/t.EXTENT/2;class qt{constructor(t,e,i){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=i;for(let i=0;i<e.length;i++){const o=e.get(i),a=o.key;this.indexedSymbolInstances[a]||(this.indexedSymbolInstances[a]=[]),this.indexedSymbolInstances[a].push({crossTileID:o.crossTileID,coord:this.getScaledCoordinates(o,t)});}}getScaledCoordinates(e,i){const o=Zt/Math.pow(2,i.canonical.z-this.tileID.canonical.z);return {x:Math.floor((i.canonical.x*t.EXTENT+e.anchorX)*o),y:Math.floor((i.canonical.y*t.EXTENT+e.anchorY)*o)}}findMatches(t,e,i){const o=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z);for(let a=0;a<t.length;a++){const s=t.get(a);if(s.crossTileID)continue;const r=this.indexedSymbolInstances[s.key];if(!r)continue;const n=this.getScaledCoordinates(s,e);for(const t of r)if(Math.abs(t.coord.x-n.x)<=o&&Math.abs(t.coord.y-n.y)<=o&&!i[t.crossTileID]){i[t.crossTileID]=!0,s.crossTileID=t.crossTileID;break}}}}class Vt{constructor(){this.maxCrossTileID=0;}generate(){return ++this.maxCrossTileID}}class jt{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0;}handleWrapJump(t){const e=Math.round((t-this.lng)/360);if(0!==e)for(const t in this.indexes){const i=this.indexes[t],o={};for(const t in i){const a=i[t];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+e),o[a.tileID.key]=a;}this.indexes[t]=o;}this.lng=t;}addBucket(t,e,i){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return !1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key]);}for(let t=0;t<e.symbolInstances.length;t++)e.symbolInstances.get(t).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});const o=this.usedCrossTileIDs[t.overscaledZ];for(const i in this.indexes){const a=this.indexes[i];if(Number(i)>t.overscaledZ)for(const i in a){const s=a[i];s.tileID.isChildOf(t)&&s.findMatches(e.symbolInstances,t,o);}else {const s=a[t.scaledTo(Number(i)).key];s&&s.findMatches(e.symbolInstances,t,o);}}for(let t=0;t<e.symbolInstances.length;t++){const a=e.symbolInstances.get(t);a.crossTileID||(a.crossTileID=i.generate(),o[a.crossTileID]=!0);}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new qt(t,e.symbolInstances,e.bucketInstanceId),!0}removeBucketCrossTileIDs(t,e){for(const i in e.indexedSymbolInstances)for(const o of e.indexedSymbolInstances[i])delete this.usedCrossTileIDs[t][o.crossTileID];}removeStaleBuckets(t){let e=!1;for(const i in this.indexes){const o=this.indexes[i];for(const a in o)t[o[a].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,o[a]),delete o[a],e=!0);}return e}}class $t{constructor(){this.layerIndexes={},this.crossTileIDs=new Vt,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={};}addLayer(t,e,i){let o=this.layerIndexes[t.id];void 0===o&&(o=this.layerIndexes[t.id]=new jt);let a=!1;const s={};o.handleWrapJump(i);for(const i of e){const e=i.getBucket(t);e&&t.id===e.layerIds[0]&&(e.bucketInstanceId||(e.bucketInstanceId=++this.maxBucketInstanceId),o.addBucket(i.tileID,e,this.crossTileIDs)&&(a=!0),s[e.bucketInstanceId]=!0);}return o.removeStaleBuckets(s)&&(a=!0),a}pruneUnusedLayers(t){const e={};t.forEach((t=>{e[t]=!0;}));for(const t in this.layerIndexes)e[t]||delete this.layerIndexes[t];}}const Wt=(e,i)=>t.emitValidationErrors(e,i&&i.filter((t=>"source.canvas"!==t.identifier))),Xt=t.pick(X,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Ht=t.pick(X,["setCenter","setZoom","setBearing","setPitch"]),Kt=function(){const e={},i=t.spec.$version;for(const o in t.spec.$root){const a=t.spec.$root[o];if(a.required){let t=null;t="version"===o?i:"array"===a.type?[]:{},null!=t&&(e[o]=t);}}return e}();class Yt extends t.Evented{constructor(e,i={}){super(),this.map=e,this.dispatcher=new E(j(),this),this.imageManager=new p,this.imageManager.setEventedParent(this),this.glyphManager=new v(e._requestManager,i.localIdeographFontFamily),this.lineAtlas=new T(256,512),this.crossTileSymbolIndex=new $t,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",t.getReferrer());const o=this;this._rtlTextPluginCallback=Yt.registerForPluginStateChange((e=>{o.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:e.pluginStatus,pluginURL:e.pluginURL},((e,i)=>{if(t.triggerPluginCompletionEvent(e),i&&i.every((t=>t)))for(const t in o.sourceCaches)o.sourceCaches[t].reload();}));})),this.on("data",(t=>{if("source"!==t.dataType||"metadata"!==t.sourceDataType)return;const e=this.sourceCaches[t.sourceId];if(!e)return;const i=e.getSource();if(i&&i.vectorLayerIds)for(const t in this._layers){const e=this._layers[t];e.source===i.id&&this._validateLayer(e);}}));}loadURL(e,i={}){this.fire(new t.Event("dataloading",{dataType:"style"}));const o="boolean"!=typeof i.validate||i.validate,a=this.map._requestManager.transformRequest(e,t.ResourceType.Style);this._request=t.getJSON(a,((e,i)=>{this._request=null,e?this.fire(new t.ErrorEvent(e)):i&&this._load(i,o);}));}loadJSON(e,i={}){this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.exported.frame((()=>{this._request=null,this._load(e,!1!==i.validate);}));}loadEmpty(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(Kt,!1);}_load(e,i){if(i&&Wt(this,t.validateStyle(e)))return;this._loaded=!0,this.stylesheet=e;for(const t in e.sources)this.addSource(t,e.sources[t],{validate:!1});e.sprite?this._loadSprite(e.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);const o=W(this.stylesheet.layers);this._order=o.map((t=>t.id)),this._layers={},this._serializedLayers={};for(let e of o)e=t.createStyleLayer(e),e.setEventedParent(this,{layer:{id:e.id}}),this._layers[e.id]=e,this._serializedLayers[e.id]=e.serialize();this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new w(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"));}_loadSprite(e){this._spriteRequest=function(e,i,o){let a,s,r;const n=devicePixelRatio>1?"@2x":"";let l=t.getJSON(i.transformRequest(i.normalizeSpriteURL(e,n,".json"),t.ResourceType.SpriteJSON),((t,e)=>{l=null,r||(r=t,a=e,h());})),c=t.getImage(i.transformRequest(i.normalizeSpriteURL(e,n,".png"),t.ResourceType.SpriteImage),((t,e)=>{c=null,r||(r=t,s=e,h());}));function h(){if(r)o(r);else if(a&&s){const e=t.exported.getImageData(s),i={};for(const o in a){const{width:s,height:r,x:n,y:l,sdf:c,pixelRatio:h,stretchX:u,stretchY:d,content:_}=a[o],m=new t.RGBAImage({width:s,height:r});t.RGBAImage.copy(e,m,{x:n,y:l},{x:0,y:0},{width:s,height:r}),i[o]={data:m,pixelRatio:h,sdf:c,stretchX:u,stretchY:d,content:_};}o(null,i);}}return {cancel(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null);}}}(e,this.map._requestManager,((e,i)=>{if(this._spriteRequest=null,e)this.fire(new t.ErrorEvent(e));else if(i)for(const t in i)this.imageManager.addImage(t,i[t]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}));}));}_validateLayer(e){const i=this.sourceCaches[e.source];if(!i)return;const o=e.sourceLayer;if(!o)return;const a=i.getSource();("geojson"===a.type||a.vectorLayerIds&&-1===a.vectorLayerIds.indexOf(o))&&this.fire(new t.ErrorEvent(new Error(`Source layer "${o}" does not exist on source "${a.id}" as specified by style layer "${e.id}".`)));}loaded(){if(!this._loaded)return !1;if(Object.keys(this._updatedSources).length)return !1;for(const t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return !1;return !!this.imageManager.isLoaded()}_serializeLayers(t){const e=[];for(const i of t){const t=this._layers[i];"custom"!==t.type&&e.push(t.serialize());}return e}hasTransitions(){if(this.light&&this.light.hasTransition())return !0;for(const t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return !0;for(const t in this._layers)if(this._layers[t].hasTransition())return !0;return !1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(e){if(!this._loaded)return;const i=this._changed;if(this._changed){const t=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);(t.length||i.length)&&this._updateWorkerLayers(t,i);for(const t in this._updatedSources){const e=this._updatedSources[t];"reload"===e?this._reloadSource(t):"clear"===e&&this._clearSource(t);}this._updateTilesForChangedImages();for(const t in this._updatedPaintProps)this._layers[t].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates();}const o={};for(const t in this.sourceCaches){const e=this.sourceCaches[t];o[t]=e.used,e.used=!1;}for(const t of this._order){const i=this._layers[t];i.recalculate(e,this._availableImages),!i.isHidden(e.zoom)&&i.source&&(this.sourceCaches[i.source].used=!0);}for(const e in o){const i=this.sourceCaches[e];o[e]!==i.used&&i.fire(new t.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:e}));}this.light.recalculate(e),this.z=e.zoom,i&&this.fire(new t.Event("data",{dataType:"style"}));}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={};}}_updateWorkerLayers(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e});}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={};}setState(e){if(this._checkLoaded(),Wt(this,t.validateStyle(e)))return !1;(e=t.clone$1(e)).layers=W(e.layers);const i=function(t,e){if(!t)return [{command:X.setStyle,args:[e]}];let i=[];try{if(!a(t.version,e.version))return [{command:X.setStyle,args:[e]}];a(t.center,e.center)||i.push({command:X.setCenter,args:[e.center]}),a(t.zoom,e.zoom)||i.push({command:X.setZoom,args:[e.zoom]}),a(t.bearing,e.bearing)||i.push({command:X.setBearing,args:[e.bearing]}),a(t.pitch,e.pitch)||i.push({command:X.setPitch,args:[e.pitch]}),a(t.sprite,e.sprite)||i.push({command:X.setSprite,args:[e.sprite]}),a(t.glyphs,e.glyphs)||i.push({command:X.setGlyphs,args:[e.glyphs]}),a(t.transition,e.transition)||i.push({command:X.setTransition,args:[e.transition]}),a(t.light,e.light)||i.push({command:X.setLight,args:[e.light]});const o={},s=[];!function(t,e,i,o){let s;for(s in e=e||{},t=t||{})Object.prototype.hasOwnProperty.call(t,s)&&(Object.prototype.hasOwnProperty.call(e,s)||K(s,i,o));for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&(Object.prototype.hasOwnProperty.call(t,s)?a(t[s],e[s])||("geojson"===t[s].type&&"geojson"===e[s].type&&J(t,e,s)?i.push({command:X.setGeoJSONSourceData,args:[s,e[s].data]}):Y(s,e,i,o)):H(s,e,i));}(t.sources,e.sources,s,o);const r=[];t.layers&&t.layers.forEach((t=>{o[t.source]?i.push({command:X.removeLayer,args:[t.id]}):r.push(t);})),i=i.concat(s),function(t,e,i){e=e||[];const o=(t=t||[]).map(tt),s=e.map(tt),r=t.reduce(et,{}),n=e.reduce(et,{}),l=o.slice(),c=Object.create(null);let h,u,d,_,m,p,f;for(h=0,u=0;h<o.length;h++)d=o[h],Object.prototype.hasOwnProperty.call(n,d)?u++:(i.push({command:X.removeLayer,args:[d]}),l.splice(l.indexOf(d,u),1));for(h=0,u=0;h<s.length;h++)d=s[s.length-1-h],l[l.length-1-h]!==d&&(Object.prototype.hasOwnProperty.call(r,d)?(i.push({command:X.removeLayer,args:[d]}),l.splice(l.lastIndexOf(d,l.length-u),1)):u++,p=l[l.length-h],i.push({command:X.addLayer,args:[n[d],p]}),l.splice(l.length-h,0,d),c[d]=!0);for(h=0;h<s.length;h++)if(d=s[h],_=r[d],m=n[d],!c[d]&&!a(_,m))if(a(_.source,m.source)&&a(_["source-layer"],m["source-layer"])&&a(_.type,m.type)){for(f in Q(_.layout,m.layout,i,d,null,X.setLayoutProperty),Q(_.paint,m.paint,i,d,null,X.setPaintProperty),a(_.filter,m.filter)||i.push({command:X.setFilter,args:[d,m.filter]}),a(_.minzoom,m.minzoom)&&a(_.maxzoom,m.maxzoom)||i.push({command:X.setLayerZoomRange,args:[d,m.minzoom,m.maxzoom]}),_)Object.prototype.hasOwnProperty.call(_,f)&&"layout"!==f&&"paint"!==f&&"filter"!==f&&"metadata"!==f&&"minzoom"!==f&&"maxzoom"!==f&&(0===f.indexOf("paint.")?Q(_[f],m[f],i,d,f.slice(6),X.setPaintProperty):a(_[f],m[f])||i.push({command:X.setLayerProperty,args:[d,f,m[f]]}));for(f in m)Object.prototype.hasOwnProperty.call(m,f)&&!Object.prototype.hasOwnProperty.call(_,f)&&"layout"!==f&&"paint"!==f&&"filter"!==f&&"metadata"!==f&&"minzoom"!==f&&"maxzoom"!==f&&(0===f.indexOf("paint.")?Q(_[f],m[f],i,d,f.slice(6),X.setPaintProperty):a(_[f],m[f])||i.push({command:X.setLayerProperty,args:[d,f,m[f]]}));}else i.push({command:X.removeLayer,args:[d]}),p=l[l.lastIndexOf(d)+1],i.push({command:X.addLayer,args:[m,p]});}(r,e.layers,i);}catch(t){console.warn("Unable to compute style diff:",t),i=[{command:X.setStyle,args:[e]}];}return i}(this.serialize(),e).filter((t=>!(t.command in Ht)));if(0===i.length)return !1;const o=i.filter((t=>!(t.command in Xt)));if(o.length>0)throw new Error(`Unimplemented: ${o.map((t=>t.command)).join(", ")}.`);return i.forEach((t=>{"setTransition"!==t.command&&this[t.command].apply(this,t.args);})),this.stylesheet=e,!0}addImage(e,i){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error(`An image named "${e}" already exists.`)));this.imageManager.addImage(e,i),this._afterImageUpdated(e);}updateImage(t,e){this.imageManager.updateImage(t,e);}getImage(t){return this.imageManager.getImage(t)}removeImage(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error(`An image named "${e}" does not exist.`)));this.imageManager.removeImage(e),this._afterImageUpdated(e);}_afterImageUpdated(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}));}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,i,o={}){if(this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error(`Source "${e}" already exists.`);if(!i.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(i).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(i.type)>=0&&this._validate(t.validateStyle.source,`sources.${e}`,i,null,o))return;this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);const a=this.sourceCaches[e]=new O(e,i,this.dispatcher);a.style=this,a.setEventedParent(this,(()=>({isSourceLoaded:this.loaded(),source:a.serialize(),sourceId:e}))),a.onAdd(this.map),this._changed=!0;}removeSource(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(const i in this._layers)if(this._layers[i].source===e)return this.fire(new t.ErrorEvent(new Error(`Source "${e}" cannot be removed while layer "${i}" is using it.`)));const i=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],i.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),i.setEventedParent(null),i.clearTiles(),i.onRemove&&i.onRemove(this.map),this._changed=!0;}setGeoJSONSourceData(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0;}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(e,i,o={}){this._checkLoaded();const a=e.id;if(this.getLayer(a))return void this.fire(new t.ErrorEvent(new Error(`Layer "${a}" already exists on this map.`)));let s;if("custom"===e.type){if(Wt(this,t.validateCustomStyleLayer(e)))return;s=t.createStyleLayer(e);}else {if("object"==typeof e.source&&(this.addSource(a,e.source),e=t.clone$1(e),e=t.extend(e,{source:a})),this._validate(t.validateStyle.layer,`layers.${a}`,e,{arrayIndex:-1},o))return;s=t.createStyleLayer(e),this._validateLayer(s),s.setEventedParent(this,{layer:{id:a}}),this._serializedLayers[s.id]=s.serialize();}const r=i?this._order.indexOf(i):this._order.length;if(i&&-1===r)this.fire(new t.ErrorEvent(new Error(`Cannot add layer "${a}" before non-existing layer "${i}".`)));else {if(this._order.splice(r,0,a),this._layerOrderChanged=!0,this._layers[a]=s,this._removedLayers[a]&&s.source&&"custom"!==s.type){const t=this._removedLayers[a];delete this._removedLayers[a],t.type!==s.type?this._updatedSources[s.source]="clear":(this._updatedSources[s.source]="reload",this.sourceCaches[s.source].pause());}this._updateLayer(s),s.onAdd&&s.onAdd(this.map);}}moveLayer(e,i){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));if(e===i)return;const o=this._order.indexOf(e);this._order.splice(o,1);const a=i?this._order.indexOf(i):this._order.length;i&&-1===a?this.fire(new t.ErrorEvent(new Error(`Cannot move layer "${e}" before non-existing layer "${i}".`))):(this._order.splice(a,0,e),this._layerOrderChanged=!0);}removeLayer(e){this._checkLoaded();const i=this._layers[e];if(!i)return void this.fire(new t.ErrorEvent(new Error(`Cannot remove non-existing layer "${e}".`)));i.setEventedParent(null);const o=this._order.indexOf(e);this._order.splice(o,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=i,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],i.onRemove&&i.onRemove(this.map);}getLayer(t){return this._layers[t]}hasLayer(t){return t in this._layers}setLayerZoomRange(e,i,o){this._checkLoaded();const a=this.getLayer(e);a?a.minzoom===i&&a.maxzoom===o||(null!=i&&(a.minzoom=i),null!=o&&(a.maxzoom=o),this._updateLayer(a)):this.fire(new t.ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer "${e}".`)));}setFilter(e,i,o={}){this._checkLoaded();const s=this.getLayer(e);if(s){if(!a(s.filter,i))return null==i?(s.filter=void 0,void this._updateLayer(s)):void(this._validate(t.validateStyle.filter,`layers.${s.id}.filter`,i,null,o)||(s.filter=t.clone$1(i),this._updateLayer(s)))}else this.fire(new t.ErrorEvent(new Error(`Cannot filter non-existing layer "${e}".`)));}getFilter(e){return t.clone$1(this.getLayer(e).filter)}setLayoutProperty(e,i,o,s={}){this._checkLoaded();const r=this.getLayer(e);r?a(r.getLayoutProperty(i),o)||(r.setLayoutProperty(i,o,s),this._updateLayer(r)):this.fire(new t.ErrorEvent(new Error(`Cannot style non-existing layer "${e}".`)));}getLayoutProperty(e,i){const o=this.getLayer(e);if(o)return o.getLayoutProperty(i);this.fire(new t.ErrorEvent(new Error(`Cannot get style of non-existing layer "${e}".`)));}setPaintProperty(e,i,o,s={}){this._checkLoaded();const r=this.getLayer(e);r?a(r.getPaintProperty(i),o)||(r.setPaintProperty(i,o,s)&&this._updateLayer(r),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error(`Cannot style non-existing layer "${e}".`)));}getPaintProperty(t,e){return this.getLayer(t).getPaintProperty(e)}setFeatureState(e,i){this._checkLoaded();const o=e.source,a=e.sourceLayer,s=this.sourceCaches[o];if(void 0===s)return void this.fire(new t.ErrorEvent(new Error(`The source '${o}' does not exist in the map's style.`)));const r=s.getSource().type;"geojson"===r&&a?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==r||a?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),s.setFeatureState(a,e.id,i)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));}removeFeatureState(e,i){this._checkLoaded();const o=e.source,a=this.sourceCaches[o];if(void 0===a)return void this.fire(new t.ErrorEvent(new Error(`The source '${o}' does not exist in the map's style.`)));const s=a.getSource().type,r="vector"===s?e.sourceLayer:void 0;"vector"!==s||r?i&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):a.removeFeatureState(r,e.id,i):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));}getFeatureState(e){this._checkLoaded();const i=e.source,o=e.sourceLayer,a=this.sourceCaches[i];if(void 0!==a)return "vector"!==a.getSource().type||o?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),a.getFeatureState(o,e.id)):void this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new t.ErrorEvent(new Error(`The source '${i}' does not exist in the map's style.`)));}getTransition(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(t=>t.serialize())),layers:this._serializeLayers(this._order)},(t=>void 0!==t))}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0;}_flattenAndSortRenderedFeatures(t){const e=t=>"fill-extrusion"===this._layers[t].type,i={},o=[];for(let a=this._order.length-1;a>=0;a--){const s=this._order[a];if(e(s)){i[s]=a;for(const e of t){const t=e[s];if(t)for(const e of t)o.push(e);}}}o.sort(((t,e)=>e.intersectionZ-t.intersectionZ));const a=[];for(let s=this._order.length-1;s>=0;s--){const r=this._order[s];if(e(r))for(let t=o.length-1;t>=0;t--){const e=o[t].feature;if(i[e.layer.id]<s)break;a.push(e),o.pop();}else for(const e of t){const t=e[r];if(t)for(const e of t)a.push(e.feature);}}return a}queryRenderedFeatures(e,i,o){i&&i.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",i.filter,null,i);const a={};if(i&&i.layers){if(!Array.isArray(i.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(const e of i.layers){const i=this._layers[e];if(!i)return this.fire(new t.ErrorEvent(new Error(`The layer '${e}' does not exist in the map's style and cannot be queried for features.`))),[];a[i.source]=!0;}}const s=[];i.availableImages=this._availableImages;for(const t in this.sourceCaches)i.layers&&!a[t]||s.push(M(this.sourceCaches[t],this._layers,this._serializedLayers,e,i,o));return this.placement&&s.push(function(t,e,i,o,a,s,r){const n={},l=s.queryRenderedSymbols(o),c=[];for(const t of Object.keys(l).map(Number))c.push(r[t]);c.sort(R);for(const i of c){const o=i.featureIndex.lookupSymbolFeatures(l[i.bucketInstanceId],e,i.bucketIndex,i.sourceLayerIndex,a.filter,a.layers,a.availableImages,t);for(const t in o){const e=n[t]=n[t]||[],a=o[t];a.sort(((t,e)=>{const o=i.featureSortOrder;if(o){const i=o.indexOf(t.featureIndex);return o.indexOf(e.featureIndex)-i}return e.featureIndex-t.featureIndex}));for(const t of a)e.push(t);}}for(const e in n)n[e].forEach((o=>{const a=o.feature,s=i[t[e].source].getFeatureState(a.layer["source-layer"],a.id);a.source=a.layer.source,a.layer["source-layer"]&&(a.sourceLayer=a.layer["source-layer"]),a.state=s;}));return n}(this._layers,this._serializedLayers,this.sourceCaches,e,i,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(s)}querySourceFeatures(e,i){i&&i.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",i.filter,null,i);const o=this.sourceCaches[e];return o?function(t,e){const i=t.getRenderableIds().map((e=>t.getTileByID(e))),o=[],a={};for(let t=0;t<i.length;t++){const s=i[t],r=s.tileID.canonical.key;a[r]||(a[r]=!0,s.querySourceFeatures(o,e));}return o}(o,i):[]}addSourceType(t,e,i){return Yt.getSourceType(t)?i(new Error(`A source type called "${t}" already exists.`)):(Yt.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},i):i(null,null))}getLight(){return this.light.getLight()}setLight(e,i={}){this._checkLoaded();const o=this.light.getLight();let s=!1;for(const t in e)if(!a(e[t],o[t])){s=!0;break}if(!s)return;const r={now:t.exported.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,i),this.light.updateTransitions(r);}_validate(e,i,o,a,s={}){return (!s||!1!==s.validate)&&Wt(this,e.call(t.validateStyle,t.extend({key:i,style:this.serialize(),value:o,styleSpec:t.spec},a)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const t in this._layers)this._layers[t].setEventedParent(null);for(const t in this.sourceCaches)this.sourceCaches[t].clearTiles(),this.sourceCaches[t].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove();}_clearSource(t){this.sourceCaches[t].clearTiles();}_reloadSource(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload();}_updateSources(t){for(const e in this.sourceCaches)this.sourceCaches[e].update(t);}_generateCollisionBoxes(){for(const t in this.sourceCaches)this._reloadSource(t);}_updatePlacement(e,i,o,a,s=!1){let r=!1,n=!1;const l={};for(const t of this._order){const i=this._layers[t];if("symbol"!==i.type)continue;if(!l[i.source]){const t=this.sourceCaches[i.source];l[i.source]=t.getRenderableIds(!0).map((e=>t.getTileByID(e))).sort(((t,e)=>e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)));}const o=this.crossTileSymbolIndex.addLayer(i,l[i.source],e.center.lng);r=r||o;}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((s=s||this._layerOrderChanged||0===o)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.exported.now(),e.zoom))&&(this.pauseablePlacement=new Gt(e,this._order,s,i,o,a,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.c
View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment