"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[4600],{32383:function(e,t,n){var a=n(41376),r=n(54354),o=n(42010),i=n(86291),u=n(31998),s=n(47486),c=n(79847);var h=new u.Z({url:"https://{a-d}.tiles.mapbox.com/v3/aj.sf-dem/{z}/{x}/{y}.png",crossOrigin:"anonymous"}),v=new s.ZP({sources:[h],operationType:"image",operation:function(e,t){var n,a,r,o,i,u,s,c,h,v,d,l,m=e[0],f=m.width,p=m.height,w=m.data,M=new Uint8ClampedArray(w.length),g=2*t.resolution,Z=f-1,y=p-1,E=[0,0,0,0],x=2*Math.PI,I=Math.PI/2,P=Math.PI*t.sunEl/180,b=Math.PI*t.sunAz/180,k=Math.cos(P),z=Math.sin(P);function A(e){return e[0]+2*e[1]+3*e[2]}for(a=0;a<=y;++a)for(o=0===a?0:a-1,i=a===y?y:a+1,n=0;n<=Z;++n)r=n===Z?Z:n+1,u=4*(a*f+(0===n?0:n-1)),E[0]=w[u],E[1]=w[u+1],E[2]=w[u+2],E[3]=w[u+3],s=t.vert*A(E),u=4*(a*f+r),E[0]=w[u],E[1]=w[u+1],E[2]=w[u+2],E[3]=w[u+3],c=(t.vert*A(E)-s)/g,u=4*(o*f+n),E[0]=w[u],E[1]=w[u+1],E[2]=w[u+2],E[3]=w[u+3],s=t.vert*A(E),u=4*(i*f+n),E[0]=w[u],E[1]=w[u+1],E[2]=w[u+2],E[3]=w[u+3],h=(t.vert*A(E)-s)/g,v=Math.atan(Math.sqrt(c*c+h*h)),d=(d=Math.atan2(h,-c))<0?I-d:d>I?x-d+I:I-d,l=255*(z*Math.cos(v)+k*Math.sin(v)*Math.cos(b-d)),M[u=4*(a*f+n)]=l,M[u+1]=l,M[u+2]=l,M[u+3]=w[u+3];return{data:M,width:f,height:p}}}),d=(new a.Z({target:"map",layers:[new o.Z({source:new c.Z}),new i.Z({opacity:.3,source:v})],view:new r.ZP({extent:[-13675026,4439648,-13580856,4580292],center:[-13615645,4497969],minZoom:10,maxZoom:16,zoom:13})}),{});["vert","sunEl","sunAz"].forEach((function(e){var t=document.getElementById(e),n=document.getElementById(e+"Out"),a=function(){n.innerText=t.value,v.changed()};t.addEventListener("input",a),t.addEventListener("change",a),n.innerText=t.value,d[e]=t})),v.on("beforeoperations",(function(e){var t=e.data;for(var n in t.resolution=e.resolution,d)t[n]=Number(d[n].value)}))}},function(e){var t=function(t){return e(e.s=t)};t(9877),t(32383)}]); //# sourceMappingURL=shaded-relief.js.map