import{i as e}from"./chunk-aKtaBQYM.js";import{Ft as t,G as n}from"./mui-BgU4WrXF.js";import{T as r}from"./index-bel1r0Sr.js";import{n as i,r as a}from"./MapView-Bhqzv-Oc.js";var o=e(a(),1),s=e(t(),1),c=()=>{let e=n(),t=r(`distanceUnit`),a=(0,s.useMemo)(()=>new o.default.ScaleControl,[]);return(0,s.useEffect)(()=>(i.addControl(a,e.direction===`rtl`?`bottom-right`:`bottom-left`),()=>i.removeControl(a)),[a,e.direction]),(0,s.useEffect)(()=>{switch(t){case`mi`:a.setUnit(`imperial`);break;case`nmi`:a.setUnit(`nautical`);break;default:a.setUnit(`metric`);break}},[a,t]),null};export{c as t};