You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
1.8 KiB
JavaScript

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[4185],{53003:function(e,t,a){var n=a(41376),r=a(54354),o=a(90634),s=a(79847),u=a(95783),c=a(42010),d=a(41372),i=new c.Z({source:new s.Z}),l=(new o.Z).readFeature("POLYGON((10.689697265625 -25.0927734375, 34.595947265625 -20.1708984375, 38.814697265625 -35.6396484375, 13.502197265625 -39.1552734375, 10.689697265625 -25.0927734375))");l.getGeometry().transform("EPSG:4326","EPSG:3857");var m=new d.Z({source:new u.Z({features:[l]}),opacity:.5}),p=new n.Z({layers:[i,m],target:"map",view:new r.ZP({center:[0,0],zoom:2})}),v={a0:[1189,841],a1:[841,594],a2:[594,420],a3:[420,297],a4:[297,210],a5:[210,148]},g=document.getElementById("export-pdf");g.addEventListener("click",(function(){g.disabled=!0,document.body.style.cursor="progress";var e=document.getElementById("format").value,t=document.getElementById("resolution").value,a=v[e],n=Math.round(a[0]*t/25.4),r=Math.round(a[1]*t/25.4),o=p.getSize(),s=p.getView().getResolution();p.once("rendercomplete",(function(){var t=document.createElement("canvas");t.width=n,t.height=r;var u=t.getContext("2d");Array.prototype.forEach.call(document.querySelectorAll(".ol-layer canvas"),(function(e){if(e.width>0){var t=e.parentNode.style.opacity;u.globalAlpha=""===t?1:Number(t);var a=e.style.transform.match(/^matrix\(([^\(]*)\)$/)[1].split(",").map(Number);CanvasRenderingContext2D.prototype.setTransform.apply(u,a),u.drawImage(e,0,0)}}));var c=new jspdf.jsPDF("landscape",void 0,e);c.addImage(t.toDataURL("image/jpeg"),"JPEG",0,0,a[0],a[1]),c.save("map.pdf"),p.setSize(o),p.getView().setResolution(s),g.disabled=!1,document.body.style.cursor="auto"}));var u=[n,r];p.setSize(u);var c=Math.min(n/o[0],r/o[1]);p.getView().setResolution(s/c)}),!1)}},function(e){var t=function(t){return e(e.s=t)};t(9877),t(53003)}]);
//# sourceMappingURL=export-pdf.js.map