UNPKG

ol-mbtiles

Version:

MBTiles format reader for Openlayers

2 lines 2.25 kB
"use strict";(self.webpackChunkol_mbtiles=self.webpackChunkol_mbtiles||[]).push([[829],{7829:(e,n,t)=>{t.r(n),t.d(n,{default:()=>A});var o=t(4316),r=t(4396),l=t(2780),c=t(1765),i=t(957),w=t(5401),s=t(6438),u=t(4509),a=t(16),f=function(e,n,t,o){return new(t||(t=Promise))((function(r,l){function c(e){try{w(o.next(e))}catch(e){l(e)}}function i(e){try{w(o.throw(e))}catch(e){l(e)}}function w(e){var n;e.done?r(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(c,i)}w((o=o.apply(e,n||[])).next())}))};function A(){return f(this,void 0,void 0,(function*(){return new o.A({target:"map",layers:[new l.A({source:new r.A}),new l.A({source:new w.A}),new i.A({source:new u.bX(yield(0,u.Cy)({url:"https://velivole.b-cdn.net/mbtiles/countries.mbtiles"})),style:a.qk})],view:new c.Ay({center:(0,s.Rb)([12,50]),zoom:6})})}))}},16:(e,n,t)=>{t.d(n,{AD:()=>h,C5:()=>f,CT:()=>w,HB:()=>b,OA:()=>d,Tl:()=>A,qk:()=>s});var o=t(9276),r=t(7733),l=t(3628),c=t(953),i=t(1426);function w(e,n){let t,w;switch(e){case 0:t=6,w="2em";break;case 1:t=5,w="1.2em";break;case 2:t=3,w="0.8em";break;default:t=1,w="0.5em"}w+=" helvetica, sans-serif";const s="#00007f";return new o.Ay({image:new r.A({fill:new l.A({color:s}),radius:t,stroke:new c.A({color:s,width:t})}),text:new i.A({font:w,text:n.get("n"),fill:new l.A({color:"#ffffff"}),stroke:new c.A({color:s,width:2})})})}const s=new o.Ay({stroke:new c.A({color:"blue",width:2})}),u={},a={motorway:"#776",trunk:"#ccb",highway:"#f39"},f=new o.Ay({fill:new l.A({color:"#666"}),stroke:new c.A({color:"#444",width:1})}),A=new o.Ay({fill:new l.A({color:"#9db9e8"})}),h=new o.Ay({stroke:new c.A({color:"#8B008B",width:2})}),d=function(e){const n=e.get("class"),t=e.get("railway"),r=e.get("sort_key"),l=n+"/"+t+"/"+r;let i=u[l];if(!i){let e,w;t?(e="#7de",w=1):(e=a[n],w="highway"==n?1.5:1),i=new o.Ay({stroke:new c.A({color:e,width:w}),zIndex:r}),u[l]=i}return i},y=new o.Ay({image:new r.A({radius:5,fill:new l.A({color:"#000080"})})}),k=new c.A({color:"white",width:2}),b=function(e){if("country"==e.get("class"))return null;if(e.get("name")){const n=y.clone();return n.setText(new i.A({text:e.get("name"),offsetY:-5,font:"bold 16px sans-serif",stroke:k})),n}return null}}}]); //# sourceMappingURL=829.bundle.js.map