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
2.4 KiB
JavaScript

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[5674],{74170:function(e,t,n){var o,a=n(40349),r=n(41376),c=n(54354),i=n(91712),d=n(91118),l=n(70277),s=n(87103),u=n(40985),g=n(42010),m=n(41372),f=n(31998),p=n(95783),w=new r.Z({layers:[new g.Z({source:new f.Z({attributions:'<a href="https://www.maptiler.com/copyright/" target="_blank">&copy; MapTiler</a> <a href="https://www.openstreetmap.org/copyright" target="_blank">&copy; OpenStreetMap contributors</a>',url:"https://api.maptiler.com/tiles/satellite/{z}/{x}/{y}.jpg?key=get_your_own_D6rA4zTHduk6KOKTXzGB",maxZoom:20})})],target:"map",view:new c.ZP({center:[0,0],zoom:2})}),h=document.getElementById("extractstyles");function v(){o&&w.removeInteraction(o),(o=new a.Z({formatConstructors:[i.Z,d.Z,l.Z,new s.ZP({extractStyles:h.checked}),u.Z]})).on("addfeatures",(function(e){var t=new p.Z({features:e.features});w.addLayer(new m.Z({source:t})),w.getView().fit(t.getExtent())})),w.addInteraction(o)}v(),h.addEventListener("change",v);var k=function(e){var t=[];if(w.forEachFeatureAtPixel(e,(function(e){t.push(e)})),t.length>0){var n,o,a=[];for(n=0,o=t.length;n<o;++n)a.push(t[n].get("name"));document.getElementById("info").innerHTML=a.join(", ")||"&nbsp"}else document.getElementById("info").innerHTML="&nbsp;"};w.on("pointermove",(function(e){if(!e.dragging){var t=w.getEventPixel(e.originalEvent);k(t)}})),w.on("click",(function(e){k(e.pixel)}));var y=document.getElementById("download");function E(e,t){fetch(e).then((function(e){return e.blob()})).then((function(e){navigator.msSaveBlob?navigator.msSaveBlob(e,t):(y.href=URL.createObjectURL(e),y.download=t,y.click())}))}document.getElementById("download-gpx").addEventListener("click",(function(){E("data/gpx/fells_loop.gpx","fells_loop.gpx")})),document.getElementById("download-geojson").addEventListener("click",(function(){E("data/geojson/roads-seoul.geojson","roads-seoul.geojson")})),document.getElementById("download-igc").addEventListener("click",(function(){E("data/igc/Ulrich-Prinz.igc","Ulrich-Prinz.igc")})),document.getElementById("download-kml").addEventListener("click",(function(){E("data/kml/states.kml","states.kml")})),document.getElementById("download-topojson").addEventListener("click",(function(){E("data/topojson/fr-departments.json","fr-departments.json")}))}},function(e){var t=function(t){return e(e.s=t)};t(9877),t(74170)}]);
//# sourceMappingURL=drag-and-drop.js.map