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