"use strict";(self.webpackChunkporta_frontend_starter_kit=self.webpackChunkporta_frontend_starter_kit||[]).push([[848],{1848:function(t,e,a){a.r(e),a.d(e,{olMap:function(){return p}});var r=a(3228),n=a(2229),o=a(38),s=a(6142),c=a(3337),i=a(2954),l=a(5765),m=a(100),u=a(2772),g=a(3565),d=a(2422),A=a(5321),f=a(3506);const p=t=>{let e=0;for(const a of t){e+=1;const t="olmap-"+e,p={zoom:a.getAttribute("data-zoom")?parseInt(a.getAttribute("data-zoom")):17,lat:parseFloat(a.getAttribute("data-lat")),lng:parseFloat(a.getAttribute("data-lng")),markerIcon:"/static/images/marker.svg",centermarkerIcon:!0,grayScale:!1,scrollWheel:!1};if(a.setAttribute("id",t),p.lat&&p.lng){const e=new r.A({source:new n.A});p.grayScale&&e.addEventListener("postcompose",(t=>{w(t.context)}));const h=d.A.fromLonLat([p.lng,p.lat]),k=new o.A({target:t,layers:[e],view:new s.A({center:h,zoom:p.zoom}),controls:A.A.defaults({rotate:!1,attribution:!1}),interactions:f.A.defaults({mouseWheelZoom:p.scrollWheel})}),b=new u.A({geometry:new g.A(h)});if(p.markerIcon){const t={crossOrigin:"anonymous",src:p.markerIcon};p.centermarkerIcon||(t.anchor=[.5,1],t.anchorXUnits="fraction",t.anchorYUnits="fraction"),b.setStyle(new l.A({image:new m.A(t)}))}const I=new i.A({features:[b]}),y=new c.A({source:I});k.addLayer(y),a.addEventListener("resize",(()=>{setTimeout((()=>{k.updateSize()}),200)}))}}},w=t=>{const e=t.canvas,a=e.width,r=e.height,n=t.getImageData(0,0,a,r),o=n.data;for(let t=0;t<o.length;t+=4){let e=.2126*o[t]+.7152*o[t+1]+.0722*o[t+2];0===e&&(e=255),o[t]=e,o[t+1]=e,o[t+2]=e,o[t+3]=255}t.putImageData(n,0,0)}}}]);