function getCircle(n,t,i){var r=0;switch(n){case 10:r=7;break;case 9:r=3;break;case 8:r=1;break;case 7:r=.5}return{radius:r*t,fillColor:i,color:"#333333",weight:1.2,opacity:.3,fillOpacity:0}}function getDist(n){var t=0;switch(n){case 10:t=125;break;case 9:t=250;break;case 8:t=500;break;case 7:t=1e3}return t}function getLonAndLat(n,t,i,r){for(var g=6378.137,s=6356752.3142,c=1/298.257223563,ft=n*1,et=t*1,nt=r,tt=i*(Math.PI/180),it=Math.sin(tt),v=Math.cos(tt),y=(1-c)*Math.tan(et*(Math.PI/180)),l=1/Math.sqrt(1+y*y),p=y*l,ot=Math.atan2(y,v),h=l*it,w=1-h*h,f=w*(g*g-s*s)/(s*s),rt=1+f/16384*(4096+f*(-768+f*(320-175*f))),b=f/1024*(256+f*(-128+f*(74-47*f))),o=nt/(s*rt),ut=2*Math.PI;Math.abs(o-ut)>1e-12;){var u=Math.cos(2*ot+o),e=Math.sin(o),a=Math.cos(o),st=b*e*(u+b/4*(a*(-1+2*u*u)-b/6*u*(-3+4*e*e)*(-3+4*u*u)));ut=o;o=nt/(s*rt)+st}var k=p*e-l*a*v,ht=Math.atan2(p*a+l*e*v,(1-c)*Math.sqrt(h*h+k*k)),ct=Math.atan2(e*it,l*a-p*e*v),d=c/16*w*(4+c*(4-3*w)),lt=ct-(1-d)*c*h*(o+d*e*(u+d*a*(-1+2*u*u))),at=Math.atan2(h,-k);return{lng:ft+lt*(180/Math.PI),lat:ht*(180/Math.PI)}}var labelText,iconText;if(pageViews>5e4&&$(window).width()<768)$("#map").append("<img src='"+mapImg+"' />");else{var circles=[],markers=[],map=L.map("map",{fullscreenControl:!0,center:new L.LatLng(lat,lon),zoom:8}),osmUrl="https://tile.thunderforest.com/outdoors/{z}/{x}/{y}.png?apikey=3c93b8b39a1847bdb8443ae1f8ec3383",myMap=new L.TileLayer(osmUrl,{attribution:'Maps &copy; <a href="https://www.thunderforest.com/">Thunderforest<\/a>, Data &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap contributors<\/a>',minZoom:7,maxZoom:10,zoomControl:!0}).addTo(map),i,d=5*3.5,z=map.getZoom(),icon=getCircleLeafletIndex(mag,maxIntensity),fillColor=icon.fillColor;for(circle=L.circleMarker(new L.LatLng(lat,lon),icon).addTo(map),markers[0]=L.circleMarker(new L.LatLng(lat,lon),getCircle(z,KM,fillColor)).addTo(map),labelText=0,iconText=new L.divIcon({iconSize:[120,20],iconAnchor:[0,20],className:"label",html:'<div style="color:#333333"><font size="1px" style="font-weight:bold">'+labelText+"<\/font><\/div>"}),circles[0]=L.marker(getLonAndLat(lon,lat,45,markers[0].getRadius()*getDist(z)),{icon:iconText}).addTo(map),i=1;i<18;i++)markers[i]=L.circleMarker(new L.LatLng(lat,lon),getCircle(z,KM+d*i,fillColor)).addTo(map),labelText=5*i,iconText.options.html='<div style="color:#333333"><font size="1px" style="font-weight:bold">'+labelText+"<\/font><\/div>",circles[i]=L.marker(getLonAndLat(lon,lat,45,markers[i].getRadius()*getDist(z)),{icon:iconText}).addTo(map);map.on("zoomend",function(){var t=map.getZoom(),n,i,r;for(console.log("Current Zoom "+t),markers[0].remove(),circles[0].remove(),n=1;n<18;n++)markers[n].remove(),circles[n].remove();for(markers[0]=L.circleMarker(new L.LatLng(lat,lon),getCircle(t,KM,fillColor)).addTo(map),i=0,r=new L.divIcon({iconSize:[120,20],iconAnchor:[0,20],className:"label",html:'<div style="color:#333333" ><font size="1px" style="font-weight:bold">'+i+"<\/font><\/div>"}),circles[0]=L.marker(getLonAndLat(lon,lat,45,markers[0].getRadius()*getDist(t)),{icon:r}).addTo(map),n=1;n<18;n++)markers[n]=L.circleMarker(new L.LatLng(lat,lon),getCircle(t,KM+d*n,fillColor)).addTo(map),i=5*n,r.options.html='<div style="color:#333333"><font size="1px" style="font-weight:bold">'+i+"<\/font><\/div>",circles[n]=L.marker(getLonAndLat(lon,lat,45,markers[n].getRadius()*getDist(t)),{icon:r}).addTo(map)})}