!function(e){function t(t){for(var r,a,c=t[0],u=t[1],s=t[2],f=0,h=[];f<c.length;f++)a=c[f],Object.prototype.hasOwnProperty.call(i,a)&&i[a]&&h.push(i[a][0]),i[a]=0;for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(e[r]=u[r]);for(l&&l(t);h.length;)h.shift()();return o.push.apply(o,s||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,c=1;c<n.length;c++){var u=n[c];0!==i[u]&&(r=!1)}r&&(o.splice(t--,1),e=a(a.s=n[0]))}return e}var r={},i={13:0},o=[];function a(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=r,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var c=window.webpackJsonp=window.webpackJsonp||[],u=c.push.bind(c);c.push=t,c=c.slice();for(var s=0;s<c.length;s++)t(c[s]);var l=u;o.push([205,0]),n()}({205:function(e,t,n){e.exports=n(226)},226:function(e,t,n){"use strict";n.r(t),n.d(t,"mvtLayer",(function(){return w}));var r=n(25),i=n(151),o=n(19),a=n(22),c=n(146),u=n(2),s=n(4),l=new i.a,f=[new o.b({stroke:new a.a({color:"green",width:2})})],h=function(){function e(e){this.urls=e.urls,this.ready=!0,this.readyPromise=Promise.resolve(!0),this.tileWidth=256,this.tileHeight=256,this.maximumLevel=e.maximumLevel||20,this.minimumLevel=e.minimumLevel||0,this.tilingScheme=new Cesium.WebMercatorTilingScheme,this.rectangle=e.rectangle||this.tilingScheme.rectangle,this.errorEvent={},this.credit=e.credit,this.hasAlphaChannel=!0,this.cache_={},this.styleFunction_=e.styleFunction||function(){return f},this.projection_=Object(u.k)("EPSG:3857")}var t=e.prototype;return t.getTileCredits=function(){return[]},t.pickFeatures=function(){},t.requestImage=function(e,t,n,r){var i=this;if(n<this.minimumLevel)return null;var o=this.urls[0].replace("{x}",e).replace("{y}",t).replace("{z}",n),a=this.cache_[o];return a||(a=this.cache_[o]=fetch(o).then((function(e){return e.ok?e:Promise.reject(e)})).then((function(e){return e.arrayBuffer()})).then((function(e){return i.rasterizePbfToTile(e,i.styleFunction_,l,i.projection_)}))),a},t.rasterizePbfToTile=function(e,t){var n=document.createElement("canvas"),r=Object(c.b)(n.getContext("2d"),{size:[256,256]});try{var i;s.a<="6.4.4"&&(i={extent:[0,0,4096,4096],dataProjection:l.dataProjection,featureProjection:l.dataProjection});var o=l.readFeatures(e,i);o.forEach((function(e){for(var t=e.getFlatCoordinates(),n=!1,r=0;r<t.length;++r)t[r]*=.0625,n&&(t[r]=256-t[r]),s.a<="6.4.4"&&(n=!n)})),o.forEach((function(e){var n=t(e);n&&n.forEach((function(t){r.setStyle(t),r.drawGeometry(e)}))}))}catch(e){this.raiseEvent("could not render pbf tile",e)}return n},e}(),p=n(26),d=(n(160),n(17)),m=n(21),v=n(117),b=n(155),y=n(24);Cesium.Ion.defaultAccessToken="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI0MzAyNzUyYi0zY2QxLTQxZDItODRkOS1hNTA3MDU3ZTBiMDUiLCJpZCI6MjU0MSwiaWF0IjoxNTMzNjI1MTYwfQ.oHn1SUWJa12esu7XUUtEoc1BbEbuZpRocLetw6M6_AA";Object(u.k)("EPSG:3857");const w=function(e,t){const n=new b.a({url:e,format:new i.a});return n.set("olcs.provider",new h({credit:new Cesium.Credit("Schweizmobil",!1),urls:[e],rectangle:new Cesium.Rectangle(...[5.2,45.45,11,48].map(Cesium.Math.toRadians)),minimumLevel:6})),new v.a({source:n,opacity:.6,style:[new o.b({stroke:new a.a({color:"purple",width:4})})]})}("https://map.dev.schweizmobil-hosting.ch/api/4/mvt_routes/3857/{z}/{x}/{y}.pbf?olcs"),g=new p.a({layers:[new d.a({source:new y.b}),w],target:"map",view:new m.a}),j=new r.a({map:g});j.getCesiumScene(),j.setEnabled(!1);const O=[572215,5684416,1277662,6145307];g.getView().fit([O[0]- -5e4,O[1]- -5e4,O[2]+-5e4,O[3]+-5e4]),document.getElementById("enable").addEventListener("click",()=>j.setEnabled(!j.getEnabled()))}});
//# sourceMappingURL=mvt.8ce3ebe5330948a2cb13.js.map