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.5 KiB
JavaScript
2 lines
1.5 KiB
JavaScript
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[2990],{41050:function(t,e,i){var o=i(41376),n=i(42010),a=i(54354),d=i(31998);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 e=this;setTimeout((function(){e.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.Z({attributions:'<a href="https://www.maptiler.com/copyright/" target="_blank">© MapTiler</a> <a href="https://www.openstreetmap.org/copyright" target="_blank">© 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.Z({layers:[new n.Z({source:l})],target:"map",view:new a.ZP({center:[0,0],zoom:2})})}},function(t){var e=function(e){return t(t.s=e)};e(9877),e(41050)}]);
|
|
//# sourceMappingURL=tile-load-events.js.map
|