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.4 KiB
JavaScript

2 weeks ago
(window.webpackJsonp=window.webpackJsonp||[]).push([[150],{379:function(t,i,e){"use strict";e.r(i);var o=e(3),a=e(5),n=e(2),d=e(27);function s(t){this.el=t,this.loading=0,this.loaded=0}s.prototype.addLoading=function(){0===this.loading&&this.show(),++this.loading,this.update()},s.prototype.addLoaded=function(){var t=this;setTimeout((function(){++t.loaded,t.update()}),100)},s.prototype.update=function(){var t=(this.loaded/this.loading*100).toFixed(1)+"%";if(this.el.style.width=t,this.loading===this.loaded){this.loading=0,this.loaded=0;var i=this;setTimeout((function(){i.hide()}),500)}},s.prototype.show=function(){this.el.style.visibility="visible"},s.prototype.hide=function(){this.loading===this.loaded&&(this.el.style.visibility="hidden",this.el.style.width=0)};var r=new s(document.getElementById("progress")),l=new d.a({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/maps/streets/{z}/{x}/{y}.png?key=get_your_own_D6rA4zTHduk6KOKTXzGB",tileSize:512});l.on("tileloadstart",(function(){r.addLoading()})),l.on("tileloadend",(function(){r.addLoaded()})),l.on("tileloaderror",(function(){r.addLoaded()}));new o.a({layers:[new a.a({source:l})],target:"map",view:new n.a({center:[0,0],zoom:2})})}},[[379,0]]]);
//# sourceMappingURL=tile-load-events.js.map