import{a as e}from"./rolldown-runtime-C_ttsnZz.js";import{St as t,q as r}from"./index-BT8Vuu3B.js";import{i as l}from"./index.modern-tyEdEbjo.js";import{n as o}from"./utils-CjIvvA5e-DRv4kcQu.js";var a=e(t(),1),s=r();function i(e,t,r){switch(e){case"fill":return{fillColor:t,fillOpacity:.25};case"line":return{strokeColor:t,strokeWeight:"LineString"===r?6:2};default:return{}}}function n({sources:e}){let[t,r]=(0,a.useState)(null),[n,p]=(0,a.useState)([]),u=(0,a.useContext)(l);return(0,a.useEffect)(()=>{u&&r(u.map)},[u]),(0,a.useEffect)(()=>{if(n.forEach(e=>{e?.setMap(null)}),!t||void 0===e||0===e.length)return;let r=e.map(e=>{let r={type:e.type||"MultiPolygon",clickable:!1};if(Array.isArray(e.layer))e.layer.forEach(t=>{let l=i(t.type,t.color,e.type);Object.assign(r,l)});else{let t=i(e.layer.type,e.layer.color,e.type);Object.assign(r,t)}let l,a=o(e.geometry,r.type);return l="LineString"===e.type?new google.maps.Polyline({strokeWeight:6,path:a,...r}):new google.maps.Polygon({strokeWeight:0,fillOpacity:0,paths:a,...r}),l.setMap(t),l});return p(r),r.forEach(e=>{e.setMap(t)}),()=>{r.forEach(e=>{e?.setMap(null)})}},[t,e]),(0,s.jsx)(s.Fragment,{})}export{n as default};
//# sourceMappingURL=Google-qvGtRAuh-HFCEiKSq.js.map