23 lines
125 KiB
JavaScript
23 lines
125 KiB
JavaScript
|
|
"use strict";var protomapsL=(()=>{var We=Object.defineProperty;var Ln=Object.getOwnPropertyDescriptor;var Pn=Object.getOwnPropertyNames;var Sn=Object.prototype.hasOwnProperty;var D=Math.pow;var l=(i,e)=>We(i,"name",{value:e,configurable:!0});var Tn=(i,e)=>{for(var t in e)We(i,t,{get:e[t],enumerable:!0})},Fn=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Pn(e))!Sn.call(i,r)&&r!==t&&We(i,r,{get:()=>e[r],enumerable:!(n=Ln(e,r))||n.enumerable});return i};var Mn=i=>Fn(We({},"__esModule",{value:!0}),i);var A=(i,e,t)=>new Promise((n,r)=>{var a=c=>{try{s(t.next(c))}catch(u){r(u)}},o=c=>{try{s(t.throw(c))}catch(u){r(u)}},s=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,o);s((t=t.apply(i,e)).next())});var Sa={};Tn(Sa,{CenteredSymbolizer:()=>at,CenteredTextSymbolizer:()=>Q,CircleSymbolizer:()=>De,FlexSymbolizer:()=>Ut,Font:()=>La,GeomType:()=>rt,GroupSymbolizer:()=>Ae,IconSymbolizer:()=>Vt,Index:()=>dt,Justify:()=>cn,Labeler:()=>ye,Labelers:()=>xe,LineLabelPlacement:()=>hn,LineLabelSymbolizer:()=>ee,LineSymbolizer:()=>O,OffsetSymbolizer:()=>ot,OffsetTextSymbolizer:()=>Re,Padding:()=>Nt,PmtilesSource:()=>pe,PolygonSymbolizer:()=>M,Sheet:()=>yi,ShieldSymbolizer:()=>$t,Static:()=>pi,TextPlacements:()=>un,TextSymbolizer:()=>Be,TileCache:()=>Ce,View:()=>ut,ZxySource:()=>Me,arr:()=>la,covering:()=>gn,createPattern:()=>sa,exp:()=>V,getZoom:()=>mi,isCcw:()=>an,isInRing:()=>It,labelRules:()=>Oe,leafletLayer:()=>za,linear:()=>st,paint:()=>Ne,paintRules:()=>je,pointInPolygon:()=>on,pointMinDistToLines:()=>ln,pointMinDistToPoints:()=>sn,sourcesToViews:()=>Ue,step:()=>ha,toIndex:()=>G,transformGeom:()=>$e,wrap:()=>Ve});function x(i,e){this.x=i,this.y=e}l(x,"Point");x.prototype={clone(){return new x(this.x,this.y)},add(i){return this.clone()._add(i)},sub(i){return this.clone()._sub(i)},multByPoint(i){return this.clone()._multByPoint(i)},divByPoint(i){return this.clone()._divByPoint(i)},mult(i){return this.clone()._mult(i)},div(i){return this.clone()._div(i)},rotate(i){return this.clone()._rotate(i)},rotateAround(i,e){return this.clone()._rotateAround(i,e)},matMult(i){return this.clone()._matMult(i)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(i){return this.x===i.x&&this.y===i.y},dist(i){return Math.sqrt(this.distSqr(i))},distSqr(i){let e=i.x-this.x,t=i.y-this.y;return e*e+t*t},angle(){return Math.atan2(this.y,this.x)},angleTo(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith(i){return this.angleWithSep(i.x,i.y)},angleWithSep(i,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult(i){let e=i[0]*this.x+i[1]*this.y,t=i[2]*this.x+i[3]*this.y;return this.x=e,this.y=t,this},_add(i){return this.x+=i.x,this.y+=i.y,this},_sub(i){return this.x-=i.x,this.y-=i.y,this},_mult(i){return this.x*=i,this.y*=i,this},_div(i){return this.x/=i,this.y/=i,this},_multByPoint(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint(i){return this.x/=i.x,this.y/=i.y,this},_unit(){return this._div(this.mag()),this},_perp(){let i=this.y;return this.y=this.x,this.x=-i,this},_rotate(i){let e=Math.cos(i),t=Math.sin(i),n=e*this.x-t*this.y,r=t*this.x+e*this.y;return this.x=n,this.y=r,this},_rotateAround(i,e){let t=Math.cos(i),n=Math.sin(i),r=e.x+t*(this.x-e.x)-n*(this.y-e.y),a=e.y+n*(this.x-e.x)+t*(this.y-e.y);return this.x=r,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:x};x.convert=function(i){if(i instanceof x)return i;if(Array.isArray(i))return new x(+i[0],+i[1]);if(i.x!==void 0&&i.y!==void 0)return new x(+i.x,+i.y);throw new Error("Expected [x, y] or {x, y} point format")};var Cn=Object.defineProperty,J=l((i,e)=>Cn(i,"name",{value:e,configurable:!0}),"r");function I(i,e){let t="script";return i==="name"?t="script":i==="name2"?t="script2":i==="name3"&&(t="script3"),[["coalesce",["get",`pgf:${i}`],["get",i]],{"text-font":["case",["==",["get",t],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",[e||"Noto Sans Regular"]]]}]}l(I,"l"
|
||
|
|
`,{},["case",["all",["!",["has",`${r}name:${i}`]],["has","name:en"],["!",["has","script"]]],"",["coalesce",["get","pgf:name"],["get","name"]]],{"text-font":["case",["==",["get","script"],"Devanagari"],["literal",["Noto Sans Devanagari Regular v1"]],["literal",[t||"Noto Sans Regular"]]]}],["get","name:en"]],["format",["coalesce",["get",`${r}name:${i}`],["get","pgf:name"],["get","name"]],N(n)]],["all",["any",["has","name"],["has","pgf:name"]],["any",["has","name2"],["has","pgf:name2"]],["!",["any",["has","name3"],["has","pgf:name3"]]]],["case",["all",W(i,n,"name"),W(i,n,"name2")],["format",["get",`${r}name:${i}`],N(n),`
|
||
|
|
`,{},...I("name"),`
|
||
|
|
`,{},...I("name2")],["case",W(i,n,"name2"),["format",["coalesce",["get",`${r}name:${i}`],["get","pgf:name"],["get","name"]],N(n),`
|
||
|
|
`,{},...I("name2")],["format",["coalesce",["get",`${r}name:${i}`],["get","pgf:name2"],["get","name2"]],N(n),`
|
||
|
|
`,{},...I("name")]]],["case",["all",W(i,n,"name"),W(i,n,"name2"),W(i,n,"name3")],["format",["get",`${r}name:${i}`],N(n),`
|
||
|
|
`,{},...I("name"),`
|
||
|
|
`,{},...I("name2"),`
|
||
|
|
`,{},...I("name3")],["case",["!",W(i,n,"name")],["format",["coalesce",["get",`${r}name:${i}`],["get","pgf:name"],["get","name"]],N(n),`
|
||
|
|
`,{},...I("name2"),`
|
||
|
|
`,{},...I("name3")],["!",W(i,n,"name2")],["format",["coalesce",["get",`${r}name:${i}`],["get","pgf:name2"],["get","name2"]],N(n),`
|
||
|
|
`,{},...I("name"),`
|
||
|
|
`,{},...I("name3")],["format",["coalesce",["get",`${r}name:${i}`],["get","pgf:name3"],["get","name3"]],N(n),`
|
||
|
|
`,{},...I("name"),`
|
||
|
|
`,{},...I("name2")]]]]}l(Z,"s");J(Z,"get_multiline_name");var Dn=[{lang:"ar",full_name:"Arabic",script:"Arabic"},{lang:"cs",full_name:"Czech",script:"Latin"},{lang:"bg",full_name:"Bulgarian",script:"Cyrillic"},{lang:"da",full_name:"Danish",script:"Latin"},{lang:"de",full_name:"German",script:"Latin"},{lang:"el",full_name:"Greek",script:"Greek"},{lang:"en",full_name:"English",script:"Latin"},{lang:"es",full_name:"Spanish",script:"Latin"},{lang:"et",full_name:"Estonian",script:"Latin"},{lang:"fa",full_name:"Persian",script:"Arabic"},{lang:"fi",full_name:"Finnish",script:"Latin"},{lang:"fr",full_name:"French",script:"Latin"},{lang:"ga",full_name:"Irish",script:"Latin"},{lang:"he",full_name:"Hebrew",script:"Hebrew"},{lang:"hi",full_name:"Hindi",script:"Devanagari"},{lang:"hr",full_name:"Croatian",script:"Latin"},{lang:"hu",full_name:"Hungarian",script:"Latin"},{lang:"id",full_name:"Indonesian",script:"Latin"},{lang:"it",full_name:"Italian",script:"Latin"},{lang:"ja",full_name:"Japanese",script:""},{lang:"ko",full_name:"Korean",script:"Hangul"},{lang:"lt",full_name:"Lithuanian",script:"Latin"},{lang:"lv",full_name:"Latvian",script:"Latin"},{lang:"ne",full_name:"Nepali",script:"Devanagari"},{lang:"nl",full_name:"Dutch",script:"Latin"},{lang:"no",full_name:"Norwegian",script:"Latin"},{lang:"mr",full_name:"Marathi",script:"Devanagari"},{lang:"mt",full_name:"Maltese",script:"Latin"},{lang:"pl",full_name:"Polish",script:"Latin"},{lang:"pt",full_name:"Portuguese",script:"Latin"},{lang:"ro",full_name:"Romanian",script:"Latin"},{lang:"ru",full_name:"Russian",script:"Cyrillic"},{lang:"sk",full_name:"Slovak",script:"Latin"},{lang:"sl",full_name:"Slovenian",script:"Latin"},{lang:"sv",full_name:"Swedish",script:"Latin"},{lang:"tr",full_name:"Turkish",script:"Latin"},{lang:"uk",full_name:"Ukrainian",script:"Cyrillic"},{lang:"ur",full_name:"Urdu",script:"Arabic"},{lang:"vi",full_name:"Vietnamese",script:"Latin"},{lang:"zh-Hans",full_name:"Chinese (Simplified)",script:"Han"},{lang:"zh-Hant",full_name:"Chinese (Traditional)",script:"Han"}];function Ti(i,e){return[{id:"background",type:"background",paint:{"background-color":e.background}},{id:"earth",type:"fill",filter:["==","$type","Polygon"],source:i,"source-layer":"earth",paint:{"fill-color":e.earth}},...e.landcover?[{id:"landcover",type:"fill",source:i,"source-layer":"landcover",paint:{"fill-color":["match",["get","kind"],"grassland",e.landcover.grassland,"barren",e.landcover.barren,"urban_area",e.landcover.urban_area,"farmland",e.landcover.farmland,"glacier",e.landcover.glacier,"scrub",e.landcover.scrub,e.landcover.forest],"fill-opacity":["interpolate",["linear"],["zoom"],5,1,7,0]}}]:[],{id:"landuse_park",type:"fill",source:i,"source-layer":"landuse",filter:["in","kind","national_park","park","cemetery","protected_area","nature_reserve","forest","golf_course","wood","nature_reserve","forest","scrub","grassland","grass","military","naval_base","airfield"],paint:{"fill-opacity":["interpolate",["linear"],["zoom"],6,0,11,1],"fill-color":["case",["in",["get","kind"],["literal",["national_park","park","cemetery","protected_area","nature_reserve","forest","golf_course"]]],e.park_b,["in",["get","kind"],["literal",["wood","nature_reserve","forest"]]],e.wood_b,["in",["get","kind"],["literal",["scrub","grassland","grass"]]],e.scrub_b,["in",["get","kind"],["literal",["glacier"]]],e.glacier,["in",["get","kind"],["literal",["sand"]]],e.sand,["in",["get","kind"],["literal",["military","naval_base","airfield"]]],e.zoo,e.earth]}},{id:"landuse_urban_green",type:"fill",source:i,"source-layer":"landuse",filter:["in","kind","allotments","village_green","playground"],paint:{"fill-color":e.park_b,"fill-opacity":.7}},{id:"landuse_hospital",type:"fill",source:i,"source-layer":"landuse",filter:["==","kind","hospital"],paint:{"fill-color":e.hospital}},{id:"landuse_industrial",type:"fill",source:i,"source-layer":"landuse",filter:["==","kind","industrial"],paint:{"fill-color":e.industrial}},{id:"landuse_school",type:"fill",source:i,"source-layer":"landuse",filter:["in","kind","school","university","college"],paint:
|
||
|
|
<svg width="20px" height="20px" viewBox="0 0 50 50" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
||
|
|
<rect width="50" height="50" fill="#cccccc"/>
|
||
|
|
<g transform="translate(5,5)">
|
||
|
|
<path fill="none" stroke="#666666" stroke-width="7" d="m11,12a8.5,8 0 1,1 17,0q0,4-4,6t-4.5,4.5-.4,4v.2m0,3v7"/>
|
||
|
|
</g>
|
||
|
|
</svg>
|
||
|
|
`,xi=class xi{constructor(e){this.src=e,this.canvas=document.createElement("canvas"),this.mapping=new Map,this.missingBox={x:0,y:0,w:0,h:0}}load(){return A(this,null,function*(){let e=this.src,t=window.devicePixelRatio;e.endsWith(".html")&&(e=yield(yield fetch(e)).text());let n=new window.DOMParser().parseFromString(e,"text/html"),r=Array.from(n.body.children),a=yield xn(`data:image/svg+xml;base64,${btoa(Pa)}`),o=[{w:a.width*t,h:a.height*t,img:a,id:""}],s=new XMLSerializer;for(let d of r){let f=`data:image/svg+xml;base64,${btoa(s.serializeToString(d))}`,m=yield xn(f);o.push({w:m.width*t,h:m.height*t,img:m,id:d.id})}let c=bi(o);this.canvas.width=c.w,this.canvas.height=c.h;let u=this.canvas.getContext("2d");if(u)for(let d of o)d.x!==void 0&&d.y!==void 0&&(u.drawImage(d.img,d.x,d.y,d.w,d.h),d.id?this.mapping.set(d.id,{x:d.x,y:d.y,w:d.w,h:d.h}):this.missingBox={x:d.x,y:d.y,w:d.w,h:d.h});return this})}get(e){let t=this.mapping.get(e);return t||(t=this.missingBox),t}};l(xi,"Sheet");var yi=xi;return Mn(Sa);})();
|
||
|
|
//# sourceMappingURL=protomaps-leaflet.js.map
|