Upgrades maplibre-gl to v6.10.0 and modernizes script loading

This commit is contained in:
nine committed 2026-09-19 21:00:32 +02:00
1 parent c6c3075c5c
commit 177b70631b
7 files changed
+914 -101

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
/**
* MapLibre GL JS
* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.10.0/LICENSE.txt
*/
import{D as e,Dn as t,Dt as n,Et as r,F as i,G as a,H as o,Li as s,Lr as c,Mn as l,N as u,Nr as d,Pn as f,Qn as p,Sn as m,Tn as h,Vt as g,_,bt as v,c as y,cn as b,cr as x,d as S,dt as C,en as w,er as T,g as E,hr as D,i as O,kn as k,l as A,ln as j,mn as M,nn as N,o as P,or as F,pr as I,r as L,t as R,xn as z,z as B}from"./maplibre-gl-shared.mjs";function V(e){let t=typeof e;if(t===`number`||t===`boolean`||t===`string`||e==null)return JSON.stringify(e);if(Array.isArray(e)){let t=`[`;for(let n of e)t+=`${V(n)},`;return`${t}]`}let n=Object.keys(e).sort(),r=`{`;for(let t=0;t<n.length;t++)r+=`${JSON.stringify(n[t])}:${V(e[n[t]])},`;return`${r}}`}function H(e){let t=``;for(let n of M)t+=`/${V(e[n])}`;return t}function U(e,t){let n={};for(let r=0;r<e.length;r++){let i=t&&t[e[r].id]||H(e[r]);t&&(t[e[r].id]=i);let a=n[i];a||=n[i]=[],a.push(e[r])}let r=[];for(let e in n)r.push(n[e]);return r}var W=class{constructor(e,t){this.keyCache={},e&&this.replace(e,t)}replace(e,t){this._layerConfigs={},this._layers={},this.update(e,[],t)}update(e,t,n){for(let t of e){this._layerConfigs[t.id]=t;let e=this._layers[t.id]=_(t,n);e._featureFilter=b(e.filter,`layers[${t.id}].filter`,n),this.keyCache[t.id]&&delete this.keyCache[t.id]}for(let e of t)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};let r=U(Object.values(this._layerConfigs),this.keyCache);for(let e of r){let t=e.map(e=>this._layers[e.id]),n=t[0];if(n.isHidden())continue;let r=n.source||``,i=this.familiesBySource[r];i||=this.familiesBySource[r]={};let a=n.sourceLayer||`_geojsonTileLayer`,o=i[a];o||=i[a]=[],o.push(t)}}},G=class{constructor(e){let t={},n=[];for(let r in e){let i=e[r],a=t[r]={};for(let e in i){let t=i[e];if(!t||t.bitmap.width===0||t.bitmap.height===0)continue;let r={x:0,y:0,w:t.bitmap.width+2,h:t.bitmap.height+2};n.push(r),a[e]={rect:r,metrics:t.metrics}}}let{w:a,h:o}=i(n),s=new r({width:a||1,height:o||1});for(let n in e){let i=e[n];for(let e in i){let a=i[e];if(!a||a.bitmap.width===0||a.bitmap.height===0)continue;let o=t[n][e].rect;r.copy(a.bitmap,s,{x:0,y:0},{x:o.x+1,y:o.y+1},a.bitmap)}}this.image=s,this.positions=t}};N(`GlyphAtlas`,G);var K=class{constructor(e){this.tileID=new S(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.inFlightDependencies=[]}async parse(e,t,n,r,i){this.data=e,this.collisionBoxArray=new g;let a=new P(Object.keys(e.layers).sort()),o=new L(this.tileID,this.promoteId);o.bucketLayerIDs=[];let s={},c={featureIndex:o,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:n,subdivisionGranularity:i},l=t.familiesBySource[this.source];for(let t in l){let r=e.layers[t];if(!r)continue;r.version===1&&d(`Vector tile source "${this.source}" layer "${t}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let i=a.encode(t),u=[];for(let e=0;e<r.length;e++){let n=r.feature(e),a=o.getId(n,t);u.push({feature:n,id:a,index:e,sourceLayerIndex:i})}for(let e of l[t]){let t=e[0];t.source!==this.source&&d(`layer.source = ${t.source} does not equal this.source = ${this.source}`),!t.isHidden(this.zoom,!0)&&(q(e,this.zoom,n),(s[t.id]=t.createBucket({index:o.bucketLayerIDs.length,layers:e,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:i,sourceID:this.source})).populate(u,c,this.tileID.canonical),o.bucketLayerIDs.push(e.map(e=>e.id)))}}let f=D(c.glyphDependencies,e=>Object.keys(e));for(let e of this.inFlightDependencies)e?.abort();this.inFlightDependencies=[];let p=Promise.resolve({});if(Object.keys(f).length){let e=new AbortController;this.inFlightDependencies.push(e),p=r.sendAsync({type:`GG`,data:{stacks:f,source:this.source,tileID:this.tileID,type:`glyphs`}},e)}let m=Object.keys(c.iconDependencies),h=Promise.resolve({});if(m.length){let e=new AbortController;this.inFlightDependencies.push(e),h=r.sendAsync({type:`GI`,data:{icons:m,source:this.source,tileID:this.tileID,type:`icons`}},e)}let _=Object.keys(c.patternDependencies),v=Promise.resolve({});if(_.length){let e=new AbortController;this.inFlightDependencies.push(e),v=r.sendAsync({type:`GI`,data:{icons:_,source:this.source,tileID:this.tileID,type:`patterns`}},e)}let y=c.dashDependencies,b=Promise.resolve({});if(Object.keys(y).length){let e=new AbortController;this.inFlightDependencies.push(e),b=r.sendAsync({type:`GDA`,data:{dashes:y}},e)}let[x,S,C,w]=await Promise.all([p,h,v,b]),T=new G(x),E=new u(S,C);for(let e in s){let t=s[e];t.hasDependencies&&(q(t.layers,this.zoom,n),t.addFeatures({options:c,canonical:this.tileID.canonical,gLine truncated
//# sourceMappingURL=maplibre-gl-worker.mjs.map