@maptalks/vt 0.119.0 → 0.120.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/maptalks.vt.d.ts +269 -49
- package/dist/maptalks.vt.es.js +643 -631
- package/dist/maptalks.vt.es.js.map +1 -1
- package/dist/maptalks.vt.gpu.es.js +643 -631
- package/dist/maptalks.vt.js +729 -717
- package/dist/maptalks.vt.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @maptalks/vt v0.
|
|
2
|
+
* @maptalks/vt v0.120.0
|
|
3
3
|
* LICENSE : undefined
|
|
4
4
|
* (c) 2016-2026 maptalks.org
|
|
5
5
|
*/
|
|
@@ -31,7 +31,7 @@ import { buildNormals as N, buildTangents as z, packTangentFrame as V } from "@m
|
|
|
31
31
|
|
|
32
32
|
import U from "rbush";
|
|
33
33
|
|
|
34
|
-
const G = "${", B = `function(t){let e;const n={width:100,height:10};let r=!1;try{const t=new OffscreenCanvas(1,1);t.getContext("2d").fillText("hello",0,0),r=!0}catch(t){r=!1}function i(){if(!e){const{width:t,height:i}=n;r?e=new OffscreenCanvas(t,i):(e=document.createElement("canvas"),e.width=t,e.height=i)}return e}class o{constructor(t,e={}){if(!Array.isArray(t))return void console.error("colors is not array");if(t.length<2)return void console.error("colors.length should >1");this.colors=t;let r=1/0,i=-1/0;for(let e=0,n=t.length;e<n;e++){const n=t[e][0];r=Math.min(n,r),i=Math.max(n,i)}this.min=r,this.max=i,this.valueOffset=this.max-this.min,this.options=Object.assign({},n,e),this._initImgData()}getImageData(){return this.imgData}_initImgData(){const t=i(),{width:e,height:n}=this.options;t.width=e,t.height=n;const r=t.getContext("2d");r.clearRect(0,0,t.width,t.height);const o=r.createLinearGradient(0,0,t.width,0),{colors:s,valueOffset:a}=this;for(let t=0,e=s.length;t<e;t++){const[e,n]=s[t],r=(e-this.min)/a;o.addColorStop(r,n)}r.fillStyle=o,r.fillRect(0,0,t.width,t.height),this.imgData=r.getImageData(0,0,t.width,t.height)}getColor(t){t=Math.max(this.min,t);const e=((t=Math.min(t,this.max))-this.min)/this.valueOffset;let n=Math.round(e*this.imgData.width);n=Math.min(n,this.imgData.width-1);const r=4*n;return[this.imgData.data[r],this.imgData.data[r+1],this.imgData.data[r+2],this.imgData.data[r+3]]}}var s;function a(t){return null==t}function l(t){return!a(t)}function u(t){return""===t}function h(t,e){var n,r,i;if(w(t)){var o,s=t.stops&&"object"==typeof t.stops[0][0],a=s||l(t.property),u=s||!a,d=t.type||e||"exponential";if("exponential"===d)o=p;else if("interval"===d)o=f;else if("categorical"===d)o=c;else if("identity"===d)o=y;else if("color-interpolate"===d)o=g;else{if("calculate-expression"!==d)throw new Error('Unknown function type "'+d+'"');o=x}if(s){var m={},v=[];for(let e=0;e<t.stops.length;e++){var b=t.stops[e];void 0===m[b[0].zoom]&&(m[b[0].zoom]={zoom:b[0].zoom,type:t.type,property:t.property,default:t.default,stops:[]}),m[b[0].zoom].stops.push([b[0].value,b[1]])}for(let t in m)v.push([m[t].zoom,h(m[t])]);n=function(e,n){const r=p({stops:v,base:t.base},e)(e,n);return"function"==typeof r?r(e,n):r},r=!1,i=!1}else u?(n=function(e){const n=o(t,e);return"function"==typeof n?n(e):n},r=!0,i=!1):(n=function(e,n){const r=o(t,n?n[t.property]:null);return"function"==typeof r?r(e,n):r},r=!1,i=!0)}else n=function(){return t},r=!0,i=!0;return n.isZoomConstant=i,n.isFeatureConstant=r,n}function c(t,e){for(let n=0;n<t.stops.length;n++)if(e===t.stops[n][0])return t.stops[n][1];return t.default}function f(t,e){for(var n=0;n<t.stops.length&&!(e<t.stops[n][0]);n++);return t.stops[Math.max(n-1,0)][1]}function p(t,e){for(var n=l(t.base)&&!u(t.base)?t.base:1,r=0;!(r>=t.stops.length||e<=t.stops[r][0]);)r++;return 0===r?t.stops[r][1]:r===t.stops.length?t.stops[r-1][1]:m(e,n,t.stops[r-1][0],t.stops[r][0],t.stops[r-1][1],t.stops[r][1])}"function"==typeof Map&&(s=new Map);const d={width:100,height:1};function g(t,e){const n=t.stops;if(n&&n.length>1){let t;if(s){const e=JSON.stringify(n);if(!s.has(e)){const t=new o(n,d);s.set(e,t)}t=s.get(e)}else t=new o(n,d);const[r,i,a,l]=t.getColor(e);return[r/255,i/255,a/255,l/255]}return n&&1===n.length?n[0][1]:null}function y(t,e){return n=e,r=t.default,l(n)?n:l(r)?r:l(i)?i:null;var n,r,i}function x(t,e){const n=String(t.property),r=t.expression,i=e;function o(e){return a(e)||u(e)||isNaN(e)?t.default:e}if(!l(e)||u(e)||isNaN(e)||e<0)return o(t.default);{const e=function t(e,n,r){const i=Number(r),o=String(n);return Array.isArray(e)?e.map((e=>t(e,o,i))):e===o?i:e}(r,n,i);return o(function e(n){if(!Array.isArray(n)){if("number"==typeof n)return n;throw new Error("Invalid expression format")}{const r=n[0];if(!["+","-","*","/"].includes(r))throw new Error(\`Unknown operator: ${G}r}\`);const i=n.slice(1).map((t=>e(t)));switch(r){case"+":return i.reduce(((t,e)=>t+e),0);case"-":return i.reduce(((t,e)=>t-e));case"*":return i.reduce(((t,e)=>t*e),1);case"/":return i.some((t=>0===t))?t.default:i.reduce(((t,e)=>t/e));default:throw new Error(\`Unsupported operator: ${G}r}\`)}}}(e))}}function m(t,e,n,r,i,o){return"function"==typeof i?function(){var s=i.apply(void 0,arguments),a=o.apply(void 0,arguments);return m(t,e,n,r,s,a)}:i.length?function(t,e,n,r,i,o){var s=[];for(let a=0;a<i.length;a++)s[a]=v(t,e,n,r,i[a],o[a]);return s}(t,e,n,r,i,o):v(t,e,n,r,i,o)}function v(t,e,n,r,i,o){var s,a=r-n,l=t-n;return i*(1-(s=1===e?l/a:(Math.pow(e,l)-1)/(Math.pow(e,a)-1)))+o*s}function w(t){return t&&"object"==typeof t&&(t.stops||t.property&&"identity"===t.type||t.expression&&"calculate-expression"===t.type)}function b(t){return M(t,"interval")}function M(t,e){if(!w(t))return function(){return t};let n=!0,r=!0;const i=(t=JSON.parse(JSON.stringify(t))).stops;if(i)for(let t=0;t<i.length;t++)if(w(i[t][1])){const o=M(i[t][1],e);n=n&&o.isZoomConstant,r=r&&o.isFeatureConstant,i[t]=[i[t][0],o]}const o=h(t,e);return o.isZoomConstant=n&&o.isZoomConstant,o.isFeatureConstant=r&&o.isFeatureConstant,o}let P=0;const _="function"==typeof Object.assign;function A(t,...e){if(_)return Object.assign(t,...e),t;for(let n=0;n<e.length;n++){const r=e[n];for(const e in r)t[e]=r[e]}return t}function I(t){return!k(t)&&("string"==typeof t||null!==t.constructor&&t.constructor===String)}function S(t){return"number"==typeof t&&!isNaN(t)}function T(t){return!k(t)&&("function"==typeof t||null!==t.constructor&&t.constructor===Function)}function F(t){return!Array.isArray(t)&&"object"==typeof t&&!!t}function k(t){return null==t}function L(t){return w(t)&&t.property}const C=new TextEncoder;new TextDecoder;const B="function"==typeof fetch&&"function"==typeof AbortController,O={jsonp:function(t,e){const n="_maptalks_jsonp_"+P++;t.match(/\\?/)?t+="&callback="+n:t+="?callback="+n;let r=document.createElement("script");return r.type="text/javascript",r.src=t,window[n]=function(t){e(null,t),document.getElementsByTagName("head")[0].removeChild(r),r=null,delete window[n]},document.getElementsByTagName("head")[0].appendChild(r),this},get:function(t,e,n){if(T(e)){const t=n;n=e,e=t}let r=(e=e||{}).errorLog;k(r)&&(r=!0),e.method&&(e.method=e.method.toUpperCase());const i="POST"===e.method;if(B){const i=new AbortController,o=e;o.signal=i.signal,o.referrerPolicy=o.referrerPolicy||"origin",o.method=o.method||"GET";const s=new Request(t,o);return e.returnJSON&&s.headers.set("Accept","application/json"),fetch(s).then((i=>{const o=this._parseResponse(i,e.returnJSON,e.responseType);o.message?(o.url=t,n(o)):o.then((t=>{"arraybuffer"===e.responseType?n(null,{data:t,cacheControl:i.headers.get("Cache-Control"),expires:i.headers.get("Expires"),contentType:i.headers.get("Content-Type")}):n(null,t)})).catch((e=>{e.code&&e.code===DOMException.ABORT_ERR||(r&&console.error("Fetch error:",t,e),n(e))}))})).catch((e=>{e.code&&e.code===DOMException.ABORT_ERR||(r&&console.error("Fetch error:",t,e),n(e))})),i}{const r=O._getClient(n);if(r.open(e.method||"GET",t,!0),e){for(const t in e.headers)r.setRequestHeader(t,e.headers[t]);r.withCredentials="include"===e.credentials,e.responseType&&(r.responseType=e.responseType)}return r.send(i?e.body:null),r}},_parseResponse:(t,e,n)=>200!==t.status?{status:t.status,statusText:t.statusText,message:\`incorrect http request with status code(${G}t.status}): ${G}t.statusText}\`}:"arraybuffer"===n?t.arrayBuffer():e?t.json():t.text(),_wrapCallback:function(t,e){return function(){if(4===t.readyState)if(200===t.status)if("arraybuffer"===t.responseType){0===t.response.byteLength?e({status:200,statusText:t.statusText,message:"http status 200 returned without content."}):e(null,{data:t.response,cacheControl:t.getResponseHeader("Cache-Control"),expires:t.getResponseHeader("Expires"),contentType:t.getResponseHeader("Content-Type")})}else e(null,t.responseText);else e({status:t.status,statusText:t.statusText,message:\`incorrect http request with status code(${G}t.status}): ${G}t.statusText}\`})}},_getClient:function(t){let e;try{e=new XMLHttpRequest}catch(t){try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}}return e.onreadystatechange=O._wrapCallback(e,t),e},getArrayBuffer(t,e,n){if(T(e)){const t=n;n=e,e=t}return e||(e={}),e.responseType="arraybuffer",O.get(t,e,n)}};function Y(t,e,n,r,i=3){let o=r;const s=n-e>>1;let a,l=n-e;const u=t[e],h=t[e+1],c=t[n],f=t[n+1];for(let r=e+i;r<n;r+=i){const e=V(t[r],t[r+1],u,h,c,f);if(e>o)a=r,o=e;else if(e===o){const t=Math.abs(r-s);t<l&&(a=r,l=t)}}o>r&&(a-e>i&&Y(t,e,a,r,i),t[a+2]=o,n-a>i&&Y(t,a,n,r,i))}function V(t,e,n,r,i,o){let s=i-n,a=o-r;if(0!==s||0!==a){const l=((t-n)*s+(e-r)*a)/(s*s+a*a);l>1?(n=i,r=o):l>0&&(n+=s*l,r+=a*l)}return s=t-n,a=e-r,s*s+a*a}function X(t,e,n,r,i,o){const s={id:null==t?null:t,type:e,geometry:n,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};i&&(s.layer=i);return function(t,e){const n=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)N(t,n,e);else if("Polygon"===r)N(t,n[0],e);else if("MultiLineString"===r)for(const r of n)N(t,r,e);else if("MultiPolygon"===r)for(const r of n)N(t,r[0],e)}(s,o?4:3),s}function N(t,e,n){for(let r=0;r<e.length;r+=n)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function E(t,e,n,r){if(r.layer=e,"FeatureCollection"===n.type)for(let e=0;e<n.features.length;e++)z(t,n.features[e],r,e);else"Feature"===n.type?z(t,n,r):z(t,{geometry:n},r)}function z(t,e,n,r){if(!e.geometry)return;const i=e.geometry.coordinates,o=e.geometry.type,s=Math.pow(n.tolerance/((1<<n.maxZoom)*n.extent),2);let a=[],l=e.id;if(n.promoteId?l=e.properties[n.promoteId]:n.generateId&&(l=r||0),"Point"===o)$(i,a,n);else if("MultiPoint"===o)for(const t of i)$(t,a,n);else if("LineString"===o)D(i,a,s,!1,n);else if("MultiLineString"===o){if(n.lineMetrics){for(const r of i)a=[],D(r,a,s,!1,n),t.push(X(l,"LineString",a,e.properties,n.layer,n.hasAltitude));return}q(i,a,s,!1,n)}else if("Polygon"===o)q(i,a,s,!0,n);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(const i of e.geometry.geometries)z(t,{id:l,geometry:i,properties:e.properties},n,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const t of i){const e=[];q(t,e,s,!0,n),a.push(e)}}t.push(X(l,o,a,e.properties,n.layer,n.hasAltitude))}function $(t,e,n){e.push(G(t[0]),j(t[1],n.projection),0),n.hasAltitude&&(t.length>2?e.push(t[2]):e.push(0))}function D(t,e,n,r,i){let o,s,a=0;for(let n=0;n<t.length;n++){const l=G(t[n][0]),u=j(t[n][1],i.projection);e.push(l,u,0),i.hasAltitude&&(t[n].length>2?e.push(t[n][2]):e.push(0)),n>0&&(a+=r?(o*u-l*s)/2:Math.sqrt(Math.pow(l-o,2)+Math.pow(u-s,2))),o=l,s=u}const l=i.hasAltitude?4:3,u=e.length-l;e[2]=1,Y(e,0,u,n,l),e[u+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function q(t,e,n,r,i){for(let o=0;o<t.length;o++){const s=[];D(t[o],s,n,r,i),e.push(s)}}function G(t){return t/360+.5}function j(t,e){if("EPSG:4326"===e)return(90-t)/360;const n=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+n)/(1-n))/Math.PI;return r<0?0:r>1?1:r}function Z(t,e,n,r,i,o,s,a){if(r/=e,o>=(n/=e)&&s<r)return t;if(s<n||o>=r)return null;const l=[];for(const e of t){const t=e.geometry;let o=e.type;const s=0===i?e.minX:e.minY,u=0===i?e.maxX:e.maxY;if(s>=n&&u<r){l.push(e);continue}if(u<n||s>=r)continue;let h=[];if("Point"===o||"MultiPoint"===o)U(t,h,n,r,i,a.hasAltitude);else if("LineString"===o)R(t,h,n,r,i,!1,a.lineMetrics,a.hasAltitude);else if("MultiLineString"===o)H(t,h,n,r,i,!1,a.hasAltitude);else if("Polygon"===o)H(t,h,n,r,i,!0,a.hasAltitude);else if("MultiPolygon"===o)for(const e of t){const t=[];H(e,t,n,r,i,!0,a.hasAltitude),t.length&&h.push(t)}if(h.length){if(a.lineMetrics&&"LineString"===o){for(const t of h)l.push(X(e.id,o,t,e.tags,e.layer,a.hasAltitude));continue}"LineString"!==o&&"MultiLineString"!==o||(1===h.length?(o="LineString",h=h[0]):o="MultiLineString"),"Point"!==o&&"MultiPoint"!==o||(o=3===h.length?"Point":"MultiPoint"),l.push(X(e.id,o,h,e.tags,e.layer,a.hasAltitude))}}return l.length?l:null}function U(t,e,n,r,i,o){const s=o?4:3;for(let a=0;a<t.length;a+=s){const s=t[a+i];s>=n&&s<=r&&(W(e,t[a],t[a+1],t[a+2]),o&&e.push(t[a+3]))}}function R(t,e,n,r,i,o,s,a){let l=J(t);const u=0===i?K:Q;let h,c,f=t.start;const p=a?4:3,d=o?t.length:t.length-p;for(let g=0;g<d;g+=p){const y=t[g],x=t[g+1],m=t[g+2];let v,w,b,M;o&&g===d-p?(v=t[0],w=t[1]):(v=t[g+p],w=t[g+p+1]),a&&(b=t[g+3],M=o&&g===d-p?t[3]:t[g+p+3]);const P=0===i?y:x,_=0===i?v:w;let A=!1;s&&(h=Math.sqrt(Math.pow(y-v,2)+Math.pow(x-w,2))),P<n?_>n&&(c=u(l,y,x,v,w,n),a&&l.push(tt(b,M,c)),s&&(l.start=f+h*c)):P>r?_<r&&(c=u(l,y,x,v,w,r),a&&l.push(tt(b,M,c)),s&&(l.start=f+h*c)):(W(l,y,x,m),a&&l.push(b)),_<n&&P>=n&&(c=u(l,y,x,v,w,n),a&&l.push(tt(b,M,c)),A=!0),_>r&&P<=r&&(c=u(l,y,x,v,w,r),a&&l.push(tt(b,M,c)),A=!0),!o&&A&&(s&&(l.end=f+h*c),e.push(l),l=J(t)),s&&(f+=h)}let g=t.length-p;if(!o){const e=t[g],o=t[g+1],s=t[g+2],u=0===i?e:o;if(u>=n&&u<=r&&W(l,e,o,s),u>=n&&u<=r&&a){const e=t[g+3];l.push(e)}}g=l.length-p,o&&g>=p&&(l[g]!==l[0]||l[g+1]!==l[1])&&(W(l,l[0],l[1],l[2]),a&&l.push(l[3])),l.length&&e.push(l)}function J(t){const e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function H(t,e,n,r,i,o,s){for(const a of t)R(a,e,n,r,i,o,!1,s)}function W(t,e,n,r){t.push(e,n,r)}function K(t,e,n,r,i,o){const s=(o-e)/(r-e);return W(t,o,n+(i-n)*s,1),s}function Q(t,e,n,r,i,o){const s=(o-n)/(i-n);return W(t,e+(r-e)*s,o,1),s}function tt(t,e,n){return t+(e-t)*n}function et(t,e,n){const r=[];for(let i=0;i<t.length;i++){const o=t[i],s=o.type;let a;if("Point"===s||"MultiPoint"===s||"LineString"===s)a=nt(o.geometry,e,n);else if("MultiLineString"===s||"Polygon"===s){a=[];for(const t of o.geometry)a.push(nt(t,e,n))}else if("MultiPolygon"===s){a=[];for(const t of o.geometry){const r=[];for(const i of t)r.push(nt(i,e,n));a.push(r)}}r.push(X(o.id,s,a,o.tags,o.layer,n))}return r}function nt(t,e,n){const r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);const i=n?4:3;for(let o=0;o<t.length;o+=i)r.push(t[o]+e,t[o+1],t[o+2]),n&&r.push(t[o+3]);return r}function rt(t,e,n){if(t.transformed)return t;const r=1<<t.z,i=t.x,o=t.y,s=n?3:2;for(const a of t.features){const t=a.geometry,l=a.type;if(a.geometry=[],1===l)for(let l=0;l<t.length;l+=s)a.geometry.push(it(t[l],t[l+1],e,r,i,o)),n&&a.geometry[a.geometry.length-1].push(t[l+2]);else for(let l=0;l<t.length;l++){const u=[];for(let a=0;a<t[l].length;a+=s)u.push(it(t[l][a],t[l][a+1],e,r,i,o)),n&&u[u.length-1].push(t[l][a+2]);a.geometry.push(u)}}return t.transformed=!0,t}function it(t,e,n,r,i,o){return[Math.round(n*(t*r-i)),Math.round(n*(e*r-o))]}function ot(t,e,n,r,i){const o=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:t.length,source:null,x:n,y:r,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const e of t)st(s,e,o,i);return s}function st(t,e,n,r){const i=e.geometry,o=e.type,s=[],a=r.hasAltitude?4:3;if(t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),"Point"===o||"MultiPoint"===o)for(let e=0;e<i.length;e+=a)s.push(i[e],i[e+1]),r.hasAltitude&&s.push(i[e+3]),t.numPoints++,t.numSimplified++;else if("LineString"===o)lt(s,i,t,n,!1,!1,r);else if("MultiLineString"===o||"Polygon"===o)for(let e=0;e<i.length;e++)lt(s,i[e],t,n,"Polygon"===o,0===e,r);else if("MultiPolygon"===o)for(let e=0;e<i.length;e++){const o=i[e];for(let e=0;e<o.length;e++)lt(s,o[e],t,n,!0,0===e,r)}if(s.length){let n=e.tags||null;if("LineString"===o&&r.lineMetrics){n={};for(const t in e.tags)n[t]=e.tags[t];n.mapbox_clip_start=i.start/i.size,n.mapbox_clip_end=i.end/i.size}const a={geometry:s,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:n};e.layer&&(a.layer=e.layer),null!==e.id&&(a.id=e.id),t.features.push(a)}}function at(t,e,n){return 0===t[e+2]&&t[e+3]>0&&n}function lt(t,e,n,r,i,o,s){const a=r*r,{hasAltitude:l,disableFilter:u}=s,h=l?4:3;if(!u&&r>0&&e.size<(i?a:r))return void(n.numPoints+=e.length/h);const c=[];for(let t=0;t<e.length;t+=h)(0===r||e[t+2]>a||at(e,t,l))&&(n.numSimplified++,c.push(e[t],e[t+1]),l&&c.push(e[t+3])),n.numPoints++;i&&function(t,e,n){const r=n?3:2;let i=0;for(let e=0,n=t.length,o=n-r;e<n;o=e,e+=r)i+=(t[e]-t[o])*(t[e+1]+t[o+1]);if(i>0===e){const e=r,i=r-1,o=r-2;for(let s=0,a=t.length;s<a/2;s+=r){const r=t[s],l=t[s+1];let u;n&&(u=t[s+2]),t[s]=t[a-e-s],t[s+1]=t[a-i-s],n&&(t[s+2]=t[a-o-s]),t[a-e-s]=r,t[a-i-s]=l,n&&(t[a-o-s]=u)}}}(c,o,l),t.push(c)}O.getJSON=function(t,e,n){if(T(e)){const t=n;n=e,e=t}const r=function(t,e){const r="string"==typeof e?JSON.parse(e):e||null;n(t,r)};return e&&e.jsonp?O.jsonp(t,r):((e=e||{}).returnJSON=!0,O.get(t,e,r))};const ut={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,hasAltitude:!1,disableFilter:!1,debug:0};class ht{constructor(t,e){const n=(e=this.options=function(t,e){for(const n in e)t[n]=e[n];return t}(Object.create(ut),e)).debug;if(n&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");let r=function(t,e){const n=[];if(Array.isArray(t)){for(let r=0;r<t.length;r++)E(n,t[r].layer,t[r].data,e);return n}if("FeatureCollection"===t.type)for(let r=0;r<t.features.length;r++)z(n,t.features[r],e,r);else"Feature"===t.type?z(n,t,e):z(n,{geometry:t},e);return n}(t,e);this.tiles={},this.tileCoords=[],n&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),r=function(t,e){const n=e.buffer/e.extent;let r=t;const i=Z(t,1,-1-n,n,0,-1,2,e),o=Z(t,1,1-n,2+n,0,-1,2,e);return(i||o)&&(r=Z(t,1,-n,1+n,0,-1,2,e)||[],i&&(r=et(i,1,e.hasAltitude).concat(r)),o&&(r=r.concat(et(o,-1,e.hasAltitude)))),r}(r,e),r.length&&this.splitTile(r,0,0,0),n&&(r.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(t,e,n,r,i,o,s){const a=[t,e,n,r],l=this.options,u=l.debug;for(;a.length;){r=a.pop(),n=a.pop(),e=a.pop(),t=a.pop();const h=1<<e,c=ct(e,n,r);let f=this.tiles[c];if(!f&&(u>1&&console.time("creation"),f=this.tiles[c]=ot(t,e,n,r,l),this.tileCoords.push({z:e,x:n,y:r}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,n,r,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));const t=\`z${G}e}\`;this.stats[t]=(this.stats[t]||0)+1,this.total++}if(f.source=t,null==i){if(e===l.indexMaxZoom||f.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===i)continue;if(null!=i){const t=i-e;if(n!==o>>t||r!==s>>t)continue}}if(f.source=null,0===t.length)continue;u>1&&console.time("clipping");const p=.5*l.buffer/l.extent,d=.5-p,g=.5+p,y=1+p;let x=null,m=null,v=null,w=null,b=Z(t,h,n-p,n+g,0,f.minX,f.maxX,l),M=Z(t,h,n+d,n+y,0,f.minX,f.maxX,l);t=null,b&&(x=Z(b,h,r-p,r+g,1,f.minY,f.maxY,l),m=Z(b,h,r+d,r+y,1,f.minY,f.maxY,l),b=null),M&&(v=Z(M,h,r-p,r+g,1,f.minY,f.maxY,l),w=Z(M,h,r+d,r+y,1,f.minY,f.maxY,l),M=null),u>1&&console.timeEnd("clipping"),a.push(x||[],e+1,2*n,2*r),a.push(m||[],e+1,2*n,2*r+1),a.push(v||[],e+1,2*n+1,2*r),a.push(w||[],e+1,2*n+1,2*r+1)}}getTile(t,e,n){t=+t,e=+e,n=+n;const r=this.options,{extent:i,debug:o}=r,{hasAltitude:s,wrapX:a}=r;if(t<0||t>24)return null;if(a){const n=1<<t;e=e+n&n-1}const l=ct(t,e,n);if(this.tiles[l])return rt(this.tiles[l],i,s);o>1&&console.log("drilling down to z%d-%d-%d",t,e,n);let u,h=t,c=e,f=n;for(;!u&&h>0;)h--,c>>=1,f>>=1,u=this.tiles[ct(h,c,f)];return u&&u.source?(o>1&&(console.log("found parent tile z%d-%d-%d",h,c,f),console.time("drilling down")),this.splitTile(u.source,h,c,f,t,e,n),o>1&&console.timeEnd("drilling down"),this.tiles[l]?rt(this.tiles[l],i,s):null):null}}function ct(t,e,n){return 32*((1<<t)*n+e)+t}function ft(t,e,n,r,i,o,s){const a=n&&Array.isArray(n[0]);for(let l=0,u=n.length;l<u;l++){t[e]=(a?n[l][0]:n[l].x)*r,t[e+1]=(a?n[l][1]:n[l].y)*r,s!==Float32Array&&(t[e]=Math.round(t[e]),t[e+1]=Math.round(t[e+1]));let h=i||0;Array.isArray(i)&&(h=i[l]),h=h?Math.round(r*h):0,t[e+2]=h,e+=3,o&&0!==l&&l!==u-1&&(t[e]=t[e-3],t[e+1]=t[e-2],t[e+2]=t[e-1],e+=3)}return t.trySetLength&&t.trySetLength(e),e}function pt(t,e,n,r){const i=t[3*e],o=t[3*e+1],s=t[3*n],a=t[3*n+1];return i===s&&(i<0||i>r)||o===a&&(o<0||o>r)}var dt="undefined"!=typeof Float32Array?Float32Array:Array;function gt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function yt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function xt(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function mt(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function vt(t,e,n){return t[0]=e,t[1]=n,t}function wt(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),function(){var t,e=(t=new dt(3),dt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t)}(),function(){var t,e=(t=new dt(4),dt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}(),function(){var t,e=(t=new dt(2),dt!=Float32Array&&(t[0]=0,t[1]=0),t)}();const bt=Math.PI/180,Mt=6378137*Math.PI/180,Pt=85.0511287798;function _t(t,e,n){if("EPSG:3857"===n)return function(t,e){const n=Pt,r=e[0],i=Math.max(Math.min(n,e[1]),-n);let o;o=0===i?0:Math.log(Math.tan((90+i)*bt/2))/bt;return t[0]=r*Mt,t[1]=o*Mt,t}(t,e);if("EPSG:4326"===n||"EPSG:4490"===n||"identity"===n)return At(t,e);if("baidu"===n)return At(t,e);throw new Error("unsupported projection:"+n)}function At(t,e){return t[0]=e[0],t[1]=e[1],t}function It(t,e,n,r,i,o,s,a,l,u,h,c,f,p,d){0===t?function(t,e,n,r,i,o,s,a,l,u){const h=1/(100*o[0]),c=1/(100*o[1]),f=u&&u[0]||0,p=u&&u[1]||0,d=[0,0];for(let i=t;i<e;i+=3){const t=i/3*2,e=r[i]-f,o=r[i+1]-p;n[t]=d[0]+e/s*h/a,n[t+1]=d[1]-o/s*c/l}}(e,n,r,i,0,s,a,l,u,d):1===t&&function(t,e,n,r,i,o,s,a,l,u,h){if(!t)return;let c,f,p,d;0===t[4]?(c=t[0],f=t[1],p=t[2],d=t[3]):(c=t[1],f=t[2],p=t[3],d=t[0]);const g=wt(c,f),y=wt(f,p),x=[],m=[],v=[];for(let t=e;t<n;t+=3){const e=t/3*2;vt(x,(o.x/l+i[t]/s)*a,o.y/l*a+(h?i[t+1]:-i[t+1])/s*a),"EPSG:4326"!==u&&"EPSG:4490"!==u||_t(x,x,"EPSG:3857"),St(m,x,c,f),St(v,x,d,c),r[e]=wt(c,m)/g,r[e+1]=wt(c,v)/y}}(h,e,n,r,i,o,a,c,f,p,!!d)}function St(t,e,n,r){const i=n[0]-r[0],o=n[1]-r[1];let s=(e[0]-n[0])*(n[0]-r[0])+(e[1]-n[1])*(n[1]-r[1]);return s/=i*i+o*o,t[0]=n[0]+s*i,t[1]=n[1]+s*o,t}function Tt(t,e,n,r,i){const o=3*e[n-1],s=3*e[n-1]+1,a=t[o],l=t[s];return u=r,h=i,c=a,f=l,Math.sqrt((c-u)*(c-u)+(f-h)*(f-h));var u,h,c,f}function Ft(t,e,n=2){const r=e&&e.length,i=r?e[0]*n:t.length;let o=kt(t,0,i,n,!0);const s=[];if(!o||o.next===o.prev)return s;let a,l,u;if(r&&(o=function(t,e,n,r){const i=[];for(let n=0,o=e.length;n<o;n++){const s=kt(t,e[n]*r,n<o-1?e[n+1]*r:t.length,r,!1);s===s.next&&(s.steiner=!0),i.push($t(s))}i.sort(Xt);for(let t=0;t<i.length;t++)n=Nt(i[t],n);return n}(t,e,o,n)),t.length>80*n){a=1/0,l=1/0;let e=-1/0,r=-1/0;for(let o=n;o<i;o+=n){const n=t[o],i=t[o+1];n<a&&(a=n),i<l&&(l=i),n>e&&(e=n),i>r&&(r=i)}u=Math.max(e-a,r-l),u=0!==u?32767/u:0}return Ct(o,s,n,a,l,u,0),s}function kt(t,e,n,r,i){let o;if(i===function(t,e,n,r){let i=0;for(let o=e,s=n-r;o<n;o+=r)i+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return i}(t,e,n,r)>0)for(let i=e;i<n;i+=r)o=Kt(i/r|0,t[i],t[i+1],o);else for(let i=n-r;i>=e;i-=r)o=Kt(i/r|0,t[i],t[i+1],o);return o&&Zt(o,o.next)&&(Qt(o),o=o.next),o}function Lt(t,e){if(!t)return t;e||(e=t);let n,r=t;do{if(n=!1,r.steiner||!Zt(r,r.next)&&0!==jt(r.prev,r,r.next))r=r.next;else{if(Qt(r),r=e=r.prev,r===r.next)break;n=!0}}while(n||r!==e);return e}function Ct(t,e,n,r,i,o,s){if(!t)return;!s&&o&&function(t,e,n,r){let i=t;do{0===i.z&&(i.z=zt(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){let e,n=1;do{let r,i=t;t=null;let o=null;for(e=0;i;){e++;let s=i,a=0;for(let t=0;t<n&&(a++,s=s.nextZ,s);t++);let l=n;for(;a>0||l>0&&s;)0!==a&&(0===l||!s||i.z<=s.z)?(r=i,i=i.nextZ,a--):(r=s,s=s.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;i=s}o.nextZ=null,n*=2}while(e>1)}(i)}(t,r,i,o);let a=t;for(;t.prev!==t.next;){const l=t.prev,u=t.next;if(o?Ot(t,r,i,o):Bt(t))e.push(l.i,t.i,u.i),Qt(t),t=u.next,a=u.next;else if((t=u)===a){s?1===s?Ct(t=Yt(Lt(t),e),e,n,r,i,o,2):2===s&&Vt(t,e,n,r,i,o):Ct(Lt(t),e,n,r,i,o,1);break}}}function Bt(t){const e=t.prev,n=t,r=t.next;if(jt(e,n,r)>=0)return!1;const i=e.x,o=n.x,s=r.x,a=e.y,l=n.y,u=r.y,h=Math.min(i,o,s),c=Math.min(a,l,u),f=Math.max(i,o,s),p=Math.max(a,l,u);let d=r.next;for(;d!==e;){if(d.x>=h&&d.x<=f&&d.y>=c&&d.y<=p&&qt(i,a,o,l,s,u,d.x,d.y)&&jt(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function Ot(t,e,n,r){const i=t.prev,o=t,s=t.next;if(jt(i,o,s)>=0)return!1;const a=i.x,l=o.x,u=s.x,h=i.y,c=o.y,f=s.y,p=Math.min(a,l,u),d=Math.min(h,c,f),g=Math.max(a,l,u),y=Math.max(h,c,f),x=zt(p,d,e,n,r),m=zt(g,y,e,n,r);let v=t.prevZ,w=t.nextZ;for(;v&&v.z>=x&&w&&w.z<=m;){if(v.x>=p&&v.x<=g&&v.y>=d&&v.y<=y&&v!==i&&v!==s&&qt(a,h,l,c,u,f,v.x,v.y)&&jt(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,w.x>=p&&w.x<=g&&w.y>=d&&w.y<=y&&w!==i&&w!==s&&qt(a,h,l,c,u,f,w.x,w.y)&&jt(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;v&&v.z>=x;){if(v.x>=p&&v.x<=g&&v.y>=d&&v.y<=y&&v!==i&&v!==s&&qt(a,h,l,c,u,f,v.x,v.y)&&jt(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;w&&w.z<=m;){if(w.x>=p&&w.x<=g&&w.y>=d&&w.y<=y&&w!==i&&w!==s&&qt(a,h,l,c,u,f,w.x,w.y)&&jt(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function Yt(t,e){let n=t;do{const r=n.prev,i=n.next.next;!Zt(r,i)&&Ut(r,n,n.next,i)&&Ht(r,i)&&Ht(i,r)&&(e.push(r.i,n.i,i.i),Qt(n),Qt(n.next),n=t=i),n=n.next}while(n!==t);return Lt(n)}function Vt(t,e,n,r,i,o){let s=t;do{let t=s.next.next;for(;t!==s.prev;){if(s.i!==t.i&&Gt(s,t)){let a=Wt(s,t);return s=Lt(s,s.next),a=Lt(a,a.next),Ct(s,e,n,r,i,o,0),void Ct(a,e,n,r,i,o,0)}t=t.next}s=s.next}while(s!==t)}function Xt(t,e){let n=t.x-e.x;if(0===n&&(n=t.y-e.y,0===n)){n=(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)}return n}function Nt(t,e){const n=function(t,e){let n=e;const r=t.x,i=t.y;let o,s=-1/0;if(Zt(t,n))return n;do{if(Zt(t,n.next))return n.next;if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){const t=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=r&&t>s&&(s=t,o=n.x<n.next.x?n:n.next,t===r))return o}n=n.next}while(n!==e);if(!o)return null;const a=o,l=o.x,u=o.y;let h=1/0;n=o;do{if(r>=n.x&&n.x>=l&&r!==n.x&&Dt(i<u?r:s,i,l,u,i<u?s:r,i,n.x,n.y)){const e=Math.abs(i-n.y)/(r-n.x);Ht(n,t)&&(e<h||e===h&&(n.x>o.x||n.x===o.x&&Et(o,n)))&&(o=n,h=e)}n=n.next}while(n!==a);return o}(t,e);if(!n)return e;const r=Wt(n,t);return Lt(r,r.next),Lt(n,n.next)}function Et(t,e){return jt(t.prev,t,e.prev)<0&&jt(e.next,t,t.next)<0}function zt(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function $t(t){let e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function Dt(t,e,n,r,i,o,s,a){return(i-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(r-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(i-s)*(r-a)}function qt(t,e,n,r,i,o,s,a){return!(t===s&&e===a)&&Dt(t,e,n,r,i,o,s,a)}function Gt(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Ut(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Ht(t,e)&&Ht(e,t)&&function(t,e){let n=t,r=!1;const i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(jt(t.prev,t,e.prev)||jt(t,e.prev,e))||Zt(t,e)&&jt(t.prev,t,t.next)>0&&jt(e.prev,e,e.next)>0)}function jt(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Zt(t,e){return t.x===e.x&&t.y===e.y}function Ut(t,e,n,r){const i=Jt(jt(t,e,n)),o=Jt(jt(t,e,r)),s=Jt(jt(n,r,t)),a=Jt(jt(n,r,e));return i!==o&&s!==a||(!(0!==i||!Rt(t,n,e))||(!(0!==o||!Rt(t,r,e))||(!(0!==s||!Rt(n,t,r))||!(0!==a||!Rt(n,e,r)))))}function Rt(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Jt(t){return t>0?1:t<0?-1:0}function Ht(t,e){return jt(t.prev,t,t.next)<0?jt(t,e,t.next)>=0&&jt(t,t.prev,e)>=0:jt(t,e,t.prev)<0||jt(t,t.next,e)<0}function Wt(t,e){const n=te(t.i,t.x,t.y),r=te(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Kt(t,e,n,r){const i=te(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Qt(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function te(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}const ee="__fea_idx";new Float32Array([-1e12])[0];const ne="maptalks_ombb";function re(){return function(){if("undefined"!=typeof undefinedThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof undefined)return global;throw new Error("unable to locate global object")}().maptalks_vt_packers}const{PackUtil:ie,ArrayPool:oe}=re();function se(t,e,n,r,i,o,s,a,l,u,h,c,f,p,d,g,y){const x=e.getLength(),m=i/3;for(let n=2,r=x;n<r;n+=3)t[i+n-2]=e[n-2],t[i+n-1]=e[n-1],t[i+n-0]=e[n]-s;i+=x;for(let n=2,r=x;n<r;n+=3)t[i+n-2]=e[n-2],t[i+n-1]=e[n-1],t[i+n-0]=e[n]-a;i+=x,t.trySetLength(i+x),t.copyWithin(i,i-2*x,i-x),i+=x,t.trySetLength(i+x),t.copyWithin(i,i-2*x,i-x),i+=x,(n=n||[]).push(x/3);const v=n.getLength();for(let e=0;e<v;e++){ae(m+(n[e-1]||0),m+n[e],t,x/3,l,r,u,h,c,f,o,p,d,g,y)}return i}function ae(t,e,n,r,i,o,s,a,l,u,h,c,f,p,d){const g=o.getLength();let y,x;for(let s=t,a=e;s<a-1;s++)if(y=s,x=s+1,i===1/0||!pt(n,y,x,i))if((s-t)%2==1&&(y+=2*r,x+=2*r),d){let t=o.currentIndex;o[t++]=y+r,o[t++]=x,o[t++]=y,o[t++]=x+r,o[t++]=x,o[t++]=y+r,o.currentIndex=t}else{let t=o.currentIndex;o[t++]=y+r,o[t++]=y,o[t++]=x,o[t++]=x,o[t++]=x+r,o[t++]=y+r,o.currentIndex=t}s&&function(t,e,n,r,i,o,s,a,l,u,h,c){let f,p=0,d=0,g=0,y=0;const x=c?[1,3,4]:[2,3,4];for(let c=o.getLength()-1;c>=s;c--){const s=o[c],m=3*s+1,v=3*s+2,w=i[3*s],b=i[m],M=i[v];p||d||(p=Math.max(i[v],i[3*o[c-3]+2]),d=Math.min(i[v],i[3*o[c-3]+2]),f=p-d);let P=g;const _=c%6;0===t?(5===_&&(y=Tt(i,o,c,w,b)),P=_===x[0]||_===x[1]||_===x[2]?g:g+y):1===t&&(_===x[0]||_===x[1]||_===x[2]?P=0:5===_?(y=Tt(i,o,c,w,b),P=y):P=y);const A=P/u*(1/(100*h))/a;let I;I=1===e?M===p?1:0:"bottom"===n?M===p?f/100/l:0:M===p?0:-f/100/l,r[2*s]=A,r[2*s+1]=I,0===_&&(g+=y)}}(a,l,u,h,n,o,g,c[0],c[1],f,p,d)}function le(t){const e=[t[0]];let n=t[0];for(let r=1;r<t.length;r++)Array.isArray(t[r])?t[r][0]===n[0]&&t[r][1]===n[1]&&t[r][2]===n[2]||e.push(t[r]):t[r].x===n.x&&t[r].y===n.y&&t[r].z===n.z||e.push(t[r]),n=t[r];return e}var ue="undefined"!=typeof Float32Array?Float32Array:Array;function he(){var t=new ue(3);return ue!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function ce(t,e,n){var r=new ue(3);return r[0]=t,r[1]=e,r[2]=n,r}function fe(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function pe(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function de(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function ge(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t}function ye(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function xe(t,e,n){var r=e[0],i=e[1],o=e[2],s=n[0],a=n[1],l=n[2];return t[0]=i*l-o*a,t[1]=o*s-r*l,t[2]=r*a-i*s,t}var me=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t};function ve(){var t=new ue(4);return ue!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function we(t,e){var n=e[0]+e[4]+e[8],r=void 0;if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,s=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*s+s]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*o+s]-e[3*s+o])*r,t[o]=(e[3*o+i]+e[3*i+o])*r,t[s]=(e[3*s+i]+e[3*i+s])*r}return t}!function(){var t=he()}(),function(){var t,e=(t=new ue(4),ue!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();var be,Me=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},Pe=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=n*n+r*r+i*i+o*o;return s>0&&(s=1/Math.sqrt(s),t[0]=n*s,t[1]=r*s,t[2]=i*s,t[3]=o*s),t};he(),ce(1,0,0),ce(0,1,0),ve(),ve(),be=new ue(9),ue!=Float32Array&&(be[1]=0,be[2]=0,be[3]=0,be[5]=0,be[6]=0,be[7]=0),be[0]=1,be[4]=1,be[8]=1;\n/*!\n * Contains code from google filament\n * https://github.com/google/filament/\n * License Apache-2.0\n */\nconst _e=8,Ae=[],Ie=[],Se=[],Te=[];function Fe(t,e,n){const r=xe(Ie,e,n),i=function(t,e,n,r,i,o,s,a,l,u){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t[6]=a,t[7]=l,t[8]=u,t}(Ae,n[0],n[1],n[2],...r,...e);t=we(t,i),t=function(t){return t[3]<0?Me(t,t,-1):t}(t=Pe(t,t));const o=1/((1<<2*_e-1)-1);if(t[3]<o){t[3]=o;const e=Math.sqrt(1-o*o);t[0]*=e,t[1]*=e,t[2]*=e}const s=n[3]>0?xe(Se,n,e):xe(Se,e,n);return ye(xe(Te,n,e),s)<0&&Me(t,t,-1),t}const ke=[];const Le=[],Ce=[],Be=[],Oe=[],Ye=[],Ve=[],Xe=[];function Ne(t,e,n,r,i,o){pe(Oe,t[3*e],t[3*e+1],t[3*e+2]),pe(Ye,t[3*n],t[3*n+1],t[3*n+2]),pe(Ve,t[3*r],t[3*r+1],t[3*r+2]);const s=me(Le,Ve,Ye),a=me(Ce,Oe,Ye),l=xe(Be,s,a);ge(Xe,l),i[3*e]=i[3*e]||0,i[3*n]=i[3*n]||0,i[3*r]=i[3*r]||0,i[3*e+1]=i[3*e+1]||0,i[3*n+1]=i[3*n+1]||0,i[3*r+1]=i[3*r+1]||0,i[3*e+2]=i[3*e+2]||0,i[3*n+2]=i[3*n+2]||0,i[3*r+2]=i[3*r+2]||0,i[3*e]+=Xe[0],i[3*n]+=Xe[0],i[3*r]+=Xe[0],i[3*e+1]+=Xe[1],i[3*n+1]+=Xe[1],i[3*r+1]+=Xe[1],i[3*e+2]+=Xe[2],i[3*n+2]+=Xe[2],i[3*r+2]+=Xe[2],o[e]+=1,o[n]+=1,o[r]+=1}\n/*!\n * Contains code from THREE.JS\n * https://github.com/mrdoob/three.js/\n * License MIT\n * \n * Generate tangents per vertex.\n */function Ee(t,e,n){return t[0]=e[n],t[1]=e[n+1],t[2]=e[n+2],t}function ze(t,e,n){return t[0]=e[n],t[1]=e[n+1],t}const{StyleUtil:$e,PackUtil:De,ArrayPool:qe}=re(),Ge=qe.getInstance();function je(t,e,n,r,i,o,s,a,l,u,h,c,f,p,d,g){void 0===e.top&&(e.top=!0),void 0===e.side&&(e.side=!0),Ge.reset();const{altitudeScale:y,altitudeProperty:x,defaultAltitude:m,heightProperty:v,minHeightProperty:P,defaultHeight:_,tangent:A,uv:I,topUVMode:T,sideUVMode:F,sideVerticalUVMode:k,top:C,side:B,textureYOrigin:O,topThickness:Y}=e,V=function(t,e,{altitudeScale:n,altitudeProperty:r,defaultAltitude:i,heightProperty:o,minHeightProperty:s,defaultHeight:a},{center:l,side:u,top:h,topThickness:c,uvOrigin:f,uv:p,uvSize:d,topUVMode:g,sideUVMode:y,sideVerticalUVMode:x,textureYOrigin:m,tileRatio:v,centimeterToPoint:w,verticalCentimeterToPoint:b,positionType:M,res:P,glScale:_,projectionCode:A},I,T){let F=e/t[0].extent;e===1/0&&(F=1);const k=e===1/0,L=T.get(),C=T.get(),B=T.get(),O=T.getProxy(),Y=T.get(),V=T.get(),X=T.get(),N=!!p,E=!!h,z=!!u,$=N?T.get():null;function D(t,n,r,i,o,s){let a=n;if(E){const u=Ft(O,r,3);if(0===u.length)return n;let h=O.getLength(),p=Y.currentIndex;for(let t=0;t<h;t++)Y[p++]=O[t];if(Y.currentIndex=p,n+=O.getLength(),s)for(let e=2,n=u.length;e<n;e+=3)u[e]+=t/3,u[e-1]+=t/3,u[e-2]+=t/3;else{let e;for(let n=2,r=u.length;n<r;n+=3)e=u[n-1],u[n-1]=u[n]+t/3,u[n]=e+t/3,u[n-2]+=t/3}h=u.length,p=V.currentIndex;for(let t=0;t<h;t++)V[p++]=u[t];V.currentIndex=p,N&&It(g||0,t,n,$,Y,f,w,v,d[0],d[1],o,P,_,A,l),c>0&&!z&&(n=se(Y,O,r,V,n,$,0,c,e,N,y||0,x||0,m,d,v,b,i<0?!s:s)),X.setLength(n/3),X.fill(1,a/3,n/3)}if(z){E&&(c=0),a=n,n=se(Y,O,r,V,n,$,c,i,e,N,y||0,x||0,m,d,v,b,i<0?!s:s),X.setLength(n/3);const t=O.getLength()/3;X.fill(1,a/3,a/3+t),X.fill(0,a/3+t,a/3+2*t),X.fill(1,a/3+2*t,a/3+3*t),X.fill(0,a/3+3*t,n/3)}return n}let q=-1/0,G=1/0,j=0;const Z=[-1,-1,e+1,e+1];let U=0,R=t.length;S(I)&&(U=I,R=I+1);let J=0,H=!1;const W=T.getProxy();let K,Q=!1;for(;U<R;U++){const l=t[U],u=l.id;S(u)&&(Math.abs(u)>J&&(J=Math.abs(u)),u<0&&(H=!0));const h=l.geometry,c=l.properties[ne];let f=Array.isArray(c&&c[0]&&c[0][0])?c[0]:c;const{altitude:p,height:d}=ie.getFeaAltitudeAndHeight(l,n,r,i,o,a,s);d<0?(Q=!0,G=Math.min(p,G),q=Math.max(p-d,q)):(q=Math.max(p,q),G=Math.min(p-d,G));const g=Y.getLength();let y=0,x=j;W.setLength(0),O.setLength(0);const m=ie.calculateSignedArea(h[0])<0;for(let t=0,n=h.length;t<n;t++){let r=h[t];m&&(r=r.reverse()),r=le(r);const i=ie.calculateSignedArea(r)<0;if(!i&&t>0&&(y++,f=c&&c[y],j=D(x,j,W,d*F,f,k),O.setLength(0),W.setLength(0),x=j),e!==1/0&&(r=ie.clipPolygon(r,Z)),!r.length){t===n-1&&(j=D(x,j,W,d*F,f,k));continue}const o=r.length;if(Array.isArray(r[0])?r[0][0]===r[o-1][0]&&r[0][1]===r[o-1][1]||r.push([r[0][0],r[0][1]]):r[0].x===r[o-1].x&&r[0].y===r[o-1].y||r.push(r[0]),i){let t=W.currentIndex;W[t++]=O.getLength()/3,W.currentIndex=t}ft(O,O.getLength(),r,F,p,!1,M),t===n-1&&(j=D(x,j,W,d*F,f,k))}const v=Y.getLength()-g,w=(ee+"").trim();for(let t=0;t<v/3;t++){let t=C.currentIndex;C[t++]=void 0===l[w]?U:l[w],C.currentIndex=t,t=L.currentIndex,L[t++]=U,L.currentIndex=t,S(u)&&(t=B.currentIndex,B[t++]=u,B.currentIndex=t)}}K=l?Float32Array:ie.getUnsignedArrayType(C.getLength()?C[C.getLength()-1]:0);const tt={hasNegativeHeight:Q,maxAltitude:q===-1/0?0:q,minAltitude:G===1/0?0:G,vertices:Y,verticeTypes:X,indices:V,pickingIds:oe.createTypedArray(C,K),featureIndexes:L};if(B.getLength()){const t=H?ie.getPosArrayType(J):ie.getUnsignedArrayType(J);tt.featureIds=oe.createTypedArray(B,t)}else tt.featureIds=[];return $&&($.setLength(Y.getLength()/3*2),tt.uvs=$),tt}(t,n,{altitudeScale:y,altitudeProperty:x,defaultAltitude:m||0,heightProperty:v,minHeightProperty:P,defaultHeight:_||0},{center:g,top:C,side:B,topThickness:10*Y||0,uv:I||A,uvSize:[i,i],uvOrigin:r,topUVMode:T,sideUVMode:F,sideVerticalUVMode:k,textureYOrigin:O,tileRatio:a,centimeterToPoint:l,verticalCentimeterToPoint:u,positionType:d,res:o,glScale:s,projectionCode:f},p,Ge),X=[],N=V.vertices.getLength()/3,E=De.getIndexArrayType(N),z=qe.createTypedArray(V.indices,E);delete V.indices,X.push(z.buffer,V.pickingIds.buffer);const $=Math.max(Math.abs(V.maxAltitude),Math.abs(V.minAltitude)),D=De.getPosArrayType(Math.max(512,$));V.vertices=qe.createTypedArray(V.vertices,D);const q=A?Ge.getProxy():new Float32Array(3*N);q.setLength&&q.setLength(3*N);const G=function(t,e,n){const r=n||[];r.setLength&&r.setLength(t.length);const i=ke;i.length<t.length/3&&(i.length=t.length/3),i.fill(0,0,t.length/3);const o=void 0===e.length?e:e.length;for(let n=0;n<o/3;n++)void 0===e.length?Ne(t,3*n,3*n+1,3*n+2,r,i):Ne(t,e[3*n],e[3*n+1],e[3*n+2],r,i);for(let t=0;t<r.length;t+=3){const e=i[t/3];0!==e?(r[t]/=e,r[t+1]/=e,r[t+2]/=e):(r[t]=0,r[t+1]=0,r[t+2]=0)}return r}(V.vertices,z,q);let j=!0;const Z=G.getLength?G.getLength():G.length;for(let t=0;t<Z;t++){G[t]=-G[t];const e=G[t]%1;1-Math.abs(e)>1e-6?j=!1:0!==e&&(G[t]=Math.round(G[t]))}if(V.normals=G,A){let t=Ge.get();t.setLength(4*N),t=function(t,e,n,r,i){const o=t.length/3,s=i||new Array(4*o),a=[],l=[];for(let t=0;t<o;t++)a[t]=[0,0,0],l[t]=[0,0,0];const u=[0,0,0],h=[0,0,0],c=[0,0,0],f=[0,0],p=[0,0],d=[0,0],g=[0,0,0],y=[0,0,0];function x(e,r,i){Ee(u,t,3*e),Ee(h,t,3*r),Ee(c,t,3*i),ze(f,n,2*e),ze(p,n,2*r),ze(d,n,2*i);const o=h[0]-u[0],s=c[0]-u[0],x=h[1]-u[1],m=c[1]-u[1],v=h[2]-u[2],w=c[2]-u[2],b=p[0]-f[0],M=d[0]-f[0],P=p[1]-f[1],_=d[1]-f[1],A=1/(b*_-M*P);pe(g,(_*o-P*s)*A,(_*x-P*m)*A,(_*v-P*w)*A),pe(y,(b*s-M*o)*A,(b*m-M*x)*A,(b*w-M*v)*A),de(a[e],a[e],g),de(a[r],a[r],g),de(a[i],a[i],g),de(l[e],l[e],y),de(l[r],l[r],y),de(l[i],l[i],y)}for(let t=0,e=r.length;t<e;t+=3)x(r[t+0],r[t+1],r[t+2]);const m=[],v=[],w=[],b=[];let M,P,_;function A(t){Ee(w,e,3*t),fe(b,w),P=a[t],fe(m,P),me(m,m,function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}(w,w,ye(w,P))),ge(m,m),xe(v,b,P),_=ye(v,l[t]),M=_<0?-1:1,s[4*t]=m[0],s[4*t+1]=m[1],s[4*t+2]=m[2],s[4*t+3]=M}for(let t=0,e=r.length;t<e;t+=3)A(r[t+0]),A(r[t+1]),A(r[t+2]);return s}(V.vertices,V.normals,V.uvs,z,t),t=function(t,e){const n=e.getLength(),r=new Float32Array(n),i=[],o=[],s=[];for(let a=0;a<n;a+=4){const n=a/4*3;gt(o,t[n]||0,t[n+1]||0,t[n+2]||0),xt(i,e[a]||0,e[a+1]||0,e[a+2]||0,e[a+3]||0),Fe(s,o,i),yt(r.subarray(a,a+4),s)}return r}(V.normals,t),V.tangents=t,X.push(t.buffer),delete V.normals}if(V.normals&&(j&&(V.normals=qe.createTypedArray(V.normals,Int8Array)),X.push(V.normals.buffer)),V.uvs){const t=V.uvs;V.uvs=qe.createTypedArray(t,Float32Array),X.push(V.uvs.buffer)}const U=function(t,e,n,r){const i={},o={},s=r.getLength();if(L(e.polygonFill)){let a=b(e.polygonFill);const l=new Uint8Array(4*s);l.fill(255);for(let e=0;e<s;e++){const o=t[r[e]],s=o.properties||{};s.$layer=o.layer,s.$type=o.type;let u=a(n,s);w(u)&&(i.aColor=1,a=b(u),u=a(n,s)),delete s.$layer,delete s.$type,$e.normalizeColor(Ze,u),l[4*e]=Ze[0],l[4*e+1]=Ze[1],l[4*e+2]=Ze[2],l[4*e+3]=Ze[3]}o.aColor=l}if(L(e.polygonOpacity)){let a=M(e.polygonOpacity,"exponential");const l=new Uint8Array(s);l.fill(255);for(let e=0;e<s;e++){const o=t[r[e]],s=o.properties||{};s.$layer=o.layer,s.$type=o.type;let u=a(n,s);w(u)&&(i.aOpacity=1,a=b(u),u=a(n,s)),delete s.$layer,delete s.$type,l[e]=255*u}o.aOpacity=l}return o.dynamicAttributes=i,o}(t,h,c,V.featureIndexes),R=function(t,e,n,r,i){const o=[[],[]],s=L(r.topPolygonFill),a=L(r.bottomPolygonFill),l=[255,255,255,255],u=e.getLength();if(s||a){let h=s&&b(r.topPolygonFill),c=a&&b(r.bottomPolygonFill),f=null,p=null,d=null,g=null;for(let r=0;r<u;r++){if(1===t[r]&&!s||0===t[r]&&!a)continue;const u=1===t[r];if(u&&e[r]===f){t[r]=d;continue}if(!u&&e[r]===p){t[r]=g;continue}const y=n[e[r]],x=y.properties||{};x.$layer=y.layer,x.$type=y.type;let m=u?h:c,v=m(i,x);w(v)&&(m=b(v),v=m(i,x)),delete x.$layer,delete x.$type,$e.normalizeColor(Ze,v),mt(Ze,Ze,l);let M=Ue(o,Ze);M<0&&(M=o.length,o.push(yt([],Ze))),t[r]=M,u?(f=e[r],d=M):(p=e[r],g=M)}}return o.slice(2)}(V.verticeTypes,V.featureIndexes,t,h,c),J={data:{data:{aVertexColorType:R.length<=252?qe.createTypedArray(V.verticeTypes,Uint8Array):qe.createTypedArray(V.verticeTypes,Uint16Array),aPosition:V.vertices,aNormal:V.normals,aTexCoord0:V.uvs,aTangent:V.tangents,aPickingId:V.pickingIds},indices:z,properties:{maxAltitude:V.maxAltitude/100,minAltitude:V.minAltitude/100,hasNegativeHeight:V.hasNegativeHeight},dynamicAttributes:U.dynamicAttributes,vertexColors:R},buffers:X};return V.featureIds.length?(J.data.featureIds=V.featureIds,X.push(J.data.featureIds.buffer)):J.data.featureIds=[],U.aColor&&(J.data.data.aColor=U.aColor,J.buffers.push(U.aColor.buffer)),U.aOpacity&&(J.data.data.aOpacity=U.aOpacity,J.buffers.push(U.aOpacity.buffer)),J.buffers.push(J.data.data.aPosition.buffer),J.data.pickingIdIndiceMap=De.generatePickingIndiceIndex(J.data.data.aPickingId,J.data.indices),J}const Ze=[];function Ue(t,e){for(let i=0;i<t.length;i++)if(n=e,r=t[i],n[0]===r[0]&&n[1]===r[1]&&n[2]===r[2]&&n[3]===r[3])return i;var n,r;return-1}const{PackUtil:Re,StyleUtil:Je,FilterUtil:He}=re();function We(t,e,n,r,{altitudeScale:i,altitudeProperty:o,defaultAltitude:s,heightProperty:a,minHeightProperty:l,defaultHeight:u,bottom:h}){const c=h,f=e/t[0].extent,p=2*function(t,e){let n=0;for(let e=0,r=t.length;e<r;e++){const r=t[e];if(S(r.geometry[0][0]))n+=3*r.geometry.length;else for(let t=0,e=r.geometry.length;t<e;t++){let e=3*r.geometry[t].length;3===r.type&&(e-=3),n+=e}}return n}(t)+3*t.length*2,d=[],g=new Int16Array(p),y=new Uint8Array(g.length/3*4);w(n)&&(n=He.compileFilter(n));const x=[];function m(t,n,r){const i=n-t,o=g.subarray(t,n),s=g.subarray(n,n+i);s.set(o);for(let t=2,e=s.length;t<e;t+=3)s[t]=o[t]-r;const a=t/3,l=i/3;let u,h;for(let t=a,n=l+a;t<n;t++)t<n-1?(u=t,h=t+1):(u=t,h=a),pt(g,u,h,e)||(x.push(u,h),c&&x.push(u+l,h+l),Ke(g,u,e)||x.push(u,u+l));return n+i}let v=0,b=-1/0,M=1/0;const P=(ee+"").trim(),_=[];for(let e=0,h=t.length;e<h;e++){const h=t[e],c=h.geometry;if(n){let t;t="function"==typeof n?n(h&&h.properties):n,Je.normalizeColor(_,t)}else gt(_,255,255,255);const p=v/3*4,{altitude:w,height:A}=Re.getFeaAltitudeAndHeight(h,i,o,s,a,u,l);A<0?(M=Math.min(w,M),b=Math.max(w-A,b)):(M=Math.min(w-A,M),b=Math.max(w,b));let I=v;for(let t=0,e=c.length;t<e;t++){let e=c[t];const n=e.length;e[0][0]===e[n-1][0]&&e[0][1]===e[n-1][1]&&(e=e.slice(0,n-1)),v=ft(g,I,e,f,w),v=m(I,v,A*f),I=v}const S=I/3*4;for(let t=p;t<S;t+=4)y[t]=_[0],y[t+1]=_[1],y[t+2]=_[2],y[t+3]=255*(r||1);const T=x.length-d.length;for(let t=0;t<T;t++)d.push(h[P])}const A=x.reduce(((t,e)=>Math.max(t,e)),0),I=new(Re.getIndexArrayType(A))(x),T=Math.max(Math.abs(b,Math.abs(M)));return{aPosition:new(Re.getPosArrayType(Math.max(512,T)))(g),indices:I,aPickingId:new Float32Array(d),aColor:y,maxAltitude:b===-1/0?0:b/100,minAltitude:M===1/0?0:M/100}}function Ke(t,e,n){const r=t[3*e],i=t[3*e+1];return r<0||r>n||i<0||i>n}function Qe(t,e,n,r){const i=We(t,e,n.lineColor,n.lineOpacity,r),{minAltitude:o,maxAltitude:s}=i;delete i.minAltitude,delete i.maxAltitude;const a=[i.aPosition.buffer,i.indices.buffer,i.aPickingId.buffer],l=i.indices;return delete i.indices,{data:{data:i,properties:{minAltitude:o,maxAltitude:s},indices:l},buffers:a}}\n/*!\n Feature Filter by\n\n (c) mapbox 2016 and maptalks 2018\n www.mapbox.com | www.maptalks.org\n License: MIT, header required.\n */const tn=["Unknown","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"];function en(t){if(!t)return"true";const e=t[0];if(t.length<=1)return"any"===e?"false":"true";return\`(${G}"=="===e?rn(t[1],t[2],"===",!1):"!="===e?rn(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?rn(t[1],t[2],e,!0):"any"===e?sn(t.slice(1),"||"):"all"===e?sn(t.slice(1),"&&"):"none"===e?un(sn(t.slice(1),"||")):"in"===e?an(t[1],t.slice(2)):"!in"===e?un(an(t[1],t.slice(2))):"has"===e?ln(t[1]):"!has"===e?un(ln(t[1])):"contains"===e?function(t,e,n){const r=nn(t);return void 0!==n?\`(${G}r} + '').indexOf("${G}e}") === ${G}n}\`:\`(${G}r} + '').indexOf("${G}e}") >= 0\`}(t[1],t[2],t[3]):"true"})\`}function nn(t){return"$"===t[0]?"f."+t.substring(1):"p["+JSON.stringify(t)+"]"}function rn(t,e,n,r){if("object"==typeof(i=t)&&i&&t.op)return function(t,e,n,r){const i=t.property,o=t.op;let s=nn(i);return"length"!==o?(console.error(\`not support ${G}o} op\`),"false"):(s=\`((${G}s}+='').length)\`,on(s,i,e,n,r))}(t,e,n,r);var i;return on(nn(t),t,e,n,r)}function on(t,e,n,r,i){const o="$type"===e?tn.indexOf(n):JSON.stringify(n);return(i?\`typeof ${G}t}=== typeof ${G}o}&&\`:"")+t+r+o}function sn(t,e){return t.map(en).join(e)}function an(t,e){"$type"===t&&(e=e.map((t=>tn.indexOf(t))));const n=JSON.stringify(e.sort(hn)),r=nn(t);return e.length<=200?\`${G}n}.indexOf(${G}r}) !== -1\`:\`function(v, a, i, j) {\\n while (i <= j) { var m = (i + j) >> 1;\\n if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;\\n }\\n return false; }(${G}r}, ${G}n},0,${G}e.length-1})\`}function ln(t){return"$id"===t?'"id" in f':\`${G}JSON.stringify(t)} in p\`}function un(t){return\`!(${G}t})\`}function hn(t,e){return t<e?-1:t>e?1:0}let cn=!1;try{const t=new OffscreenCanvas(1,1);t.getContext("2d").fillText("hello",0,0),cn=!0}catch(t){cn=!1}var fn=cn;const{VectorPack:pn,PolygonPack:dn,NativeLinePack:gn,LinePack:yn,PointPack:xn,NativePointPack:mn,LineExtrusionPack:vn,CirclePack:wn,RoundTubePack:bn,SquareTubePack:Mn,FilterUtil:Pn,PackUtil:_n,StyleUtil:An,TextUtil:In,DEFAULT_TEX_WIDTH:Sn,GlyphRequestor:Tn}=re(),Fn="__original_properties",kn="__fn-type_properties";class Ln{constructor(t,e,n,r,i){this.id=t,this.options=e,this.upload=n,this._compileStyle(e.style),this.requests={},this._cache=r,this._styleCounter=1,this.loadings=i}updateStyle(t,e){this.options.style=t,this._styleCounter=t.styleCounter,this._compileStyle(t),e()}updateOptions(t,e){this.options=A(this.options,t),e()}loadTile(t,e){const n=this.loadings,r=t.tileInfo.url,i=this.options.debugTile;if(i){const{x:n,y:r,z:o}=t.tileInfo;let s=!1;for(let t=0;t<i.length;t++)if(n===i[t].x&&r===i[t].y&&o===i[t].z){s=!0;break}if(!s)return void e()}if(n[r])return void n[r].push({context:t,callback:e,ref:this});n[r]=[{context:t,callback:e,ref:this}];const o=this.options.featureIdProperty;this.requests[r]=this.getTileFeatures(t,((e,i,s,a)=>{const l=n[r];if(delete n[r],this.checkIfCanceled(r))return delete this.requests[r],void this._callWaitings(l,null,{canceled:!0});if(delete this.requests[r],(this.options.debug||o)&&i)for(let e=0;e<i.length;e++)if(this.options.debug&&(i[e]._debug_info={index:e,id:i[e].id,tileId:t.tileInfo.id}),o){const t=F(o)?o[i[e].layer]:o,n=i[e].properties;i[e].id=n&&n[t]||null}if(e)this._callWaitings(l,e);else if(i&&i.length){if(l)for(let t=0;t<l.length;t++)this._onTileLoad.call(l[t].ref,l[t].context,l[t].callback,r,s,i,a)}else this._callWaitings(l)}))}_onTileLoad(t,e,n,r,i,o){this._createTileData(r,i,t).then((n=>{if(n.canceled)return void e(null,{canceled:!0});n.data.styleCounter=t.styleCounter,o&&A(n.data,o);const r=n.data.features;if(r){const t={};for(const e in r){const n=r[e];t[n.id]=n}const e=function(t){try{const e=JSON.stringify(t);return C.encode(e)}catch(t){console.error("encode JSON to Uint8Array error:",t)}}(t);e&&(n.data.featuresTypeArray=e,n.buffers=n.buffer||[],n.buffers.push(e.buffer));const i="id"===this.options.features;for(const t in r){const n=r[t];e&&delete n.geometry,i&&(r[t]=n.id)}}e(null,n.data,n.buffers)})).catch((t=>{e(t)}))}abortTile(t,e){delete this.requests[t],this._cancelLoadings(t),e()}_cancelLoadings(t){const e=this.loadings[t];if(e)for(let t=0;t<e.length;t++)e[t].callback(null,{canceled:!0});delete this.loadings[t]}_callWaitings(t,e,n){if(t)for(let r=0;r<t.length;r++)t[r].callback(e,n)}checkIfCanceled(t){return!this.requests[t]}onRemove(){this.loadings={},this._cache&&this._cache.reset(),delete this._cache,this.requests={}}fetchIconGlyphs(t,e,n){if(this.options.workerGlyph&&fn){const r=[];if(t&&Object.keys(t).length){const e=new Promise((e=>{this.upload("fetchIconGlyphs",{icons:t},null,((t,n)=>{e({err:t,iconData:n})}))}));r.push(e)}if(e&&Object.keys(e).length){const t=new Promise((t=>{this._glyphRequestor||(this._glyphRequestor=new Tn),this._glyphRequestor.getGlyphs(e,((e,n)=>{t({err:e,glyphData:n})}))}));r.push(t)}Promise.all(r).then((t=>{const e={icons:null,glyphs:null};for(let r=0;r<t.length;r++){if(t[r].err)return void n(t[r].err);t[r].iconData?e.icons=t[r].iconData.icons:t[r].glyphData&&(e.glyphs=t[r].glyphData.glyphs)}return e})).then((t=>{n(null,t)}))}else this.upload("fetchIconGlyphs",{icons:t,glyphs:e},null,n)}_createTileData(t,e,n){if(!e.length)return Promise.resolve({data:null,buffers:[]});const{glScale:r,tileInfo:i}=n,o=!this.options.style.style.length&&!this.options.style.featureStyle.length;let s=this.pluginConfig.slice(0);o&&(s=this._updateLayerPluginConfig(t)),this.featurePlugins&&function(t){for(let e=1;e<arguments.length;e++){const n=arguments[e];if(n)for(let e=0,r=n.length;e<r;e++)t.push(n[e])}t.length}(s,this.featurePlugins);const a={};for(let t=0;t<s.length;t++)Nn(e,n.tileInfo.z,s[t],a);const l=[],u=[];for(let t=0;t<e.length;t++){const n=e[t],r=a[t];if(r){u.fill(null);let t=0;for(const e in r){let i=0;const o=r[e].values();for(const t of o){let r=u[i];r||(r=Dn(n),u[i]=r),r.properties[e]=t,i++}i>t&&(t=i)}for(let e=0;e<t;e++)l.push(u[e])}else l.push(n)}const h=(e=l)[0].extent,c=i.z,f={x:i.extent2d.xmin*r,y:i.extent2d.ymax*r},p=[],d=[],g=[],y=this.options,x=[],m={},v=[Promise.resolve(n.styleCounter)];let w=0,b=-1;const M=[];let P=!1;for(let t=0;t<s.length;t++){b++;const r=s[t];r.type!==w&&(b=0,w=r.type);const a=0===r.type?p:d;jn(r.symbol,M,t),P=P||M[t]&&M[t].size>0;const{tileFeatures:l,tileFeaIndexes:u}=this._filterFeatures(c,r.type,r.filter,e,m,t);if(!l.length){a[b]=null;continue}const y=u[u.length-1],_=_n.getIndexArrayType(y);a[b]={styledFeatures:new _(u)},g.push({idx:t,typeIdx:b}),x.push(a[b].styledFeatures.buffer);const I=A({},n,{extent:h,zoom:c,tilePoint:f});if(this.options.debugTile){const t=this.options.debugTile;for(let e=0;e<t.length;e++){const{x:n,y:r,z:o}=t[e];if(i.x===n&&i.y===r&&i.z===o){I.debugIndex=t[e].index;break}}}let S=this._createTileGeometry(l,r,I);o&&(S=S.then((t=>{if(!t)return null;if(t.data)t.data.layer=l[0].layer;else if(Array.isArray(t))for(let e=0;e<t.length;e++)t[e]&&t[e].data&&(t[e].data.layer=l[0].layer);return t}))),v.push(S)}return Promise.all(v).then((([n,...r])=>{if(n!==this._styleCounter)return{canceled:!0};function i(t,e){if(void 0!==t.data.ref)return;const n=s[g[e].idx],r=n.renderPlugin.dataConfig;if(t.data.type=r.type,t.data.filter=n.filter.def,r.altitudeOffset&&(t.data.properties.minAltitude+=r.altitudeOffset,t.data.properties.maxAltitude+=r.altitudeOffset),t.buffers&&t.buffers.length)for(let e=0;e<t.buffers.length;e++)x.push(t.buffers[e])}for(let t=0;t<r.length;t++){if(!r[t])continue;const e=r[t],n=0===s[g[t].idx].type?p:d;if(Array.isArray(e)){const r=[];for(let n=0;n<e.length;n++)e[n]&&(i(e[n],t),(void 0===e[n].data.ref||e[e[n].data.ref])&&r.push(e[n].data));r.length&&(n[g[t].typeIdx].data=r)}else i(e,t),n[g[t].typeIdx].data=e.data}const o={},a=t;if(y.features||y.schema||P){let t,n=!1;for(let r=0,i=e.length;r<i;r++)if(t=e[r],a[t.layer].properties||(a[t.layer].properties=On(t.properties)),t&&(y.features||P&&m[r])){delete t.extent,delete t.properties.$layer,delete t.properties.$type,delete t.__index;const e=t.originalFeature;if(e){const e=t.properties,n=A({},t.originalFeature);delete e[Fn],n.customProps=A({},e),t=n}const i=A({},t);if(P&&m[r]&&(!y.features||"transient"===y.features)){const i=m[r];for(let r=0;r<i.length;r++){const i=M[r];i&&i.forEach((r=>{const i=e?e.properties:t.properties;i[kn]||(i[kn]=new Set),i[kn].add(r),n=!0}))}}o[r]=i}if(n)for(const t in o){const e=o[t],n=e.properties[kn];if(n){delete e.properties[kn],"transient"===y.features&&(e.fnTypeProps=A({},e.properties));for(const t in e.properties)n.has(t)||("transient"===y.features?delete e.fnTypeProps[t]:delete e.properties[t])}}}return{data:{styleCounter:n,schema:a,data:p,featureData:d,extent:h,features:o},buffers:x}})).catch((t=>{console.error(t)}))}_createTileGeometry(t,e,n){let r=t;const i=e.renderPlugin.dataConfig,o=e.symbol,s=this.options.tileSize,{extent:a,glScale:l,zScale:u,zoom:h,tilePoint:c,centimeterToPoint:f,verticalCentimeterToPoint:p}=n,d=a/s,g=i.type,y=n.debugIndex;let x=A({},i,{EXTENT:a,zoom:h,debugIndex:y,features:this.options.features,isWebGPU:this.options.isWebGPU,isWebGL1:this.options.isWebGL1});if("3d-extrusion"===g){Yn(o)&&(i.uv=1);const t=this.options.projectionCode,e=o.material&&o.material.textureWidth||Sn;return Promise.all([Promise.resolve(je(r,i,a,c,e,n.tileInfo.res,l,a/this.options.tileSize,f,p,o,h,t,y))])}if("3d-wireframe"===g)return Promise.all([Promise.resolve(Qe(r,a,o,i))]);if("point"===g){x=A(x,{requestor:this.fetchIconGlyphs.bind(this),altitudeToTileScale:u*a/this.options.tileSize/l,pluginType:e.renderPlugin.type});let t=o;return Array.isArray(o)||(t=[o]),t=t.map(((t,e)=>(t&&(t.index={index:e},t.isIconText=function(t){return t.markerType||t.markerFile}(t)),t))).filter((t=>!!t)),Promise.all(t.map((t=>{x.defaultMarkerVerticalAlignment="middle";const e=pn.genFnTypes(t);let n=r;return xn.needMerge(t,e,h)&&(n=xn.mergeLineFeatures(r,t,e,h)),new xn(n,t,x).load(d)})))}if("native-point"===g){const t=u*a/this.options.tileSize/l;return x.altitudeToTileScale=t,Vn(r,o,x,mn,d)}if("line"===g)return x=A(x,{requestor:this.fetchIconGlyphs.bind(this),tileRatio:d}),Vn(r,o,x,yn,1,!0);if("native-line"===g)return Vn(r,o,x,gn,1,!0);if("fill"===g)return x=A(x,{requestor:this.fetchIconGlyphs.bind(this)}),Vn(r,o,x,dn);if("line-extrusion"===g){delete o.lineGradientProperty,o.lineJoin="miter",o.lineCap="butt";const t=Yn(o);if(t&&(i.uv=1),x=A(x,{tileSize:s,zScale:u,glScale:l}),o.mergeOnProperty){const t=pn.genFnTypes(o);r=yn.mergeLineFeatures(r,o,t,x.zoom)}if(t){const t=[];if(!1!==i.top){const e=A({},x);e.side=!1,t.push(new vn(r,o,e))}return!1!==i.side&&(x.side=!0,x.top=!1,t.push(new vn(r,o,x))),Promise.all(t.map((t=>t.load())))}return Promise.all([new vn(r,o,x).load()])}if("circle"===g)return Vn(r,o,x,wn);if("round-tube"===g||"square-tube"===g){const t="round-tube"===g?bn:Mn;return x=A(x,{requestor:this.fetchIconGlyphs.bind(this),radialSegments:"round-tube"===g?i.radialSegments||8:4,centimeterToPoint:f,verticalCentimeterToPoint:p,tileRatio:d,isTube:!0}),Vn(r,o,x,t)}return Promise.resolve([])}_filterFeatures(t,e,n,r,i,o){const s=(ee+"").trim(),a=[],l=[],u=r.length;for(let h=0;h<u;h++)if((1===e||void 0===r[h].id||!this.styledFeatures[r[h].id])&&((!n.def||"default"===n.def)&&!i[h]||!0===n.def||n.def&&(void 0!==n.def.condition||Array.isArray(n.def))&&n(r[h],t))){const t=r[h];if(void 0===t[s]&&(t[s]=h),i[h]||(i[h]=[]),i[h].push(o),l.push(t),a.push(h),1===e)break}return{tileFeatures:l,tileFeaIndexes:a}}_compileStyle(t){const{style:e,featureStyle:n}=t,r={};n.forEach((t=>{Array.isArray(t.id)?(t.id.forEach((t=>{r[t]=1})),t.filter=["in","$id",...t.id]):(r[t.id]=1,t.filter=["==","$id",t.id])}));const i=Pn.compileStyle(e);for(let t=0;t<e.length;t++)i[t].filter&&(i[t].filter.def=e[t].filter?e[t].filter.value||e[t].filter:void 0),i[t].type=0;const o=[],s=Pn.compileStyle(n);for(let t=0;t<n.length;t++)s[t].type=1,s[t].filter.def=n[t].filter?n[t].filter.value||n[t].filter:void 0,s[t].renderPlugin&&o.push(s[t]);this.pluginConfig=i,this.featurePlugins=o,this.styledFeatures=r}_updateLayerPluginConfig(t){let e=this._layerPlugins;this._layerPlugins||(e=this._layerPlugins={});const n=["","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon"],r=[];for(const o in t){const s=o;if(!e[o]){const r=[];for(let e=0;e<t[o].types.length;e++){const a=t[o].types[e],l=["all",["==","$layer",s],["==","$type",n[a]]],u={filter:(i=l,new Function("f",\`var p = (f && f.properties || {}); return ${G}en(i)}\`)),renderPlugin:Cn(a),symbol:Bn(a)};u.filter.def=l,u.type=0,r.push(u)}e[s]=r}r.push(...e[s])}var i;return r}}function Cn(t){switch(t){case 1:return{type:"native-point",dataConfig:{type:"native-point",only2D:!0}};case 2:return{type:"native-line",dataConfig:{type:"native-line",only2D:!0}};case 3:return{type:"fill",dataConfig:{type:"fill",only2D:!0}}}return null}function Bn(t){switch(t){case 1:return{markerFill:"#f00",markerSize:10};case 2:return{lineColor:"#fff"};case 3:return{polygonFill:"#00f",polygonOpacity:.4}}return null}function On(t){if(Array.isArray(t)||!F(t))return{};const e={};for(const n in t){const r=t[n];I(r)?e[n]="string":S(r)?e[n]="number":!0===r||!1===r?e[n]="boolean":Array.isArray(r)?e[n]="array":e[n]="object"}return e}function Yn(t){if(!t)return 0;let e=0;for(const n in t){if(("normalTexture"===n||"bumpTexture"===n)&&t[n])return 2;if(n.indexOf("Texture")>0&&t[n])e=1;else if(F(t[n])){const r=Yn(t[n]);if(2===r)return r;1===r&&(e=1)}}return e}function Vn(t,e,n,r,i,o){const s={},a=Array.isArray(e)?e:[e];let l=-1;for(let t=0;t<a.length;t++)s[t]=Xn(a[t]),!s[t]&&a[t]&&-1===l&&(l=t);const u=[];for(let e=0;e<a.length;e++){if(!a[e])continue;a[e].index={index:e};let h=t;if(o&&a[e].mergeOnProperty){const r=pn.genFnTypes(a[e]);h=yn.mergeLineFeatures(t,a[0],r,n.zoom)}s[e]||e===l?u.push(new r(h,a[e],n).load(i)):u.push({data:{ref:l,symbolIndex:{index:e}}})}return Promise.all(u)}function Xn(t){if(!t)return 0;for(const e in t)if(L(t[e]))return 1;return 0}function Nn(t,e,n,r){const i=n.customProperties;if(!i)return t;if(i)for(let t=0;t<i.length;t++)i[t].fn=Pn.compileFilter(i[t].filter);for(let n=0;n<i.length;n++)for(let o=0,s=t.length;o<s;o++)if(i[n].fn(t[o],e))for(const t in i[n].properties){const e=i[n].properties[t];k(e)||(r[o]||(r[o]={}),r[o][t]||(r[o][t]=new Set),r[o][t].add(e))}}const En={get:(t,e)=>e in t?t[e]:t.originalFeature[e],has:(t,e)=>e in t||e in t.originalFeature},zn={get:function(t,e){return e in t?t[e]:t[Fn][e]},has:(t,e)=>e in t||e in t[Fn]},$n={};function Dn(t){const e={};e.originalFeature=t;const n=new Proxy(e,En);return n.properties=new Proxy({},zn),n.properties[Fn]=t.properties||$n,n}function qn(t,e,n){t[e]||(t[e]=new Set),t[e].add(n)}const Gn=[];function jn(t,e,n){if(!t)return Gn;for(const r in t){if(!t[r]||!An.checkIfZoomFnTypeSymbol(r))continue;if(L(t[r]))qn(e,n,t[r].property);else{if("lineGradientProperty"===r){qn(e,n,t[r]);continue}if("textName"===r)if(I(t[r])){const i=In.resolveVarNames(t[r]);if(i)for(let t=0;t<i.length;t++)qn(e,n,i[t])}else if(Pn.isExpression(t[r])){const i=[];In.resolveExpVarNames(i,t[r]);for(let t=0;t<i.length;t++)qn(e,n,i[t])}}const i=t[r].stops;if(i&&i.length)for(let t=0;t<i.length;t++)L(i[t][1])&&qn(e,t,i[t][1].property)}return e[n]}function Zn(t,e){Un(t.geometry,e)}function Un(t,e){if(t)switch(t.type){case"Point":Rn(t.coordinates,e);break;case"MultiPoint":case"LineString":Jn(t.coordinates,e);break;case"MultiLineString":!function(t,e){for(let n=0,r=t.length;n<r;n++)Jn(t[n],e)}(t.coordinates,e);break;case"Polygon":Hn(t.coordinates,e);break;case"MultiPolygon":!function(t,e){for(let n=0,r=t.length;n<r;n++)Hn(t[n],e)}(t.coordinates,e);break;case"GeometryCollection":const n=t.geometries.length;for(let r=0;r<n;r++)Un(t.geometries[r],e)}}function Rn(t,e){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Jn(t,e){for(let n=0,r=t.length;n<r;n++)Rn(t[n],e)}function Hn(t,e){t.length&&Jn(t[0],e)}function Wn(t,e,n,r,i){Kn(t,e,n||0,r||t.length-1,i||tr)}function Kn(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,s=e-n+1,a=Math.log(o),l=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1);Kn(t,e,Math.max(n,Math.floor(e-s*l/o+u)),Math.min(r,Math.floor(e+(o-s)*l/o+u)),i)}var h=t[e],c=n,f=r;for(Qn(t,n,e),i(t[r],h)>0&&Qn(t,n,r);c<f;){for(Qn(t,c,f),c++,f--;i(t[c],h)<0;)c++;for(;i(t[f],h)>0;)f--}0===i(t[n],h)?Qn(t,n,f):Qn(t,++f,r),f<=e&&(n=f+1),e<=f&&(r=f-1)}}function Qn(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function tr(t,e){return t<e?-1:t>e?1:0}class er{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!fr(t,e))return n;const r=this.toBBox,i=[];for(;e;){for(let o=0;o<e.children.length;o++){const s=e.children[o],a=e.leaf?r(s):s;fr(t,a)&&(e.leaf?n.push(s):cr(t,a)?this._all(s,n):i.push(s))}e=i.pop()}return n}collides(t){let e=this.data;if(!fr(t,e))return!1;const n=[];for(;e;){for(let r=0;r<e.children.length;r++){const i=e.children[r],o=e.leaf?this.toBBox(i):i;if(fr(t,o)){if(e.leaf||cr(t,o))return!0;n.push(i)}}e=n.pop()}return!1}load(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=pr([]),this}remove(t,e){if(!t)return this;let n=this.data;const r=this.toBBox(t),i=[],o=[];let s,a,l;for(;n||i.length;){if(n||(n=i.pop(),a=i[i.length-1],s=o.pop(),l=!0),n.leaf){const r=nr(t,n.children,e);if(-1!==r)return n.children.splice(r,1),i.push(n),this._condense(i),this}l||n.leaf||!cr(n,r)?a?(s++,n=a.children[s],l=!1):n=null:(i.push(n),o.push(s),s=0,a=n,n=n.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,r){const i=n-e+1;let o,s=this._maxEntries;if(i<=s)return o=pr(t.slice(e,n+1)),rr(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(s)),s=Math.ceil(i/Math.pow(s,r-1))),o=pr([]),o.leaf=!1,o.height=r;const a=Math.ceil(i/s),l=a*Math.ceil(Math.sqrt(s));dr(t,e,n,l,this.compareMinX);for(let i=e;i<=n;i+=l){const e=Math.min(i+l-1,n);dr(t,i,e,a,this.compareMinY);for(let n=i;n<=e;n+=a){const i=Math.min(n+a-1,e);o.children.push(this._build(t,n,i,r-1))}}return rr(o,this.toBBox),o}_chooseSubtree(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){let n,r=1/0,s=1/0;for(let a=0;a<e.children.length;a++){const l=e.children[a],u=lr(l),h=(i=t,o=l,(Math.max(o.maxX,i.maxX)-Math.min(o.minX,i.minX))*(Math.max(o.maxY,i.maxY)-Math.min(o.minY,i.minY))-u);h<s?(s=h,r=u<r?u:r,n=l):h===s&&u<r&&(r=u,n=l)}e=n||e.children[0]}var i,o;return e}_insert(t,e,n){const r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),or(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)}_split(t,e){const n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r),s=pr(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,rr(n,this.toBBox),rr(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)}_splitRoot(t,e){this.data=pr([t,e]),this.data.height=t.height+1,this.data.leaf=!1,rr(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let r,i=1/0,o=1/0;for(let s=e;s<=n-e;s++){const e=ir(t,0,s,this.toBBox),a=ir(t,s,n,this.toBBox),l=hr(e,a),u=lr(e)+lr(a);l<i?(i=l,r=s,o=u<o?u:o):l===i&&u<o&&(o=u,r=s)}return r||n-e}_chooseSplitAxis(t,e,n){const r=t.leaf?this.compareMinX:sr,i=t.leaf?this.compareMinY:ar;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)}_allDistMargin(t,e,n,r){t.children.sort(r);const i=this.toBBox,o=ir(t,0,e,i),s=ir(t,n-e,n,i);let a=ur(o)+ur(s);for(let r=e;r<n-e;r++){const e=t.children[r];or(o,t.leaf?i(e):e),a+=ur(o)}for(let r=n-e-1;r>=e;r--){const e=t.children[r];or(s,t.leaf?i(e):e),a+=ur(s)}return a}_adjustParentBBoxes(t,e,n){for(let r=n;r>=0;r--)or(e[r],t)}_condense(t){for(let e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children,e.splice(e.indexOf(t[n]),1)):this.clear():rr(t[n],this.toBBox)}}function nr(t,e,n){if(!n)return e.indexOf(t);for(let r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function rr(t,e){ir(t,0,t.children.length,e,t)}function ir(t,e,n,r,i){i||(i=pr(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=e;o<n;o++){const e=t.children[o];or(i,t.leaf?r(e):e)}return i}function or(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function sr(t,e){return t.minX-e.minX}function ar(t,e){return t.minY-e.minY}function lr(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function ur(t){return t.maxX-t.minX+(t.maxY-t.minY)}function hr(t,e){const n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function cr(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function fr(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function pr(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function dr(t,e,n,r,i){const o=[e,n];for(;o.length;){if((n=o.pop())-(e=o.pop())<=r)continue;const s=e+Math.ceil((n-e)/r/2)*r;Wn(t,s,e,n,i),o.push(e,s,s,n)}}class gr{constructor(t=[],e=yr){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:n}=this,r=e[t];for(;t>0;){const i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r}_down(t){const{data:e,compare:n}=this,r=this.length>>1,i=e[t];for(;t<r;){let r=1+(t<<1),o=e[r];const s=r+1;if(s<this.length&&n(e[s],o)<0&&(r=s,o=e[s]),n(o,i)>=0)break;e[t]=o,t=r}e[t]=i}}function yr(t,e){return t<e?-1:t>e?1:0}function xr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var mr={exports:{}},vr=function(t,e,n,r){var i=t[0],o=t[1],s=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var a=(r-n)/2,l=0,u=a-1;l<a;u=l++){var h=e[n+2*l+0],c=e[n+2*l+1],f=e[n+2*u+0],p=e[n+2*u+1];c>o!=p>o&&i<(f-h)*(o-c)/(p-c)+h&&(s=!s)}return s},wr=function(t,e,n,r){var i=t[0],o=t[1],s=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var a=r-n,l=0,u=a-1;l<a;u=l++){var h=e[l+n][0],c=e[l+n][1],f=e[u+n][0],p=e[u+n][1];c>o!=p>o&&i<(f-h)*(o-c)/(p-c)+h&&(s=!s)}return s};mr.exports=function(t,e,n,r){return e.length>0&&Array.isArray(e[0])?wr(t,e,n,r):vr(t,e,n,r)};var br=mr.exports.nested=wr;mr.exports.flat=vr;const Mr=11102230246251565e-32,Pr=134217729,_r=(3+8*Mr)*Mr;function Ar(t,e,n,r,i){let o,s,a,l,u=e[0],h=r[0],c=0,f=0;h>u==h>-u?(o=u,u=e[++c]):(o=h,h=r[++f]);let p=0;if(c<t&&f<n)for(h>u==h>-u?(s=u+o,a=o-(s-u),u=e[++c]):(s=h+o,a=o-(s-h),h=r[++f]),o=s,0!==a&&(i[p++]=a);c<t&&f<n;)h>u==h>-u?(s=o+u,l=s-o,a=o-(s-l)+(u-l),u=e[++c]):(s=o+h,l=s-o,a=o-(s-l)+(h-l),h=r[++f]),o=s,0!==a&&(i[p++]=a);for(;c<t;)s=o+u,l=s-o,a=o-(s-l)+(u-l),u=e[++c],o=s,0!==a&&(i[p++]=a);for(;f<n;)s=o+h,l=s-o,a=o-(s-l)+(h-l),h=r[++f],o=s,0!==a&&(i[p++]=a);return 0===o&&0!==p||(i[p++]=o),p}function Ir(t){return new Float64Array(t)}const Sr=33306690738754716e-32,Tr=22204460492503146e-32,Fr=11093356479670487e-47,kr=Ir(4),Lr=Ir(8),Cr=Ir(12),Br=Ir(16),Or=Ir(4);function Yr(t,e,n,r,i,o){const s=(e-o)*(n-i),a=(t-i)*(r-o),l=s-a;if(0===s||0===a||s>0!=a>0)return l;const u=Math.abs(s+a);return Math.abs(l)>=Sr*u?l:-function(t,e,n,r,i,o,s){let a,l,u,h,c,f,p,d,g,y,x,m,v,w,b,M,P,_;const A=t-i,I=n-i,S=e-o,T=r-o;w=A*T,f=Pr*A,p=f-(f-A),d=A-p,f=Pr*T,g=f-(f-T),y=T-g,b=d*y-(w-p*g-d*g-p*y),M=S*I,f=Pr*S,p=f-(f-S),d=S-p,f=Pr*I,g=f-(f-I),y=I-g,P=d*y-(M-p*g-d*g-p*y),x=b-P,c=b-x,kr[0]=b-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-M,c=v-x,kr[1]=v-(x+c)+(c-M),_=m+x,c=_-m,kr[2]=m-(_-c)+(x-c),kr[3]=_;let F=function(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}(4,kr),k=Tr*s;if(F>=k||-F>=k)return F;if(c=t-A,a=t-(A+c)+(c-i),c=n-I,u=n-(I+c)+(c-i),c=e-S,l=e-(S+c)+(c-o),c=r-T,h=r-(T+c)+(c-o),0===a&&0===l&&0===u&&0===h)return F;if(k=Fr*s+_r*Math.abs(F),F+=A*h+T*a-(S*u+I*l),F>=k||-F>=k)return F;w=a*T,f=Pr*a,p=f-(f-a),d=a-p,f=Pr*T,g=f-(f-T),y=T-g,b=d*y-(w-p*g-d*g-p*y),M=l*I,f=Pr*l,p=f-(f-l),d=l-p,f=Pr*I,g=f-(f-I),y=I-g,P=d*y-(M-p*g-d*g-p*y),x=b-P,c=b-x,Or[0]=b-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-M,c=v-x,Or[1]=v-(x+c)+(c-M),_=m+x,c=_-m,Or[2]=m-(_-c)+(x-c),Or[3]=_;const L=Ar(4,kr,4,Or,Lr);w=A*h,f=Pr*A,p=f-(f-A),d=A-p,f=Pr*h,g=f-(f-h),y=h-g,b=d*y-(w-p*g-d*g-p*y),M=S*u,f=Pr*S,p=f-(f-S),d=S-p,f=Pr*u,g=f-(f-u),y=u-g,P=d*y-(M-p*g-d*g-p*y),x=b-P,c=b-x,Or[0]=b-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-M,c=v-x,Or[1]=v-(x+c)+(c-M),_=m+x,c=_-m,Or[2]=m-(_-c)+(x-c),Or[3]=_;const C=Ar(L,Lr,4,Or,Cr);w=a*h,f=Pr*a,p=f-(f-a),d=a-p,f=Pr*h,g=f-(f-h),y=h-g,b=d*y-(w-p*g-d*g-p*y),M=l*u,f=Pr*l,p=f-(f-l),d=l-p,f=Pr*u,g=f-(f-u),y=u-g,P=d*y-(M-p*g-d*g-p*y),x=b-P,c=b-x,Or[0]=b-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-M,c=v-x,Or[1]=v-(x+c)+(c-M),_=m+x,c=_-m,Or[2]=m-(_-c)+(x-c),Or[3]=_;const B=Ar(C,Cr,4,Or,Br);return Br[B-1]}(t,e,n,r,i,o,u)}function Vr(t,e,n){e=Math.max(0,void 0===e?2:e),n=n||0;var r=function(t){for(var e=t[0],n=t[0],r=t[0],i=t[0],o=0;o<t.length;o++){var s=t[o];s[0]<e[0]&&(e=s),s[0]>r[0]&&(r=s),s[1]<n[1]&&(n=s),s[1]>i[1]&&(i=s)}var a=[e,n,r,i],l=a.slice();for(o=0;o<t.length;o++)br(t[o],a)||l.push(t[o]);return function(t){t.sort(Rr);for(var e=[],n=0;n<t.length;n++){for(;e.length>=2&&Dr(e[e.length-2],e[e.length-1],t[n])<=0;)e.pop();e.push(t[n])}for(var r=[],i=t.length-1;i>=0;i--){for(;r.length>=2&&Dr(r[r.length-2],r[r.length-1],t[i])<=0;)r.pop();r.push(t[i])}return r.pop(),e.pop(),e.concat(r)}(l)}(t),i=new er(16);i.toBBox=function(t){return{minX:t[0],minY:t[1],maxX:t[0],maxY:t[1]}},i.compareMinX=function(t,e){return t[0]-e[0]},i.compareMinY=function(t,e){return t[1]-e[1]},i.load(t);for(var o,s=[],a=0;a<r.length;a++){var l=r[a];i.remove(l),o=Gr(l,o),s.push(o)}var u=new er(16);for(a=0;a<s.length;a++)u.insert(qr(s[a]));for(var h=e*e,c=n*n;s.length;){var f=s.shift(),p=f.p,d=f.next.p,g=jr(p,d);if(!(g<c)){var y=g/h;(l=Xr(i,f.prev.p,p,d,f.next.next.p,y,u))&&Math.min(jr(l,p),jr(l,d))<=y&&(s.push(f),s.push(Gr(l,f)),i.remove(l),u.remove(f),u.insert(qr(f)),u.insert(qr(f.next)))}}f=o;var x=[];do{x.push(f.p),f=f.next}while(f!==o);return x.push(f.p),x}function Xr(t,e,n,r,i,o,s){for(var a=new gr([],Nr),l=t.data;l;){for(var u=0;u<l.children.length;u++){var h=l.children[u],c=l.leaf?Zr(h,n,r):Er(n,r,h);c>o||a.push({node:h,dist:c})}for(;a.length&&!a.peek().node.children;){var f=a.pop(),p=f.node,d=Zr(p,e,n),g=Zr(p,r,i);if(f.dist<d&&f.dist<g&&$r(n,p,s)&&$r(r,p,s))return p}(l=a.pop())&&(l=l.node)}return null}function Nr(t,e){return t.dist-e.dist}function Er(t,e,n){if(zr(t,n)||zr(e,n))return 0;var r=Ur(t[0],t[1],e[0],e[1],n.minX,n.minY,n.maxX,n.minY);if(0===r)return 0;var i=Ur(t[0],t[1],e[0],e[1],n.minX,n.minY,n.minX,n.maxY);if(0===i)return 0;var o=Ur(t[0],t[1],e[0],e[1],n.maxX,n.minY,n.maxX,n.maxY);if(0===o)return 0;var s=Ur(t[0],t[1],e[0],e[1],n.minX,n.maxY,n.maxX,n.maxY);return 0===s?0:Math.min(r,i,o,s)}function zr(t,e){return t[0]>=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function $r(t,e,n){for(var r,i,o,s,a=Math.min(t[0],e[0]),l=Math.min(t[1],e[1]),u=Math.max(t[0],e[0]),h=Math.max(t[1],e[1]),c=n.search({minX:a,minY:l,maxX:u,maxY:h}),f=0;f<c.length;f++)if(r=c[f].p,i=c[f].next.p,o=t,r!==(s=e)&&i!==o&&Dr(r,i,o)>0!=Dr(r,i,s)>0&&Dr(o,s,r)>0!=Dr(o,s,i)>0)return!1;return!0}function Dr(t,e,n){return Yr(t[0],t[1],e[0],e[1],n[0],n[1])}function qr(t){var e=t.p,n=t.next.p;return t.minX=Math.min(e[0],n[0]),t.minY=Math.min(e[1],n[1]),t.maxX=Math.max(e[0],n[0]),t.maxY=Math.max(e[1],n[1]),t}function Gr(t,e){var n={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(n.next=e.next,n.prev=e,e.next.prev=n,e.next=n):(n.prev=n,n.next=n),n}function jr(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function Zr(t,e,n){var r=e[0],i=e[1],o=n[0]-r,s=n[1]-i;if(0!==o||0!==s){var a=((t[0]-r)*o+(t[1]-i)*s)/(o*o+s*s);a>1?(r=n[0],i=n[1]):a>0&&(r+=o*a,i+=s*a)}return(o=t[0]-r)*o+(s=t[1]-i)*s}function Ur(t,e,n,r,i,o,s,a){var l,u,h,c,f=n-t,p=r-e,d=s-i,g=a-o,y=t-i,x=e-o,m=f*f+p*p,v=f*d+p*g,w=d*d+g*g,b=f*y+p*x,M=d*y+g*x,P=m*w-v*v,_=P,A=P;0===P?(u=0,_=1,c=M,A=w):(c=m*M-v*b,(u=v*M-w*b)<0?(u=0,c=M,A=w):u>_&&(u=_,c=M+v,A=w)),c<0?(c=0,-b<0?u=0:-b>m?u=_:(u=-b,_=m)):c>A&&(c=A,-b+v<0?u=0:-b+v>m?u=_:(u=-b+v,_=m));var I=(1-(h=0===c?0:c/A))*i+h*s-((1-(l=0===u?0:u/_))*t+l*n),S=(1-h)*o+h*a-((1-l)*e+l*r);return I*I+S*S}function Rr(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]}const{PackUtil:Jr}=re();class Hr{constructor(t,e){this.x=t,this.y=e}clone(){return new Hr(this.x,this.y)}normalize(){const t=this.length();this.x/=t,this.y/=t}negate(){this.x=-this.x,this.y=-this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}diff(t){return new Hr(this.x-t.x,this.y-t.y)}distance(t){const e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)}dot(t){return this.x*t.x+this.y*t.y}equals(t){return this.x===t.x&&this.y===t.y}orthogonal(){return new Hr(this.y,-this.x)}}function Wr(t,e,n,r){const i=e.x*r.y-e.y*r.x,o=n.x-t.x,s=n.y-t.y,a=(o*r.y-s*r.x)/i;return new Hr(t.x+a*e.x,t.y+a*e.y)}const Kr=[],Qr=[];function ti(t){if(S(t[0]&&t[0].x)){const e=[];let n=0;for(let r=0;r<t.length;r++)Qr[n]?(Qr[n][0]=t[r].x,Qr[n][1]=t[r].y):Qr[n]=[t[r].x,t[r].y],e.push(Qr[n]),n++;t=e}try{const e=Vr(t,1/0);let n=[1/0,1/0],r=[-1/0,-1/0];for(let t=0;t<e.length;t++)e[t][0]<n[0]&&(n[0]=e[t][0]),e[t][0]>r[0]&&(r[0]=e[t][0]),e[t][1]<n[1]&&(n[1]=e[t][1]),e[t][1]>r[1]&&(r[1]=e[t][1]);const i=[];let o=[],s=0;for(let t=0;t<e.length;t++)t===e.length-1&&e[t][0]===e[0][0]&&e[t][1]===e[0][1]||(_t(i,e[t],"EPSG:3857"),Kr[s]?(Kr[s].x=i[0],Kr[s].y=i[1]):Kr[s]=new Hr(i[0],i[1]),o.push(Kr[s]),s++);Jr.calculateSignedArea(o)<0&&(o=o.reverse());const a=function(t){let e,n=Number.MAX_VALUE;const r=function(t,r,i,o,s,a,l,u){var h=Wr(t,r,s,a),c=Wr(i,o,s,a),f=Wr(l,u,t,r),p=Wr(l,u,i,o),d=h.distance(c)*h.distance(f);0!==d&&d<n&&(e=[h,f,p,c],n=d)};var i=[];for(let e=0;e<t.length;e++)i.push(t[(e+1)%t.length].diff(t[e])),i[e].normalize();var o,s,a,l,u=new Hr(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),h=new Hr(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let e=0;e<t.length;e++){var c=t[e];c.x<u.x&&(u.x=c.x,o=e),c.x>h.x&&(h.x=c.x,s=e),c.y<u.y&&(u.y=c.y,l=e),c.y>h.y&&(h.y=c.y,a=e)}var f=new Hr(0,-1),p=new Hr(0,1),d=new Hr(-1,0),g=new Hr(1,0);for(let e=0;e<t.length;e++){var y=[Math.acos(f.dot(i[o])),Math.acos(p.dot(i[s])),Math.acos(d.dot(i[a])),Math.acos(g.dot(i[l]))];switch(y.indexOf(Math.min.apply(Math,y))){case 0:(p=(f=i[o].clone()).clone()).negate(),(g=(d=f.orthogonal()).clone()).negate(),o=(o+1)%t.length;break;case 1:(f=(p=i[s].clone()).clone()).negate(),(g=(d=f.orthogonal()).clone()).negate(),s=(s+1)%t.length;break;case 2:(g=(d=i[a].clone()).clone()).negate(),(p=(f=g.orthogonal()).clone()).negate(),a=(a+1)%t.length;break;case 3:(d=(g=i[l].clone()).clone()).negate(),(p=(f=g.orthogonal()).clone()).negate(),l=(l+1)%t.length}r(t[o],f,t[s],p,t[a],d,t[l],g)}return e}(o);if(!a||4!==a.length)return null;const l=a[0].distance(a[1]),u=a[1].distance(a[2]),h=a.map((t=>[t.x,t.y]));return h.push(+(u>l)),h}catch(t){return null}}const ei=[];function ni(t,e){const n=Array.isArray(t&&t[0]&&t[0][0]);for(let r=0;r<t.length;r++)n?t[r]=ni(t[r]):(_t(ei,t[r],e),t[r][0]=ei[0],t[r][1]=ei[1]);return t}const{PackUtil:ri}=re();class ii extends Ln{constructor(t,e,n,r,i,o){super(t,e,n,r,i),(e=e||{}).extent||(e.extent=8192),this.setData(e.data,o)}clearData(){delete this.index}setData(t,e){if(delete this.index,function(t){if(!t)return!0;if(Array.isArray(t)&&!t.length)return!0;if(t.features&&!t.features.length)return!0;return!1}(t))return this.empty=!0,void e();const n={maxZoom:24,tolerance:this.options.simplifyTolerance,extent:this.options.extent,buffer:S(this.options.tileBuffer)?this.options.tileBuffer:64,hasAltitude:!!this.options.hasAltitude,debug:0,lineMetrics:!0,indexMaxZoom:5,indexMaxPoints:1e5,disableFilter:!0};if(this.options.projection&&(n.projection=this.options.projection,"EPSG:4490"===n.projection&&(n.projection="EPSG:4326")),I(t)&&"{"!=t.substring(0,1)||t.url){const r=t.url?t.url:t;O.getJSON(r,t.url?t:{},((t,i)=>{if(t&&(console.error("Failed to fetch geojson:"+r),e(t)),!i)return void e(null,{extent:null,idMap:new Map});let o=i;if(this.options.convertFn){o=new Function("data",this.options.convertFn+"\\nreturn convert(data)")(o)}const s=Array.isArray(o)?o:o.features;this._genOMBB(s);const{sample1000:a,idMap:l}=this._generateId(s);this._generate(a,l,o,n,e)}))}else{"string"==typeof t&&(t=JSON.parse(t));const r=Array.isArray(t)?t:t.features;this._genOMBB(r);let i=r;this._generate(i,null,t,n,e)}}_genOMBB(t){if(this.options.generateOMBB&&t)for(let e=0;e<t.length;e++){const n=t[e];if(n&&n.geometry&&n.geometry.coordinates)if("Polygon"===n.geometry.type){const t=n.geometry.coordinates[0];if(!t)continue;const e=ti(t,t.length);n.properties=n.properties||{},n.properties[ne]=e}else if("MultiPolygon"===n.geometry.type){const t=n.geometry.coordinates;for(let e=0;e<t.length;e++){if(!t[e])continue;const r=t[e][0];if(!r)continue;const i=ti(r,r.length);n.properties=n.properties||{},n.properties[ne]=n.properties[ne]||[],n.properties[ne][e]=i}}}}_generate(t,e,n,r,i){try{const o=t&&t.length?function(t){let e=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];switch(t.type){case"FeatureCollection":const n=t.features.length;for(let r=0;r<n;r++)Zn(t.features[r],e);break;case"Feature":Zn(t,e);break;default:Un(t,e)}return e}({type:"FeatureCollection",features:t}):null;this.index=function(t,e){return new ht(t,e)}(n,this.options.geojsonvt||r),i(null,{extent:o,idMap:e})}catch(t){console.warn(t),i({error:t.message})}}_generateId(t){const e=[],n=new Map;let r=0;const i=this.options.featureIdProperty;return t&&(t.length,t.forEach(((t,o)=>{!function(t,o,s){if(!t)return;if("Feature"===t.type&&!t.geometry)return;if(S(t.id)||(t.id=r++),i){let e=i;F(i)&&(e=i[t.layer||"0"]),t.id=t.properties[e]}const a=A({},t);t.geometry?(a.geometry=A({},t.geometry),a.geometry.coordinates=null):t.coordinates&&(a.coordinates=null),n.set(t.id,a),e.push(t)}(t)}))),{sample1000:e,idMap:n}}getTileFeatures(t,e){const n=t.tileInfo,r=[];if(!this.index)return this.empty?(setTimeout((function(){e(null,r,[])}),1),1):(setTimeout((function(){e({loading:!0})}),1),1);const i=this.index.getTile(n.z,n.x,n.y);if(!i||0===i.features.length)return setTimeout((function(){e(null,r,[])}),1),1;const o=[];for(let t=0,e=i.features.length;t<e;t++){const e=i.features[t];let n=e.layer;void 0===n&&(n="0"),o[n]={types:{}};o[n].types[e.type]=1,e.tags=e.tags||{},e.geometry.converted||(ri.convertGeometry(e),e.geometry.converted=1),r.push({type:e.type,layer:n,id:e.id,geometry:e.geometry,properties:e.tags,extent:this.options.extent})}for(const t in o)o[t].types=Object.keys(o[t].types).map((t=>+t));return setTimeout((function(){e(null,r,o)}),1),1}onRemove(){super.onRemove(),delete this.index}}var oi={\n/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\nread:function(t,e,n,r,i){var o,s,a=8*i-r-1,l=(1<<a)-1,u=l>>1,h=-7,c=n?i-1:0,f=n?-1:1,p=t[e+c];for(c+=f,o=p&(1<<-h)-1,p>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=f,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=r;h>0;s=256*s+t[e+c],c+=f,h-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=u}return(p?-1:1)*s*Math.pow(2,o-r)},write:function(t,e,n,r,i,o){var s,a,l,u=8*o-i-1,h=(1<<u)-1,c=h>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+c>=1?f/l:f*Math.pow(2,1-c))*l>=2&&(s++,l/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*l-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[n+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[n+p]=255&s,p+=d,s/=256,u-=8);t[n+p-d]|=128*g}},si=li,ai=oi;function li(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}li.Varint=0,li.Fixed64=1,li.Bytes=2,li.Fixed32=5;var ui=4294967296,hi=1/ui,ci="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function fi(t){return t.type===li.Bytes?t.readVarint()+t.pos:t.pos+1}function pi(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function di(t,e,n){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=t;i--)n.buf[i+r]=n.buf[i]}function gi(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function yi(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function xi(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function mi(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function vi(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function wi(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function bi(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function Mi(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function Pi(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function _i(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Ai(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function Ii(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}li.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var r=this.readVarint(),i=r>>3,o=this.pos;this.type=7&r,t(i,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=_i(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Ii(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=_i(this.buf,this.pos)+_i(this.buf,this.pos+4)*ui;return this.pos+=8,t},readSFixed64:function(){var t=_i(this.buf,this.pos)+Ii(this.buf,this.pos+4)*ui;return this.pos+=8,t},readFloat:function(){var t=ai.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=ai.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,r=this.buf;return e=127&(n=r[this.pos++]),n<128?e:(e|=(127&(n=r[this.pos++]))<<7,n<128?e:(e|=(127&(n=r[this.pos++]))<<14,n<128?e:(e|=(127&(n=r[this.pos++]))<<21,n<128?e:function(t,e,n){var r,i,o=n.buf;if(i=o[n.pos++],r=(112&i)>>4,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(127&i)<<3,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(127&i)<<10,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(127&i)<<17,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(127&i)<<24,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(1&i)<<31,i<128)return pi(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&ci?function(t,e,n){return ci.decode(t.subarray(e,n))}(this.buf,e,t):function(t,e,n){var r="",i=e;for(;i<n;){var o,s,a,l=t[i],u=null,h=l>239?4:l>223?3:l>191?2:1;if(i+h>n)break;1===h?l<128&&(u=l):2===h?128==(192&(o=t[i+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===h?(o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&((u=(15&l)<<12|(63&o)<<6|63&s)<=2047||u>=55296&&u<=57343)&&(u=null)):4===h&&(o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,h=1):u>65535&&(u-=65536,r+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),r+=String.fromCharCode(u),i+=h}return r}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==li.Bytes)return t.push(this.readVarint(e));var n=fi(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==li.Bytes)return t.push(this.readSVarint());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==li.Bytes)return t.push(this.readBoolean());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==li.Bytes)return t.push(this.readFloat());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==li.Bytes)return t.push(this.readDouble());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==li.Bytes)return t.push(this.readFixed32());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==li.Bytes)return t.push(this.readSFixed32());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==li.Bytes)return t.push(this.readFixed64());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==li.Bytes)return t.push(this.readSFixed64());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===li.Varint)for(;this.buf[this.pos++]>127;);else if(e===li.Bytes)this.pos=this.readVarint()+this.pos;else if(e===li.Fixed32)this.pos+=4;else{if(e!==li.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var n=new Uint8Array(e);n.set(this.buf),this.buf=n,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Ai(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Ai(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Ai(this.buf,-1&t,this.pos),Ai(this.buf,Math.floor(t*hi),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Ai(this.buf,-1&t,this.pos),Ai(this.buf,Math.floor(t*hi),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var n,r;t>=0?(n=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,r=r+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos]=127&t}(n,0,e),function(t,e){var n=(7&t)<<4;if(e.buf[e.pos++]|=n|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,n){for(var r,i,o=0;o<e.length;o++){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){r>56319||o+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):i=r;continue}if(r<56320){t[n++]=239,t[n++]=191,t[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(t[n++]=239,t[n++]=191,t[n++]=189,i=null);r<128?t[n++]=r:(r<2048?t[n++]=r>>6|192:(r<65536?t[n++]=r>>12|224:(t[n++]=r>>18|240,t[n++]=r>>12&63|128),t[n++]=r>>6&63|128),t[n++]=63&r|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&di(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),ai.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),ai.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var n=0;n<e;n++)this.buf[this.pos++]=t[n]},writeRawMessage:function(t,e){this.pos++;var n=this.pos;t(e,this);var r=this.pos-n;r>=128&&di(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,n){this.writeTag(t,li.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,gi,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,yi,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,vi,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,xi,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,mi,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,wi,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,bi,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Mi,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Pi,e)},writeBytesField:function(t,e){this.writeTag(t,li.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,li.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,li.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,li.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,li.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,li.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,li.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,li.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,li.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,li.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Si=xr(si),Ti=Fi;function Fi(t,e){this.x=t,this.y=e}Fi.prototype={clone:function(){return new Fi(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,n=t.y-this.y;return e*e+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),n=Math.sin(t),r=e*this.x-n*this.y,i=n*this.x+e*this.y;return this.x=r,this.y=i,this},_rotateAround:function(t,e){var n=Math.cos(t),r=Math.sin(t),i=e.x+n*(this.x-e.x)-r*(this.y-e.y),o=e.y+r*(this.x-e.x)+n*(this.y-e.y);return this.x=i,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Fi.convert=function(t){return t instanceof Fi?t:Array.isArray(t)?new Fi(t[0],t[1]):t};var ki=Ti,Li=Ci;function Ci(t,e,n,r,i){this.properties={},this.extent=n,this.type=0,this._pbf=t,this._geometry=-1,this._keys=r,this._values=i,t.readFields(Bi,this,e)}function Bi(t,e,n){1==t?e.id=n.readVarint():2==t?function(t,e){var n=t.readVarint()+t.pos;for(;t.pos<n;){var r=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[r]=i}}(n,e):3==t?e.type=n.readVarint():4==t&&(e._geometry=n.pos)}function Oi(t){for(var e,n,r=0,i=0,o=t.length,s=o-1;i<o;s=i++)e=t[i],r+=((n=t[s]).x-e.x)*(e.y+n.y);return r}Ci.types=["Unknown","Point","LineString","Polygon"],Ci.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,n=t.readVarint()+t.pos,r=1,i=0,o=0,s=0,a=[];t.pos<n;){if(i<=0){var l=t.readVarint();r=7&l,i=l>>3}if(i--,1===r||2===r)o+=t.readSVarint(),s+=t.readSVarint(),1===r&&(e&&a.push(e),e=[]),e.push(new ki(o,s));else{if(7!==r)throw new Error("unknown command "+r);e&&e.push(e[0].clone())}}return e&&a.push(e),a},Ci.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,n=1,r=0,i=0,o=0,s=1/0,a=-1/0,l=1/0,u=-1/0;t.pos<e;){if(r<=0){var h=t.readVarint();n=7&h,r=h>>3}if(r--,1===n||2===n)(i+=t.readSVarint())<s&&(s=i),i>a&&(a=i),(o+=t.readSVarint())<l&&(l=o),o>u&&(u=o);else if(7!==n)throw new Error("unknown command "+n)}return[s,l,a,u]},Ci.prototype.toGeoJSON=function(t,e,n){var r,i,o=this.extent*Math.pow(2,n),s=this.extent*t,a=this.extent*e,l=this.loadGeometry(),u=Ci.types[this.type];function h(t){for(var e=0;e<t.length;e++){var n=t[e],r=180-360*(n.y+a)/o;t[e]=[360*(n.x+s)/o-180,360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90]}}switch(this.type){case 1:var c=[];for(r=0;r<l.length;r++)c[r]=l[r][0];h(l=c);break;case 2:for(r=0;r<l.length;r++)h(l[r]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var n,r,i=[],o=0;o<e;o++){var s=Oi(t[o]);0!==s&&(void 0===r&&(r=s<0),r===s<0?(n&&i.push(n),n=[t[o]]):n.push(t[o]))}n&&i.push(n);return i}(l),r=0;r<l.length;r++)for(i=0;i<l[r].length;i++)h(l[r][i])}1===l.length?l=l[0]:u="Multi"+u;var f={type:"Feature",geometry:{type:u,coordinates:l},properties:this.properties};return"id"in this&&(f.id=this.id),f};var Yi=Li,Vi=Xi;function Xi(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(Ni,this,e),this.length=this._features.length}function Ni(t,e,n){15===t?e.version=n.readVarint():1===t?e.name=n.readString():5===t?e.extent=n.readVarint():2===t?e._features.push(n.pos):3===t?e._keys.push(n.readString()):4===t&&e._values.push(function(t){var e=null,n=t.readVarint()+t.pos;for(;t.pos<n;){var r=t.readVarint()>>3;e=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return e}(n))}Xi.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Yi(this._pbf,e,this.extent,this._keys,this._values)};var Ei=Vi,zi=function(t,e){this.layers=t.readFields($i,{},e)};function $i(t,e,n){if(3===t){var r=new Ei(n,n.readVarint()+n.pos);r.length&&(e[r.name]=r)}}var Di=zi;const qi=2,Gi=new TextDecoder("utf-8");class ji extends Ln{constructor(t,e,n,r,i,o){super(t,e,n,r,i),e=e||{},o()}clearData(){this._abortRequests()}getTileFeatures(t,e){const n=t.tileInfo.url,r=t.fetchOptions||{},{altitudePropertyName:i,disableAltitudeWarning:o}=t,s=this._cache.get(n);if(s&&s.cacheIndex===t.workerCacheIndex){const{err:t,data:r}=s;return setTimeout((()=>{this._readTile(n,i,o,t,r,e)}),1)}const{tileArrayBuffer:a}=t;if(a)return setTimeout((()=>{this._readTile(n,i,o,null,a,e)}),1);r.referrer=t.referrer,r.errorLog=t.loadTileErrorLog;const{loadTileCachMaxSize:l,loadTileCacheLog:u}=t;return O.getArrayBuffer(n,r,((r,s)=>{if(this._cache){if(r)r.loading||this._cache.add(n,{err:r,data:s&&s.data,cacheIndex:t.workerCacheIndex});else if(s&&s.data){let e=!0;if("number"==typeof(h=l)&&!isNaN(h)&&l>0){const t=(a=s.data)&&a instanceof ArrayBuffer?a.byteLength/1048576:0;t>l&&(e=!1,u&&console.warn(\`url:${G}n},loadTileCachMaxSize exceeded: ${G}t} > ${G}l},the tile will not be cached.\`))}e&&this._cache.add(n,{err:null,data:s.data,cacheIndex:t.workerCacheIndex})}var a,h;this._readTile(n,i,o,r,s&&s.data,e)}}))}_readTile(t,e,n,r,i,o){if(r)return void o(r);let s;try{s=new Di(new Si(i))}catch(r){const e=Gi.decode(i);return r.message+="\\n"+t+"\\n"+e,void o(r.message,[],[])}const a=[];if(!s.layers)return void o(null,a,[]);const l={};let u;for(const t in s.layers)if(h=s.layers,c=t,Object.prototype.hasOwnProperty.call(h,c)){l[t]={types:{}};const i=l[t].types;for(let o=0,l=s.layers[t].length;o<l;o++)try{u=s.layers[t].feature(o),i[u.type]=1;const r={type:u.type,layer:t,geometry:u.loadGeometry(),properties:u.properties,extent:u.extent};void 0!==u.id&&(r.id=u.id);let l=r.properties[ne];l&&(I(l)&&(l=JSON.parse(l)),r.properties[ne]=ni(l,"EPSG:3857"));const h=e&&r.properties[e];if(h){const t=Zi(h),e=[];Ui(r.geometry,t,e),e.length&&!n&&(console.warn("feature.geometry is not consistent with altitude values:"),console.warn(JSON.stringify(r,null,2)))}a.push(r)}catch(r){console.warn("error when load vt geometry:",r)}}var h,c;for(const t in l)l[t].types=Object.keys(l[t].types).map((t=>+t));o(null,a,l,{byteLength:i.byteLength})}abortTile(t,e){const n=this.requests[t];delete this.requests[t],n&&n.abort&&n.abort(),this._cancelLoadings(t),e()}onRemove(){super.onRemove(),this._abortRequests()}_abortRequests(){for(const t in this.requests){const e=this.requests[t];e&&e.abort&&e.abort()}this.requests={}}}function Zi(t){const e=atob(t),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return new Float32Array(n.buffer)}function Ui(t,e,n,r){r||(r={index:0});for(let i=0;i<t.length;i++)if(Array.isArray(t[i]))Ui(t[i],e,n,r);else{const o=r.index;k(e[o])?n.push(qi):t[i].z=100*e[o],r.index++}}const{LRUCache:Ri}=re();let Ji=0;const Hi=new Ri(128);class Wi{constructor(t){this._layers={},this._callbacks={},this.workerId=t}addLayer({actorId:t,mapId:e,layerId:n,params:r},i){if(this._getLayerById(e,n))return;const o=this._genKey(e,n),s=r.type,a=r.options,l=this.send.bind(this,t);this._layers[o]="GeoJSONVectorTileLayer"===s?new ii(n,a,l,Hi,{},i):new ji(n,a,l,Hi,{},i)}removeLayer({mapId:t,layerId:e},n){const r=this._getLayerById(t,e),i=this._genKey(t,e);delete this._layers[i],r&&r.onRemove(n)}loadTile({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.loadTile(n,r)}abortTile({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.abortTile&&i.abortTile(n.url,r)}removeTile({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.removeTile(n,r)}updateStyle({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.updateStyle(n,r)}updateOptions({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.updateOptions(n,r)}setData({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.setData(n.data,r)}clearData({mapId:t,layerId:e},n){const r=this._getLayerById(t,e);r&&(r.clearData(n),this._resetCache())}receive(t){const e=t.callback,n=this._callbacks[e];delete this._callbacks[e],n&&t.error?n(new Error(t.error)):n&&n(null,t.data)}send(t,e,n,r,i){const o=i?\`${G}t}-${G}Ji++}\`:null;i&&(this._callbacks[o]=i),postMessage({type:"<request>",workerId:this.workerId,actorId:t,command:e,params:n,callback:String(o)},r||[])}_genKey(t,e){return\`${G}t}-${G}e}\`}_getLayerById(t,e){const n=this._genKey(t,e);return this._layers[n]}_resetCache(){Hi.reset()}}t.initialize=function(){},t.onmessage=function(t,e){const n=t.data;if(this.dispatcher||(this.dispatcher=new Wi(t.workerId)),"<response>"===t.type)this.dispatcher.workerId===t.workerId&&this.dispatcher.receive(t);else{const r=n.command,i=(n.params||{}).loadTileErrorLog,o=(n.params||{}).loadTileErrorLogIgnoreCodes||[];this.dispatcher[r]({actorId:t.actorId,mapId:n.mapId,layerId:n.layerId,params:n.params},((t,n,s)=>{if(i&&t&&!t.loading){const e=t.status;S(e)&&-1===o.indexOf(e)&&console.error(r,t)}e(t,n,s)}))}}}`;
|
|
34
|
+
const G = "${", B = `function(t){let e;const n={width:100,height:10};let r=!1;try{const t=new OffscreenCanvas(1,1);t.getContext("2d").fillText("hello",0,0),r=!0}catch(t){r=!1}function i(){if(!e){const{width:t,height:i}=n;r?e=new OffscreenCanvas(t,i):(e=document.createElement("canvas"),e.width=t,e.height=i)}return e}class o{constructor(t,e={}){if(!Array.isArray(t))return void console.error("colors is not array");if(t.length<2)return void console.error("colors.length should >1");this.colors=t;let r=1/0,i=-1/0;for(let e=0,n=t.length;e<n;e++){const n=t[e][0];r=Math.min(n,r),i=Math.max(n,i)}this.min=r,this.max=i,this.valueOffset=this.max-this.min,this.options=Object.assign({},n,e),this._initImgData()}getImageData(){return this.imgData}_initImgData(){const t=i(),{width:e,height:n}=this.options;t.width=e,t.height=n;const r=t.getContext("2d");r.clearRect(0,0,t.width,t.height);const o=r.createLinearGradient(0,0,t.width,0),{colors:s,valueOffset:a}=this;for(let t=0,e=s.length;t<e;t++){const[e,n]=s[t],r=(e-this.min)/a;o.addColorStop(r,n)}r.fillStyle=o,r.fillRect(0,0,t.width,t.height),this.imgData=r.getImageData(0,0,t.width,t.height)}getColor(t){t=Math.max(this.min,t);const e=((t=Math.min(t,this.max))-this.min)/this.valueOffset;let n=Math.round(e*this.imgData.width);n=Math.min(n,this.imgData.width-1);const r=4*n;return[this.imgData.data[r],this.imgData.data[r+1],this.imgData.data[r+2],this.imgData.data[r+3]]}}var s;function a(t){return null==t}function l(t){return!a(t)}function u(t){return""===t}function h(t,e){var n,r,i;if(w(t)){var o,s=t.stops&&"object"==typeof t.stops[0][0],a=s||l(t.property),u=s||!a,d=t.type||e||"exponential";if("exponential"===d)o=p;else if("interval"===d)o=f;else if("categorical"===d)o=c;else if("identity"===d)o=y;else if("color-interpolate"===d)o=g;else{if("calculate-expression"!==d)throw new Error('Unknown function type "'+d+'"');o=x}if(s){var m={},v=[];for(let e=0;e<t.stops.length;e++){var b=t.stops[e];void 0===m[b[0].zoom]&&(m[b[0].zoom]={zoom:b[0].zoom,type:t.type,property:t.property,default:t.default,stops:[]}),m[b[0].zoom].stops.push([b[0].value,b[1]])}for(let t in m)v.push([m[t].zoom,h(m[t])]);n=function(e,n){const r=p({stops:v,base:t.base},e)(e,n);return"function"==typeof r?r(e,n):r},r=!1,i=!1}else u?(n=function(e){const n=o(t,e);return"function"==typeof n?n(e):n},r=!0,i=!1):(n=function(e,n){const r=o(t,n?n[t.property]:null);return"function"==typeof r?r(e,n):r},r=!1,i=!0)}else n=function(){return t},r=!0,i=!0;return n.isZoomConstant=i,n.isFeatureConstant=r,n}function c(t,e){for(let n=0;n<t.stops.length;n++)if(e===t.stops[n][0])return t.stops[n][1];return t.default}function f(t,e){for(var n=0;n<t.stops.length&&!(e<t.stops[n][0]);n++);return t.stops[Math.max(n-1,0)][1]}function p(t,e){for(var n=l(t.base)&&!u(t.base)?t.base:1,r=0;!(r>=t.stops.length||e<=t.stops[r][0]);)r++;return 0===r?t.stops[r][1]:r===t.stops.length?t.stops[r-1][1]:m(e,n,t.stops[r-1][0],t.stops[r][0],t.stops[r-1][1],t.stops[r][1])}"function"==typeof Map&&(s=new Map);const d={width:100,height:1};function g(t,e){const n=t.stops;if(n&&n.length>1){let t;if(s){const e=JSON.stringify(n);if(!s.has(e)){const t=new o(n,d);s.set(e,t)}t=s.get(e)}else t=new o(n,d);const[r,i,a,l]=t.getColor(e);return[r/255,i/255,a/255,l/255]}return n&&1===n.length?n[0][1]:null}function y(t,e){return n=e,r=t.default,l(n)?n:l(r)?r:l(i)?i:null;var n,r,i}function x(t,e){const n=String(t.property),r=t.expression,i=e;function o(e){return a(e)||u(e)||isNaN(e)?t.default:e}if(!l(e)||u(e)||isNaN(e)||e<0)return o(t.default);{const e=function t(e,n,r){const i=Number(r),o=String(n);return Array.isArray(e)?e.map((e=>t(e,o,i))):e===o?i:e}(r,n,i);return o(function e(n){if(!Array.isArray(n)){if("number"==typeof n)return n;throw new Error("Invalid expression format")}{const r=n[0];if(!["+","-","*","/"].includes(r))throw new Error(\`Unknown operator: ${G}r}\`);const i=n.slice(1).map((t=>e(t)));switch(r){case"+":return i.reduce(((t,e)=>t+e),0);case"-":return i.reduce(((t,e)=>t-e));case"*":return i.reduce(((t,e)=>t*e),1);case"/":return i.some((t=>0===t))?t.default:i.reduce(((t,e)=>t/e));default:throw new Error(\`Unsupported operator: ${G}r}\`)}}}(e))}}function m(t,e,n,r,i,o){return"function"==typeof i?function(){var s=i.apply(void 0,arguments),a=o.apply(void 0,arguments);return m(t,e,n,r,s,a)}:i.length?function(t,e,n,r,i,o){var s=[];for(let a=0;a<i.length;a++)s[a]=v(t,e,n,r,i[a],o[a]);return s}(t,e,n,r,i,o):v(t,e,n,r,i,o)}function v(t,e,n,r,i,o){var s,a=r-n,l=t-n;return i*(1-(s=1===e?l/a:(Math.pow(e,l)-1)/(Math.pow(e,a)-1)))+o*s}function w(t){return t&&"object"==typeof t&&(t.stops||t.property&&"identity"===t.type||t.expression&&"calculate-expression"===t.type)}function b(t){return M(t,"interval")}function M(t,e){if(!w(t))return function(){return t};let n=!0,r=!0;const i=(t=JSON.parse(JSON.stringify(t))).stops;if(i)for(let t=0;t<i.length;t++)if(w(i[t][1])){const o=M(i[t][1],e);n=n&&o.isZoomConstant,r=r&&o.isFeatureConstant,i[t]=[i[t][0],o]}const o=h(t,e);return o.isZoomConstant=n&&o.isZoomConstant,o.isFeatureConstant=r&&o.isFeatureConstant,o}let P=0;const _="function"==typeof Object.assign;function A(t,...e){if(_)return Object.assign(t,...e),t;for(let n=0;n<e.length;n++){const r=e[n];for(const e in r)t[e]=r[e]}return t}function I(t){return!k(t)&&("string"==typeof t||null!==t.constructor&&t.constructor===String)}function S(t){return"number"==typeof t&&!isNaN(t)}function T(t){return!k(t)&&("function"==typeof t||null!==t.constructor&&t.constructor===Function)}function F(t){return!Array.isArray(t)&&"object"==typeof t&&!!t}function k(t){return null==t}function L(t){return w(t)&&t.property}const B=new TextEncoder;new TextDecoder;const C="function"==typeof fetch&&"function"==typeof AbortController,O={jsonp:function(t,e){const n="_maptalks_jsonp_"+P++;t.match(/\\?/)?t+="&callback="+n:t+="?callback="+n;let r=document.createElement("script");return r.type="text/javascript",r.src=t,window[n]=function(t){e(null,t),document.getElementsByTagName("head")[0].removeChild(r),r=null,delete window[n]},document.getElementsByTagName("head")[0].appendChild(r),this},get:function(t,e,n){if(T(e)){const t=n;n=e,e=t}let r=(e=e||{}).errorLog;k(r)&&(r=!0),e.method&&(e.method=e.method.toUpperCase());const i="POST"===e.method;if(C){const i=new AbortController,o=e;o.signal=i.signal,o.referrerPolicy=o.referrerPolicy||"origin",o.method=o.method||"GET";const s=new Request(t,o);return e.returnJSON&&s.headers.set("Accept","application/json"),fetch(s).then((i=>{const o=this._parseResponse(i,e.returnJSON,e.responseType);o.message?(o.url=t,n(o)):o.then((t=>{"arraybuffer"===e.responseType?n(null,{data:t,cacheControl:i.headers.get("Cache-Control"),expires:i.headers.get("Expires"),contentType:i.headers.get("Content-Type")}):n(null,t)})).catch((e=>{e.code&&e.code===DOMException.ABORT_ERR||(r&&console.error("Fetch error:",t,e),n(e))}))})).catch((e=>{e.code&&e.code===DOMException.ABORT_ERR||(r&&console.error("Fetch error:",t,e),n(e))})),i}{const r=O._getClient(n);if(r.open(e.method||"GET",t,!0),e){for(const t in e.headers)r.setRequestHeader(t,e.headers[t]);r.withCredentials="include"===e.credentials,e.responseType&&(r.responseType=e.responseType)}return r.send(i?e.body:null),r}},_parseResponse:(t,e,n)=>200!==t.status?{status:t.status,statusText:t.statusText,message:\`incorrect http request with status code(${G}t.status}): ${G}t.statusText}\`}:"arraybuffer"===n?t.arrayBuffer():e?t.json():t.text(),_wrapCallback:function(t,e){return function(){if(4===t.readyState)if(200===t.status)if("arraybuffer"===t.responseType){0===t.response.byteLength?e({status:200,statusText:t.statusText,message:"http status 200 returned without content."}):e(null,{data:t.response,cacheControl:t.getResponseHeader("Cache-Control"),expires:t.getResponseHeader("Expires"),contentType:t.getResponseHeader("Content-Type")})}else e(null,t.responseText);else e({status:t.status,statusText:t.statusText,message:\`incorrect http request with status code(${G}t.status}): ${G}t.statusText}\`})}},_getClient:function(t){let e;try{e=new XMLHttpRequest}catch(t){try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}}return e.onreadystatechange=O._wrapCallback(e,t),e},getArrayBuffer(t,e,n){if(T(e)){const t=n;n=e,e=t}return e||(e={}),e.responseType="arraybuffer",O.get(t,e,n)}};function Y(t,e,n,r,i=3){let o=r;const s=n-e>>1;let a,l=n-e;const u=t[e],h=t[e+1],c=t[n],f=t[n+1];for(let r=e+i;r<n;r+=i){const e=V(t[r],t[r+1],u,h,c,f);if(e>o)a=r,o=e;else if(e===o){const t=Math.abs(r-s);t<l&&(a=r,l=t)}}o>r&&(a-e>i&&Y(t,e,a,r,i),t[a+2]=o,n-a>i&&Y(t,a,n,r,i))}function V(t,e,n,r,i,o){let s=i-n,a=o-r;if(0!==s||0!==a){const l=((t-n)*s+(e-r)*a)/(s*s+a*a);l>1?(n=i,r=o):l>0&&(n+=s*l,r+=a*l)}return s=t-n,a=e-r,s*s+a*a}function X(t,e,n,r,i,o){const s={id:null==t?null:t,type:e,geometry:n,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};i&&(s.layer=i);return function(t,e){const n=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)N(t,n,e);else if("Polygon"===r)N(t,n[0],e);else if("MultiLineString"===r)for(const r of n)N(t,r,e);else if("MultiPolygon"===r)for(const r of n)N(t,r[0],e)}(s,o?4:3),s}function N(t,e,n){for(let r=0;r<e.length;r+=n)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function E(t,e,n,r){if(r.layer=e,"FeatureCollection"===n.type)for(let e=0;e<n.features.length;e++)z(t,n.features[e],r,e);else"Feature"===n.type?z(t,n,r):z(t,{geometry:n},r)}function z(t,e,n,r){if(!e.geometry)return;const i=e.geometry.coordinates,o=e.geometry.type,s=Math.pow(n.tolerance/((1<<n.maxZoom)*n.extent),2);let a=[],l=e.id;if(n.promoteId?l=e.properties[n.promoteId]:n.generateId&&(l=r||0),"Point"===o)D(i,a,n);else if("MultiPoint"===o)for(const t of i)D(t,a,n);else if("LineString"===o)$(i,a,s,!1,n);else if("MultiLineString"===o){if(n.lineMetrics){for(const r of i)a=[],$(r,a,s,!1,n),t.push(X(l,"LineString",a,e.properties,n.layer,n.hasAltitude));return}q(i,a,s,!1,n)}else if("Polygon"===o)q(i,a,s,!0,n);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(const i of e.geometry.geometries)z(t,{id:l,geometry:i,properties:e.properties},n,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const t of i){const e=[];q(t,e,s,!0,n),a.push(e)}}t.push(X(l,o,a,e.properties,n.layer,n.hasAltitude))}function D(t,e,n){e.push(G(t[0]),j(t[1],n.projection),0),n.hasAltitude&&(t.length>2?e.push(t[2]):e.push(0))}function $(t,e,n,r,i){let o,s,a=0;for(let n=0;n<t.length;n++){const l=G(t[n][0]),u=j(t[n][1],i.projection);e.push(l,u,0),i.hasAltitude&&(t[n].length>2?e.push(t[n][2]):e.push(0)),n>0&&(a+=r?(o*u-l*s)/2:Math.sqrt(Math.pow(l-o,2)+Math.pow(u-s,2))),o=l,s=u}const l=i.hasAltitude?4:3,u=e.length-l;e[2]=1,Y(e,0,u,n,l),e[u+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function q(t,e,n,r,i){for(let o=0;o<t.length;o++){const s=[];$(t[o],s,n,r,i),e.push(s)}}function G(t){return t/360+.5}function j(t,e){if("EPSG:4326"===e)return(90-t)/360;const n=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+n)/(1-n))/Math.PI;return r<0?0:r>1?1:r}function Z(t,e,n,r,i,o,s,a){if(r/=e,o>=(n/=e)&&s<r)return t;if(s<n||o>=r)return null;const l=[];for(const e of t){const t=e.geometry;let o=e.type;const s=0===i?e.minX:e.minY,u=0===i?e.maxX:e.maxY;if(s>=n&&u<r){l.push(e);continue}if(u<n||s>=r)continue;let h=[];if("Point"===o||"MultiPoint"===o)U(t,h,n,r,i,a.hasAltitude);else if("LineString"===o)R(t,h,n,r,i,!1,a.lineMetrics,a.hasAltitude);else if("MultiLineString"===o)H(t,h,n,r,i,!1,a.hasAltitude);else if("Polygon"===o)H(t,h,n,r,i,!0,a.hasAltitude);else if("MultiPolygon"===o)for(const e of t){const t=[];H(e,t,n,r,i,!0,a.hasAltitude),t.length&&h.push(t)}if(h.length){if(a.lineMetrics&&"LineString"===o){for(const t of h)l.push(X(e.id,o,t,e.tags,e.layer,a.hasAltitude));continue}"LineString"!==o&&"MultiLineString"!==o||(1===h.length?(o="LineString",h=h[0]):o="MultiLineString"),"Point"!==o&&"MultiPoint"!==o||(o=3===h.length?"Point":"MultiPoint"),l.push(X(e.id,o,h,e.tags,e.layer,a.hasAltitude))}}return l.length?l:null}function U(t,e,n,r,i,o){const s=o?4:3;for(let a=0;a<t.length;a+=s){const s=t[a+i];s>=n&&s<=r&&(W(e,t[a],t[a+1],t[a+2]),o&&e.push(t[a+3]))}}function R(t,e,n,r,i,o,s,a){let l=J(t);const u=0===i?K:Q;let h,c,f=t.start;const p=a?4:3,d=o?t.length:t.length-p;for(let g=0;g<d;g+=p){const y=t[g],x=t[g+1],m=t[g+2];let v,w,b,M;o&&g===d-p?(v=t[0],w=t[1]):(v=t[g+p],w=t[g+p+1]),a&&(b=t[g+3],M=o&&g===d-p?t[3]:t[g+p+3]);const P=0===i?y:x,_=0===i?v:w;let A=!1;s&&(h=Math.sqrt(Math.pow(y-v,2)+Math.pow(x-w,2))),P<n?_>n&&(c=u(l,y,x,v,w,n),a&&l.push(tt(b,M,c)),s&&(l.start=f+h*c)):P>r?_<r&&(c=u(l,y,x,v,w,r),a&&l.push(tt(b,M,c)),s&&(l.start=f+h*c)):(W(l,y,x,m),a&&l.push(b)),_<n&&P>=n&&(c=u(l,y,x,v,w,n),a&&l.push(tt(b,M,c)),A=!0),_>r&&P<=r&&(c=u(l,y,x,v,w,r),a&&l.push(tt(b,M,c)),A=!0),!o&&A&&(s&&(l.end=f+h*c),e.push(l),l=J(t)),s&&(f+=h)}let g=t.length-p;if(!o){const e=t[g],o=t[g+1],s=t[g+2],u=0===i?e:o;if(u>=n&&u<=r&&W(l,e,o,s),u>=n&&u<=r&&a){const e=t[g+3];l.push(e)}}g=l.length-p,o&&g>=p&&(l[g]!==l[0]||l[g+1]!==l[1])&&(W(l,l[0],l[1],l[2]),a&&l.push(l[3])),l.length&&e.push(l)}function J(t){const e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function H(t,e,n,r,i,o,s){for(const a of t)R(a,e,n,r,i,o,!1,s)}function W(t,e,n,r){t.push(e,n,r)}function K(t,e,n,r,i,o){const s=(o-e)/(r-e);return W(t,o,n+(i-n)*s,1),s}function Q(t,e,n,r,i,o){const s=(o-n)/(i-n);return W(t,e+(r-e)*s,o,1),s}function tt(t,e,n){return t+(e-t)*n}function et(t,e,n){const r=[];for(let i=0;i<t.length;i++){const o=t[i],s=o.type;let a;if("Point"===s||"MultiPoint"===s||"LineString"===s)a=nt(o.geometry,e,n);else if("MultiLineString"===s||"Polygon"===s){a=[];for(const t of o.geometry)a.push(nt(t,e,n))}else if("MultiPolygon"===s){a=[];for(const t of o.geometry){const r=[];for(const i of t)r.push(nt(i,e,n));a.push(r)}}r.push(X(o.id,s,a,o.tags,o.layer,n))}return r}function nt(t,e,n){const r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);const i=n?4:3;for(let o=0;o<t.length;o+=i)r.push(t[o]+e,t[o+1],t[o+2]),n&&r.push(t[o+3]);return r}function rt(t,e,n){if(t.transformed)return t;const r=1<<t.z,i=t.x,o=t.y,s=n?3:2;for(const a of t.features){const t=a.geometry,l=a.type;if(a.geometry=[],1===l)for(let l=0;l<t.length;l+=s)a.geometry.push(it(t[l],t[l+1],e,r,i,o)),n&&a.geometry[a.geometry.length-1].push(t[l+2]);else for(let l=0;l<t.length;l++){const u=[];for(let a=0;a<t[l].length;a+=s)u.push(it(t[l][a],t[l][a+1],e,r,i,o)),n&&u[u.length-1].push(t[l][a+2]);a.geometry.push(u)}}return t.transformed=!0,t}function it(t,e,n,r,i,o){return[Math.round(n*(t*r-i)),Math.round(n*(e*r-o))]}function ot(t,e,n,r,i){const o=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:t.length,source:null,x:n,y:r,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const e of t)st(s,e,o,i);return s}function st(t,e,n,r){const i=e.geometry,o=e.type,s=[],a=r.hasAltitude?4:3;if(t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),"Point"===o||"MultiPoint"===o)for(let e=0;e<i.length;e+=a)s.push(i[e],i[e+1]),r.hasAltitude&&s.push(i[e+3]),t.numPoints++,t.numSimplified++;else if("LineString"===o)lt(s,i,t,n,!1,!1,r);else if("MultiLineString"===o||"Polygon"===o)for(let e=0;e<i.length;e++)lt(s,i[e],t,n,"Polygon"===o,0===e,r);else if("MultiPolygon"===o)for(let e=0;e<i.length;e++){const o=i[e];for(let e=0;e<o.length;e++)lt(s,o[e],t,n,!0,0===e,r)}if(s.length){let n=e.tags||null;if("LineString"===o&&r.lineMetrics){n={};for(const t in e.tags)n[t]=e.tags[t];n.mapbox_clip_start=i.start/i.size,n.mapbox_clip_end=i.end/i.size}const a={geometry:s,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:n};e.layer&&(a.layer=e.layer),null!==e.id&&(a.id=e.id),t.features.push(a)}}function at(t,e,n){return 0===t[e+2]&&t[e+3]>0&&n}function lt(t,e,n,r,i,o,s){const a=r*r,{hasAltitude:l,disableFilter:u}=s,h=l?4:3;if(!u&&r>0&&e.size<(i?a:r))return void(n.numPoints+=e.length/h);const c=[];for(let t=0;t<e.length;t+=h)(0===r||e[t+2]>a||at(e,t,l))&&(n.numSimplified++,c.push(e[t],e[t+1]),l&&c.push(e[t+3])),n.numPoints++;i&&function(t,e,n){const r=n?3:2;let i=0;for(let e=0,n=t.length,o=n-r;e<n;o=e,e+=r)i+=(t[e]-t[o])*(t[e+1]+t[o+1]);if(i>0===e){const e=r,i=r-1,o=r-2;for(let s=0,a=t.length;s<a/2;s+=r){const r=t[s],l=t[s+1];let u;n&&(u=t[s+2]),t[s]=t[a-e-s],t[s+1]=t[a-i-s],n&&(t[s+2]=t[a-o-s]),t[a-e-s]=r,t[a-i-s]=l,n&&(t[a-o-s]=u)}}}(c,o,l),t.push(c)}O.getJSON=function(t,e,n){if(T(e)){const t=n;n=e,e=t}const r=function(t,e){const r="string"==typeof e?JSON.parse(e):e||null;n(t,r)};return e&&e.jsonp?O.jsonp(t,r):((e=e||{}).returnJSON=!0,O.get(t,e,r))};const ut={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,hasAltitude:!1,disableFilter:!1,debug:0};class ht{constructor(t,e){const n=(e=this.options=function(t,e){for(const n in e)t[n]=e[n];return t}(Object.create(ut),e)).debug;if(n&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");let r=function(t,e){const n=[];if(Array.isArray(t)){for(let r=0;r<t.length;r++)E(n,t[r].layer,t[r].data,e);return n}if("FeatureCollection"===t.type)for(let r=0;r<t.features.length;r++)z(n,t.features[r],e,r);else"Feature"===t.type?z(n,t,e):z(n,{geometry:t},e);return n}(t,e);this.tiles={},this.tileCoords=[],n&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),r=function(t,e){const n=e.buffer/e.extent;let r=t;const i=Z(t,1,-1-n,n,0,-1,2,e),o=Z(t,1,1-n,2+n,0,-1,2,e);return(i||o)&&(r=Z(t,1,-n,1+n,0,-1,2,e)||[],i&&(r=et(i,1,e.hasAltitude).concat(r)),o&&(r=r.concat(et(o,-1,e.hasAltitude)))),r}(r,e),r.length&&this.splitTile(r,0,0,0),n&&(r.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(t,e,n,r,i,o,s){const a=[t,e,n,r],l=this.options,u=l.debug;for(;a.length;){r=a.pop(),n=a.pop(),e=a.pop(),t=a.pop();const h=1<<e,c=ct(e,n,r);let f=this.tiles[c];if(!f&&(u>1&&console.time("creation"),f=this.tiles[c]=ot(t,e,n,r,l),this.tileCoords.push({z:e,x:n,y:r}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,n,r,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));const t=\`z${G}e}\`;this.stats[t]=(this.stats[t]||0)+1,this.total++}if(f.source=t,null==i){if(e===l.indexMaxZoom||f.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===i)continue;if(null!=i){const t=i-e;if(n!==o>>t||r!==s>>t)continue}}if(f.source=null,0===t.length)continue;u>1&&console.time("clipping");const p=.5*l.buffer/l.extent,d=.5-p,g=.5+p,y=1+p;let x=null,m=null,v=null,w=null,b=Z(t,h,n-p,n+g,0,f.minX,f.maxX,l),M=Z(t,h,n+d,n+y,0,f.minX,f.maxX,l);t=null,b&&(x=Z(b,h,r-p,r+g,1,f.minY,f.maxY,l),m=Z(b,h,r+d,r+y,1,f.minY,f.maxY,l),b=null),M&&(v=Z(M,h,r-p,r+g,1,f.minY,f.maxY,l),w=Z(M,h,r+d,r+y,1,f.minY,f.maxY,l),M=null),u>1&&console.timeEnd("clipping"),a.push(x||[],e+1,2*n,2*r),a.push(m||[],e+1,2*n,2*r+1),a.push(v||[],e+1,2*n+1,2*r),a.push(w||[],e+1,2*n+1,2*r+1)}}getTile(t,e,n){t=+t,e=+e,n=+n;const r=this.options,{extent:i,debug:o}=r,{hasAltitude:s,wrapX:a}=r;if(t<0||t>24)return null;if(a){const n=1<<t;e=e+n&n-1}const l=ct(t,e,n);if(this.tiles[l])return rt(this.tiles[l],i,s);o>1&&console.log("drilling down to z%d-%d-%d",t,e,n);let u,h=t,c=e,f=n;for(;!u&&h>0;)h--,c>>=1,f>>=1,u=this.tiles[ct(h,c,f)];return u&&u.source?(o>1&&(console.log("found parent tile z%d-%d-%d",h,c,f),console.time("drilling down")),this.splitTile(u.source,h,c,f,t,e,n),o>1&&console.timeEnd("drilling down"),this.tiles[l]?rt(this.tiles[l],i,s):null):null}}function ct(t,e,n){return 32*((1<<t)*n+e)+t}function ft(t,e,n,r,i,o,s){const a=n&&Array.isArray(n[0]);for(let l=0,u=n.length;l<u;l++){t[e]=(a?n[l][0]:n[l].x)*r,t[e+1]=(a?n[l][1]:n[l].y)*r,s!==Float32Array&&(t[e]=Math.round(t[e]),t[e+1]=Math.round(t[e+1]));let h=i||0;Array.isArray(i)&&(h=i[l]),h=h?Math.round(r*h):0,t[e+2]=h,e+=3,o&&0!==l&&l!==u-1&&(t[e]=t[e-3],t[e+1]=t[e-2],t[e+2]=t[e-1],e+=3)}return t.trySetLength&&t.trySetLength(e),e}function pt(t,e,n,r){const i=t[3*e],o=t[3*e+1],s=t[3*n],a=t[3*n+1];return i===s&&(i<0||i>r)||o===a&&(o<0||o>r)}var dt="undefined"!=typeof Float32Array?Float32Array:Array;function gt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function yt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function xt(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function mt(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t}function vt(t,e,n){return t[0]=e,t[1]=n,t}function wt(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),function(){var t,e=(t=new dt(3),dt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t)}(),function(){var t,e=(t=new dt(4),dt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}(),function(){var t,e=(t=new dt(2),dt!=Float32Array&&(t[0]=0,t[1]=0),t)}();const bt=Math.PI/180,Mt=6378137*Math.PI/180,Pt=85.0511287798;function _t(t,e,n){if("EPSG:3857"===n)return function(t,e){const n=Pt,r=e[0],i=Math.max(Math.min(n,e[1]),-n);let o;o=0===i?0:Math.log(Math.tan((90+i)*bt/2))/bt;return t[0]=r*Mt,t[1]=o*Mt,t}(t,e);if("EPSG:4326"===n||"EPSG:4490"===n||"identity"===n)return At(t,e);if("baidu"===n)return At(t,e);throw new Error("unsupported projection:"+n)}function At(t,e){return t[0]=e[0],t[1]=e[1],t}function It(t,e,n,r,i,o,s,a,l,u,h,c,f,p,d){0===t?function(t,e,n,r,i,o,s,a,l,u){const h=1/(100*o[0]),c=1/(100*o[1]),f=u&&u[0]||0,p=u&&u[1]||0,d=[0,0];for(let i=t;i<e;i+=3){const t=i/3*2,e=r[i]-f,o=r[i+1]-p;n[t]=d[0]+e/s*h/a,n[t+1]=d[1]-o/s*c/l}}(e,n,r,i,0,s,a,l,u,d):1===t&&function(t,e,n,r,i,o,s,a,l,u,h){if(!t)return;let c,f,p,d;0===t[4]?(c=t[0],f=t[1],p=t[2],d=t[3]):(c=t[1],f=t[2],p=t[3],d=t[0]);const g=wt(c,f),y=wt(f,p),x=[],m=[],v=[];for(let t=e;t<n;t+=3){const e=t/3*2;vt(x,(o.x/l+i[t]/s)*a,o.y/l*a+(h?i[t+1]:-i[t+1])/s*a),"EPSG:4326"!==u&&"EPSG:4490"!==u||_t(x,x,"EPSG:3857"),St(m,x,c,f),St(v,x,d,c),r[e]=wt(c,m)/g,r[e+1]=wt(c,v)/y}}(h,e,n,r,i,o,a,c,f,p,!!d)}function St(t,e,n,r){const i=n[0]-r[0],o=n[1]-r[1];let s=(e[0]-n[0])*(n[0]-r[0])+(e[1]-n[1])*(n[1]-r[1]);return s/=i*i+o*o,t[0]=n[0]+s*i,t[1]=n[1]+s*o,t}function Tt(t,e,n,r,i){const o=3*e[n-1],s=3*e[n-1]+1,a=t[o],l=t[s];return u=r,h=i,c=a,f=l,Math.sqrt((c-u)*(c-u)+(f-h)*(f-h));var u,h,c,f}function Ft(t,e,n=2){const r=e&&e.length,i=r?e[0]*n:t.length;let o=kt(t,0,i,n,!0);const s=[];if(!o||o.next===o.prev)return s;let a,l,u;if(r&&(o=function(t,e,n,r){const i=[];for(let n=0,o=e.length;n<o;n++){const s=kt(t,e[n]*r,n<o-1?e[n+1]*r:t.length,r,!1);s===s.next&&(s.steiner=!0),i.push(Dt(s))}i.sort(Xt);for(let t=0;t<i.length;t++)n=Nt(i[t],n);return n}(t,e,o,n)),t.length>80*n){a=1/0,l=1/0;let e=-1/0,r=-1/0;for(let o=n;o<i;o+=n){const n=t[o],i=t[o+1];n<a&&(a=n),i<l&&(l=i),n>e&&(e=n),i>r&&(r=i)}u=Math.max(e-a,r-l),u=0!==u?32767/u:0}return Bt(o,s,n,a,l,u,0),s}function kt(t,e,n,r,i){let o;if(i===function(t,e,n,r){let i=0;for(let o=e,s=n-r;o<n;o+=r)i+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return i}(t,e,n,r)>0)for(let i=e;i<n;i+=r)o=Kt(i/r|0,t[i],t[i+1],o);else for(let i=n-r;i>=e;i-=r)o=Kt(i/r|0,t[i],t[i+1],o);return o&&Zt(o,o.next)&&(Qt(o),o=o.next),o}function Lt(t,e){if(!t)return t;e||(e=t);let n,r=t;do{if(n=!1,r.steiner||!Zt(r,r.next)&&0!==jt(r.prev,r,r.next))r=r.next;else{if(Qt(r),r=e=r.prev,r===r.next)break;n=!0}}while(n||r!==e);return e}function Bt(t,e,n,r,i,o,s){if(!t)return;!s&&o&&function(t,e,n,r){let i=t;do{0===i.z&&(i.z=zt(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){let e,n=1;do{let r,i=t;t=null;let o=null;for(e=0;i;){e++;let s=i,a=0;for(let t=0;t<n&&(a++,s=s.nextZ,s);t++);let l=n;for(;a>0||l>0&&s;)0!==a&&(0===l||!s||i.z<=s.z)?(r=i,i=i.nextZ,a--):(r=s,s=s.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;i=s}o.nextZ=null,n*=2}while(e>1)}(i)}(t,r,i,o);let a=t;for(;t.prev!==t.next;){const l=t.prev,u=t.next;if(o?Ot(t,r,i,o):Ct(t))e.push(l.i,t.i,u.i),Qt(t),t=u.next,a=u.next;else if((t=u)===a){s?1===s?Bt(t=Yt(Lt(t),e),e,n,r,i,o,2):2===s&&Vt(t,e,n,r,i,o):Bt(Lt(t),e,n,r,i,o,1);break}}}function Ct(t){const e=t.prev,n=t,r=t.next;if(jt(e,n,r)>=0)return!1;const i=e.x,o=n.x,s=r.x,a=e.y,l=n.y,u=r.y,h=Math.min(i,o,s),c=Math.min(a,l,u),f=Math.max(i,o,s),p=Math.max(a,l,u);let d=r.next;for(;d!==e;){if(d.x>=h&&d.x<=f&&d.y>=c&&d.y<=p&&qt(i,a,o,l,s,u,d.x,d.y)&&jt(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function Ot(t,e,n,r){const i=t.prev,o=t,s=t.next;if(jt(i,o,s)>=0)return!1;const a=i.x,l=o.x,u=s.x,h=i.y,c=o.y,f=s.y,p=Math.min(a,l,u),d=Math.min(h,c,f),g=Math.max(a,l,u),y=Math.max(h,c,f),x=zt(p,d,e,n,r),m=zt(g,y,e,n,r);let v=t.prevZ,w=t.nextZ;for(;v&&v.z>=x&&w&&w.z<=m;){if(v.x>=p&&v.x<=g&&v.y>=d&&v.y<=y&&v!==i&&v!==s&&qt(a,h,l,c,u,f,v.x,v.y)&&jt(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,w.x>=p&&w.x<=g&&w.y>=d&&w.y<=y&&w!==i&&w!==s&&qt(a,h,l,c,u,f,w.x,w.y)&&jt(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;v&&v.z>=x;){if(v.x>=p&&v.x<=g&&v.y>=d&&v.y<=y&&v!==i&&v!==s&&qt(a,h,l,c,u,f,v.x,v.y)&&jt(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;w&&w.z<=m;){if(w.x>=p&&w.x<=g&&w.y>=d&&w.y<=y&&w!==i&&w!==s&&qt(a,h,l,c,u,f,w.x,w.y)&&jt(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function Yt(t,e){let n=t;do{const r=n.prev,i=n.next.next;!Zt(r,i)&&Ut(r,n,n.next,i)&&Ht(r,i)&&Ht(i,r)&&(e.push(r.i,n.i,i.i),Qt(n),Qt(n.next),n=t=i),n=n.next}while(n!==t);return Lt(n)}function Vt(t,e,n,r,i,o){let s=t;do{let t=s.next.next;for(;t!==s.prev;){if(s.i!==t.i&&Gt(s,t)){let a=Wt(s,t);return s=Lt(s,s.next),a=Lt(a,a.next),Bt(s,e,n,r,i,o,0),void Bt(a,e,n,r,i,o,0)}t=t.next}s=s.next}while(s!==t)}function Xt(t,e){let n=t.x-e.x;if(0===n&&(n=t.y-e.y,0===n)){n=(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)}return n}function Nt(t,e){const n=function(t,e){let n=e;const r=t.x,i=t.y;let o,s=-1/0;if(Zt(t,n))return n;do{if(Zt(t,n.next))return n.next;if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){const t=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=r&&t>s&&(s=t,o=n.x<n.next.x?n:n.next,t===r))return o}n=n.next}while(n!==e);if(!o)return null;const a=o,l=o.x,u=o.y;let h=1/0;n=o;do{if(r>=n.x&&n.x>=l&&r!==n.x&&$t(i<u?r:s,i,l,u,i<u?s:r,i,n.x,n.y)){const e=Math.abs(i-n.y)/(r-n.x);Ht(n,t)&&(e<h||e===h&&(n.x>o.x||n.x===o.x&&Et(o,n)))&&(o=n,h=e)}n=n.next}while(n!==a);return o}(t,e);if(!n)return e;const r=Wt(n,t);return Lt(r,r.next),Lt(n,n.next)}function Et(t,e){return jt(t.prev,t,e.prev)<0&&jt(e.next,t,t.next)<0}function zt(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Dt(t){let e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function $t(t,e,n,r,i,o,s,a){return(i-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(r-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(i-s)*(r-a)}function qt(t,e,n,r,i,o,s,a){return!(t===s&&e===a)&&$t(t,e,n,r,i,o,s,a)}function Gt(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Ut(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Ht(t,e)&&Ht(e,t)&&function(t,e){let n=t,r=!1;const i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(jt(t.prev,t,e.prev)||jt(t,e.prev,e))||Zt(t,e)&&jt(t.prev,t,t.next)>0&&jt(e.prev,e,e.next)>0)}function jt(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Zt(t,e){return t.x===e.x&&t.y===e.y}function Ut(t,e,n,r){const i=Jt(jt(t,e,n)),o=Jt(jt(t,e,r)),s=Jt(jt(n,r,t)),a=Jt(jt(n,r,e));return i!==o&&s!==a||(!(0!==i||!Rt(t,n,e))||(!(0!==o||!Rt(t,r,e))||(!(0!==s||!Rt(n,t,r))||!(0!==a||!Rt(n,e,r)))))}function Rt(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Jt(t){return t>0?1:t<0?-1:0}function Ht(t,e){return jt(t.prev,t,t.next)<0?jt(t,e,t.next)>=0&&jt(t,t.prev,e)>=0:jt(t,e,t.prev)<0||jt(t,t.next,e)<0}function Wt(t,e){const n=te(t.i,t.x,t.y),r=te(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Kt(t,e,n,r){const i=te(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Qt(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function te(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}const ee="__fea_idx";new Float32Array([-1e12])[0];const ne="maptalks_ombb";function re(){return function(){if("undefined"!=typeof undefinedThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof undefined)return global;throw new Error("unable to locate global object")}().maptalks_vt_packers}const{PackUtil:ie,ArrayPool:oe}=re();function se(t,e,n,r,i,o,s,a,l,u,h,c,f,p,d,g,y){const x=e.getLength(),m=i/3;for(let n=2,r=x;n<r;n+=3)t[i+n-2]=e[n-2],t[i+n-1]=e[n-1],t[i+n-0]=e[n]-s;i+=x;for(let n=2,r=x;n<r;n+=3)t[i+n-2]=e[n-2],t[i+n-1]=e[n-1],t[i+n-0]=e[n]-a;i+=x,t.trySetLength(i+x),t.copyWithin(i,i-2*x,i-x),i+=x,t.trySetLength(i+x),t.copyWithin(i,i-2*x,i-x),i+=x,(n=n||[]).push(x/3);const v=n.getLength();for(let e=0;e<v;e++){ae(m+(n[e-1]||0),m+n[e],t,x/3,l,r,u,h,c,f,o,p,d,g,y)}return i}function ae(t,e,n,r,i,o,s,a,l,u,h,c,f,p,d){const g=o.getLength();let y,x;for(let s=t,a=e;s<a-1;s++)if(y=s,x=s+1,i===1/0||!pt(n,y,x,i))if((s-t)%2==1&&(y+=2*r,x+=2*r),d){let t=o.currentIndex;o[t++]=y+r,o[t++]=x,o[t++]=y,o[t++]=x+r,o[t++]=x,o[t++]=y+r,o.currentIndex=t}else{let t=o.currentIndex;o[t++]=y+r,o[t++]=y,o[t++]=x,o[t++]=x,o[t++]=x+r,o[t++]=y+r,o.currentIndex=t}s&&function(t,e,n,r,i,o,s,a,l,u,h,c){let f,p=0,d=0,g=0,y=0;const x=c?[1,3,4]:[2,3,4];for(let c=o.getLength()-1;c>=s;c--){const s=o[c],m=3*s+1,v=3*s+2,w=i[3*s],b=i[m],M=i[v];p||d||(p=Math.max(i[v],i[3*o[c-3]+2]),d=Math.min(i[v],i[3*o[c-3]+2]),f=p-d);let P=g;const _=c%6;0===t?(5===_&&(y=Tt(i,o,c,w,b)),P=_===x[0]||_===x[1]||_===x[2]?g:g+y):1===t&&(_===x[0]||_===x[1]||_===x[2]?P=0:5===_?(y=Tt(i,o,c,w,b),P=y):P=y);const A=P/u*(1/(100*h))/a;let I;I=1===e?M===p?1:0:"bottom"===n?M===p?f/100/l:0:M===p?0:-f/100/l,r[2*s]=A,r[2*s+1]=I,0===_&&(g+=y)}}(a,l,u,h,n,o,g,c[0],c[1],f,p,d)}function le(t){const e=[t[0]];let n=t[0];for(let r=1;r<t.length;r++)Array.isArray(t[r])?t[r][0]===n[0]&&t[r][1]===n[1]&&t[r][2]===n[2]||e.push(t[r]):t[r].x===n.x&&t[r].y===n.y&&t[r].z===n.z||e.push(t[r]),n=t[r];return e}var ue="undefined"!=typeof Float32Array?Float32Array:Array;function he(){var t=new ue(3);return ue!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function ce(t,e,n){var r=new ue(3);return r[0]=t,r[1]=e,r[2]=n,r}function fe(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function pe(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function de(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function ge(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t}function ye(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function xe(t,e,n){var r=e[0],i=e[1],o=e[2],s=n[0],a=n[1],l=n[2];return t[0]=i*l-o*a,t[1]=o*s-r*l,t[2]=r*a-i*s,t}var me=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t};function ve(){var t=new ue(4);return ue!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function we(t,e){var n=e[0]+e[4]+e[8],r=void 0;if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,s=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*s+s]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*o+s]-e[3*s+o])*r,t[o]=(e[3*o+i]+e[3*i+o])*r,t[s]=(e[3*s+i]+e[3*i+s])*r}return t}!function(){var t=he()}(),function(){var t,e=(t=new ue(4),ue!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();var be,Me=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},Pe=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],s=n*n+r*r+i*i+o*o;return s>0&&(s=1/Math.sqrt(s),t[0]=n*s,t[1]=r*s,t[2]=i*s,t[3]=o*s),t};he(),ce(1,0,0),ce(0,1,0),ve(),ve(),be=new ue(9),ue!=Float32Array&&(be[1]=0,be[2]=0,be[3]=0,be[5]=0,be[6]=0,be[7]=0),be[0]=1,be[4]=1,be[8]=1;\n/*!\n * Contains code from google filament\n * https://github.com/google/filament/\n * License Apache-2.0\n */\nconst _e=8,Ae=[],Ie=[],Se=[],Te=[];function Fe(t,e,n){const r=xe(Ie,e,n),i=function(t,e,n,r,i,o,s,a,l,u){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t[6]=a,t[7]=l,t[8]=u,t}(Ae,n[0],n[1],n[2],...r,...e);t=we(t,i),t=function(t){return t[3]<0?Me(t,t,-1):t}(t=Pe(t,t));const o=1/((1<<2*_e-1)-1);if(t[3]<o){t[3]=o;const e=Math.sqrt(1-o*o);t[0]*=e,t[1]*=e,t[2]*=e}const s=n[3]>0?xe(Se,n,e):xe(Se,e,n);return ye(xe(Te,n,e),s)<0&&Me(t,t,-1),t}const ke=[];const Le=[],Be=[],Ce=[],Oe=[],Ye=[],Ve=[],Xe=[];function Ne(t,e,n,r,i,o){pe(Oe,t[3*e],t[3*e+1],t[3*e+2]),pe(Ye,t[3*n],t[3*n+1],t[3*n+2]),pe(Ve,t[3*r],t[3*r+1],t[3*r+2]);const s=me(Le,Ve,Ye),a=me(Be,Oe,Ye),l=xe(Ce,s,a);ge(Xe,l),i[3*e]=i[3*e]||0,i[3*n]=i[3*n]||0,i[3*r]=i[3*r]||0,i[3*e+1]=i[3*e+1]||0,i[3*n+1]=i[3*n+1]||0,i[3*r+1]=i[3*r+1]||0,i[3*e+2]=i[3*e+2]||0,i[3*n+2]=i[3*n+2]||0,i[3*r+2]=i[3*r+2]||0,i[3*e]+=Xe[0],i[3*n]+=Xe[0],i[3*r]+=Xe[0],i[3*e+1]+=Xe[1],i[3*n+1]+=Xe[1],i[3*r+1]+=Xe[1],i[3*e+2]+=Xe[2],i[3*n+2]+=Xe[2],i[3*r+2]+=Xe[2],o[e]+=1,o[n]+=1,o[r]+=1}\n/*!\n * Contains code from THREE.JS\n * https://github.com/mrdoob/three.js/\n * License MIT\n * \n * Generate tangents per vertex.\n */function Ee(t,e,n){return t[0]=e[n],t[1]=e[n+1],t[2]=e[n+2],t}function ze(t,e,n){return t[0]=e[n],t[1]=e[n+1],t}const{StyleUtil:De,PackUtil:$e,ArrayPool:qe}=re(),Ge=qe.getInstance();function je(t,e,n,r,i,o,s,a,l,u,h,c,f,p,d,g){void 0===e.top&&(e.top=!0),void 0===e.side&&(e.side=!0),Ge.reset();const{altitudeScale:y,altitudeProperty:x,defaultAltitude:m,heightProperty:v,minHeightProperty:P,defaultHeight:_,tangent:A,uv:I,topUVMode:T,sideUVMode:F,sideVerticalUVMode:k,top:B,side:C,textureYOrigin:O,topThickness:Y}=e,V=function(t,e,{altitudeScale:n,altitudeProperty:r,defaultAltitude:i,heightProperty:o,minHeightProperty:s,defaultHeight:a},{center:l,side:u,top:h,topThickness:c,uvOrigin:f,uv:p,uvSize:d,topUVMode:g,sideUVMode:y,sideVerticalUVMode:x,textureYOrigin:m,tileRatio:v,centimeterToPoint:w,verticalCentimeterToPoint:b,positionType:M,res:P,glScale:_,projectionCode:A},I,T){let F=e/t[0].extent;e===1/0&&(F=1);const k=e===1/0,L=T.get(),B=T.get(),C=T.get(),O=T.getProxy(),Y=T.get(),V=T.get(),X=T.get(),N=!!p,E=!!h,z=!!u,D=N?T.get():null;function $(t,n,r,i,o,s){let a=n;if(E){const u=Ft(O,r,3);if(0===u.length)return n;let h=O.getLength(),p=Y.currentIndex;for(let t=0;t<h;t++)Y[p++]=O[t];if(Y.currentIndex=p,n+=O.getLength(),s)for(let e=2,n=u.length;e<n;e+=3)u[e]+=t/3,u[e-1]+=t/3,u[e-2]+=t/3;else{let e;for(let n=2,r=u.length;n<r;n+=3)e=u[n-1],u[n-1]=u[n]+t/3,u[n]=e+t/3,u[n-2]+=t/3}h=u.length,p=V.currentIndex;for(let t=0;t<h;t++)V[p++]=u[t];V.currentIndex=p,N&&It(g||0,t,n,D,Y,f,w,v,d[0],d[1],o,P,_,A,l),c>0&&!z&&(n=se(Y,O,r,V,n,D,0,c,e,N,y||0,x||0,m,d,v,b,i<0?!s:s)),X.setLength(n/3),X.fill(1,a/3,n/3)}if(z){E&&(c=0),a=n,n=se(Y,O,r,V,n,D,c,i,e,N,y||0,x||0,m,d,v,b,i<0?!s:s),X.setLength(n/3);const t=O.getLength()/3;X.fill(1,a/3,a/3+t),X.fill(0,a/3+t,a/3+2*t),X.fill(1,a/3+2*t,a/3+3*t),X.fill(0,a/3+3*t,n/3)}return n}let q=-1/0,G=1/0,j=0;const Z=[-1,-1,e+1,e+1];let U=0,R=t.length;S(I)&&(U=I,R=I+1);let J=0,H=!1;const W=T.getProxy();let K,Q=!1;for(;U<R;U++){const l=t[U],u=l.id;S(u)&&(Math.abs(u)>J&&(J=Math.abs(u)),u<0&&(H=!0));const h=l.geometry,c=l.properties[ne];let f=Array.isArray(c&&c[0]&&c[0][0])?c[0]:c;const{altitude:p,height:d}=ie.getFeaAltitudeAndHeight(l,n,r,i,o,a,s);d<0?(Q=!0,G=Math.min(p,G),q=Math.max(p-d,q)):(q=Math.max(p,q),G=Math.min(p-d,G));const g=Y.getLength();let y=0,x=j;W.setLength(0),O.setLength(0);const m=ie.calculateSignedArea(h[0])<0;for(let t=0,n=h.length;t<n;t++){let r=h[t];m&&(r=r.reverse()),r=le(r);const i=ie.calculateSignedArea(r)<0;if(!i&&t>0&&(y++,f=c&&c[y],j=$(x,j,W,d*F,f,k),O.setLength(0),W.setLength(0),x=j),e!==1/0&&(r=ie.clipPolygon(r,Z)),!r.length){t===n-1&&(j=$(x,j,W,d*F,f,k));continue}const o=r.length;if(Array.isArray(r[0])?r[0][0]===r[o-1][0]&&r[0][1]===r[o-1][1]||r.push([r[0][0],r[0][1]]):r[0].x===r[o-1].x&&r[0].y===r[o-1].y||r.push(r[0]),i){let t=W.currentIndex;W[t++]=O.getLength()/3,W.currentIndex=t}ft(O,O.getLength(),r,F,p,!1,M),t===n-1&&(j=$(x,j,W,d*F,f,k))}const v=Y.getLength()-g,w=(ee+"").trim();for(let t=0;t<v/3;t++){let t=B.currentIndex;B[t++]=void 0===l[w]?U:l[w],B.currentIndex=t,t=L.currentIndex,L[t++]=U,L.currentIndex=t,S(u)&&(t=C.currentIndex,C[t++]=u,C.currentIndex=t)}}K=l?Float32Array:ie.getUnsignedArrayType(B.getLength()?B[B.getLength()-1]:0);const tt={hasNegativeHeight:Q,maxAltitude:q===-1/0?0:q,minAltitude:G===1/0?0:G,vertices:Y,verticeTypes:X,indices:V,pickingIds:oe.createTypedArray(B,K),featureIndexes:L};if(C.getLength()){const t=H?ie.getPosArrayType(J):ie.getUnsignedArrayType(J);tt.featureIds=oe.createTypedArray(C,t)}else tt.featureIds=[];return D&&(D.setLength(Y.getLength()/3*2),tt.uvs=D),tt}(t,n,{altitudeScale:y,altitudeProperty:x,defaultAltitude:m||0,heightProperty:v,minHeightProperty:P,defaultHeight:_||0},{center:g,top:B,side:C,topThickness:10*Y||0,uv:I||A,uvSize:[i,i],uvOrigin:r,topUVMode:T,sideUVMode:F,sideVerticalUVMode:k,textureYOrigin:O,tileRatio:a,centimeterToPoint:l,verticalCentimeterToPoint:u,positionType:d,res:o,glScale:s,projectionCode:f},p,Ge),X=[],N=V.vertices.getLength()/3,E=$e.getIndexArrayType(N),z=qe.createTypedArray(V.indices,E);delete V.indices,X.push(z.buffer,V.pickingIds.buffer);const D=Math.max(Math.abs(V.maxAltitude),Math.abs(V.minAltitude)),$=$e.getPosArrayType(Math.max(512,D));V.vertices=qe.createTypedArray(V.vertices,$);const q=A?Ge.getProxy():new Float32Array(3*N);q.setLength&&q.setLength(3*N);const G=function(t,e,n){const r=n||[];r.setLength&&r.setLength(t.length);const i=ke;i.length<t.length/3&&(i.length=t.length/3),i.fill(0,0,t.length/3);const o=void 0===e.length?e:e.length;for(let n=0;n<o/3;n++)void 0===e.length?Ne(t,3*n,3*n+1,3*n+2,r,i):Ne(t,e[3*n],e[3*n+1],e[3*n+2],r,i);for(let t=0;t<r.length;t+=3){const e=i[t/3];0!==e?(r[t]/=e,r[t+1]/=e,r[t+2]/=e):(r[t]=0,r[t+1]=0,r[t+2]=0)}return r}(V.vertices,z,q);let j=!0;const Z=G.getLength?G.getLength():G.length;for(let t=0;t<Z;t++){G[t]=-G[t];const e=G[t]%1;1-Math.abs(e)>1e-6?j=!1:0!==e&&(G[t]=Math.round(G[t]))}if(V.normals=G,A){let t=Ge.get();t.setLength(4*N),t=function(t,e,n,r,i){const o=t.length/3,s=i||new Array(4*o),a=[],l=[];for(let t=0;t<o;t++)a[t]=[0,0,0],l[t]=[0,0,0];const u=[0,0,0],h=[0,0,0],c=[0,0,0],f=[0,0],p=[0,0],d=[0,0],g=[0,0,0],y=[0,0,0];function x(e,r,i){Ee(u,t,3*e),Ee(h,t,3*r),Ee(c,t,3*i),ze(f,n,2*e),ze(p,n,2*r),ze(d,n,2*i);const o=h[0]-u[0],s=c[0]-u[0],x=h[1]-u[1],m=c[1]-u[1],v=h[2]-u[2],w=c[2]-u[2],b=p[0]-f[0],M=d[0]-f[0],P=p[1]-f[1],_=d[1]-f[1],A=1/(b*_-M*P);pe(g,(_*o-P*s)*A,(_*x-P*m)*A,(_*v-P*w)*A),pe(y,(b*s-M*o)*A,(b*m-M*x)*A,(b*w-M*v)*A),de(a[e],a[e],g),de(a[r],a[r],g),de(a[i],a[i],g),de(l[e],l[e],y),de(l[r],l[r],y),de(l[i],l[i],y)}for(let t=0,e=r.length;t<e;t+=3)x(r[t+0],r[t+1],r[t+2]);const m=[],v=[],w=[],b=[];let M,P,_;function A(t){Ee(w,e,3*t),fe(b,w),P=a[t],fe(m,P),me(m,m,function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}(w,w,ye(w,P))),ge(m,m),xe(v,b,P),_=ye(v,l[t]),M=_<0?-1:1,s[4*t]=m[0],s[4*t+1]=m[1],s[4*t+2]=m[2],s[4*t+3]=M}for(let t=0,e=r.length;t<e;t+=3)A(r[t+0]),A(r[t+1]),A(r[t+2]);return s}(V.vertices,V.normals,V.uvs,z,t),t=function(t,e){const n=e.getLength(),r=new Float32Array(n),i=[],o=[],s=[];for(let a=0;a<n;a+=4){const n=a/4*3;gt(o,t[n]||0,t[n+1]||0,t[n+2]||0),xt(i,e[a]||0,e[a+1]||0,e[a+2]||0,e[a+3]||0),Fe(s,o,i),yt(r.subarray(a,a+4),s)}return r}(V.normals,t),V.tangents=t,X.push(t.buffer),delete V.normals}if(V.normals&&(j&&(V.normals=qe.createTypedArray(V.normals,Int8Array)),X.push(V.normals.buffer)),V.uvs){const t=V.uvs;V.uvs=qe.createTypedArray(t,Float32Array),X.push(V.uvs.buffer)}const U=function(t,e,n,r){const i={},o={},s=r.getLength();if(L(e.polygonFill)){let a=b(e.polygonFill);const l=new Uint8Array(4*s);l.fill(255);for(let e=0;e<s;e++){const o=t[r[e]],s=o.properties||{};s.$layer=o.layer,s.$type=o.type;let u=a(n,s);w(u)&&(i.aColor=1,a=b(u),u=a(n,s)),delete s.$layer,delete s.$type,De.normalizeColor(Ze,u),l[4*e]=Ze[0],l[4*e+1]=Ze[1],l[4*e+2]=Ze[2],l[4*e+3]=Ze[3]}o.aColor=l}if(L(e.polygonOpacity)){let a=M(e.polygonOpacity,"exponential");const l=new Uint8Array(s);l.fill(255);for(let e=0;e<s;e++){const o=t[r[e]],s=o.properties||{};s.$layer=o.layer,s.$type=o.type;let u=a(n,s);w(u)&&(i.aOpacity=1,a=b(u),u=a(n,s)),delete s.$layer,delete s.$type,l[e]=255*u}o.aOpacity=l}return o.dynamicAttributes=i,o}(t,h,c,V.featureIndexes),R=function(t,e,n,r,i){const o=[[],[]],s=L(r.topPolygonFill),a=L(r.bottomPolygonFill),l=[255,255,255,255],u=e.getLength();if(s||a){let h=s&&b(r.topPolygonFill),c=a&&b(r.bottomPolygonFill),f=null,p=null,d=null,g=null;for(let r=0;r<u;r++){if(1===t[r]&&!s||0===t[r]&&!a)continue;const u=1===t[r];if(u&&e[r]===f){t[r]=d;continue}if(!u&&e[r]===p){t[r]=g;continue}const y=n[e[r]],x=y.properties||{};x.$layer=y.layer,x.$type=y.type;let m=u?h:c,v=m(i,x);w(v)&&(m=b(v),v=m(i,x)),delete x.$layer,delete x.$type,De.normalizeColor(Ze,v),mt(Ze,Ze,l);let M=Ue(o,Ze);M<0&&(M=o.length,o.push(yt([],Ze))),t[r]=M,u?(f=e[r],d=M):(p=e[r],g=M)}}return o.slice(2)}(V.verticeTypes,V.featureIndexes,t,h,c),J={data:{data:{aVertexColorType:R.length<=252?qe.createTypedArray(V.verticeTypes,Uint8Array):qe.createTypedArray(V.verticeTypes,Uint16Array),aPosition:V.vertices,aNormal:V.normals,aTexCoord0:V.uvs,aTangent:V.tangents,aPickingId:V.pickingIds},indices:z,properties:{maxAltitude:V.maxAltitude/100,minAltitude:V.minAltitude/100,hasNegativeHeight:V.hasNegativeHeight},dynamicAttributes:U.dynamicAttributes,vertexColors:R},buffers:X};return V.featureIds.length?(J.data.featureIds=V.featureIds,X.push(J.data.featureIds.buffer)):J.data.featureIds=[],U.aColor&&(J.data.data.aColor=U.aColor,J.buffers.push(U.aColor.buffer)),U.aOpacity&&(J.data.data.aOpacity=U.aOpacity,J.buffers.push(U.aOpacity.buffer)),J.buffers.push(J.data.data.aPosition.buffer),J.data.pickingIdIndiceMap=$e.generatePickingIndiceIndex(J.data.data.aPickingId,J.data.indices),J}const Ze=[];function Ue(t,e){for(let i=0;i<t.length;i++)if(n=e,r=t[i],n[0]===r[0]&&n[1]===r[1]&&n[2]===r[2]&&n[3]===r[3])return i;var n,r;return-1}const{PackUtil:Re,StyleUtil:Je,FilterUtil:He}=re();function We(t,e,n,r,{altitudeScale:i,altitudeProperty:o,defaultAltitude:s,heightProperty:a,minHeightProperty:l,defaultHeight:u,bottom:h}){const c=h,f=e/t[0].extent,p=2*function(t,e){let n=0;for(let e=0,r=t.length;e<r;e++){const r=t[e];if(S(r.geometry[0][0]))n+=3*r.geometry.length;else for(let t=0,e=r.geometry.length;t<e;t++){let e=3*r.geometry[t].length;3===r.type&&(e-=3),n+=e}}return n}(t)+3*t.length*2,d=[],g=new Int16Array(p),y=new Uint8Array(g.length/3*4);w(n)&&(n=He.compileFilter(n));const x=[];function m(t,n,r){const i=n-t,o=g.subarray(t,n),s=g.subarray(n,n+i);s.set(o);for(let t=2,e=s.length;t<e;t+=3)s[t]=o[t]-r;const a=t/3,l=i/3;let u,h;for(let t=a,n=l+a;t<n;t++)t<n-1?(u=t,h=t+1):(u=t,h=a),pt(g,u,h,e)||(x.push(u,h),c&&x.push(u+l,h+l),Ke(g,u,e)||x.push(u,u+l));return n+i}let v=0,b=-1/0,M=1/0;const P=(ee+"").trim(),_=[];for(let e=0,h=t.length;e<h;e++){const h=t[e],c=h.geometry;if(n){let t;t="function"==typeof n?n(h&&h.properties):n,Je.normalizeColor(_,t)}else gt(_,255,255,255);const p=v/3*4,{altitude:w,height:A}=Re.getFeaAltitudeAndHeight(h,i,o,s,a,u,l);A<0?(M=Math.min(w,M),b=Math.max(w-A,b)):(M=Math.min(w-A,M),b=Math.max(w,b));let I=v;for(let t=0,e=c.length;t<e;t++){let e=c[t];const n=e.length;e[0][0]===e[n-1][0]&&e[0][1]===e[n-1][1]&&(e=e.slice(0,n-1)),v=ft(g,I,e,f,w),v=m(I,v,A*f),I=v}const S=I/3*4;for(let t=p;t<S;t+=4)y[t]=_[0],y[t+1]=_[1],y[t+2]=_[2],y[t+3]=255*(r||1);const T=x.length-d.length;for(let t=0;t<T;t++)d.push(h[P])}const A=x.reduce(((t,e)=>Math.max(t,e)),0),I=new(Re.getIndexArrayType(A))(x),T=Math.max(Math.abs(b,Math.abs(M)));return{aPosition:new(Re.getPosArrayType(Math.max(512,T)))(g),indices:I,aPickingId:new Float32Array(d),aColor:y,maxAltitude:b===-1/0?0:b/100,minAltitude:M===1/0?0:M/100}}function Ke(t,e,n){const r=t[3*e],i=t[3*e+1];return r<0||r>n||i<0||i>n}function Qe(t,e,n,r){const i=We(t,e,n.lineColor,n.lineOpacity,r),{minAltitude:o,maxAltitude:s}=i;delete i.minAltitude,delete i.maxAltitude;const a=[i.aPosition.buffer,i.indices.buffer,i.aPickingId.buffer],l=i.indices;return delete i.indices,{data:{data:i,properties:{minAltitude:o,maxAltitude:s},indices:l},buffers:a}}\n/*!\n Feature Filter by\n\n (c) mapbox 2016 and maptalks 2018\n www.mapbox.com | www.maptalks.org\n License: MIT, header required.\n */const tn=["Unknown","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"];function en(t){if(!t)return"true";const e=t[0];if(t.length<=1)return"any"===e?"false":"true";return\`(${G}"=="===e?rn(t[1],t[2],"===",!1):"!="===e?rn(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?rn(t[1],t[2],e,!0):"any"===e?sn(t.slice(1),"||"):"all"===e?sn(t.slice(1),"&&"):"none"===e?un(sn(t.slice(1),"||")):"in"===e?an(t[1],t.slice(2)):"!in"===e?un(an(t[1],t.slice(2))):"has"===e?ln(t[1]):"!has"===e?un(ln(t[1])):"contains"===e?function(t,e,n){const r=nn(t);return void 0!==n?\`(${G}r} + '').indexOf("${G}e}") === ${G}n}\`:\`(${G}r} + '').indexOf("${G}e}") >= 0\`}(t[1],t[2],t[3]):"true"})\`}function nn(t){return"$"===t[0]?"f."+t.substring(1):"p["+JSON.stringify(t)+"]"}function rn(t,e,n,r){if("object"==typeof(i=t)&&i&&t.op)return function(t,e,n,r){const i=t.property,o=t.op;let s=nn(i);return"length"!==o?(console.error(\`not support ${G}o} op\`),"false"):(s=\`((${G}s}+='').length)\`,on(s,i,e,n,r))}(t,e,n,r);var i;return on(nn(t),t,e,n,r)}function on(t,e,n,r,i){const o="$type"===e?tn.indexOf(n):JSON.stringify(n);return(i?\`typeof ${G}t}=== typeof ${G}o}&&\`:"")+t+r+o}function sn(t,e){return t.map(en).join(e)}function an(t,e){"$type"===t&&(e=e.map((t=>tn.indexOf(t))));const n=JSON.stringify(e.sort(hn)),r=nn(t);return e.length<=200?\`${G}n}.indexOf(${G}r}) !== -1\`:\`function(v, a, i, j) {\\n while (i <= j) { var m = (i + j) >> 1;\\n if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;\\n }\\n return false; }(${G}r}, ${G}n},0,${G}e.length-1})\`}function ln(t){return"$id"===t?'"id" in f':\`${G}JSON.stringify(t)} in p\`}function un(t){return\`!(${G}t})\`}function hn(t,e){return t<e?-1:t>e?1:0}let cn=!1;try{const t=new OffscreenCanvas(1,1);t.getContext("2d").fillText("hello",0,0),cn=!0}catch(t){cn=!1}var fn=cn;const{VectorPack:pn,PolygonPack:dn,NativeLinePack:gn,LinePack:yn,PointPack:xn,NativePointPack:mn,LineExtrusionPack:vn,CirclePack:wn,RoundTubePack:bn,SquareTubePack:Mn,FilterUtil:Pn,PackUtil:_n,StyleUtil:An,TextUtil:In,DEFAULT_TEX_WIDTH:Sn,GlyphRequestor:Tn}=re(),Fn="__original_properties",kn="__fn-type_properties";class Ln{constructor(t,e,n,r,i){this.id=t,this.options=e,this.upload=n,this._compileStyle(e.style),this.requests={},this._cache=r,this._styleCounter=1,this.loadings=i}updateStyle(t,e){this.options.style=t,this._styleCounter=t.styleCounter,this._compileStyle(t),e()}updateOptions(t,e){this.options=A(this.options,t),e()}loadTile(t,e){const n=this.loadings,r=t.tileInfo.url,i=this.options.debugTile;if(i){const{x:n,y:r,z:o}=t.tileInfo;let s=!1;for(let t=0;t<i.length;t++)if(n===i[t].x&&r===i[t].y&&o===i[t].z){s=!0;break}if(!s)return void e()}if(n[r])return void n[r].push({context:t,callback:e,ref:this});n[r]=[{context:t,callback:e,ref:this}];const o=this.options.featureIdProperty;this.requests[r]=this.getTileFeatures(t,((e,i,s,a)=>{const l=n[r];if(delete n[r],this.checkIfCanceled(r))return delete this.requests[r],void this._callWaitings(l,null,{canceled:!0});if(delete this.requests[r],(this.options.debug||o)&&i)for(let e=0;e<i.length;e++)if(this.options.debug&&(i[e]._debug_info={index:e,id:i[e].id,tileId:t.tileInfo.id}),o){const t=F(o)?o[i[e].layer]:o,n=i[e].properties;i[e].id=n&&n[t]||null}if(e)this._callWaitings(l,e);else if(i&&i.length){if(l)for(let t=0;t<l.length;t++)this._onTileLoad.call(l[t].ref,l[t].context,l[t].callback,r,s,i,a)}else this._callWaitings(l)}))}_onTileLoad(t,e,n,r,i,o){this._createTileData(r,i,t).then((n=>{if(n.canceled)return void e(null,{canceled:!0});n.data.styleCounter=t.styleCounter,o&&A(n.data,o);const r=n.data.features;if(r){const t={};for(const e in r){const n=r[e];t[n.id]=n}const e=function(t){try{const e=JSON.stringify(t);return B.encode(e)}catch(t){console.error("encode JSON to Uint8Array error:",t)}}(t);e&&(n.data.featuresTypeArray=e,n.buffers=n.buffer||[],n.buffers.push(e.buffer));const i="id"===this.options.features;for(const t in r){const n=r[t];e&&delete n.geometry,i&&(r[t]=n.id)}}e(null,n.data,n.buffers)})).catch((t=>{e(t)}))}abortTile(t,e){delete this.requests[t],this._cancelLoadings(t),e()}_cancelLoadings(t){const e=this.loadings[t];if(e)for(let t=0;t<e.length;t++)e[t].callback(null,{canceled:!0});delete this.loadings[t]}_callWaitings(t,e,n){if(t)for(let r=0;r<t.length;r++)t[r].callback(e,n)}checkIfCanceled(t){return!this.requests[t]}onRemove(){this.loadings={},this._cache&&this._cache.reset(),delete this._cache,this.requests={}}fetchIconGlyphs(t,e,n){if(this.options.workerGlyph&&fn){const r=[];if(t&&Object.keys(t).length){const e=new Promise((e=>{this.upload("fetchIconGlyphs",{icons:t},null,((t,n)=>{e({err:t,iconData:n})}))}));r.push(e)}if(e&&Object.keys(e).length){const t=new Promise((t=>{this._glyphRequestor||(this._glyphRequestor=new Tn),this._glyphRequestor.getGlyphs(e,((e,n)=>{t({err:e,glyphData:n})}))}));r.push(t)}Promise.all(r).then((t=>{const e={icons:null,glyphs:null};for(let r=0;r<t.length;r++){if(t[r].err)return void n(t[r].err);t[r].iconData?e.icons=t[r].iconData.icons:t[r].glyphData&&(e.glyphs=t[r].glyphData.glyphs)}return e})).then((t=>{n(null,t)}))}else this.upload("fetchIconGlyphs",{icons:t,glyphs:e},null,n)}_createTileData(t,e,n){if(!e.length)return Promise.resolve({data:null,buffers:[]});const{glScale:r,tileInfo:i}=n,o=!this.options.style.style.length&&!this.options.style.featureStyle.length;let s=this.pluginConfig.slice(0);o&&(s=this._updateLayerPluginConfig(t)),this.featurePlugins&&function(t){for(let e=1;e<arguments.length;e++){const n=arguments[e];if(n)for(let e=0,r=n.length;e<r;e++)t.push(n[e])}t.length}(s,this.featurePlugins);const a={};for(let t=0;t<s.length;t++)Nn(e,n.tileInfo.z,s[t],a);const l=[],u=[];for(let t=0;t<e.length;t++){const n=e[t],r=a[t];if(r){u.fill(null);let t=0;for(const e in r){let i=0;const o=r[e].values();for(const t of o){let r=u[i];r||(r=$n(n),u[i]=r),r.properties[e]=t,i++}i>t&&(t=i)}for(let e=0;e<t;e++)l.push(u[e])}else l.push(n)}const h=(e=l)[0].extent,c=i.z,f={x:i.extent2d.xmin*r,y:i.extent2d.ymax*r},p=[],d=[],g=[],y=this.options,x=[],m={},v=[Promise.resolve(n.styleCounter)];let w=0,b=-1;const M=[];let P=!1;for(let t=0;t<s.length;t++){b++;const r=s[t];r.type!==w&&(b=0,w=r.type);const a=0===r.type?p:d;jn(r.symbol,M,t),P=P||M[t]&&M[t].size>0;const{tileFeatures:l,tileFeaIndexes:u}=this._filterFeatures(c,r.type,r.filter,e,m,t);if(!l.length){a[b]=null;continue}const y=u[u.length-1],_=_n.getIndexArrayType(y);a[b]={styledFeatures:new _(u)},g.push({idx:t,typeIdx:b}),x.push(a[b].styledFeatures.buffer);const I=A({},n,{extent:h,zoom:c,tilePoint:f});if(this.options.debugTile){const t=this.options.debugTile;for(let e=0;e<t.length;e++){const{x:n,y:r,z:o}=t[e];if(i.x===n&&i.y===r&&i.z===o){I.debugIndex=t[e].index;break}}}let S=this._createTileGeometry(l,r,I);o&&(S=S.then((t=>{if(!t)return null;if(t.data)t.data.layer=l[0].layer;else if(Array.isArray(t))for(let e=0;e<t.length;e++)t[e]&&t[e].data&&(t[e].data.layer=l[0].layer);return t}))),v.push(S)}return Promise.all(v).then((([n,...r])=>{if(n!==this._styleCounter)return{canceled:!0};function i(t,e){if(void 0!==t.data.ref)return;const n=s[g[e].idx],r=n.renderPlugin.dataConfig;if(t.data.type=r.type,t.data.filter=n.filter.def,r.altitudeOffset&&(t.data.properties.minAltitude+=r.altitudeOffset,t.data.properties.maxAltitude+=r.altitudeOffset),t.buffers&&t.buffers.length)for(let e=0;e<t.buffers.length;e++)x.push(t.buffers[e])}for(let t=0;t<r.length;t++){if(!r[t])continue;const e=r[t],n=0===s[g[t].idx].type?p:d;if(Array.isArray(e)){const r=[];for(let n=0;n<e.length;n++)e[n]&&(i(e[n],t),(void 0===e[n].data.ref||e[e[n].data.ref])&&r.push(e[n].data));r.length&&(n[g[t].typeIdx].data=r)}else i(e,t),n[g[t].typeIdx].data=e.data}const o={},a=t;if(y.features||y.schema||P){let t,n=!1;for(let r=0,i=e.length;r<i;r++)if(t=e[r],a[t.layer].properties||(a[t.layer].properties=On(t.properties)),t&&(y.features||P&&m[r])){delete t.extent,delete t.properties.$layer,delete t.properties.$type,delete t.__index;const e=t.originalFeature;if(e){const e=t.properties,n=A({},t.originalFeature);delete e[Fn],n.customProps=A({},e),t=n}const i=A({},t);if(P&&m[r]&&(!y.features||"transient"===y.features)){const i=m[r];for(let r=0;r<i.length;r++){const i=M[r];i&&i.forEach((r=>{const i=e?e.properties:t.properties;i[kn]||(i[kn]=new Set),i[kn].add(r),n=!0}))}}o[r]=i}if(n)for(const t in o){const e=o[t],n=e.properties[kn];if(n){delete e.properties[kn],"transient"===y.features&&(e.fnTypeProps=A({},e.properties));for(const t in e.properties)n.has(t)||("transient"===y.features?delete e.fnTypeProps[t]:delete e.properties[t])}}}return{data:{styleCounter:n,schema:a,data:p,featureData:d,extent:h,features:o},buffers:x}})).catch((t=>{console.error(t)}))}_createTileGeometry(t,e,n){let r=t;const i=e.renderPlugin.dataConfig,o=e.symbol,s=this.options.tileSize,{extent:a,glScale:l,zScale:u,zoom:h,tilePoint:c,centimeterToPoint:f,verticalCentimeterToPoint:p}=n,d=a/s,g=i.type,y=n.debugIndex;let x=A({},i,{EXTENT:a,zoom:h,debugIndex:y,features:this.options.features,isWebGPU:this.options.isWebGPU,isWebGL1:this.options.isWebGL1});if("3d-extrusion"===g){Yn(o)&&(i.uv=1);const t=this.options.projectionCode,e=o.material&&o.material.textureWidth||Sn;return Promise.all([Promise.resolve(je(r,i,a,c,e,n.tileInfo.res,l,a/this.options.tileSize,f,p,o,h,t,y))])}if("3d-wireframe"===g)return Promise.all([Promise.resolve(Qe(r,a,o,i))]);if("point"===g){x=A(x,{requestor:this.fetchIconGlyphs.bind(this),altitudeToTileScale:u*a/this.options.tileSize/l,pluginType:e.renderPlugin.type});let t=o;return Array.isArray(o)||(t=[o]),t=t.map(((t,e)=>(t&&(t.index={index:e},t.isIconText=function(t){return t.markerType||t.markerFile}(t)),t))).filter((t=>!!t)),Promise.all(t.map((t=>{x.defaultMarkerVerticalAlignment="middle";const e=pn.genFnTypes(t);let n=r;return xn.needMerge(t,e,h)&&(n=xn.mergeLineFeatures(r,t,e,h)),new xn(n,t,x).load(d)})))}if("native-point"===g){const t=u*a/this.options.tileSize/l;return x.altitudeToTileScale=t,Vn(r,o,x,mn,d)}if("line"===g)return x=A(x,{requestor:this.fetchIconGlyphs.bind(this),tileRatio:d}),Vn(r,o,x,yn,1,!0);if("native-line"===g)return Vn(r,o,x,gn,1,!0);if("fill"===g)return x=A(x,{requestor:this.fetchIconGlyphs.bind(this)}),Vn(r,o,x,dn);if("line-extrusion"===g){delete o.lineGradientProperty,o.lineJoin="miter",o.lineCap="butt";const t=Yn(o);if(t&&(i.uv=1),x=A(x,{tileSize:s,zScale:u,glScale:l}),o.mergeOnProperty){const t=pn.genFnTypes(o);r=yn.mergeLineFeatures(r,o,t,x.zoom)}if(t){const t=[];if(!1!==i.top){const e=A({},x);e.side=!1,t.push(new vn(r,o,e))}return!1!==i.side&&(x.side=!0,x.top=!1,t.push(new vn(r,o,x))),Promise.all(t.map((t=>t.load())))}return Promise.all([new vn(r,o,x).load()])}if("circle"===g)return Vn(r,o,x,wn);if("round-tube"===g||"square-tube"===g){const t="round-tube"===g?bn:Mn;return x=A(x,{requestor:this.fetchIconGlyphs.bind(this),radialSegments:"round-tube"===g?i.radialSegments||8:4,centimeterToPoint:f,verticalCentimeterToPoint:p,tileRatio:d,isTube:!0}),Vn(r,o,x,t)}return Promise.resolve([])}_filterFeatures(t,e,n,r,i,o){const s=(ee+"").trim(),a=[],l=[],u=r.length;for(let h=0;h<u;h++)if((1===e||void 0===r[h].id||!this.styledFeatures[r[h].id])&&((!n.def||"default"===n.def)&&!i[h]||!0===n.def||n.def&&(void 0!==n.def.condition||Array.isArray(n.def))&&n(r[h],t))){const t=r[h];if(void 0===t[s]&&(t[s]=h),i[h]||(i[h]=[]),i[h].push(o),l.push(t),a.push(h),1===e)break}return{tileFeatures:l,tileFeaIndexes:a}}_compileStyle(t){const{style:e,featureStyle:n}=t,r={};n.forEach((t=>{Array.isArray(t.id)?(t.id.forEach((t=>{r[t]=1})),t.filter=["in","$id",...t.id]):(r[t.id]=1,t.filter=["==","$id",t.id])}));const i=Pn.compileStyle(e);for(let t=0;t<e.length;t++)i[t].filter&&(i[t].filter.def=e[t].filter?e[t].filter.value||e[t].filter:void 0),i[t].type=0;const o=[],s=Pn.compileStyle(n);for(let t=0;t<n.length;t++)s[t].type=1,s[t].filter.def=n[t].filter?n[t].filter.value||n[t].filter:void 0,s[t].renderPlugin&&o.push(s[t]);this.pluginConfig=i,this.featurePlugins=o,this.styledFeatures=r}_updateLayerPluginConfig(t){let e=this._layerPlugins;this._layerPlugins||(e=this._layerPlugins={});const n=["","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon"],r=[];for(const o in t){const s=o;if(!e[o]){const r=[];for(let e=0;e<t[o].types.length;e++){const a=t[o].types[e],l=["all",["==","$layer",s],["==","$type",n[a]]],u={filter:(i=l,new Function("f",\`var p = (f && f.properties || {}); return ${G}en(i)}\`)),renderPlugin:Bn(a),symbol:Cn(a)};u.filter.def=l,u.type=0,r.push(u)}e[s]=r}r.push(...e[s])}var i;return r}}function Bn(t){switch(t){case 1:return{type:"native-point",dataConfig:{type:"native-point",only2D:!0}};case 2:return{type:"native-line",dataConfig:{type:"native-line",only2D:!0}};case 3:return{type:"fill",dataConfig:{type:"fill",only2D:!0}}}return null}function Cn(t){switch(t){case 1:return{markerFill:"#f00",markerSize:10};case 2:return{lineColor:"#fff"};case 3:return{polygonFill:"#00f",polygonOpacity:.4}}return null}function On(t){if(Array.isArray(t)||!F(t))return{};const e={};for(const n in t){const r=t[n];I(r)?e[n]="string":S(r)?e[n]="number":!0===r||!1===r?e[n]="boolean":Array.isArray(r)?e[n]="array":e[n]="object"}return e}function Yn(t){if(!t)return 0;let e=0;for(const n in t){if(("normalTexture"===n||"bumpTexture"===n)&&t[n])return 2;if(n.indexOf("Texture")>0&&t[n])e=1;else if(F(t[n])){const r=Yn(t[n]);if(2===r)return r;1===r&&(e=1)}}return e}function Vn(t,e,n,r,i,o){const s={},a=Array.isArray(e)?e:[e];let l=-1;for(let t=0;t<a.length;t++)s[t]=Xn(a[t]),!s[t]&&a[t]&&-1===l&&(l=t);const u=[];for(let e=0;e<a.length;e++){if(!a[e])continue;a[e].index={index:e};let h=t;if(o&&a[e].mergeOnProperty){const r=pn.genFnTypes(a[e]);h=yn.mergeLineFeatures(t,a[0],r,n.zoom)}s[e]||e===l?u.push(new r(h,a[e],n).load(i)):u.push({data:{ref:l,symbolIndex:{index:e}}})}return Promise.all(u)}function Xn(t){if(!t)return 0;for(const e in t)if(L(t[e]))return 1;return 0}function Nn(t,e,n,r){const i=n.customProperties;if(!i)return t;if(i)for(let t=0;t<i.length;t++)i[t].fn=Pn.compileFilter(i[t].filter);for(let n=0;n<i.length;n++)for(let o=0,s=t.length;o<s;o++)if(i[n].fn(t[o],e))for(const t in i[n].properties){const e=i[n].properties[t];k(e)||(r[o]||(r[o]={}),r[o][t]||(r[o][t]=new Set),r[o][t].add(e))}}const En={get:(t,e)=>e in t?t[e]:t.originalFeature[e],has:(t,e)=>e in t||e in t.originalFeature},zn={get:function(t,e){return e in t?t[e]:t[Fn][e]},has:(t,e)=>e in t||e in t[Fn]},Dn={};function $n(t){const e={};e.originalFeature=t;const n=new Proxy(e,En);return n.properties=new Proxy({},zn),n.properties[Fn]=t.properties||Dn,n}function qn(t,e,n){t[e]||(t[e]=new Set),t[e].add(n)}const Gn=[];function jn(t,e,n){if(!t)return Gn;for(const r in t){if(!t[r]||!An.checkIfZoomFnTypeSymbol(r))continue;if(L(t[r]))qn(e,n,t[r].property);else{if("lineGradientProperty"===r){qn(e,n,t[r]);continue}if("textName"===r)if(I(t[r])){const i=In.resolveVarNames(t[r]);if(i)for(let t=0;t<i.length;t++)qn(e,n,i[t])}else if(Pn.isExpression(t[r])){const i=[];In.resolveExpVarNames(i,t[r]);for(let t=0;t<i.length;t++)qn(e,n,i[t])}}const i=t[r].stops;if(i&&i.length)for(let t=0;t<i.length;t++)L(i[t][1])&&qn(e,t,i[t][1].property)}return e[n]}function Zn(t,e){Un(t.geometry,e)}function Un(t,e){if(t)switch(t.type){case"Point":Rn(t.coordinates,e);break;case"MultiPoint":case"LineString":Jn(t.coordinates,e);break;case"MultiLineString":!function(t,e){for(let n=0,r=t.length;n<r;n++)Jn(t[n],e)}(t.coordinates,e);break;case"Polygon":Hn(t.coordinates,e);break;case"MultiPolygon":!function(t,e){for(let n=0,r=t.length;n<r;n++)Hn(t[n],e)}(t.coordinates,e);break;case"GeometryCollection":const n=t.geometries.length;for(let r=0;r<n;r++)Un(t.geometries[r],e)}}function Rn(t,e){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Jn(t,e){for(let n=0,r=t.length;n<r;n++)Rn(t[n],e)}function Hn(t,e){t.length&&Jn(t[0],e)}function Wn(t,e,n,r,i){Kn(t,e,n||0,r||t.length-1,i||tr)}function Kn(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,s=e-n+1,a=Math.log(o),l=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1);Kn(t,e,Math.max(n,Math.floor(e-s*l/o+u)),Math.min(r,Math.floor(e+(o-s)*l/o+u)),i)}var h=t[e],c=n,f=r;for(Qn(t,n,e),i(t[r],h)>0&&Qn(t,n,r);c<f;){for(Qn(t,c,f),c++,f--;i(t[c],h)<0;)c++;for(;i(t[f],h)>0;)f--}0===i(t[n],h)?Qn(t,n,f):Qn(t,++f,r),f<=e&&(n=f+1),e<=f&&(r=f-1)}}function Qn(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function tr(t,e){return t<e?-1:t>e?1:0}class er{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!fr(t,e))return n;const r=this.toBBox,i=[];for(;e;){for(let o=0;o<e.children.length;o++){const s=e.children[o],a=e.leaf?r(s):s;fr(t,a)&&(e.leaf?n.push(s):cr(t,a)?this._all(s,n):i.push(s))}e=i.pop()}return n}collides(t){let e=this.data;if(!fr(t,e))return!1;const n=[];for(;e;){for(let r=0;r<e.children.length;r++){const i=e.children[r],o=e.leaf?this.toBBox(i):i;if(fr(t,o)){if(e.leaf||cr(t,o))return!0;n.push(i)}}e=n.pop()}return!1}load(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=pr([]),this}remove(t,e){if(!t)return this;let n=this.data;const r=this.toBBox(t),i=[],o=[];let s,a,l;for(;n||i.length;){if(n||(n=i.pop(),a=i[i.length-1],s=o.pop(),l=!0),n.leaf){const r=nr(t,n.children,e);if(-1!==r)return n.children.splice(r,1),i.push(n),this._condense(i),this}l||n.leaf||!cr(n,r)?a?(s++,n=a.children[s],l=!1):n=null:(i.push(n),o.push(s),s=0,a=n,n=n.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,r){const i=n-e+1;let o,s=this._maxEntries;if(i<=s)return o=pr(t.slice(e,n+1)),rr(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(s)),s=Math.ceil(i/Math.pow(s,r-1))),o=pr([]),o.leaf=!1,o.height=r;const a=Math.ceil(i/s),l=a*Math.ceil(Math.sqrt(s));dr(t,e,n,l,this.compareMinX);for(let i=e;i<=n;i+=l){const e=Math.min(i+l-1,n);dr(t,i,e,a,this.compareMinY);for(let n=i;n<=e;n+=a){const i=Math.min(n+a-1,e);o.children.push(this._build(t,n,i,r-1))}}return rr(o,this.toBBox),o}_chooseSubtree(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){let n,r=1/0,s=1/0;for(let a=0;a<e.children.length;a++){const l=e.children[a],u=lr(l),h=(i=t,o=l,(Math.max(o.maxX,i.maxX)-Math.min(o.minX,i.minX))*(Math.max(o.maxY,i.maxY)-Math.min(o.minY,i.minY))-u);h<s?(s=h,r=u<r?u:r,n=l):h===s&&u<r&&(r=u,n=l)}e=n||e.children[0]}var i,o;return e}_insert(t,e,n){const r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),or(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)}_split(t,e){const n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r),s=pr(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,rr(n,this.toBBox),rr(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)}_splitRoot(t,e){this.data=pr([t,e]),this.data.height=t.height+1,this.data.leaf=!1,rr(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let r,i=1/0,o=1/0;for(let s=e;s<=n-e;s++){const e=ir(t,0,s,this.toBBox),a=ir(t,s,n,this.toBBox),l=hr(e,a),u=lr(e)+lr(a);l<i?(i=l,r=s,o=u<o?u:o):l===i&&u<o&&(o=u,r=s)}return r||n-e}_chooseSplitAxis(t,e,n){const r=t.leaf?this.compareMinX:sr,i=t.leaf?this.compareMinY:ar;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)}_allDistMargin(t,e,n,r){t.children.sort(r);const i=this.toBBox,o=ir(t,0,e,i),s=ir(t,n-e,n,i);let a=ur(o)+ur(s);for(let r=e;r<n-e;r++){const e=t.children[r];or(o,t.leaf?i(e):e),a+=ur(o)}for(let r=n-e-1;r>=e;r--){const e=t.children[r];or(s,t.leaf?i(e):e),a+=ur(s)}return a}_adjustParentBBoxes(t,e,n){for(let r=n;r>=0;r--)or(e[r],t)}_condense(t){for(let e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children,e.splice(e.indexOf(t[n]),1)):this.clear():rr(t[n],this.toBBox)}}function nr(t,e,n){if(!n)return e.indexOf(t);for(let r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function rr(t,e){ir(t,0,t.children.length,e,t)}function ir(t,e,n,r,i){i||(i=pr(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=e;o<n;o++){const e=t.children[o];or(i,t.leaf?r(e):e)}return i}function or(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function sr(t,e){return t.minX-e.minX}function ar(t,e){return t.minY-e.minY}function lr(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function ur(t){return t.maxX-t.minX+(t.maxY-t.minY)}function hr(t,e){const n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function cr(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function fr(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function pr(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function dr(t,e,n,r,i){const o=[e,n];for(;o.length;){if((n=o.pop())-(e=o.pop())<=r)continue;const s=e+Math.ceil((n-e)/r/2)*r;Wn(t,s,e,n,i),o.push(e,s,s,n)}}class gr{constructor(t=[],e=yr){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:n}=this,r=e[t];for(;t>0;){const i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r}_down(t){const{data:e,compare:n}=this,r=this.length>>1,i=e[t];for(;t<r;){let r=1+(t<<1),o=e[r];const s=r+1;if(s<this.length&&n(e[s],o)<0&&(r=s,o=e[s]),n(o,i)>=0)break;e[t]=o,t=r}e[t]=i}}function yr(t,e){return t<e?-1:t>e?1:0}function xr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var mr={exports:{}},vr=function(t,e,n,r){var i=t[0],o=t[1],s=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var a=(r-n)/2,l=0,u=a-1;l<a;u=l++){var h=e[n+2*l+0],c=e[n+2*l+1],f=e[n+2*u+0],p=e[n+2*u+1];c>o!=p>o&&i<(f-h)*(o-c)/(p-c)+h&&(s=!s)}return s},wr=function(t,e,n,r){var i=t[0],o=t[1],s=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);for(var a=r-n,l=0,u=a-1;l<a;u=l++){var h=e[l+n][0],c=e[l+n][1],f=e[u+n][0],p=e[u+n][1];c>o!=p>o&&i<(f-h)*(o-c)/(p-c)+h&&(s=!s)}return s};mr.exports=function(t,e,n,r){return e.length>0&&Array.isArray(e[0])?wr(t,e,n,r):vr(t,e,n,r)};var br=mr.exports.nested=wr;mr.exports.flat=vr;const Mr=11102230246251565e-32,Pr=134217729,_r=(3+8*Mr)*Mr;function Ar(t,e,n,r,i){let o,s,a,l,u=e[0],h=r[0],c=0,f=0;h>u==h>-u?(o=u,u=e[++c]):(o=h,h=r[++f]);let p=0;if(c<t&&f<n)for(h>u==h>-u?(s=u+o,a=o-(s-u),u=e[++c]):(s=h+o,a=o-(s-h),h=r[++f]),o=s,0!==a&&(i[p++]=a);c<t&&f<n;)h>u==h>-u?(s=o+u,l=s-o,a=o-(s-l)+(u-l),u=e[++c]):(s=o+h,l=s-o,a=o-(s-l)+(h-l),h=r[++f]),o=s,0!==a&&(i[p++]=a);for(;c<t;)s=o+u,l=s-o,a=o-(s-l)+(u-l),u=e[++c],o=s,0!==a&&(i[p++]=a);for(;f<n;)s=o+h,l=s-o,a=o-(s-l)+(h-l),h=r[++f],o=s,0!==a&&(i[p++]=a);return 0===o&&0!==p||(i[p++]=o),p}function Ir(t){return new Float64Array(t)}const Sr=33306690738754716e-32,Tr=22204460492503146e-32,Fr=11093356479670487e-47,kr=Ir(4),Lr=Ir(8),Br=Ir(12),Cr=Ir(16),Or=Ir(4);function Yr(t,e,n,r,i,o){const s=(e-o)*(n-i),a=(t-i)*(r-o),l=s-a;if(0===s||0===a||s>0!=a>0)return l;const u=Math.abs(s+a);return Math.abs(l)>=Sr*u?l:-function(t,e,n,r,i,o,s){let a,l,u,h,c,f,p,d,g,y,x,m,v,w,b,M,P,_;const A=t-i,I=n-i,S=e-o,T=r-o;w=A*T,f=Pr*A,p=f-(f-A),d=A-p,f=Pr*T,g=f-(f-T),y=T-g,b=d*y-(w-p*g-d*g-p*y),M=S*I,f=Pr*S,p=f-(f-S),d=S-p,f=Pr*I,g=f-(f-I),y=I-g,P=d*y-(M-p*g-d*g-p*y),x=b-P,c=b-x,kr[0]=b-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-M,c=v-x,kr[1]=v-(x+c)+(c-M),_=m+x,c=_-m,kr[2]=m-(_-c)+(x-c),kr[3]=_;let F=function(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}(4,kr),k=Tr*s;if(F>=k||-F>=k)return F;if(c=t-A,a=t-(A+c)+(c-i),c=n-I,u=n-(I+c)+(c-i),c=e-S,l=e-(S+c)+(c-o),c=r-T,h=r-(T+c)+(c-o),0===a&&0===l&&0===u&&0===h)return F;if(k=Fr*s+_r*Math.abs(F),F+=A*h+T*a-(S*u+I*l),F>=k||-F>=k)return F;w=a*T,f=Pr*a,p=f-(f-a),d=a-p,f=Pr*T,g=f-(f-T),y=T-g,b=d*y-(w-p*g-d*g-p*y),M=l*I,f=Pr*l,p=f-(f-l),d=l-p,f=Pr*I,g=f-(f-I),y=I-g,P=d*y-(M-p*g-d*g-p*y),x=b-P,c=b-x,Or[0]=b-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-M,c=v-x,Or[1]=v-(x+c)+(c-M),_=m+x,c=_-m,Or[2]=m-(_-c)+(x-c),Or[3]=_;const L=Ar(4,kr,4,Or,Lr);w=A*h,f=Pr*A,p=f-(f-A),d=A-p,f=Pr*h,g=f-(f-h),y=h-g,b=d*y-(w-p*g-d*g-p*y),M=S*u,f=Pr*S,p=f-(f-S),d=S-p,f=Pr*u,g=f-(f-u),y=u-g,P=d*y-(M-p*g-d*g-p*y),x=b-P,c=b-x,Or[0]=b-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-M,c=v-x,Or[1]=v-(x+c)+(c-M),_=m+x,c=_-m,Or[2]=m-(_-c)+(x-c),Or[3]=_;const B=Ar(L,Lr,4,Or,Br);w=a*h,f=Pr*a,p=f-(f-a),d=a-p,f=Pr*h,g=f-(f-h),y=h-g,b=d*y-(w-p*g-d*g-p*y),M=l*u,f=Pr*l,p=f-(f-l),d=l-p,f=Pr*u,g=f-(f-u),y=u-g,P=d*y-(M-p*g-d*g-p*y),x=b-P,c=b-x,Or[0]=b-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-M,c=v-x,Or[1]=v-(x+c)+(c-M),_=m+x,c=_-m,Or[2]=m-(_-c)+(x-c),Or[3]=_;const C=Ar(B,Br,4,Or,Cr);return Cr[C-1]}(t,e,n,r,i,o,u)}function Vr(t,e,n){e=Math.max(0,void 0===e?2:e),n=n||0;var r=function(t){for(var e=t[0],n=t[0],r=t[0],i=t[0],o=0;o<t.length;o++){var s=t[o];s[0]<e[0]&&(e=s),s[0]>r[0]&&(r=s),s[1]<n[1]&&(n=s),s[1]>i[1]&&(i=s)}var a=[e,n,r,i],l=a.slice();for(o=0;o<t.length;o++)br(t[o],a)||l.push(t[o]);return function(t){t.sort(Rr);for(var e=[],n=0;n<t.length;n++){for(;e.length>=2&&$r(e[e.length-2],e[e.length-1],t[n])<=0;)e.pop();e.push(t[n])}for(var r=[],i=t.length-1;i>=0;i--){for(;r.length>=2&&$r(r[r.length-2],r[r.length-1],t[i])<=0;)r.pop();r.push(t[i])}return r.pop(),e.pop(),e.concat(r)}(l)}(t),i=new er(16);i.toBBox=function(t){return{minX:t[0],minY:t[1],maxX:t[0],maxY:t[1]}},i.compareMinX=function(t,e){return t[0]-e[0]},i.compareMinY=function(t,e){return t[1]-e[1]},i.load(t);for(var o,s=[],a=0;a<r.length;a++){var l=r[a];i.remove(l),o=Gr(l,o),s.push(o)}var u=new er(16);for(a=0;a<s.length;a++)u.insert(qr(s[a]));for(var h=e*e,c=n*n;s.length;){var f=s.shift(),p=f.p,d=f.next.p,g=jr(p,d);if(!(g<c)){var y=g/h;(l=Xr(i,f.prev.p,p,d,f.next.next.p,y,u))&&Math.min(jr(l,p),jr(l,d))<=y&&(s.push(f),s.push(Gr(l,f)),i.remove(l),u.remove(f),u.insert(qr(f)),u.insert(qr(f.next)))}}f=o;var x=[];do{x.push(f.p),f=f.next}while(f!==o);return x.push(f.p),x}function Xr(t,e,n,r,i,o,s){for(var a=new gr([],Nr),l=t.data;l;){for(var u=0;u<l.children.length;u++){var h=l.children[u],c=l.leaf?Zr(h,n,r):Er(n,r,h);c>o||a.push({node:h,dist:c})}for(;a.length&&!a.peek().node.children;){var f=a.pop(),p=f.node,d=Zr(p,e,n),g=Zr(p,r,i);if(f.dist<d&&f.dist<g&&Dr(n,p,s)&&Dr(r,p,s))return p}(l=a.pop())&&(l=l.node)}return null}function Nr(t,e){return t.dist-e.dist}function Er(t,e,n){if(zr(t,n)||zr(e,n))return 0;var r=Ur(t[0],t[1],e[0],e[1],n.minX,n.minY,n.maxX,n.minY);if(0===r)return 0;var i=Ur(t[0],t[1],e[0],e[1],n.minX,n.minY,n.minX,n.maxY);if(0===i)return 0;var o=Ur(t[0],t[1],e[0],e[1],n.maxX,n.minY,n.maxX,n.maxY);if(0===o)return 0;var s=Ur(t[0],t[1],e[0],e[1],n.minX,n.maxY,n.maxX,n.maxY);return 0===s?0:Math.min(r,i,o,s)}function zr(t,e){return t[0]>=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function Dr(t,e,n){for(var r,i,o,s,a=Math.min(t[0],e[0]),l=Math.min(t[1],e[1]),u=Math.max(t[0],e[0]),h=Math.max(t[1],e[1]),c=n.search({minX:a,minY:l,maxX:u,maxY:h}),f=0;f<c.length;f++)if(r=c[f].p,i=c[f].next.p,o=t,r!==(s=e)&&i!==o&&$r(r,i,o)>0!=$r(r,i,s)>0&&$r(o,s,r)>0!=$r(o,s,i)>0)return!1;return!0}function $r(t,e,n){return Yr(t[0],t[1],e[0],e[1],n[0],n[1])}function qr(t){var e=t.p,n=t.next.p;return t.minX=Math.min(e[0],n[0]),t.minY=Math.min(e[1],n[1]),t.maxX=Math.max(e[0],n[0]),t.maxY=Math.max(e[1],n[1]),t}function Gr(t,e){var n={p:t,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return e?(n.next=e.next,n.prev=e,e.next.prev=n,e.next=n):(n.prev=n,n.next=n),n}function jr(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function Zr(t,e,n){var r=e[0],i=e[1],o=n[0]-r,s=n[1]-i;if(0!==o||0!==s){var a=((t[0]-r)*o+(t[1]-i)*s)/(o*o+s*s);a>1?(r=n[0],i=n[1]):a>0&&(r+=o*a,i+=s*a)}return(o=t[0]-r)*o+(s=t[1]-i)*s}function Ur(t,e,n,r,i,o,s,a){var l,u,h,c,f=n-t,p=r-e,d=s-i,g=a-o,y=t-i,x=e-o,m=f*f+p*p,v=f*d+p*g,w=d*d+g*g,b=f*y+p*x,M=d*y+g*x,P=m*w-v*v,_=P,A=P;0===P?(u=0,_=1,c=M,A=w):(c=m*M-v*b,(u=v*M-w*b)<0?(u=0,c=M,A=w):u>_&&(u=_,c=M+v,A=w)),c<0?(c=0,-b<0?u=0:-b>m?u=_:(u=-b,_=m)):c>A&&(c=A,-b+v<0?u=0:-b+v>m?u=_:(u=-b+v,_=m));var I=(1-(h=0===c?0:c/A))*i+h*s-((1-(l=0===u?0:u/_))*t+l*n),S=(1-h)*o+h*a-((1-l)*e+l*r);return I*I+S*S}function Rr(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]}const{PackUtil:Jr}=re();class Hr{constructor(t,e){this.x=t,this.y=e}clone(){return new Hr(this.x,this.y)}normalize(){const t=this.length();this.x/=t,this.y/=t}negate(){this.x=-this.x,this.y=-this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}diff(t){return new Hr(this.x-t.x,this.y-t.y)}distance(t){const e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)}dot(t){return this.x*t.x+this.y*t.y}equals(t){return this.x===t.x&&this.y===t.y}orthogonal(){return new Hr(this.y,-this.x)}}function Wr(t,e,n,r){const i=e.x*r.y-e.y*r.x,o=n.x-t.x,s=n.y-t.y,a=(o*r.y-s*r.x)/i;return new Hr(t.x+a*e.x,t.y+a*e.y)}const Kr=[],Qr=[];function ti(t){if(S(t[0]&&t[0].x)){const e=[];let n=0;for(let r=0;r<t.length;r++)Qr[n]?(Qr[n][0]=t[r].x,Qr[n][1]=t[r].y):Qr[n]=[t[r].x,t[r].y],e.push(Qr[n]),n++;t=e}try{const e=Vr(t,1/0);let n=[1/0,1/0],r=[-1/0,-1/0];for(let t=0;t<e.length;t++)e[t][0]<n[0]&&(n[0]=e[t][0]),e[t][0]>r[0]&&(r[0]=e[t][0]),e[t][1]<n[1]&&(n[1]=e[t][1]),e[t][1]>r[1]&&(r[1]=e[t][1]);const i=[];let o=[],s=0;for(let t=0;t<e.length;t++)t===e.length-1&&e[t][0]===e[0][0]&&e[t][1]===e[0][1]||(_t(i,e[t],"EPSG:3857"),Kr[s]?(Kr[s].x=i[0],Kr[s].y=i[1]):Kr[s]=new Hr(i[0],i[1]),o.push(Kr[s]),s++);Jr.calculateSignedArea(o)<0&&(o=o.reverse());const a=function(t){let e,n=Number.MAX_VALUE;const r=function(t,r,i,o,s,a,l,u){var h=Wr(t,r,s,a),c=Wr(i,o,s,a),f=Wr(l,u,t,r),p=Wr(l,u,i,o),d=h.distance(c)*h.distance(f);0!==d&&d<n&&(e=[h,f,p,c],n=d)};var i=[];for(let e=0;e<t.length;e++)i.push(t[(e+1)%t.length].diff(t[e])),i[e].normalize();var o,s,a,l,u=new Hr(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),h=new Hr(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(let e=0;e<t.length;e++){var c=t[e];c.x<u.x&&(u.x=c.x,o=e),c.x>h.x&&(h.x=c.x,s=e),c.y<u.y&&(u.y=c.y,l=e),c.y>h.y&&(h.y=c.y,a=e)}var f=new Hr(0,-1),p=new Hr(0,1),d=new Hr(-1,0),g=new Hr(1,0);for(let e=0;e<t.length;e++){var y=[Math.acos(f.dot(i[o])),Math.acos(p.dot(i[s])),Math.acos(d.dot(i[a])),Math.acos(g.dot(i[l]))];switch(y.indexOf(Math.min.apply(Math,y))){case 0:(p=(f=i[o].clone()).clone()).negate(),(g=(d=f.orthogonal()).clone()).negate(),o=(o+1)%t.length;break;case 1:(f=(p=i[s].clone()).clone()).negate(),(g=(d=f.orthogonal()).clone()).negate(),s=(s+1)%t.length;break;case 2:(g=(d=i[a].clone()).clone()).negate(),(p=(f=g.orthogonal()).clone()).negate(),a=(a+1)%t.length;break;case 3:(d=(g=i[l].clone()).clone()).negate(),(p=(f=g.orthogonal()).clone()).negate(),l=(l+1)%t.length}r(t[o],f,t[s],p,t[a],d,t[l],g)}return e}(o);if(!a||4!==a.length)return null;const l=a[0].distance(a[1]),u=a[1].distance(a[2]),h=a.map((t=>[t.x,t.y]));return h.push(+(u>l)),h}catch(t){return null}}const ei=[];function ni(t,e){const n=Array.isArray(t&&t[0]&&t[0][0]);for(let r=0;r<t.length;r++)n?t[r]=ni(t[r]):(_t(ei,t[r],e),t[r][0]=ei[0],t[r][1]=ei[1]);return t}const{PackUtil:ri}=re();class ii extends Ln{constructor(t,e,n,r,i,o){super(t,e,n,r,i),(e=e||{}).extent||(e.extent=8192),this.setData(e.data,o)}clearData(){delete this.index}setData(t,e){if(delete this.index,function(t){if(!t)return!0;if(Array.isArray(t)&&!t.length)return!0;if(t.features&&!t.features.length)return!0;return!1}(t))return this.empty=!0,void e();const n={maxZoom:24,tolerance:this.options.simplifyTolerance,extent:this.options.extent,buffer:S(this.options.tileBuffer)?this.options.tileBuffer:64,hasAltitude:!!this.options.hasAltitude,debug:0,lineMetrics:!0,indexMaxZoom:5,indexMaxPoints:1e5,disableFilter:!0};if(this.options.projection&&(n.projection=this.options.projection,"EPSG:4490"===n.projection&&(n.projection="EPSG:4326")),I(t)&&"{"!=t.substring(0,1)||t.url){const r=t.url?t.url:t;O.getJSON(r,t.url?t:{},((t,i)=>{if(t&&(console.error("Failed to fetch geojson:"+r),e(t)),!i)return void e(null,{extent:null,idMap:new Map});let o=i;if(this.options.convertFn){o=new Function("data",this.options.convertFn+"\\nreturn convert(data)")(o)}const s=Array.isArray(o)?o:o.features;this._genOMBB(s);const{sample1000:a,idMap:l}=this._generateId(s);this._generate(a,l,o,n,e)}))}else{"string"==typeof t&&(t=JSON.parse(t));const r=Array.isArray(t)?t:t.features;this._genOMBB(r);let i=r;this._generate(i,null,t,n,e)}}_genOMBB(t){if(this.options.generateOMBB&&t)for(let e=0;e<t.length;e++){const n=t[e];if(n&&n.geometry&&n.geometry.coordinates)if("Polygon"===n.geometry.type){const t=n.geometry.coordinates[0];if(!t)continue;const e=ti(t,t.length);n.properties=n.properties||{},n.properties[ne]=e}else if("MultiPolygon"===n.geometry.type){const t=n.geometry.coordinates;for(let e=0;e<t.length;e++){if(!t[e])continue;const r=t[e][0];if(!r)continue;const i=ti(r,r.length);n.properties=n.properties||{},n.properties[ne]=n.properties[ne]||[],n.properties[ne][e]=i}}}}_generate(t,e,n,r,i){try{const o=t&&t.length?function(t){let e=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];switch(t.type){case"FeatureCollection":const n=t.features.length;for(let r=0;r<n;r++)Zn(t.features[r],e);break;case"Feature":Zn(t,e);break;default:Un(t,e)}return e}({type:"FeatureCollection",features:t}):null;this.index=function(t,e){return new ht(t,e)}(n,this.options.geojsonvt||r),i(null,{extent:o,idMap:e})}catch(t){console.warn(t),i({error:t.message})}}_generateId(t){const e=[],n=new Map;let r=0;const i=this.options.featureIdProperty;return t&&(t.length,t.forEach(((t,o)=>{!function(t,o,s){if(!t)return;if("Feature"===t.type&&!t.geometry)return;if(S(t.id)||(t.id=r++),i){let e=i;F(i)&&(e=i[t.layer||"0"]),t.id=t.properties[e]}const a=A({},t);t.geometry?(a.geometry=A({},t.geometry),a.geometry.coordinates=null):t.coordinates&&(a.coordinates=null),n.set(t.id,a),e.push(t)}(t)}))),{sample1000:e,idMap:n}}getTileFeatures(t,e){const n=t.tileInfo,r=[];if(!this.index)return this.empty?(setTimeout((function(){e(null,r,[])}),1),1):(setTimeout((function(){e({loading:!0})}),1),1);const i=this.index.getTile(n.z,n.x,n.y);if(!i||0===i.features.length)return setTimeout((function(){e(null,r,[])}),1),1;const o=[];for(let t=0,e=i.features.length;t<e;t++){const e=i.features[t];let n=e.layer;void 0===n&&(n="0"),o[n]={types:{}};o[n].types[e.type]=1,e.tags=e.tags||{},e.geometry.converted||(ri.convertGeometry(e),e.geometry.converted=1),r.push({type:e.type,layer:n,id:e.id,geometry:e.geometry,properties:e.tags,extent:this.options.extent})}for(const t in o)o[t].types=Object.keys(o[t].types).map((t=>+t));return setTimeout((function(){e(null,r,o)}),1),1}onRemove(){super.onRemove(),delete this.index}}var oi={\n/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\nread:function(t,e,n,r,i){var o,s,a=8*i-r-1,l=(1<<a)-1,u=l>>1,h=-7,c=n?i-1:0,f=n?-1:1,p=t[e+c];for(c+=f,o=p&(1<<-h)-1,p>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=f,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=r;h>0;s=256*s+t[e+c],c+=f,h-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=u}return(p?-1:1)*s*Math.pow(2,o-r)},write:function(t,e,n,r,i,o){var s,a,l,u=8*o-i-1,h=(1<<u)-1,c=h>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+c>=1?f/l:f*Math.pow(2,1-c))*l>=2&&(s++,l/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*l-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[n+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[n+p]=255&s,p+=d,s/=256,u-=8);t[n+p-d]|=128*g}},si=li,ai=oi;function li(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}li.Varint=0,li.Fixed64=1,li.Bytes=2,li.Fixed32=5;var ui=4294967296,hi=1/ui,ci="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function fi(t){return t.type===li.Bytes?t.readVarint()+t.pos:t.pos+1}function pi(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function di(t,e,n){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=t;i--)n.buf[i+r]=n.buf[i]}function gi(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function yi(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function xi(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function mi(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function vi(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function wi(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function bi(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function Mi(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function Pi(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function _i(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Ai(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function Ii(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}li.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var r=this.readVarint(),i=r>>3,o=this.pos;this.type=7&r,t(i,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=_i(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Ii(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=_i(this.buf,this.pos)+_i(this.buf,this.pos+4)*ui;return this.pos+=8,t},readSFixed64:function(){var t=_i(this.buf,this.pos)+Ii(this.buf,this.pos+4)*ui;return this.pos+=8,t},readFloat:function(){var t=ai.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=ai.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,r=this.buf;return e=127&(n=r[this.pos++]),n<128?e:(e|=(127&(n=r[this.pos++]))<<7,n<128?e:(e|=(127&(n=r[this.pos++]))<<14,n<128?e:(e|=(127&(n=r[this.pos++]))<<21,n<128?e:function(t,e,n){var r,i,o=n.buf;if(i=o[n.pos++],r=(112&i)>>4,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(127&i)<<3,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(127&i)<<10,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(127&i)<<17,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(127&i)<<24,i<128)return pi(t,r,e);if(i=o[n.pos++],r|=(1&i)<<31,i<128)return pi(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&ci?function(t,e,n){return ci.decode(t.subarray(e,n))}(this.buf,e,t):function(t,e,n){var r="",i=e;for(;i<n;){var o,s,a,l=t[i],u=null,h=l>239?4:l>223?3:l>191?2:1;if(i+h>n)break;1===h?l<128&&(u=l):2===h?128==(192&(o=t[i+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===h?(o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&((u=(15&l)<<12|(63&o)<<6|63&s)<=2047||u>=55296&&u<=57343)&&(u=null)):4===h&&(o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,h=1):u>65535&&(u-=65536,r+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),r+=String.fromCharCode(u),i+=h}return r}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==li.Bytes)return t.push(this.readVarint(e));var n=fi(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==li.Bytes)return t.push(this.readSVarint());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==li.Bytes)return t.push(this.readBoolean());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==li.Bytes)return t.push(this.readFloat());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==li.Bytes)return t.push(this.readDouble());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==li.Bytes)return t.push(this.readFixed32());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==li.Bytes)return t.push(this.readSFixed32());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==li.Bytes)return t.push(this.readFixed64());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==li.Bytes)return t.push(this.readSFixed64());var e=fi(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===li.Varint)for(;this.buf[this.pos++]>127;);else if(e===li.Bytes)this.pos=this.readVarint()+this.pos;else if(e===li.Fixed32)this.pos+=4;else{if(e!==li.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var n=new Uint8Array(e);n.set(this.buf),this.buf=n,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Ai(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Ai(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Ai(this.buf,-1&t,this.pos),Ai(this.buf,Math.floor(t*hi),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Ai(this.buf,-1&t,this.pos),Ai(this.buf,Math.floor(t*hi),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var n,r;t>=0?(n=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,r=r+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos]=127&t}(n,0,e),function(t,e){var n=(7&t)<<4;if(e.buf[e.pos++]|=n|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,n){for(var r,i,o=0;o<e.length;o++){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){r>56319||o+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):i=r;continue}if(r<56320){t[n++]=239,t[n++]=191,t[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(t[n++]=239,t[n++]=191,t[n++]=189,i=null);r<128?t[n++]=r:(r<2048?t[n++]=r>>6|192:(r<65536?t[n++]=r>>12|224:(t[n++]=r>>18|240,t[n++]=r>>12&63|128),t[n++]=r>>6&63|128),t[n++]=63&r|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&di(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),ai.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),ai.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var n=0;n<e;n++)this.buf[this.pos++]=t[n]},writeRawMessage:function(t,e){this.pos++;var n=this.pos;t(e,this);var r=this.pos-n;r>=128&&di(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,n){this.writeTag(t,li.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,gi,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,yi,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,vi,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,xi,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,mi,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,wi,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,bi,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Mi,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Pi,e)},writeBytesField:function(t,e){this.writeTag(t,li.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,li.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,li.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,li.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,li.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,li.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,li.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,li.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,li.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,li.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Si=xr(si),Ti=Fi;function Fi(t,e){this.x=t,this.y=e}Fi.prototype={clone:function(){return new Fi(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,n=t.y-this.y;return e*e+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),n=Math.sin(t),r=e*this.x-n*this.y,i=n*this.x+e*this.y;return this.x=r,this.y=i,this},_rotateAround:function(t,e){var n=Math.cos(t),r=Math.sin(t),i=e.x+n*(this.x-e.x)-r*(this.y-e.y),o=e.y+r*(this.x-e.x)+n*(this.y-e.y);return this.x=i,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Fi.convert=function(t){return t instanceof Fi?t:Array.isArray(t)?new Fi(t[0],t[1]):t};var ki=Ti,Li=Bi;function Bi(t,e,n,r,i){this.properties={},this.extent=n,this.type=0,this._pbf=t,this._geometry=-1,this._keys=r,this._values=i,t.readFields(Ci,this,e)}function Ci(t,e,n){1==t?e.id=n.readVarint():2==t?function(t,e){var n=t.readVarint()+t.pos;for(;t.pos<n;){var r=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[r]=i}}(n,e):3==t?e.type=n.readVarint():4==t&&(e._geometry=n.pos)}function Oi(t){for(var e,n,r=0,i=0,o=t.length,s=o-1;i<o;s=i++)e=t[i],r+=((n=t[s]).x-e.x)*(e.y+n.y);return r}Bi.types=["Unknown","Point","LineString","Polygon"],Bi.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,n=t.readVarint()+t.pos,r=1,i=0,o=0,s=0,a=[];t.pos<n;){if(i<=0){var l=t.readVarint();r=7&l,i=l>>3}if(i--,1===r||2===r)o+=t.readSVarint(),s+=t.readSVarint(),1===r&&(e&&a.push(e),e=[]),e.push(new ki(o,s));else{if(7!==r)throw new Error("unknown command "+r);e&&e.push(e[0].clone())}}return e&&a.push(e),a},Bi.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,n=1,r=0,i=0,o=0,s=1/0,a=-1/0,l=1/0,u=-1/0;t.pos<e;){if(r<=0){var h=t.readVarint();n=7&h,r=h>>3}if(r--,1===n||2===n)(i+=t.readSVarint())<s&&(s=i),i>a&&(a=i),(o+=t.readSVarint())<l&&(l=o),o>u&&(u=o);else if(7!==n)throw new Error("unknown command "+n)}return[s,l,a,u]},Bi.prototype.toGeoJSON=function(t,e,n){var r,i,o=this.extent*Math.pow(2,n),s=this.extent*t,a=this.extent*e,l=this.loadGeometry(),u=Bi.types[this.type];function h(t){for(var e=0;e<t.length;e++){var n=t[e],r=180-360*(n.y+a)/o;t[e]=[360*(n.x+s)/o-180,360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90]}}switch(this.type){case 1:var c=[];for(r=0;r<l.length;r++)c[r]=l[r][0];h(l=c);break;case 2:for(r=0;r<l.length;r++)h(l[r]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var n,r,i=[],o=0;o<e;o++){var s=Oi(t[o]);0!==s&&(void 0===r&&(r=s<0),r===s<0?(n&&i.push(n),n=[t[o]]):n.push(t[o]))}n&&i.push(n);return i}(l),r=0;r<l.length;r++)for(i=0;i<l[r].length;i++)h(l[r][i])}1===l.length?l=l[0]:u="Multi"+u;var f={type:"Feature",geometry:{type:u,coordinates:l},properties:this.properties};return"id"in this&&(f.id=this.id),f};var Yi=Li,Vi=Xi;function Xi(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(Ni,this,e),this.length=this._features.length}function Ni(t,e,n){15===t?e.version=n.readVarint():1===t?e.name=n.readString():5===t?e.extent=n.readVarint():2===t?e._features.push(n.pos):3===t?e._keys.push(n.readString()):4===t&&e._values.push(function(t){var e=null,n=t.readVarint()+t.pos;for(;t.pos<n;){var r=t.readVarint()>>3;e=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return e}(n))}Xi.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Yi(this._pbf,e,this.extent,this._keys,this._values)};var Ei=Vi,zi=function(t,e){this.layers=t.readFields(Di,{},e)};function Di(t,e,n){if(3===t){var r=new Ei(n,n.readVarint()+n.pos);r.length&&(e[r.name]=r)}}var $i=zi;const qi=2,Gi=new TextDecoder("utf-8");class ji extends Ln{constructor(t,e,n,r,i,o){super(t,e,n,r,i),e=e||{},o()}clearData(){this._abortRequests()}getTileFeatures(t,e){const n=t.tileInfo.url,r=t.fetchOptions||{},{altitudePropertyName:i,disableAltitudeWarning:o}=t,s=this._cache.get(n);if(s&&s.cacheIndex===t.workerCacheIndex){const{err:t,data:r}=s;return setTimeout((()=>{this._readTile(n,i,o,t,r,e)}),1)}const{tileArrayBuffer:a}=t;if(a)return setTimeout((()=>{this._readTile(n,i,o,null,a,e)}),1);r.referrer=t.referrer,r.errorLog=t.loadTileErrorLog;const{loadTileCachMaxSize:l,loadTileCacheLog:u}=t;return O.getArrayBuffer(n,r,((r,s)=>{if(!this._cache)return;let a,h=!1;const c=()=>{this._readTile(n,i,o,r,a,e)};if(r)r.loading||this._cache.add(n,{err:r,data:s&&s.data,cacheIndex:t.workerCacheIndex});else if(s&&s.data){h=!0,a=s.data;const e=function(t){if(!t)return!1;if(!(t instanceof ArrayBuffer))return!1;try{const e=new Uint8Array(t),n=e[0],r=e[1];return 31===n&&139===r}catch(t){console.error("arraybufferIsGZip read buffer error:",t)}return!1}(a),r=()=>{let e=!0;if(a&&("number"==typeof(i=l)&&!isNaN(i))&&l>0){const t=(r=a)&&r instanceof ArrayBuffer?r.byteLength/1048576:0;t>l&&(e=!1,u&&console.warn(\`url:${G}n},loadTileCachMaxSize exceeded: ${G}t} > ${G}l},the tile will not be cached.\`))}var r,i;e&&a&&this._cache.add(n,{err:null,data:a,cacheIndex:t.workerCacheIndex}),c()};e?function(t,e){try{const n=new DecompressionStream("gzip"),r=new Blob([t]).stream().pipeThrough(n);new Response(r).arrayBuffer().then((t=>{e(t)})).catch((t=>{console.error("decompressGzipWithBlob:",t),e()}))}catch(t){console.error("decompressGzipWithBlob:",t),e()}}(a,(t=>{t&&(a=t),r()})):r()}h||c()}))}_readTile(t,e,n,r,i,o){if(r)return void o(r);let s;try{s=new $i(new Si(i))}catch(r){const e=Gi.decode(i);return r.message+="\\n"+t+"\\n"+e,void o(r.message,[],[])}const a=[];if(!s.layers)return void o(null,a,[]);const l={};let u;for(const t in s.layers)if(h=s.layers,c=t,Object.prototype.hasOwnProperty.call(h,c)){l[t]={types:{}};const i=l[t].types;for(let o=0,l=s.layers[t].length;o<l;o++)try{u=s.layers[t].feature(o),i[u.type]=1;const r={type:u.type,layer:t,geometry:u.loadGeometry(),properties:u.properties,extent:u.extent};void 0!==u.id&&(r.id=u.id);let l=r.properties[ne];l&&(I(l)&&(l=JSON.parse(l)),r.properties[ne]=ni(l,"EPSG:3857"));const h=e&&r.properties[e];if(h){const t=Zi(h),e=[];Ui(r.geometry,t,e),e.length&&!n&&(console.warn("feature.geometry is not consistent with altitude values:"),console.warn(JSON.stringify(r,null,2)))}a.push(r)}catch(r){console.warn("error when load vt geometry:",r)}}var h,c;for(const t in l)l[t].types=Object.keys(l[t].types).map((t=>+t));o(null,a,l,{byteLength:i.byteLength})}abortTile(t,e){const n=this.requests[t];delete this.requests[t],n&&n.abort&&n.abort(),this._cancelLoadings(t),e()}onRemove(){super.onRemove(),this._abortRequests()}_abortRequests(){for(const t in this.requests){const e=this.requests[t];e&&e.abort&&e.abort()}this.requests={}}}function Zi(t){const e=atob(t),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return new Float32Array(n.buffer)}function Ui(t,e,n,r){r||(r={index:0});for(let i=0;i<t.length;i++)if(Array.isArray(t[i]))Ui(t[i],e,n,r);else{const o=r.index;k(e[o])?n.push(qi):t[i].z=100*e[o],r.index++}}const{LRUCache:Ri}=re();let Ji=0;const Hi=new Ri(128);class Wi{constructor(t){this._layers={},this._callbacks={},this.workerId=t}addLayer({actorId:t,mapId:e,layerId:n,params:r},i){if(this._getLayerById(e,n))return;const o=this._genKey(e,n),s=r.type,a=r.options,l=this.send.bind(this,t);this._layers[o]="GeoJSONVectorTileLayer"===s?new ii(n,a,l,Hi,{},i):new ji(n,a,l,Hi,{},i)}removeLayer({mapId:t,layerId:e},n){const r=this._getLayerById(t,e),i=this._genKey(t,e);delete this._layers[i],r&&r.onRemove(n)}loadTile({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.loadTile(n,r)}abortTile({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.abortTile&&i.abortTile(n.url,r)}removeTile({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.removeTile(n,r)}updateStyle({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.updateStyle(n,r)}updateOptions({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.updateOptions(n,r)}setData({mapId:t,layerId:e,params:n},r){const i=this._getLayerById(t,e);i&&i.setData(n.data,r)}clearData({mapId:t,layerId:e},n){const r=this._getLayerById(t,e);r&&(r.clearData(n),this._resetCache())}receive(t){const e=t.callback,n=this._callbacks[e];delete this._callbacks[e],n&&t.error?n(new Error(t.error)):n&&n(null,t.data)}send(t,e,n,r,i){const o=i?\`${G}t}-${G}Ji++}\`:null;i&&(this._callbacks[o]=i),postMessage({type:"<request>",workerId:this.workerId,actorId:t,command:e,params:n,callback:String(o)},r||[])}_genKey(t,e){return\`${G}t}-${G}e}\`}_getLayerById(t,e){const n=this._genKey(t,e);return this._layers[n]}_resetCache(){Hi.reset()}}t.initialize=function(){},t.onmessage=function(t,e){const n=t.data;if(this.dispatcher||(this.dispatcher=new Wi(t.workerId)),"<response>"===t.type)this.dispatcher.workerId===t.workerId&&this.dispatcher.receive(t);else{const r=n.command,i=(n.params||{}).loadTileErrorLog,o=(n.params||{}).loadTileErrorLogIgnoreCodes||[];this.dispatcher[r]({actorId:t.actorId,mapId:n.mapId,layerId:n.layerId,params:n.params},((t,n,s)=>{if(i&&t&&!t.loading){const e=t.status;S(e)&&-1===o.indexOf(e)&&console.error(r,t)}e(t,n,s)}))}}}`;
|
|
35
35
|
|
|
36
36
|
function W(e) {
|
|
37
37
|
const t = function() {
|
|
@@ -640,7 +640,7 @@ function W(e) {
|
|
|
640
640
|
var n, i, r;
|
|
641
641
|
if (ie(e)) {
|
|
642
642
|
var o, s = e.stops && "object" == typeof e.stops[0][0], a = s || j(e.property), l = s || !a, h = e.type || t || "exponential";
|
|
643
|
-
if ("exponential" === h) o =
|
|
643
|
+
if ("exponential" === h) o = Z; else if ("interval" === h) o = q; else if ("categorical" === h) o = Y; else if ("identity" === h) o = Q; else if ("color-interpolate" === h) o = J; else {
|
|
644
644
|
if ("calculate-expression" !== h) throw new Error('Unknown function type "' + h + '"');
|
|
645
645
|
o = ee;
|
|
646
646
|
}
|
|
@@ -658,7 +658,7 @@ function W(e) {
|
|
|
658
658
|
}
|
|
659
659
|
for (let e in c) u.push([ c[e].zoom, $(c[e]) ]);
|
|
660
660
|
n = function(t, n) {
|
|
661
|
-
const i =
|
|
661
|
+
const i = Z({
|
|
662
662
|
stops: u,
|
|
663
663
|
base: e.base
|
|
664
664
|
}, t)(t, n);
|
|
@@ -680,11 +680,11 @@ function W(e) {
|
|
|
680
680
|
for (let n = 0; n < e.stops.length; n++) if (t === e.stops[n][0]) return e.stops[n][1];
|
|
681
681
|
return e.default;
|
|
682
682
|
}
|
|
683
|
-
function
|
|
683
|
+
function q(e, t) {
|
|
684
684
|
for (var n = 0; n < e.stops.length && !(t < e.stops[n][0]); n++) ;
|
|
685
685
|
return e.stops[Math.max(n - 1, 0)][1];
|
|
686
686
|
}
|
|
687
|
-
function
|
|
687
|
+
function Z(e, t) {
|
|
688
688
|
for (var n = j(e.base) && !X(e.base) ? e.base : 1, i = 0; !(i >= e.stops.length || t <= e.stops[i][0]); ) i++;
|
|
689
689
|
return 0 === i ? e.stops[i][1] : i === e.stops.length ? e.stops[i - 1][1] : te(t, n, e.stops[i - 1][0], e.stops[i][0], e.stops[i - 1][1], e.stops[i][1]);
|
|
690
690
|
}
|
|
@@ -1804,8 +1804,8 @@ function W(e) {
|
|
|
1804
1804
|
};
|
|
1805
1805
|
}
|
|
1806
1806
|
}));
|
|
1807
|
-
var
|
|
1808
|
-
function
|
|
1807
|
+
var qe = n(je);
|
|
1808
|
+
function Ze(e) {
|
|
1809
1809
|
for (let t = 1; t < arguments.length; t++) {
|
|
1810
1810
|
const n = arguments[t];
|
|
1811
1811
|
for (const t in n) e[t] = n[t];
|
|
@@ -1849,7 +1849,7 @@ function W(e) {
|
|
|
1849
1849
|
e[1] = 255 * t.g, e[2] = 255 * t.b, void 0 !== t.a ? e[3] = 255 * t.a : e[3] = 255,
|
|
1850
1850
|
e;
|
|
1851
1851
|
const n = t;
|
|
1852
|
-
t = lt[n] = lt[n] ||
|
|
1852
|
+
t = lt[n] = lt[n] || qe(t).unitArray();
|
|
1853
1853
|
}
|
|
1854
1854
|
for (let n = 0; n < t.length; n++) e[n] = 255 * t[n];
|
|
1855
1855
|
return 3 === t.length && (e[3] = 255), e;
|
|
@@ -1906,7 +1906,7 @@ function W(e) {
|
|
|
1906
1906
|
evaluate: function(e, t, n) {
|
|
1907
1907
|
return tt(e) ? e(void 0 !== n ? n : null, t) : e;
|
|
1908
1908
|
},
|
|
1909
|
-
extend:
|
|
1909
|
+
extend: Ze,
|
|
1910
1910
|
getAltitudeToLocal: st,
|
|
1911
1911
|
getTubeSizeScale: at,
|
|
1912
1912
|
hasOwn: it,
|
|
@@ -2216,10 +2216,10 @@ function W(e) {
|
|
|
2216
2216
|
}
|
|
2217
2217
|
return `Expected ${Xt(e)} but found ${Xt(t)} instead.`;
|
|
2218
2218
|
}
|
|
2219
|
-
function
|
|
2219
|
+
function qt(e, t) {
|
|
2220
2220
|
return t.some((t => t.kind === e.kind));
|
|
2221
2221
|
}
|
|
2222
|
-
function
|
|
2222
|
+
function Zt(e, t) {
|
|
2223
2223
|
return t.some((t => "null" === t ? null === e : "array" === t ? Array.isArray(e) : "object" === t ? e && !Array.isArray(e) && "object" == typeof e : t === typeof e));
|
|
2224
2224
|
}
|
|
2225
2225
|
var Kt, Jt = {
|
|
@@ -3116,8 +3116,8 @@ function W(e) {
|
|
|
3116
3116
|
return [ "within", this.geojson ];
|
|
3117
3117
|
}
|
|
3118
3118
|
}
|
|
3119
|
-
var
|
|
3120
|
-
function
|
|
3119
|
+
var qn = Yn;
|
|
3120
|
+
function Zn(e) {
|
|
3121
3121
|
if (e instanceof Cn) {
|
|
3122
3122
|
if ("get" === e.name && 1 === e.args.length) return !1;
|
|
3123
3123
|
if ("feature-state" === e.name) return !1;
|
|
@@ -3125,10 +3125,10 @@ function W(e) {
|
|
|
3125
3125
|
if ("properties" === e.name || "geometry-type" === e.name || "id" === e.name) return !1;
|
|
3126
3126
|
if (/^filter-/.test(e.name)) return !1;
|
|
3127
3127
|
}
|
|
3128
|
-
if (e instanceof
|
|
3128
|
+
if (e instanceof qn) return !1;
|
|
3129
3129
|
let t = !0;
|
|
3130
3130
|
return e.eachChild((e => {
|
|
3131
|
-
t && !
|
|
3131
|
+
t && !Zn(e) && (t = !1);
|
|
3132
3132
|
})), t;
|
|
3133
3133
|
}
|
|
3134
3134
|
function Kn(e) {
|
|
@@ -3226,12 +3226,12 @@ function W(e) {
|
|
|
3226
3226
|
if (e instanceof ei) return ii(e.boundExpression);
|
|
3227
3227
|
if (e instanceof Cn && "error" === e.name) return !1;
|
|
3228
3228
|
if (e instanceof On) return !1;
|
|
3229
|
-
if (e instanceof
|
|
3229
|
+
if (e instanceof qn) return !1;
|
|
3230
3230
|
const t = e instanceof Pn || e instanceof vn;
|
|
3231
3231
|
let n = !0;
|
|
3232
3232
|
return e.eachChild((e => {
|
|
3233
3233
|
n = t ? n && ii(e) : n && e instanceof mn;
|
|
3234
|
-
})), !!n &&
|
|
3234
|
+
})), !!n && Zn(e) && Jn(e, [ "zoom", "heatmap-density", "line-progress", "sky-radial-progress", "accumulated", "is-supported-script", "pitch", "distance-from-center" ]);
|
|
3235
3235
|
}
|
|
3236
3236
|
function ri(e, t) {
|
|
3237
3237
|
const n = e.length - 1;
|
|
@@ -3608,13 +3608,13 @@ function W(e) {
|
|
|
3608
3608
|
static parse(e, t) {
|
|
3609
3609
|
if (3 !== e.length) return t.error(`Expected 2 arguments, but found ${e.length - 1} instead.`);
|
|
3610
3610
|
const n = t.parse(e[1], 1, Ut), i = t.parse(e[2], 2, Ut);
|
|
3611
|
-
return n && i ?
|
|
3611
|
+
return n && i ? qt(n.type, [ Nt, Lt, Dt, Ht, Ut ]) ? new Ni(n, i) : t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Xt(n.type)} instead`) : null;
|
|
3612
3612
|
}
|
|
3613
3613
|
evaluate(e) {
|
|
3614
3614
|
const t = this.needle.evaluate(e), n = this.haystack.evaluate(e);
|
|
3615
3615
|
if (null == n) return !1;
|
|
3616
|
-
if (!
|
|
3617
|
-
if (!
|
|
3616
|
+
if (!Zt(t, [ "boolean", "string", "number", "null" ])) throw new yn(`Expected first argument to be of type boolean, string, number or null, but found ${Xt(dn(t))} instead.`);
|
|
3617
|
+
if (!Zt(n, [ "string", "array" ])) throw new yn(`Expected second argument to be of type array or string, but found ${Xt(dn(n))} instead.`);
|
|
3618
3618
|
return n.indexOf(t) >= 0;
|
|
3619
3619
|
}
|
|
3620
3620
|
eachChild(e) {
|
|
@@ -3636,7 +3636,7 @@ function W(e) {
|
|
|
3636
3636
|
if (e.length <= 2 || e.length >= 5) return t.error(`Expected 3 or 4 arguments, but found ${e.length - 1} instead.`);
|
|
3637
3637
|
const n = t.parse(e[1], 1, Ut), i = t.parse(e[2], 2, Ut);
|
|
3638
3638
|
if (!n || !i) return null;
|
|
3639
|
-
if (!
|
|
3639
|
+
if (!qt(n.type, [ Nt, Lt, Dt, Ht, Ut ])) return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Xt(n.type)} instead`);
|
|
3640
3640
|
if (4 === e.length) {
|
|
3641
3641
|
const r = t.parse(e[3], 3, Dt);
|
|
3642
3642
|
return r ? new Vi(n, i, r) : null;
|
|
@@ -3645,8 +3645,8 @@ function W(e) {
|
|
|
3645
3645
|
}
|
|
3646
3646
|
evaluate(e) {
|
|
3647
3647
|
const t = this.needle.evaluate(e), n = this.haystack.evaluate(e);
|
|
3648
|
-
if (!
|
|
3649
|
-
if (!
|
|
3648
|
+
if (!Zt(t, [ "boolean", "string", "number", "null" ])) throw new yn(`Expected first argument to be of type boolean, string, number or null, but found ${Xt(dn(t))} instead.`);
|
|
3649
|
+
if (!Zt(n, [ "string", "array" ])) throw new yn(`Expected second argument to be of type array or string, but found ${Xt(dn(n))} instead.`);
|
|
3650
3650
|
if (this.fromIndex) {
|
|
3651
3651
|
const i = this.fromIndex.evaluate(e);
|
|
3652
3652
|
return n.indexOf(t, i);
|
|
@@ -3773,7 +3773,7 @@ function W(e) {
|
|
|
3773
3773
|
if (e.length <= 2 || e.length >= 5) return t.error(`Expected 3 or 4 arguments, but found ${e.length - 1} instead.`);
|
|
3774
3774
|
const n = t.parse(e[1], 1, Ut), i = t.parse(e[2], 2, Dt);
|
|
3775
3775
|
if (!n || !i) return null;
|
|
3776
|
-
if (!
|
|
3776
|
+
if (!qt(n.type, [ jt(Ut), Lt, Ut ])) return t.error(`Expected first argument to be of type array or string, but found ${Xt(n.type)} instead`);
|
|
3777
3777
|
if (4 === e.length) {
|
|
3778
3778
|
const r = t.parse(e[3], 3, Dt);
|
|
3779
3779
|
return r ? new Xi(n.type, n, i, r) : null;
|
|
@@ -3782,7 +3782,7 @@ function W(e) {
|
|
|
3782
3782
|
}
|
|
3783
3783
|
evaluate(e) {
|
|
3784
3784
|
const t = this.input.evaluate(e), n = this.beginIndex.evaluate(e);
|
|
3785
|
-
if (!
|
|
3785
|
+
if (!Zt(t, [ "string", "array" ])) throw new yn(`Expected first argument to be of type array or string, but found ${Xt(dn(t))} instead.`);
|
|
3786
3786
|
if (this.endIndex) {
|
|
3787
3787
|
const i = this.endIndex.evaluate(e);
|
|
3788
3788
|
return t.slice(n, i);
|
|
@@ -3807,10 +3807,10 @@ function W(e) {
|
|
|
3807
3807
|
function Yi(e, t) {
|
|
3808
3808
|
return "==" === e || "!=" === e ? "boolean" === t.kind || "string" === t.kind || "number" === t.kind || "null" === t.kind || "value" === t.kind : "string" === t.kind || "number" === t.kind || "value" === t.kind;
|
|
3809
3809
|
}
|
|
3810
|
-
function
|
|
3810
|
+
function qi(e, t, n, i) {
|
|
3811
3811
|
return 0 === i.compare(t, n);
|
|
3812
3812
|
}
|
|
3813
|
-
function
|
|
3813
|
+
function Zi(e, t, n) {
|
|
3814
3814
|
const i = "==" !== e && "!=" !== e;
|
|
3815
3815
|
return class r {
|
|
3816
3816
|
constructor(e, t, n) {
|
|
@@ -3860,25 +3860,25 @@ function W(e) {
|
|
|
3860
3860
|
}
|
|
3861
3861
|
};
|
|
3862
3862
|
}
|
|
3863
|
-
const Ki =
|
|
3863
|
+
const Ki = Zi("==", (function(e, t, n) {
|
|
3864
3864
|
return t === n;
|
|
3865
|
-
}),
|
|
3865
|
+
}), qi), Ji = Zi("!=", (function(e, t, n) {
|
|
3866
3866
|
return t !== n;
|
|
3867
3867
|
}), (function(e, t, n, i) {
|
|
3868
|
-
return !
|
|
3869
|
-
})), Qi =
|
|
3868
|
+
return !qi(0, t, n, i);
|
|
3869
|
+
})), Qi = Zi("<", (function(e, t, n) {
|
|
3870
3870
|
return t < n;
|
|
3871
3871
|
}), (function(e, t, n, i) {
|
|
3872
3872
|
return i.compare(t, n) < 0;
|
|
3873
|
-
})), er =
|
|
3873
|
+
})), er = Zi(">", (function(e, t, n) {
|
|
3874
3874
|
return t > n;
|
|
3875
3875
|
}), (function(e, t, n, i) {
|
|
3876
3876
|
return i.compare(t, n) > 0;
|
|
3877
|
-
})), tr =
|
|
3877
|
+
})), tr = Zi("<=", (function(e, t, n) {
|
|
3878
3878
|
return t <= n;
|
|
3879
3879
|
}), (function(e, t, n, i) {
|
|
3880
3880
|
return i.compare(t, n) <= 0;
|
|
3881
|
-
})), nr =
|
|
3881
|
+
})), nr = Zi(">=", (function(e, t, n) {
|
|
3882
3882
|
return t >= n;
|
|
3883
3883
|
}), (function(e, t, n, i) {
|
|
3884
3884
|
return i.compare(t, n) >= 0;
|
|
@@ -3994,7 +3994,7 @@ function W(e) {
|
|
|
3994
3994
|
"to-number": Pn,
|
|
3995
3995
|
"to-string": Pn,
|
|
3996
3996
|
var: ei,
|
|
3997
|
-
within:
|
|
3997
|
+
within: qn
|
|
3998
3998
|
};
|
|
3999
3999
|
function sr(e, [t, n, i, r]) {
|
|
4000
4000
|
t = t.evaluate(e), n = n.evaluate(e), i = i.evaluate(e);
|
|
@@ -4360,7 +4360,7 @@ function W(e) {
|
|
|
4360
4360
|
}
|
|
4361
4361
|
function Ir(e, t) {
|
|
4362
4362
|
if ("error" === (e = Pr(e, t)).result) return e;
|
|
4363
|
-
const n = e.value.expression, i =
|
|
4363
|
+
const n = e.value.expression, i = Zn(n);
|
|
4364
4364
|
if (!i && !function(e) {
|
|
4365
4365
|
return "data-driven" === e["property-type"];
|
|
4366
4366
|
}(t)) return fr([ new Rt("", "data expressions not supported") ]);
|
|
@@ -4436,7 +4436,7 @@ function W(e) {
|
|
|
4436
4436
|
if (i !== n) {
|
|
4437
4437
|
const e = Pr(n, null);
|
|
4438
4438
|
if ("error" === e.result) throw new Error(e.value.map((e => `${e.key}: ${e.message}`)).join(", "));
|
|
4439
|
-
s = (t, n, i, r, o) => e.value.evaluate(t, n, {}, i, void 0, void 0, r, o), a = !
|
|
4439
|
+
s = (t, n, i, r, o) => e.value.evaluate(t, n, {}, i, void 0, void 0, r, o), a = !Zn(e.value.expression);
|
|
4440
4440
|
}
|
|
4441
4441
|
return {
|
|
4442
4442
|
filter: o,
|
|
@@ -4548,7 +4548,7 @@ function W(e) {
|
|
|
4548
4548
|
let i;
|
|
4549
4549
|
i = !0 === e[n].filter ? function() {
|
|
4550
4550
|
return !0;
|
|
4551
|
-
} : Br(e[n].filter), t.push(
|
|
4551
|
+
} : Br(e[n].filter), t.push(Ze({}, e[n], {
|
|
4552
4552
|
filter: i
|
|
4553
4553
|
}));
|
|
4554
4554
|
}
|
|
@@ -4624,7 +4624,7 @@ function W(e) {
|
|
|
4624
4624
|
function Yr(e) {
|
|
4625
4625
|
return $r[e];
|
|
4626
4626
|
}
|
|
4627
|
-
const
|
|
4627
|
+
const qr = {
|
|
4628
4628
|
markerPlacement: 1,
|
|
4629
4629
|
markerFile: 1,
|
|
4630
4630
|
mergeOnProperty: 1,
|
|
@@ -4648,21 +4648,21 @@ function W(e) {
|
|
|
4648
4648
|
lineCap: 1,
|
|
4649
4649
|
linePatternFile: 1,
|
|
4650
4650
|
polygonPatternFile: 1
|
|
4651
|
-
},
|
|
4651
|
+
}, Zr = {
|
|
4652
4652
|
lineDasharray: 1,
|
|
4653
4653
|
markerLineDasharray: 1,
|
|
4654
4654
|
uvScale: 1,
|
|
4655
4655
|
uvOffset: 1
|
|
4656
4656
|
};
|
|
4657
4657
|
function Kr(e) {
|
|
4658
|
-
return
|
|
4658
|
+
return qr[e] ? "string" : Yr(e) ? "number" : Zr[e] ? "array" : "color";
|
|
4659
4659
|
}
|
|
4660
4660
|
var Jr = Object.freeze({
|
|
4661
4661
|
__proto__: null,
|
|
4662
4662
|
compileFilter: Br,
|
|
4663
4663
|
compileStyle: function(e = []) {
|
|
4664
4664
|
return Gr(e = e.map((e => {
|
|
4665
|
-
const t =
|
|
4665
|
+
const t = Ze({}, e);
|
|
4666
4666
|
return t.filter && t.filter.value && (t.filter = t.filter.value), t;
|
|
4667
4667
|
})));
|
|
4668
4668
|
},
|
|
@@ -4867,7 +4867,7 @@ function W(e) {
|
|
|
4867
4867
|
t && !Ke(t.x) && (n = e);
|
|
4868
4868
|
}
|
|
4869
4869
|
if (!n) if (n = [], Array.isArray(r.geometry)) for (let t = 0; t < e.length; t++) {
|
|
4870
|
-
const i =
|
|
4870
|
+
const i = Ze({}, e[t]);
|
|
4871
4871
|
n.push(N(i));
|
|
4872
4872
|
} else for (let i = 0; i < e.length; i++) {
|
|
4873
4873
|
const r = e[i], o = a(r);
|
|
@@ -5485,7 +5485,7 @@ function W(e) {
|
|
|
5485
5485
|
}
|
|
5486
5486
|
if (d.length !== o) {
|
|
5487
5487
|
const e = c - a;
|
|
5488
|
-
f = Math.max(e, f),
|
|
5488
|
+
f = Math.max(e, f), qo(d, t, o, d.length - 1, .5);
|
|
5489
5489
|
}
|
|
5490
5490
|
c = 0, u -= i;
|
|
5491
5491
|
}
|
|
@@ -5577,7 +5577,7 @@ function W(e) {
|
|
|
5577
5577
|
verticalAlign: i
|
|
5578
5578
|
};
|
|
5579
5579
|
}
|
|
5580
|
-
function
|
|
5580
|
+
function qo(e, t, n, i, r) {
|
|
5581
5581
|
const o = t[e[i].glyph];
|
|
5582
5582
|
if (o) {
|
|
5583
5583
|
const t = o.metrics.advance, s = (e[i].x + t) * r;
|
|
@@ -5585,7 +5585,7 @@ function W(e) {
|
|
|
5585
5585
|
for (let t = n; t <= i; t++) e[t].x -= s;
|
|
5586
5586
|
}
|
|
5587
5587
|
}
|
|
5588
|
-
function
|
|
5588
|
+
function Zo(e) {
|
|
5589
5589
|
if (!function(e) {
|
|
5590
5590
|
for (const t of e) if (Ho(t.charCodeAt(0))) return !0;
|
|
5591
5591
|
return !1;
|
|
@@ -5770,7 +5770,7 @@ function W(e) {
|
|
|
5770
5770
|
const l = [];
|
|
5771
5771
|
for (let e = 0; e < s.length; e++) a = et(s[e]) ? {
|
|
5772
5772
|
path: s[e]
|
|
5773
|
-
} : s[e], a =
|
|
5773
|
+
} : s[e], a = Ze({}, o, a), a.d = a.path, delete a.path, l.push(a);
|
|
5774
5774
|
const h = [ '<svg version="1.1"', 'xmlns="http://www.w3.org/2000/svg"' ];
|
|
5775
5775
|
i < 1 && h.push('opacity="' + i + '"'), e.markerPathWidth && e.markerPathHeight && h.push('viewBox="0 0 ' + e.markerPathWidth + " " + e.markerPathHeight + '"'),
|
|
5776
5776
|
h.push('preserveAspectRatio="none"'), t && h.push('width="' + t + '"'), n && h.push('height="' + n + '"'),
|
|
@@ -5793,7 +5793,7 @@ function W(e) {
|
|
|
5793
5793
|
if (e || 0 === e) {
|
|
5794
5794
|
const t = bo(x ? x(null, S) : A.textFaceName);
|
|
5795
5795
|
let n = wo(e, S);
|
|
5796
|
-
n && n.length && (n =
|
|
5796
|
+
n && n.length && (n = Zo(n), v.glyph = {
|
|
5797
5797
|
font: t,
|
|
5798
5798
|
text: n
|
|
5799
5799
|
});
|
|
@@ -6360,7 +6360,7 @@ function W(e) {
|
|
|
6360
6360
|
t >= 1) return !1;
|
|
6361
6361
|
return !0;
|
|
6362
6362
|
}(e.getIconAndGlyph().glyph.text) ? 1 : 0, {textFillFn: x, textSizeFn: _, textHaloFillFn: v, textHaloRadiusFn: A, textHaloOpacityFn: T, textDxFn: S, textDyFn: I, textPitchAlignmentFn: C, textRotationAlignmentFn: O, textRotationFn: k, textAllowOverlapFn: R, textIgnorePlacementFn: F, textOpacityFn: E, markerWidthFn: H, markerHeightFn: D, markerDxFn: L, markerDyFn: N, markerPitchAlignmentFn: z, markerRotationAlignmentFn: V, markerRotationFn: U, markerAllowOverlapFn: G, markerIgnorePlacementFn: B, markerOpacityFn: W} = this._fnTypes;
|
|
6363
|
-
let j, X, $, Y,
|
|
6363
|
+
let j, X, $, Y, q, Z = [ 0, 0, 0, 0 ], K = 14, J = [ 0, 0, 0, 0 ], Q = 0, ee = 0, te = 0, ne = 0, re = 0, oe = 0, se = 0, ae = 0, le = 0, he = 0, ce = 0, ue = 0, fe = 0, de = 0;
|
|
6364
6364
|
if (g) {
|
|
6365
6365
|
const t = e.getIconAndGlyph().glyph.font;
|
|
6366
6366
|
$ = function(e, t, n) {
|
|
@@ -6387,7 +6387,7 @@ function W(e) {
|
|
|
6387
6387
|
});
|
|
6388
6388
|
}
|
|
6389
6389
|
return r;
|
|
6390
|
-
}(r.horizontal, p, this.glyphAtlas.positions[t]), x && (
|
|
6390
|
+
}(r.horizontal, p, this.glyphAtlas.positions[t]), x && (Z = x(null, d), ie(Z) ? this.dynamicAttrs.aTextFill = 1 : Z = ht([], Z)),
|
|
6391
6391
|
_ && (K = _(this.options.zoom, d), w(K) && (K = 14)), v && (J = v(null, d), ie(J) ? this.dynamicAttrs.aTextHaloFill = 1 : J = ht([], J)),
|
|
6392
6392
|
A && (Q = A(null, d)), T && (ee = 255 * T(null, d)), S && (te = S(null, d) || 0),
|
|
6393
6393
|
I && (ne = I(null, d) || 0), C && (he = +("map" === C(null, d))), O && (ue = +("map" === O(null, d))),
|
|
@@ -6435,7 +6435,7 @@ function W(e) {
|
|
|
6435
6435
|
(ie(le) || ie(he)) && (this.dynamicAttrs.aPitchAlign = 1), (ie(ce) || ie(ue)) && (this.dynamicAttrs.aRotationAlign = 1),
|
|
6436
6436
|
(ie(fe) || ie(de)) && (this.dynamicAttrs.aRotation = 1), (G || R) && (G && (j = G(null, d) || 0),
|
|
6437
6437
|
!j && R && (j = R(null, d) || 0)), (B || F) && (B && (X = B(null, d) || 0), !X && F && (X = F(null, d) || 0)),
|
|
6438
|
-
W && (
|
|
6438
|
+
W && (q = 255 * (W(this.options.zoom, d) || 0));
|
|
6439
6439
|
let pe = 0;
|
|
6440
6440
|
E && (pe = 255 * (E(this.options.zoom, d) || 0));
|
|
6441
6441
|
const ge = $ && $.length || 0;
|
|
@@ -6447,13 +6447,13 @@ function W(e) {
|
|
|
6447
6447
|
const c = t[l], {tl: f, tr: d, bl: g, br: m, tex: x} = c;
|
|
6448
6448
|
let _;
|
|
6449
6449
|
this._fillPos(h, n, i, r, 10 * f.x, 10 * f.y, x.x, x.y + x.h, e, s), this._fillTextData(h, p, a, c.glyphOffset, o, y, o.axis, o.angleR),
|
|
6450
|
-
this._fillFnTypeData(h,
|
|
6450
|
+
this._fillFnTypeData(h, Z, K, J, Q, ee, te, ne, re, oe, se, ae, q, pe, le, he, ce, ue, fe, de, j, X),
|
|
6451
6451
|
this._fillPos(h, n, i, r, 10 * d.x, 10 * d.y, x.x + x.w, x.y + x.h, e, s), this._fillTextData(h, p, a, c.glyphOffset, o, y, o.axis, o.angleR),
|
|
6452
|
-
this._fillFnTypeData(h,
|
|
6452
|
+
this._fillFnTypeData(h, Z, K, J, Q, ee, te, ne, re, oe, se, ae, q, pe, le, he, ce, ue, fe, de, j, X),
|
|
6453
6453
|
this._fillPos(h, n, i, r, 10 * g.x, 10 * g.y, x.x, x.y, e, s), this._fillTextData(h, p, a, c.glyphOffset, o, y, o.axis, o.angleR),
|
|
6454
|
-
this._fillFnTypeData(h,
|
|
6454
|
+
this._fillFnTypeData(h, Z, K, J, Q, ee, te, ne, re, oe, se, ae, q, pe, le, he, ce, ue, fe, de, j, X),
|
|
6455
6455
|
this._fillPos(h, n, i, r, 10 * m.x, 10 * m.y, x.x + x.w, x.y, e, s), this._fillTextData(h, p, a, c.glyphOffset, o, y, o.axis, o.angleR),
|
|
6456
|
-
this._fillFnTypeData(h,
|
|
6456
|
+
this._fillFnTypeData(h, Z, K, J, Q, ee, te, ne, re, oe, se, ae, q, pe, le, he, ce, ue, fe, de, j, X),
|
|
6457
6457
|
this.addElements(u, u + 1, u + 2), this.addElements(u + 1, u + 2, u + 3), u += 4,
|
|
6458
6458
|
_ = Ae ? Math.max(Math.abs(n), Math.abs(i)) : Math.max(Math.abs(n), Math.abs(i), Math.abs(r)),
|
|
6459
6459
|
_ > this.maxPos && (this.maxPos = _);
|
|
@@ -7086,18 +7086,18 @@ function W(e) {
|
|
|
7086
7086
|
function Ys(e, t, n, i) {
|
|
7087
7087
|
return e[0] = t, e[1] = n, e[2] = i, e;
|
|
7088
7088
|
}
|
|
7089
|
-
var
|
|
7089
|
+
var qs = function(e, t, n) {
|
|
7090
7090
|
return e[0] = t[0] - n[0], e[1] = t[1] - n[1], e[2] = t[2] - n[2], e;
|
|
7091
7091
|
};
|
|
7092
7092
|
!function() {
|
|
7093
7093
|
var e = new $s(3);
|
|
7094
7094
|
$s != Float32Array && (e[0] = 0, e[1] = 0, e[2] = 0);
|
|
7095
7095
|
}();
|
|
7096
|
-
const
|
|
7096
|
+
const Zs = [], Ks = [], Js = [], Qs = [], ea = [], ta = [], na = [], ia = [];
|
|
7097
7097
|
function ra(e, t, n, i, r, o) {
|
|
7098
7098
|
Ys(ea, e[3 * t], e[3 * t + 1], e[3 * t + 2]), Ys(ta, e[3 * n], e[3 * n + 1], e[3 * n + 2]),
|
|
7099
7099
|
Ys(na, e[3 * i], e[3 * i + 1], e[3 * i + 2]);
|
|
7100
|
-
const s =
|
|
7100
|
+
const s = qs(Ks, na, ta), a = qs(Js, ea, ta), l = function(e, t, n) {
|
|
7101
7101
|
var i = t[0], r = t[1], o = t[2], s = n[0], a = n[1], l = n[2];
|
|
7102
7102
|
return e[0] = r * l - o * a, e[1] = o * s - i * l, e[2] = i * a - r * s, e;
|
|
7103
7103
|
}(Qs, s, a);
|
|
@@ -7409,7 +7409,7 @@ function W(e) {
|
|
|
7409
7409
|
} ];
|
|
7410
7410
|
class Ua extends zs {
|
|
7411
7411
|
constructor(e, t, n) {
|
|
7412
|
-
(t =
|
|
7412
|
+
(t = Ze({}, t)).lineJoin = "miter", t.lineCap = "butt", super(e, t, n), this.options.radialSegments % 2 == 1 && this.options.radialSegments--;
|
|
7413
7413
|
}
|
|
7414
7414
|
getFormat() {
|
|
7415
7415
|
const {lineWidthFn: e, lineColorFn: t, lineOpacityFn: n, linePatternAnimSpeedFn: i, linePatternGapFn: r} = this._fnTypes, o = [ ...this.getPositionFormat(), {
|
|
@@ -7517,16 +7517,16 @@ function W(e) {
|
|
|
7517
7517
|
return Os(n, i * (Math.cos(r) * e[0] + Math.sin(r) * t[0]), i * (Math.cos(r) * e[1] + Math.sin(r) * t[1]), i * (Math.cos(r) * e[2] + Math.sin(r) * t[2]), o),
|
|
7518
7518
|
n;
|
|
7519
7519
|
}
|
|
7520
|
-
const $a = [], Ya = [],
|
|
7520
|
+
const $a = [], Ya = [], qa = [], Za = [], Ka = [];
|
|
7521
7521
|
function Ja(e, t, n, i, r, o, s, a) {
|
|
7522
|
-
Ms(Ya, n, i, r), Ms(
|
|
7522
|
+
Ms(Ya, n, i, r), Ms(qa, o, s, 0), Cs(Za, Ya, qa), Is(qa, qa), Is(Za, Za), Rs($a, e, t);
|
|
7523
7523
|
const l = function(e) {
|
|
7524
7524
|
var t = e[0], n = e[1];
|
|
7525
7525
|
return Math.hypot(t, n);
|
|
7526
7526
|
}($a) / e, h = Math.atan(t / e);
|
|
7527
7527
|
let c = Math.PI / 2 + (Math.PI / 2 - h);
|
|
7528
|
-
return Ka[0] || (Ka[0] = []), Xa(
|
|
7529
|
-
Xa(
|
|
7528
|
+
return Ka[0] || (Ka[0] = []), Xa(qa, Za, Ka[0], l, c, a ? 1 : -1), c += 2 * h, Ka[1] || (Ka[1] = []),
|
|
7529
|
+
Xa(qa, Za, Ka[1], l, c, a ? 1 : -1), Ka;
|
|
7530
7530
|
}
|
|
7531
7531
|
class Qa {
|
|
7532
7532
|
constructor(e) {
|
|
@@ -7626,7 +7626,7 @@ function W(e) {
|
|
|
7626
7626
|
return {
|
|
7627
7627
|
charCode: e.charCode,
|
|
7628
7628
|
bitmap: t,
|
|
7629
|
-
metrics:
|
|
7629
|
+
metrics: Ze({}, e.metrics)
|
|
7630
7630
|
};
|
|
7631
7631
|
}
|
|
7632
7632
|
var sl = Object.freeze({
|
|
@@ -7634,7 +7634,7 @@ function W(e) {
|
|
|
7634
7634
|
calculateSignedArea: A,
|
|
7635
7635
|
clipPolygon: Ha,
|
|
7636
7636
|
convertGeometry: N,
|
|
7637
|
-
convertRTLText:
|
|
7637
|
+
convertRTLText: Zo,
|
|
7638
7638
|
generatePickingIndiceIndex: I,
|
|
7639
7639
|
getFeaAltitudeAndHeight: b,
|
|
7640
7640
|
getIndexArrayType: E,
|
|
@@ -7997,7 +7997,7 @@ function W(e) {
|
|
|
7997
7997
|
const {aExtrudedPosition: o, aPosition: s, aLinesofar: a, aUp: l, aExtrude: h, aColor: c, aLineHeight: u, aLineWidth: f} = i, d = {}, p = function(e, t, n) {
|
|
7998
7998
|
const i = [];
|
|
7999
7999
|
i.setLength && i.setLength(e.length);
|
|
8000
|
-
const r =
|
|
8000
|
+
const r = Zs;
|
|
8001
8001
|
r.length < e.length / 3 && (r.length = e.length / 3), r.fill(0, 0, e.length / 3);
|
|
8002
8002
|
const o = void 0 === t.length ? t : t.length;
|
|
8003
8003
|
for (let n = 0; n < o / 3; n++) void 0 === t.length ? ra(e, 3 * n, 3 * n + 1, 3 * n + 2, i, r) : ra(e, t[3 * n], t[3 * n + 1], t[3 * n + 2], i, r);
|
|
@@ -8281,7 +8281,7 @@ function j() {
|
|
|
8281
8281
|
}
|
|
8282
8282
|
|
|
8283
8283
|
var X = {
|
|
8284
|
-
vert: "\nstruct VTPUniforms {\n minAltitude: f32,\n};\n\n@group(0) @binding($b) var<uniform> vtUniforms: VTPUniforms;\n\n#ifdef HAS_ALTITUDE\n fn
|
|
8284
|
+
vert: "\nstruct VTPUniforms {\n minAltitude: f32,\n};\n\n@group(0) @binding($b) var<uniform> vtUniforms: VTPUniforms;\n\n#ifdef HAS_ALTITUDE\n fn unpackVTPositionOffset(vertexInput: VertexInput, offset: vec3f) -> vec3f {\n var altitude: f32 = vertexInput.aAltitude;\n #ifdef HAS_TERRAIN_ALTITUDE\n // aTerrainAltitude的单位是米,在vt中需要转换为厘米\n altitude += vertexInput.aTerrainAltitude * 100.0;\n #endif\n altitude += vtUniforms.minAltitude * 100.0;\n return vec3f(vec2f(vertexInput.aPosition.xy) + offset.xy, altitude + offset.z);\n }\n#else\n // 16384 is pow(2.0, 14.0)\n const position_modValue: f32 = 16384.0;\n const position_delta: f32 = 0.00001;\n\n fn unpackVTPositionOffset(vertexInput: VertexInput, offset:vec3f) -> vec3f {\n let aPosition: vec3f = vec3f(vertexInput.aPosition.xyz);\n let z: f32 = aPosition.z;\n let pos: vec2f = sign(aPosition.xy + position_delta) * (abs(aPosition.xy) % position_modValue);\n let highs: vec2f = floor(abs(aPosition.xy) / position_modValue);\n\n var altitude: f32 = sign(z + position_delta) * (highs.x * 2.0 + highs.y) * pow(2.0, 15.0) + z;\n #ifdef HAS_TERRAIN_ALTITUDE\n // aTerrainAltitude的单位是米,在vt中需要转换为厘米\n altitude += vertexInput.aTerrainAltitude * 100.0;\n #endif\n altitude += vtUniforms.minAltitude * 100.0;\n return vec3f(pos + offset.xy, altitude + offset.z);\n }\n#endif\n\n fn unpackVTPosition(vertexInput: VertexInput) -> vec3f {\n return unpackVTPositionOffset(vertexInput, vec3f(0));\n }\n",
|
|
8285
8285
|
attributes: [ {
|
|
8286
8286
|
defines: [ "HAS_TERRAIN_ALTITUDE" ],
|
|
8287
8287
|
name: "aTerrainAltitude",
|
|
@@ -8290,19 +8290,19 @@ var X = {
|
|
|
8290
8290
|
};
|
|
8291
8291
|
|
|
8292
8292
|
var $ = {
|
|
8293
|
-
frag: "\n#define
|
|
8293
|
+
frag: "\n#define SDF_PX 8.0\n#define DEVICE_PIXEL_RATIO 1.0\n// 0.105 / DEVICE_PIXEL_RATIO\n#define EDGE_GAMMA 0.105 / 1.0\n\nstruct TextRenderShaderUniforms {\n gammaScale: f32\n}\n\nstruct TextRenderUniforms {\n textOpacity: f32,\n isHalo: f32,\n textHaloBlur: f32,\n #ifndef HAS_TEXT_HALO_OPACITY\n textHaloOpacity: f32,\n #endif\n #ifndef HAS_TEXT_HALO_RADIUS\n textHaloRadius: f32,\n #endif\n #ifndef HAS_TEXT_FILL\n textFill: vec4f,\n #endif\n #ifndef HAS_TEXT_HALO_FILL\n textHaloFill: vec4f,\n #endif\n};\n\n@group(0) @binding($b) var<uniform> textRenderUniforms: TextRenderUniforms;\n@group(0) @binding($b) var<uniform> textRenderShaderUniforms: TextRenderShaderUniforms;\n@group(0) @binding($b) var glyphTex: texture_2d<f32>;\n@group(0) @binding($b) var glyphTexSampler: sampler;\n\n\nfn renderText(input: VertexOutput) -> vec4f {\n #ifdef HAS_TEXT_FILL\n var myTextFill = input.vTextFill;\n #else\n var myTextFill = textRenderUniforms.textFill;\n #endif\n let gammaScale = textRenderShaderUniforms.gammaScale;\n let fontScale = input.vTextSize / 24.0;\n var color = myTextFill;\n var gamma = EDGE_GAMMA / (fontScale * gammaScale);\n var buff = 185.0 / 256.0; // (256.0 - 64.0) / 256.0\n\n var isHaloText: bool;\n #ifdef HAS_HALO_ATTR\n // text halo in icon\n isHaloText = input.vHalo > 0.5;\n #else\n isHaloText = textRenderUniforms.isHalo == 1.0;\n #endif\n\n if (isHaloText) {\n #ifdef HAS_TEXT_HALO_FILL\n var haloFill = input.vTextHaloFill;\n #else\n var haloFill = textRenderUniforms.textHaloFill;\n #endif\n\n #ifdef HAS_TEXT_HALO_RADIUS\n let haloRadius = input.vTextHalo.x;\n #else\n let haloRadius = textRenderUniforms.textHaloRadius;\n #endif\n\n if (haloRadius == 0.0) {\n discard;\n }\n\n color = haloFill;\n gamma = (textRenderUniforms.textHaloBlur * 1.19 / SDF_PX + EDGE_GAMMA) / (fontScale * gammaScale);\n buff = (6.0 - haloRadius / fontScale) / SDF_PX;\n\n #ifdef HAS_TEXT_HALO_OPACITY\n let haloOpacity = input.vTextHalo.y / 255.0;\n #else\n let haloOpacity = textRenderUniforms.textHaloOpacity;\n #endif\n\n color *= haloOpacity * 1.25;\n }\n\n let dist = textureSampleLevel(glyphTex, glyphTexSampler, input.vTexCoord, 0.0).r;\n let gammaScaled = gamma * input.vGammaScale * 0.7;\n\n let alpha = clamp(smoothstep(buff - gammaScaled, buff + gammaScaled, dist), 0.0, 1.0);\n return color * (alpha * textRenderUniforms.textOpacity);\n}\n"
|
|
8294
8294
|
};
|
|
8295
8295
|
|
|
8296
8296
|
let Y = 0;
|
|
8297
8297
|
|
|
8298
|
-
function
|
|
8298
|
+
function q() {
|
|
8299
8299
|
return Y++;
|
|
8300
8300
|
}
|
|
8301
8301
|
|
|
8302
|
-
const
|
|
8302
|
+
const Z = "function" == typeof Object.assign;
|
|
8303
8303
|
|
|
8304
8304
|
function K(e, ...t) {
|
|
8305
|
-
if (
|
|
8305
|
+
if (Z) return Object.assign(e, ...t), e;
|
|
8306
8306
|
for (let n = 0; n < t.length; n++) {
|
|
8307
8307
|
const i = t[n];
|
|
8308
8308
|
for (const t in i) e[t] = i[t];
|
|
@@ -8393,7 +8393,7 @@ function he(e, t, n) {
|
|
|
8393
8393
|
|
|
8394
8394
|
const ce = "function" == typeof fetch && "function" == typeof AbortController, ue = {
|
|
8395
8395
|
jsonp: function(e, t) {
|
|
8396
|
-
const n = "_maptalks_jsonp_" +
|
|
8396
|
+
const n = "_maptalks_jsonp_" + q();
|
|
8397
8397
|
e.match(/\?/) ? e += "&callback=" + n : e += "?callback=" + n;
|
|
8398
8398
|
let i = document.createElement("script");
|
|
8399
8399
|
return i.type = "text/javascript", i.src = e, window[n] = function(e) {
|
|
@@ -8689,7 +8689,7 @@ class ye extends e.worker.Actor {
|
|
|
8689
8689
|
constructor(e, t) {
|
|
8690
8690
|
super(e);
|
|
8691
8691
|
const n = t.getMap().id;
|
|
8692
|
-
this._layer = t, this._mapId = n, this._workerLayerId = "vt_" +
|
|
8692
|
+
this._layer = t, this._mapId = n, this._workerLayerId = "vt_" + q();
|
|
8693
8693
|
const i = t.getJSONType();
|
|
8694
8694
|
this._isDedicated = me.indexOf(i) >= 0, this._dedicatedVTWorkers = {}, this._iconRequestor = new de({
|
|
8695
8695
|
iconErrorUrl: t.options.iconErrorUrl,
|
|
@@ -9144,11 +9144,11 @@ function Ye(e, t, n, i) {
|
|
|
9144
9144
|
if (e.fill) e.fill(t, n, i); else for (let r = n; r < i; r++) e[r] = t;
|
|
9145
9145
|
}
|
|
9146
9146
|
|
|
9147
|
-
function
|
|
9147
|
+
function qe(e) {
|
|
9148
9148
|
return "number" == typeof e && !isNaN(e);
|
|
9149
9149
|
}
|
|
9150
9150
|
|
|
9151
|
-
function
|
|
9151
|
+
function Ze(e) {
|
|
9152
9152
|
return e && (e.markerFile || e.markerType) && void 0 !== e.textName;
|
|
9153
9153
|
}
|
|
9154
9154
|
|
|
@@ -9851,8 +9851,8 @@ class ct extends(m(tt(nt))){
|
|
|
9851
9851
|
if (!this.layer.isDefaultRender() && !i.length && !r.length) return;
|
|
9852
9852
|
this.isRenderingTerrainSkin = !0;
|
|
9853
9853
|
const o = this._currentTimestamp, s = this._parentContext, a = this.layer.getTileSize().width;
|
|
9854
|
-
this._startFrame(o);
|
|
9855
9854
|
for (let t = 0; t < n.length; t++) {
|
|
9855
|
+
this._startFrame(o);
|
|
9856
9856
|
const i = n[t], r = i.texture;
|
|
9857
9857
|
this._parentContext = {
|
|
9858
9858
|
terrainMaskFBO: i.terrainMaskFBO,
|
|
@@ -9860,9 +9860,9 @@ class ct extends(m(tt(nt))){
|
|
|
9860
9860
|
fbo: r
|
|
9861
9861
|
}
|
|
9862
9862
|
}, at.framebuffer = r, e.clear(at), this._parentContext.maskViewport = gt(i.terrainMaskFBO.width / 2),
|
|
9863
|
-
this._parentContext.viewport = gt(a), this._drawTerrainTile(i.tile);
|
|
9863
|
+
this._parentContext.viewport = gt(a), this._drawTerrainTile(i.tile), this._endTerrainFrame(i);
|
|
9864
9864
|
}
|
|
9865
|
-
this.
|
|
9865
|
+
this._parentContext = s, this.isRenderingTerrainSkin = !1;
|
|
9866
9866
|
}
|
|
9867
9867
|
_drawTerrainTile(e) {
|
|
9868
9868
|
const {info: t, image: n} = e;
|
|
@@ -9882,15 +9882,13 @@ class ct extends(m(tt(nt))){
|
|
|
9882
9882
|
t.isRenderingTerrainSkin = !0, e.prepareRender(t);
|
|
9883
9883
|
})), t.forEach(((t, n) => {
|
|
9884
9884
|
if (!this._isVisitable(t) || !lt(t)) return;
|
|
9885
|
-
|
|
9886
|
-
|
|
9887
|
-
|
|
9888
|
-
|
|
9889
|
-
|
|
9890
|
-
|
|
9891
|
-
|
|
9892
|
-
const i = this._pluginOffsets[n] || 0, r = this._getPluginContext(t, i, [ 0, 0, 0 ], this._currentTimestamp);
|
|
9893
|
-
r.isRenderingTerrainSkin = !0, t.endFrame(r);
|
|
9885
|
+
const i = e.texture;
|
|
9886
|
+
this.device.clear({
|
|
9887
|
+
stencil: 255,
|
|
9888
|
+
framebuffer: i
|
|
9889
|
+
});
|
|
9890
|
+
const r = this._pluginOffsets[n] || 0, o = this._getPluginContext(t, r, [ 0, 0, 0 ], this._currentTimestamp);
|
|
9891
|
+
o.isRenderingTerrainSkin = !0, t.endFrame(o);
|
|
9894
9892
|
}));
|
|
9895
9893
|
}
|
|
9896
9894
|
drawTile(e, t, n) {
|
|
@@ -9919,6 +9917,7 @@ class ct extends(m(tt(nt))){
|
|
|
9919
9917
|
isRenderingTerrainSkin: null,
|
|
9920
9918
|
renderTarget: null
|
|
9921
9919
|
};
|
|
9920
|
+
i && c && c.terrainMaskFBO && c.terrainMaskFBO.clearTerrainMask();
|
|
9922
9921
|
for (let t = 0, o = f.length; t < o; t++) {
|
|
9923
9922
|
const o = f[t], s = t;
|
|
9924
9923
|
if (!o || n && !n(o)) continue;
|
|
@@ -9937,11 +9936,9 @@ class ct extends(m(tt(nt))){
|
|
|
9937
9936
|
}
|
|
9938
9937
|
if (this.drawingParentTiles && !o.painter.shouldDrawParentTile()) continue;
|
|
9939
9938
|
const l = i && lt(o);
|
|
9940
|
-
g.
|
|
9941
|
-
g.
|
|
9942
|
-
|
|
9943
|
-
g.tileTransform = l ? h : a, g.isRenderingTerrainSkin = l, l && c && c.renderTarget && (g.renderTarget = c.renderTarget,
|
|
9944
|
-
o.isTerrainMask() && (g.renderTarget = {
|
|
9939
|
+
g.renderTarget = null, g.sceneConfig = o.config.sceneConfig, g.pluginIndex = s,
|
|
9940
|
+
g.tileCache = r[s], g.tileData = u[s], g.tileTransform = l ? h : a, g.isRenderingTerrainSkin = l,
|
|
9941
|
+
l && c && c.renderTarget && (g.renderTarget = c.renderTarget, o.isTerrainMask() && (g.renderTarget = {
|
|
9945
9942
|
fbo: c.terrainMaskFBO
|
|
9946
9943
|
}));
|
|
9947
9944
|
const d = o.paintTile(g);
|
|
@@ -10423,8 +10420,7 @@ class St extends e.TileLayer {
|
|
|
10423
10420
|
return fetch(e, t || {}).then((e => e.json())).then((e => St.fromJSON(e)));
|
|
10424
10421
|
}
|
|
10425
10422
|
constructor(e, t) {
|
|
10426
|
-
super(e, t), this.isVectorTileLayer = !0, this.
|
|
10427
|
-
this.VERSION = St.VERSION;
|
|
10423
|
+
super(e, t), this.isVectorTileLayer = !0, this._schema = {}, this.VERSION = St.VERSION;
|
|
10428
10424
|
const n = t && t.style;
|
|
10429
10425
|
this.setStyle(n);
|
|
10430
10426
|
}
|
|
@@ -10485,7 +10481,7 @@ class St extends e.TileLayer {
|
|
|
10485
10481
|
if (!e.spatialReference) {
|
|
10486
10482
|
512 === this.getTileSize().width && (i ? e.spatialReference = "preset-vt-3857" : n && (e.spatialReference = "preset-vt-4326"));
|
|
10487
10483
|
}
|
|
10488
|
-
e.tileSystem ||
|
|
10484
|
+
e.tileSystem || e.tms || n && (e.tileSystem = [ 1, -1, -180, 90 ]), super._prepareOptions();
|
|
10489
10485
|
}
|
|
10490
10486
|
forceReload() {
|
|
10491
10487
|
const e = this.getRenderer();
|
|
@@ -11055,6 +11051,7 @@ St.prototype._getTileZoom = function(t) {
|
|
|
11055
11051
|
forceRenderOnMoving: !0,
|
|
11056
11052
|
forceRenderOnRotating: !0,
|
|
11057
11053
|
tileSize: [ 512, 512 ],
|
|
11054
|
+
features: !0,
|
|
11058
11055
|
schema: !1,
|
|
11059
11056
|
cascadeTiles: !0,
|
|
11060
11057
|
collision: !0,
|
|
@@ -11387,8 +11384,8 @@ function Ht(e, t) {
|
|
|
11387
11384
|
},
|
|
11388
11385
|
_fillCommonProps: function(e, t) {
|
|
11389
11386
|
const {layer: n, tileInfo: i} = t, r = n.getMap(), o = (n.getSpatialReference ? n.getSpatialReference() : r.getSpatialReference()).getResolution(i.z), s = t.tileExtent / n.getTileSize().width;
|
|
11390
|
-
e.properties.
|
|
11391
|
-
e.properties.tileExtent = t.tileExtent;
|
|
11387
|
+
e.properties.tile = i, e.properties.tileResolution = o, e.properties.tileRatio = s,
|
|
11388
|
+
e.properties.z = i.z, e.properties.tileExtent = t.tileExtent;
|
|
11392
11389
|
},
|
|
11393
11390
|
updateSceneConfig: function(e) {
|
|
11394
11391
|
const t = this.painter;
|
|
@@ -11632,7 +11629,7 @@ function Wt(e, t, n, i, r, o) {
|
|
|
11632
11629
|
|
|
11633
11630
|
function jt(e, t, n) {
|
|
11634
11631
|
const i = t[n.symbolName], r = e[zt];
|
|
11635
|
-
return !w(i, r[n.symbolName]) && (r[n.symbolName] = i, !0);
|
|
11632
|
+
return !!r && (!w(i, r[n.symbolName]) && (r[n.symbolName] = i, !0));
|
|
11636
11633
|
}
|
|
11637
11634
|
|
|
11638
11635
|
function Xt(e, t, n) {
|
|
@@ -11652,7 +11649,7 @@ function Yt(e, t, n, i) {
|
|
|
11652
11649
|
for (let n = 0; n < f; n += 2) {
|
|
11653
11650
|
const r = t[n], a = t[n + 1];
|
|
11654
11651
|
let f = h[l[r]];
|
|
11655
|
-
f && f.feature &&
|
|
11652
|
+
f && f.feature && Zt(c, f, o, r, a, u, s, e, i);
|
|
11656
11653
|
}
|
|
11657
11654
|
} else {
|
|
11658
11655
|
if (c = e.data[r], function(e) {
|
|
@@ -11667,20 +11664,20 @@ function Yt(e, t, n, i) {
|
|
|
11667
11664
|
for (let n = 0; n < a; n++) {
|
|
11668
11665
|
if (l[n] === l[u] && n < a - 1) continue;
|
|
11669
11666
|
let r = h[l[u]];
|
|
11670
|
-
r && r.feature && (
|
|
11667
|
+
r && r.feature && (Zt(c, r, o, u, n === a - 1 ? a : n, t, s, e, i), u = n);
|
|
11671
11668
|
}
|
|
11672
11669
|
}
|
|
11673
11670
|
c.dirty && (e.updateData(r, c), c.dirty = !1);
|
|
11674
11671
|
}
|
|
11675
11672
|
|
|
11676
|
-
const
|
|
11673
|
+
const qt = {};
|
|
11677
11674
|
|
|
11678
|
-
function
|
|
11675
|
+
function Zt(e, t, n, i, r, o, s, a, l) {
|
|
11679
11676
|
const h = (t = t.feature).properties || {};
|
|
11680
11677
|
if (void 0 === h.$layer && (t.properties || (t.properties = h), h.$layer = t.layer,
|
|
11681
|
-
h.$type = t.type), l.getFeatureState && (
|
|
11678
|
+
h.$type = t.type), l.getFeatureState && (qt.layer = t.layer, qt.id = t.id, t[Ee] && (t[Ee] = null),
|
|
11682
11679
|
!Ue(t.id))) {
|
|
11683
|
-
const e = l.getFeatureState(
|
|
11680
|
+
const e = l.getFeatureState(qt);
|
|
11684
11681
|
t.properties[Ee] = e;
|
|
11685
11682
|
}
|
|
11686
11683
|
const c = n(h, a, e, i * o);
|
|
@@ -11893,7 +11890,7 @@ class Mn {
|
|
|
11893
11890
|
}
|
|
11894
11891
|
isVisible() {
|
|
11895
11892
|
const {minZoom: t, maxZoom: n} = this.sceneConfig || {};
|
|
11896
|
-
if (
|
|
11893
|
+
if (qe(t) || qe(n)) {
|
|
11897
11894
|
const i = this.getMap(), r = e.MapStateCache[i.id], o = r ? r.zoom : i.getZoom();
|
|
11898
11895
|
if (!Ue(t) && o < t) return !1;
|
|
11899
11896
|
if (!Ue(n) && o > n) return !1;
|
|
@@ -12717,7 +12714,7 @@ const {INVALID_TEX_COORD: Xn} = j(), $n = g.identity([]), Yn = {
|
|
|
12717
12714
|
uvOffset: [ 0, 0 ],
|
|
12718
12715
|
patternWidth: [ 0, 0 ],
|
|
12719
12716
|
patternOffset: [ 0, 0 ]
|
|
12720
|
-
},
|
|
12717
|
+
}, qn = [], Zn = new e.Coordinate(0, 0), Kn = new e.Coordinate(0, 0), Jn = new e.Coordinate(0, 0), Qn = [];
|
|
12721
12718
|
|
|
12722
12719
|
class ei extends On {
|
|
12723
12720
|
static getBloomSymbol() {
|
|
@@ -12737,11 +12734,11 @@ class ei extends On {
|
|
|
12737
12734
|
return !0;
|
|
12738
12735
|
}
|
|
12739
12736
|
getAnalysisMeshes() {
|
|
12740
|
-
if (!this.isVisible()) return
|
|
12737
|
+
if (!this.isVisible()) return qn;
|
|
12741
12738
|
return this.scene.getMeshes().filter((e => 0 === e.properties.level));
|
|
12742
12739
|
}
|
|
12743
12740
|
createMesh(t, n, i) {
|
|
12744
|
-
const r = this.getMap(), {tilePoint: o} = i, {geometry: s, symbolIndex: a, ref: l} = t, h = this.layer instanceof e.TileLayer, c = this.layer.getTileSize().width, u = s.properties.tileExtent / c, f = s.properties.tileResolution, p = r.pointAtResToCoord(
|
|
12741
|
+
const r = this.getMap(), {tilePoint: o} = i, {geometry: s, symbolIndex: a, ref: l} = t, h = this.layer instanceof e.TileLayer, c = this.layer.getTileSize().width, u = s.properties.tileExtent / c, f = s.properties.tileResolution, p = r.pointAtResToCoord(Zn.set(o[0], o[1]), f), g = {
|
|
12745
12742
|
tileExtent: s.properties.tileExtent,
|
|
12746
12743
|
tileRatio: u
|
|
12747
12744
|
}, m = this.getSymbol(a), y = this.getSymbolDef(a);
|
|
@@ -12762,7 +12759,7 @@ class ei extends On {
|
|
|
12762
12759
|
const t = g.tileScale;
|
|
12763
12760
|
if (s.data.aPatternOrigin) return e[0] = o[0] * t % _, e[1] = o[1] * t % _, e;
|
|
12764
12761
|
const n = m.polygonPatternFileOrigin;
|
|
12765
|
-
return n ? (
|
|
12762
|
+
return n ? (Zn.set(n[0], n[1]), r.coordToPointAtRes(Zn, f, Kn), v.set(e, o[0] - Kn.x, o[1] - Kn.y)) : (e[0] = o[0] * t % _,
|
|
12766
12763
|
e[1] = o[1] * t % _, e);
|
|
12767
12764
|
}
|
|
12768
12765
|
});
|
|
@@ -12881,7 +12878,7 @@ class ei extends On {
|
|
|
12881
12878
|
}
|
|
12882
12879
|
c = a[e];
|
|
12883
12880
|
const t = s(null, r[c].feature.properties);
|
|
12884
|
-
t ? (
|
|
12881
|
+
t ? (Zn.set(t[0], t[1]), o.coordToPointAtRes(Zn, i, Kn), u = h[2 * e] = Kn.x, f = h[2 * e + 1] = Kn.y) : (u = h[2 * e] = n[0],
|
|
12885
12882
|
f = h[2 * e + 1] = n[1]);
|
|
12886
12883
|
}
|
|
12887
12884
|
t.data.aPatternOrigin = h;
|
|
@@ -12978,7 +12975,7 @@ class ei extends On {
|
|
|
12978
12975
|
if (t.hasSSRGround) return !0;
|
|
12979
12976
|
if (t.meshConfig.transparent) return !1;
|
|
12980
12977
|
const n = t.polygonOpacity;
|
|
12981
|
-
return !(
|
|
12978
|
+
return !(qe(n) && n < 1);
|
|
12982
12979
|
},
|
|
12983
12980
|
func: this.sceneConfig.depthFunc || "<="
|
|
12984
12981
|
},
|
|
@@ -13028,7 +13025,7 @@ class ei extends On {
|
|
|
13028
13025
|
name: "vt-fill",
|
|
13029
13026
|
vert: "#define SHADER_NAME FILL\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\n#ifdef HAS_COLOR\nattribute vec4 aColor;\nvarying vec4 vColor;\n#endif\n#ifdef HAS_OPACITY\nattribute float aOpacity;\nvarying float vOpacity;\n#endif\nuniform mat4 projViewModelMatrix;\nuniform mat4 positionMatrix;\n#ifndef IS_VT\nuniform mat4 modelMatrix;\n#endif\n#ifdef HAS_PATTERN\n#ifdef HAS_TEX_COORD\nattribute vec2 aTexCoord;\n#endif\nattribute vec4 aTexInfo;\nuniform vec2 patternWidth;\nuniform vec2 patternOffset;\nuniform vec2 uvOrigin;\nuniform vec2 uvScale;\n#ifdef IS_VT\nuniform float tileRatio;\nuniform float tileScale;\n#else\nuniform float glScale;\n#endif\n#ifdef HAS_UV_SCALE\nattribute vec2 aUVScale;\nvarying vec2 vUVScale;\n#endif\n#ifdef HAS_UV_OFFSET\nattribute vec2 aUVOffset;\nvarying vec2 vUVOffset;\n#endif\n#ifdef HAS_PATTERN_WIDTH\nattribute vec2 aPatternWidth;\n#endif\n#ifdef HAS_PATTERN_ORIGIN\nattribute vec2 aPatternOrigin;\n#endif\n#ifdef HAS_PATTERN_OFFSET\nattribute vec2 aPatternOffset;\n#endif\nvarying vec2 vTexCoord;\nvarying vec4 vTexInfo;\nvec2 c(vec2 d, vec2 e) {\n \n#ifdef IS_VT\nfloat f = d.x / e.x;\n float h = d.y / e.y;\n return vec2(f, h);\n#else\nfloat i = glScale;\n#ifdef HAS_PATTERN_WIDTH\nfloat j = sign(length(aPatternWidth));\n i = mix(glScale, 1., j);\n#endif\nvec2 k = uvOrigin;\n#ifdef HAS_PATTERN_ORIGIN\nk = aPatternOrigin;\n#endif\n#ifdef HAS_PATTERN_OFFSET\nvec2 l = aPatternOffset;\n#else\nvec2 l = patternOffset;\n#endif\nk += l;\n float f = (d.x - k.x) * i / e.x;\n float h = (d.y - k.y) * i / e.y;\n return vec2(f, -h);\n#endif\n}\nvec2 m(vec4 n, vec2 o) {\n \n#ifdef IS_VT\n#ifdef HAS_PATTERN_OFFSET\nvec2 l = aPatternOffset;\n#else\nvec2 l = patternOffset;\n#endif\nvec2 k = uvOrigin + l;\n#ifdef HAS_PATTERN_ORIGIN\nk = k - aPatternOrigin * tileScale;\n#endif\nfloat j = sign(length(patternWidth));\n vec2 A = mix(o, patternWidth, j);\n#ifdef HAS_PATTERN_WIDTH\nA = aPatternWidth;\n#endif\nvec2 B = k * vec2(1., -1.) / A;\n return mod(B, 1.) + c(n.xy * tileScale / tileRatio, A);\n#else\nvec2 A = o;\n#ifdef HAS_PATTERN_WIDTH\nfloat j = sign(length(aPatternWidth));\n A = mix(o, aPatternWidth, j);\n#endif\nvec4 C = modelMatrix * n;\n return c(C.xy, A);\n#endif\n}\n#endif\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\n#include <vsm_shadow_vert>\n#endif\n#include <vt_position_vert>\n#include <highlight_vert>\nvoid main() {\n vec3 D = unpackVTPosition();\n vec4 n = vec4(D, 1.);\n gl_Position = projViewModelMatrix * positionMatrix * n;\n#ifdef HAS_PATTERN\nvec2 o = aTexInfo.zw + 1.;\n vTexInfo = vec4(aTexInfo.xy, o);\n#ifdef HAS_TEX_COORD\nif(aTexCoord.x == INVALID_TEX_COORD) {\n vTexCoord = m(n, o);\n } else {\n vTexCoord = aTexCoord;\n }\n#else\nvTexCoord = m(n, o);\n#endif\n#ifdef HAS_UV_SCALE\nvUVScale = aUVScale / 255.;\n#endif\n#ifdef HAS_UV_OFFSET\nvUVOffset = aUVOffset / 255.;\n#endif\n#endif\n#ifdef HAS_COLOR\nvColor = aColor / 255.;\n#endif\nhighlight_setVarying();\n#ifdef HAS_OPACITY\nvOpacity = aOpacity / 255.;\n#endif\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\nshadow_computeShadowPars(n);\n#endif\n}",
|
|
13030
13027
|
frag: "#define SHADER_NAME FILL\nprecision mediump float;\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\n#include <vsm_shadow_frag>\n#endif\n#ifdef HAS_PATTERN\n#ifdef HAS_UV_SCALE\nvarying vec2 vUVScale;\n#else\nuniform highp vec2 uvScale;\n#endif\n#ifdef HAS_UV_OFFSET\nvarying vec2 vUVOffset;\n#else\nuniform vec2 uvOffset;\n#endif\n#endif\n#ifdef HAS_PATTERN\nuniform sampler2D polygonPatternFile;\nuniform vec2 atlasSize;\nvarying vec2 vTexCoord;\nvarying vec4 vTexInfo;\nvec2 c() {\n \n#ifdef HAS_UV_SCALE\nvec2 d = vUVScale;\n#else\nvec2 d = uvScale;\n#endif\n#ifdef HAS_UV_OFFSET\nvec2 e = vUVOffset;\n#else\nvec2 e = uvOffset;\n#endif\nvec2 f = mod(vTexCoord * d + e, 1.);\n vec2 h = vTexInfo.xy;\n vec2 i = vTexInfo.zw;\n return (h + f * i) / atlasSize;\n}\n#endif\n#ifdef HAS_COLOR\nvarying vec4 vColor;\n#else\nuniform vec4 polygonFill;\n#endif\n#include <highlight_frag>\n#ifdef HAS_OPACITY\nvarying float vOpacity;\n#else\nuniform lowp float polygonOpacity;\n#endif\nuniform float layerOpacity;\nuniform float tileExtent;\nvoid main() {\n \n#ifdef HAS_COLOR\nvec4 j = vColor;\n#else\nvec4 j = polygonFill;\n#endif\n#ifdef HAS_PATTERN\nif(vTexInfo.z * vTexInfo.w > 1.) {\n vec2 f = c();\n j = texture2D(polygonPatternFile, f);\n }\n#endif\n#ifdef HAS_OPACITY\ngl_FragColor = j * vOpacity;\n#else\ngl_FragColor = j * polygonOpacity;\n#endif\ngl_FragColor *= layerOpacity;\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\nfloat k = shadow_computeShadow();\n gl_FragColor.rgb = shadow_blend(gl_FragColor.rgb, k);\n#endif\ngl_FragColor = highlight_blendColor(gl_FragColor);\n}",
|
|
13031
|
-
wgslVert: "#define SHADER_NAME FILL\nstruct VertexInput {\n#ifdef HAS_ALTITUDE\n @location($i) aPosition: POSITION_TYPE_2,\n @location($i) aAltitude: f32,\n#else\n @location($i) aPosition: POSITION_TYPE_3,\n#endif\n#ifdef HAS_COLOR\n @location($i) aColor: vec4u,\n#endif\n#ifdef HAS_OPACITY\n @location($i) aOpacity: u32,\n#endif\n#ifdef HAS_PATTERN\n #ifdef HAS_TEX_COORD\n @location($i) aTexCoord: vec2f,\n #endif\n @location($i) aTexInfo: vec4u,\n #ifdef HAS_UV_SCALE\n @location($i) aUVScale: vec2u,\n #endif\n #ifdef HAS_UV_OFFSET\n @location($i) aUVOffset: vec2u,\n #endif\n #ifdef HAS_PATTERN_WIDTH\n @location($i) aPatternWidth: vec2f,\n #endif\n #ifdef HAS_PATTERN_ORIGIN\n @location($i) aPatternOrigin: vec2f,\n #endif\n #ifdef HAS_PATTERN_OFFSET\n @location($i) aPatternOffset: vec2f,\n #endif\n#endif\n}\nstruct VertexOutput {\n @builtin(position) position : vec4f,\n#ifdef HAS_COLOR\n @location($o) vColor: vec4f,\n#endif\n#ifdef HAS_OPACITY\n @location($o) vOpacity: f32,\n#endif\n#ifdef HAS_PATTERN\n @location($o) vTexCoord: vec2f,\n @location($o) vTexInfo: vec4f,\n #ifdef HAS_UV_SCALE\n @location($o) vUVScale: vec2f,\n #endif\n #ifdef HAS_UV_OFFSET\n @location($o) vUVOffset: vec2f,\n #endif\n#endif\n}\nstruct ModelUniforms {\n projViewModelMatrix: mat4x4f,\n positionMatrix: mat4x4f,\n#ifdef IS_VT\n#else\n modelMatrix: mat4x4f,\n#endif\n#ifdef HAS_PATTERN\n patternWidth: vec2f,\n patternOffset: vec2f,\n uvOrigin: vec2f,\n uvScale: vec2f,\n#ifdef IS_VT\n tileRatio: f32,\n tileScale: f32,\n#endif\n#endif\n};\n#ifdef HAS_PATTERN && IS_VT\n#else\nstruct Uniforms {\n glScale: f32,\n}\n#endif\n@group(0) @binding($b) var<uniform> uniforms: ModelUniforms;\n#ifdef HAS_PATTERN && IS_VT\n#else\n@group(0) @binding($b) var<uniform> shaderUniforms: Uniforms;\n#endif\n#ifdef HAS_PATTERN\n fn computeUV(input: VertexInput, vertex: vec2f, patternWidth: vec2f) -> vec2f {\n #ifdef IS_VT\n let u = vertex.x / patternWidth.x;\n let v = vertex.y / patternWidth.y;\n return vec2f(u, v);\n #else\n let glScale = shaderUniforms.glScale;\n var mapGLScale = glScale;\n #ifdef HAS_PATTERN_WIDTH\n let hasPatternWidth = sign(length(vec2f(input.aPatternWidth)));\n mapGLScale = mix(glScale, 1.0, hasPatternWidth);\n #endif\n var origin = uniforms.uvOrigin;\n #ifdef HAS_PATTERN_ORIGIN\n origin = vec2f(input.aPatternOrigin);\n #endif\n #ifdef HAS_PATTERN_OFFSET\n let myPatternOffset = vec2f(input.aPatternOffset);\n #else\n let myPatternOffset = uniforms.patternOffset;\n #endif\n origin += myPatternOffset;\n let u = (vertex.x - origin.x) * mapGLScale / patternWidth.x;\n let v = (vertex.y - origin.y) * mapGLScale / patternWidth.y;\n return vec2f(u, -v);\n #endif\n }\n fn computeTexCoord(input:VertexInput, localVertex: vec4f, patternSize: vec2f) -> vec2f {\n #ifdef HAS_PATTERN_WIDTH\n let aPatternWidth = vec2f(input.aPatternWidth);\n #endif\n #ifdef IS_VT\n #ifdef HAS_PATTERN_OFFSET\n let myPatternOffset = aPatternOffset;\n #else\n let myPatternOffset = uniforms.patternOffset;\n #endif\n var origin = uniforms.uvOrigin + myPatternOffset;\n #ifdef HAS_PATTERN_ORIGIN\n origin = origin - aPatternOrigin * uniforms.tileScale;\n #endif\n let hasPatternWidth = sign(length(uniforms.patternWidth));\n var myPatternWidth = mix(patternSize, uniforms.patternWidth, hasPatternWidth);\n #ifdef HAS_PATTERN_WIDTH\n myPatternWidth = aPatternWidth;\n #endif\n let originOffset = origin * vec2f(1.0, -1.0) / myPatternWidth;\n return (originOffset % 1.0) + computeUV(input, localVertex.xy * uniforms.tileScale / uniforms.tileRatio, myPatternWidth);\n #else\n var myPatternWidth = patternSize;\n #ifdef HAS_PATTERN_WIDTH\n let hasPatternWidth = sign(length(aPatternWidth));\n myPatternWidth = mix(patternSize, aPatternWidth, hasPatternWidth);\n #endif\n let position = uniforms.modelMatrix * localVertex;\n return computeUV(input, position.xy, myPatternWidth);\n #endif\n }\n#endif\n#if HAS_SHADOWING && !HAS_BLOOM\n #include <vsm_shadow_vert>\n#endif\n#include <vt_position_vert>\n#include <highlight_vert>\n@vertex\nfn main(vertexInput: VertexInput) -> VertexOutput {\n let myPosition = unpackVTPosition(vertexInput);\n let localVertex = vec4f(myPosition, 1.0);\n var out: VertexOutput;\n var position = uniforms.projViewModelMatrix * uniforms.positionMatrix * localVertex;\n out.position = position;\n #ifdef HAS_PATTERN\n let aTexInfo: vec4f = vec4f(vertexInput.aTexInfo);\n let patternSize = aTexInfo.zw + 1.0;\n out.vTexInfo = vec4f(aTexInfo.xy, patternSize);\n #ifdef HAS_TEX_COORD\n if (vertexInput.aTexCoord.x == INVALID_TEX_COORD) {\n out.vTexCoord = computeTexCoord(vertexInput, localVertex, patternSize);\n } else {\n out.vTexCoord = vertexInput.aTexCoord;\n }\n #else\n out.vTexCoord = computeTexCoord(vertexInput, localVertex, patternSize);\n #endif\n #ifdef HAS_UV_SCALE\n out.vUVScale = vec2f(vertexInput.aUVScale) / 255.0;\n #endif\n #ifdef HAS_UV_OFFSET\n out.vUVOffset = vec2f(vertexInput.aUVOffset) / 255.0;\n #endif\n #endif\n #ifdef HAS_COLOR\n out.vColor = vec4f(vertexInput.aColor) / 255.0;\n #endif\n #if HAS_HIGHLIGHT_COLOR || HAS_HIGHLIGHT_OPACITY\n highlight_setVarying(vertexInput, out);\n #endif\n #ifdef HAS_OPACITY\n out.vOpacity = f32(vertexInput.aOpacity) / 255.0;\n #endif\n #if HAS_SHADOWING && !HAS_BLOOM\n shadow_computeShadowPars(localVertex, &out);\n #endif\n return out;\n}",
|
|
13028
|
+
wgslVert: "#define SHADER_NAME FILL\nstruct VertexInput {\n#ifdef HAS_ALTITUDE\n @location($i) aPosition: POSITION_TYPE_2,\n @location($i) aAltitude: f32,\n#else\n @location($i) aPosition: POSITION_TYPE_3,\n#endif\n#ifdef HAS_COLOR\n @location($i) aColor: vec4u,\n#endif\n#ifdef HAS_OPACITY\n @location($i) aOpacity: u32,\n#endif\n#ifdef HAS_PATTERN\n #ifdef HAS_TEX_COORD\n @location($i) aTexCoord: vec2f,\n #endif\n @location($i) aTexInfo: vec4u,\n #ifdef HAS_UV_SCALE\n @location($i) aUVScale: vec2u,\n #endif\n #ifdef HAS_UV_OFFSET\n @location($i) aUVOffset: vec2u,\n #endif\n #ifdef HAS_PATTERN_WIDTH\n @location($i) aPatternWidth: vec2f,\n #endif\n #ifdef HAS_PATTERN_ORIGIN\n @location($i) aPatternOrigin: vec2f,\n #endif\n #ifdef HAS_PATTERN_OFFSET\n @location($i) aPatternOffset: vec2f,\n #endif\n#endif\n}\nstruct VertexOutput {\n @builtin(position) position : vec4f,\n#ifdef HAS_COLOR\n @location($o) vColor: vec4f,\n#endif\n#ifdef HAS_OPACITY\n @location($o) vOpacity: f32,\n#endif\n#ifdef HAS_PATTERN\n @location($o) vTexCoord: vec2f,\n @location($o) vTexInfo: vec4f,\n #ifdef HAS_UV_SCALE\n @location($o) vUVScale: vec2f,\n #endif\n #ifdef HAS_UV_OFFSET\n @location($o) vUVOffset: vec2f,\n #endif\n#endif\n}\nstruct ModelUniforms {\n projViewModelMatrix: mat4x4f,\n positionMatrix: mat4x4f,\n#ifdef IS_VT\n#else\n modelMatrix: mat4x4f,\n#endif\n#ifdef HAS_PATTERN\n patternWidth: vec2f,\n patternOffset: vec2f,\n uvOrigin: vec2f,\n uvScale: vec2f,\n#ifdef IS_VT\n tileRatio: f32,\n tileScale: f32,\n#endif\n#endif\n};\n#ifdef HAS_PATTERN && IS_VT\n#else\nstruct Uniforms {\n glScale: f32,\n}\n#endif\n@group(0) @binding($b) var<uniform> uniforms: ModelUniforms;\n#ifdef HAS_PATTERN && IS_VT\n#else\n@group(0) @binding($b) var<uniform> shaderUniforms: Uniforms;\n#endif\n#ifdef HAS_PATTERN\n fn computeUV(input: VertexInput, vertex: vec2f, patternWidth: vec2f) -> vec2f {\n #ifdef IS_VT\n let u = vertex.x / patternWidth.x;\n let v = vertex.y / patternWidth.y;\n return vec2f(u, v);\n #else\n let glScale = shaderUniforms.glScale;\n var mapGLScale = glScale;\n #ifdef HAS_PATTERN_WIDTH\n let hasPatternWidth = sign(length(vec2f(input.aPatternWidth)));\n mapGLScale = mix(glScale, 1.0, hasPatternWidth);\n #endif\n var origin = uniforms.uvOrigin;\n #ifdef HAS_PATTERN_ORIGIN\n origin = vec2f(input.aPatternOrigin);\n #endif\n #ifdef HAS_PATTERN_OFFSET\n let myPatternOffset = vec2f(input.aPatternOffset);\n #else\n let myPatternOffset = uniforms.patternOffset;\n #endif\n origin += myPatternOffset;\n let u = (vertex.x - origin.x) * mapGLScale / patternWidth.x;\n let v = (vertex.y - origin.y) * mapGLScale / patternWidth.y;\n return vec2f(u, -v);\n #endif\n }\n fn computeTexCoord(input:VertexInput, localVertex: vec4f, patternSize: vec2f) -> vec2f {\n #ifdef HAS_PATTERN_WIDTH\n let aPatternWidth = vec2f(input.aPatternWidth);\n #endif\n #ifdef IS_VT\n #ifdef HAS_PATTERN_OFFSET\n let myPatternOffset = aPatternOffset;\n #else\n let myPatternOffset = uniforms.patternOffset;\n #endif\n var origin = uniforms.uvOrigin + myPatternOffset;\n #ifdef HAS_PATTERN_ORIGIN\n origin = origin - aPatternOrigin * uniforms.tileScale;\n #endif\n let hasPatternWidth = sign(length(uniforms.patternWidth));\n var myPatternWidth = mix(patternSize, uniforms.patternWidth, hasPatternWidth);\n #ifdef HAS_PATTERN_WIDTH\n myPatternWidth = aPatternWidth;\n #endif\n let originOffset = origin * vec2f(1.0, -1.0) / myPatternWidth;\n return (originOffset % 1.0) + computeUV(input, localVertex.xy * uniforms.tileScale / uniforms.tileRatio, myPatternWidth);\n #else\n var myPatternWidth = patternSize;\n #ifdef HAS_PATTERN_WIDTH\n let hasPatternWidth = sign(length(aPatternWidth));\n myPatternWidth = mix(patternSize, aPatternWidth, hasPatternWidth);\n #endif\n let position = uniforms.modelMatrix * localVertex;\n return computeUV(input, position.xy, myPatternWidth);\n #endif\n }\n#endif\n#if HAS_SHADOWING && !HAS_BLOOM\n #include <vsm_shadow_vert>\n#endif\n#include <vt_position_vert>\n#include <highlight_vert>\n@vertex\nfn main(vertexInput: VertexInput) -> VertexOutput {\n let myPosition = unpackVTPosition(vertexInput);\n let localVertex = vec4f(myPosition, 1.0);\n var out: VertexOutput;\n var position = uniforms.projViewModelMatrix * uniforms.positionMatrix * localVertex;\n out.position = position;\n #ifdef HAS_PATTERN\n let aTexInfo: vec4f = vec4f(vertexInput.aTexInfo);\n let patternSize = aTexInfo.zw + 1.0;\n out.vTexInfo = vec4f(aTexInfo.xy, patternSize);\n #ifdef HAS_TEX_COORD\n if (vertexInput.aTexCoord.x == INVALID_TEX_COORD) {\n out.vTexCoord = computeTexCoord(vertexInput, localVertex, patternSize);\n } else {\n out.vTexCoord = vertexInput.aTexCoord;\n }\n #else\n out.vTexCoord = computeTexCoord(vertexInput, localVertex, patternSize);\n #endif\n #ifdef HAS_UV_SCALE\n out.vUVScale = vec2f(vertexInput.aUVScale) / 255.0;\n #endif\n #ifdef HAS_UV_OFFSET\n out.vUVOffset = vec2f(vertexInput.aUVOffset) / 255.0;\n #endif\n #endif\n #ifdef HAS_COLOR\n out.vColor = vec4f(vertexInput.aColor) / 255.0;\n #endif\n #if HAS_HIGHLIGHT_COLOR || HAS_HIGHLIGHT_OPACITY\n highlight_setVarying(vertexInput, &out);\n #endif\n #ifdef HAS_OPACITY\n out.vOpacity = f32(vertexInput.aOpacity) / 255.0;\n #endif\n #if HAS_SHADOWING && !HAS_BLOOM\n shadow_computeShadowPars(localVertex, &out);\n #endif\n return out;\n}",
|
|
13032
13029
|
wgslFrag: "#define SHADER_NAME FILL\n#if HAS_SHADOWING && !HAS_BLOOM\n #include <vsm_shadow_frag>\n#endif\nstruct FragmentUniforms {\n #ifdef HAS_PATTERN\n #ifndef HAS_UV_SCALE\n uvScale: vec2f,\n #endif\n #ifndef HAS_UV_OFFSET\n uvOffset: vec2f,\n #endif\n atlasSize: vec2f,\n #endif\n #ifndef HAS_COLOR\n polygonFill: vec4f,\n #endif\n #ifndef HAS_OPACITY\n polygonOpacity: f32,\n #endif\n tileExtent: f32,\n}\nstruct ShaderUniforms {\n layerOpacity: f32,\n}\n@group(0) @binding($b) var<uniform> fragmentUniforms: FragmentUniforms;\n@group(0) @binding($b) var<uniform> uniforms: ShaderUniforms;\n#if HAS_PATTERN\n @group(0) @binding($b) var polygonPatternFile: texture_2d<f32>;\n @group(0) @binding($b) var polygonPatternFileSampler: sampler;\n#endif\n#include <highlight_frag>\n#ifdef HAS_PATTERN\n fn computeUV(vertexOutput: VertexOutput) -> vec2f {\n #ifdef HAS_UV_SCALE\n let myUVScale = vertexOutput.vUVScale;\n #else\n let myUVScale = fragmentUniforms.uvScale;\n #endif\n #ifdef HAS_UV_OFFSET\n let myUVOffset = vertexOutput.vUVOffset;\n #else\n let myUVOffset = fragmentUniforms.uvOffset;\n #endif\n let uv = (vertexOutput.vTexCoord * myUVScale + myUVOffset) % 1.0;\n let uvStart = vertexOutput.vTexInfo.xy;\n let uvSize = vertexOutput.vTexInfo.zw;\n return (uvStart + uv * uvSize) / fragmentUniforms.atlasSize;\n }\n#endif\n@fragment\nfn main(\n #ifdef HAS_PATTERN || HAS_COLOR || HAS_OPACITY || HAS_UV_SCALE || HAS_UV_OFFSET || HAS_HIGHLIGHT_COLOR || HAS_HIGHLIGHT_OPACITY\n vertexOutput: VertexOutput\n #endif\n) -> @location(0) vec4f {\n #ifdef HAS_COLOR\n var color = vertexOutput.vColor;\n #else\n var color = fragmentUniforms.polygonFill;\n #endif\n #ifdef HAS_PATTERN\n let uv = computeUV(vertexOutput);\n var texColor = textureSample(polygonPatternFile, polygonPatternFileSampler, uv);\n if (vertexOutput.vTexInfo.z * vertexOutput.vTexInfo.w > 1.0) {\n color = texColor;\n }\n #endif\n #ifdef HAS_OPACITY\n var outputColor = color * vertexOutput.vOpacity;\n #else\n var outputColor = color * fragmentUniforms.polygonOpacity;\n #endif\n outputColor *= uniforms.layerOpacity;\n #if HAS_SHADOWING && !HAS_BLOOM\n let shadowCoeff = shadow_computeShadow(vertexOutput);\n outputColor.rgb = shadow_blend(outputColor.rgb, shadowCoeff);\n #endif\n #if HAS_HIGHLIGHT_COLOR || HAS_HIGHLIGHT_OPACITY\n outputColor = highlight_blendColor(outputColor, vertexOutput);\n #endif\n return outputColor;\n}",
|
|
13033
13030
|
uniforms: i,
|
|
13034
13031
|
defines: r,
|
|
@@ -13064,7 +13061,7 @@ class ei extends On {
|
|
|
13064
13061
|
}
|
|
13065
13062
|
}
|
|
13066
13063
|
|
|
13067
|
-
var ti = "#define SHADER_NAME LINE\n#define AA_CLIP_LIMIT 2.0\n#define AA_LINE_WIDTH 16.0\n#define DEVICE_PIXEL_RATIO 1.0\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n#define EXTRUDE_SCALE 63.0\n#define EXTRUDE_MOD 64.0\n#define MAX_LINE_DISTANCE 65535.0\n#ifdef PICKING_MODE\n#include <gl2_vert>\n#endif\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY)\nattribute vec3 aExtrude;\n#else\nattribute vec2 aExtrude;\n#endif\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY) || defined(HAS_GRADIENT) || defined(HAS_TRAIL)\nattribute float aLinesofar;\nvarying highp float vLinesofar;\n#endif\nuniform float cameraToCenterDistance;\n#if defined(HAS_STROKE_WIDTH)\nattribute float aLineStrokeWidth;\n#else\nuniform float lineStrokeWidth;\n#endif\nuniform mat4 positionMatrix;\nuniform mat4 projViewModelMatrix;\nuniform mat4 modelMatrix;\nuniform float tileResolution;\nuniform float resolution;\nuniform float tileRatio;\nuniform float isRenderingTerrain;\n#if defined(HAS_LINE_DX) || defined(HAS_LINE_DY)\nattribute vec2 aLineDxDy;\n#endif\n#ifndef HAS_LINE_DX\nuniform float lineDx;\n#endif\n#ifndef HAS_LINE_DY\nuniform float lineDy;\n#endif\nuniform vec2 canvasSize;\nuniform float layerScale;\nvarying vec2 vNormal;\nvarying vec2 vWidth;\nvarying float vGammaScale;\n#ifndef ENABLE_TILE_STENCIL\nvarying vec2 vPosition;\n#endif\n#ifdef USE_LINE_OFFSET\nattribute vec2 aExtrudeOffset;\n#endif\n#ifdef HAS_LINE_WIDTH\nattribute float aLineWidth;\n#else\nuniform float lineWidth;\n#endif\n#ifndef PICKING_MODE\n#ifndef HAS_GRADIENT\n#ifdef HAS_COLOR\nattribute vec4 aColor;\nvarying vec4 vColor;\n#endif\n#ifdef HAS_PATTERN\n#if defined(HAS_PATTERN_ANIM) || defined(HAS_PATTERN_GAP)\nattribute vec2 aLinePattern;\n#endif\n#ifdef HAS_PATTERN_ANIM\nvarying float vLinePatternAnimSpeed;\n#endif\n#ifdef HAS_PATTERN_GAP\nvarying float vLinePatternGap;\n#endif\nattribute vec4 aTexInfo;\nvarying vec4 vTexInfo;\n#endif\n#ifdef HAS_DASHARRAY\n#ifdef HAS_DASHARRAY_ATTR\nattribute vec4 aDasharray;\nvarying vec4 vDasharray;\n#endif\n#ifdef HAS_DASHARRAY_COLOR\nattribute vec4 aDashColor;\nvarying vec4 vDashColor;\n#endif\n#endif\n#endif\n#ifdef HAS_STROKE_COLOR\nattribute vec4 aStrokeColor;\nvarying vec4 vStrokeColor;\n#endif\n#ifdef HAS_OPACITY\nattribute float aOpacity;\nvarying float vOpacity;\n#endif\n#ifdef HAS_GRADIENT\nattribute float aGradIndex;\nvarying float vGradIndex;\n#endif\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\n#include <vsm_shadow_vert>\n#endif\n#include <highlight_vert>\n#else\n#include <fbo_picking_vert>\n#endif\nvarying vec3 vVertex;\n#include <vt_position_vert>\nvoid main() {\n vec3 c = unpackVTPosition();\n float d = mod(abs(aExtrude.x), 2.);\n float e = mod(abs(aExtrude.y), 2.);\n vNormal = vec2(d, e * 2. - 1.);\n vec4 f = vec4(c, 1.);\n vec4 h = projViewModelMatrix * positionMatrix * f;\n if(isRenderingTerrain == 1.) {\n vVertex = (positionMatrix * f).xyz;\n } else {\n vVertex = (modelMatrix * positionMatrix * f).xyz;\n }\n#ifdef HAS_STROKE_WIDTH\nfloat i = aLineStrokeWidth / 2. * layerScale;\n#else\nfloat i = lineStrokeWidth;\n#endif\n#ifdef HAS_LINE_WIDTH\nfloat j = aLineWidth / 2. * layerScale;\n#else\nfloat j = lineWidth * layerScale;\n#endif\nfloat k = j / 2. + i;\n float l = sign(i) * j / 2.;\n float m = l + sign(l) * ANTIALIASING;\n float n = k + sign(k) * ANTIALIASING;\n#ifdef USE_LINE_OFFSET\nvec2 o = lineOffset * (vNormal.y * (aExtrude.xy - aExtrudeOffset) + aExtrudeOffset);\n vec2 u = (n * aExtrude.xy + o) / EXTRUDE_SCALE;\n#else\nvec2 v = aExtrude.xy / EXTRUDE_SCALE;\n vec2 u = n * v;\n#endif\nfloat A = tileResolution / resolution;\n vec4 B = vec4(c + vec3(u, .0) * tileRatio / A, 1.);\n gl_Position = projViewModelMatrix * positionMatrix * B;\n#ifdef HAS_LINE_DX\nfloat C = aLineDxDy[0];\n#else\nfloat C = lineDx;\n#endif\n#ifdef HAS_LINE_DY\nfloat D = aLineDxDy[1];\n#else\nfloat D = lineDy;\n#endif\nfloat E = gl_Position.w;\n gl_Position.xy += vec2(C, D) * 2. / canvasSize * E;\n#ifndef PICKING_MODE\nvWidth = vec2(n, m);\n if(isRenderingTerrain == 1.) {\n vGammaScale = 1.;\n } else {\n vGammaScale = E / cameraToCenterDistance;\n }\n#ifndef ENABLE_TILE_STENCIL\nvPosition = c.xy;\n#ifdef USE_LINE_OFFSET\nvPosition += tileRatio * o / EXTRUDE_SCALE;\n#endif\n#endif\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY) || defined(HAS_GRADIENT)\n#ifdef HAS_GRADIENT\nvLinesofar = aLinesofar / MAX_LINE_DISTANCE;\n vGradIndex = aGradIndex;\n#else\nfloat F = aLinesofar - k * aExtrude.z / EXTRUDE_SCALE / A * tileRatio;\n vLinesofar = F / tileRatio * A;\n#endif\n#endif\n#ifndef HAS_GRADIENT\n#ifdef HAS_COLOR\nvColor = aColor;\n#endif\n#ifdef HAS_DASHARRAY\n#ifdef HAS_DASHARRAY_ATTR\nvDasharray = aDasharray;\n#endif\n#ifdef HAS_DASHARRAY_COLOR\nvDashColor = aDashColor / 255.;\n#endif\n#endif\n#ifdef HAS_PATTERN\nvTexInfo = vec4(aTexInfo.xy, aTexInfo.zw + 1.);\n#ifdef HAS_PATTERN_ANIM\nvLinePatternAnimSpeed = aLinePattern[0] / 127.;\n#endif\n#ifdef HAS_PATTERN_GAP\nvLinePatternGap = aLinePattern[1] / 10.0;\n#endif\n#endif\n#endif\n#ifdef HAS_STROKE_COLOR\nvStrokeColor = aStrokeColor;\n#endif\n#ifdef HAS_OPACITY\nvOpacity = aOpacity / 255.;\n#endif\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\nshadow_computeShadowPars(B);\n#endif\nhighlight_setVarying();\n#else\nfbo_picking_setData(E, true);\n#endif\n}", ni = "#define AA_CLIP_LIMIT 2.0\n#define AA_LINE_WIDTH 16.0\n#define DEVICE_PIXEL_RATIO 1.0\n#define ANTIALIASING 1.0 / 1.0 / 2.0\n#define EXTRUDE_SCALE 63.0\n#define EXTRUDE_MOD 64.0\n#define MAX_LINE_DISTANCE 65535.0\nstruct LineUniforms {\n lineStrokeWidth: f32,\n positionMatrix: mat4x4f,\n projViewModelMatrix: mat4x4f,\n modelMatrix: mat4x4f,\n tileResolution: f32,\n tileRatio: f32,\n lineDx: f32,\n lineDy: f32,\n lineWidth: f32\n};\nstruct ShaderUniforms {\n resolution: f32,\n cameraToCenterDistance: f32,\n canvasSize: vec2f,\n layerScale: f32,\n isRenderingTerrain: f32,\n}\n@group(0) @binding($b) var<uniform> uniforms: LineUniforms;\n@group(0) @binding($b) var<uniform> shaderUniforms: ShaderUniforms;\nstruct VertexInput {\n#ifdef HAS_ALTITUDE\n @location($i) aPosition: POSITION_TYPE_2,\n @location($i) aAltitude: f32,\n#else\n @location($i) aPosition: POSITION_TYPE_3,\n#endif\n#if HAS_PATTERN || HAS_DASHARRAY\n @location($i) aExtrude: vec4i,\n#else\n @location($i) aExtrude: vec2i,\n#endif\n#if HAS_PATTERN || HAS_DASHARRAY || HAS_GRADIENT || HAS_TRAIL\n @location($i) aLinesofar: LINESOFAR_TYPE,\n#endif\n#ifdef HAS_STROKE_WIDTH\n @location($i) aLineStrokeWidth: u32,\n#endif\n#if HAS_LINE_DX || HAS_LINE_DY\n @location($i) aLineDxDy: vec2i,\n#endif\n#ifdef USE_LINE_OFFSET\n @location($i) aExtrudeOffset: vec2f,\n#endif\n#ifdef HAS_LINE_WIDTH\n @location($i) aLineWidth: u32,\n#endif\n#ifndef PICKING_MODE\n #ifndef HAS_GRADIENT\n #ifdef HAS_COLOR\n @location($i) aColor: vec4u,\n #endif\n #ifdef HAS_PATTERN\n #if HAS_PATTERN_ANIM || HAS_PATTERN_GAP\n @location($i) aLinePattern: vec2i,\n #endif\n @location($i) aTexInfo: vec4u,\n #endif\n #ifdef HAS_DASHARRAY\n #ifdef HAS_DASHARRAY_ATTR\n @location($i) aDasharray: vec4u,\n #endif\n #ifdef HAS_DASHARRAY_COLOR\n @location($i) aDashColor: vec4u,\n #endif\n #endif\n #endif\n #ifdef HAS_STROKE_COLOR\n @location($i) aStrokeColor: vec4u,\n #endif\n #ifdef HAS_OPACITY\n @location($i) aOpacity: u32,\n #endif\n #ifdef HAS_GRADIENT\n @location($i) aGradIndex: u32,\n #endif\n#endif\n};\nstruct VertexOutput {\n @builtin(position) position: vec4f,\n#ifndef PICKING_MODE\n @location($o) vNormal: vec2f,\n @location($o) vWidth: vec2f,\n @location($o) vGammaScale: f32,\n#ifndef ENABLE_TILE_STENCIL\n @location($o) vPosition: vec2f,\n#endif\n @location($o) vVertex: vec3f,\n#if HAS_PATTERN || HAS_DASHARRAY || HAS_GRADIENT || HAS_TRAIL\n @location($o) vLinesofar: f32,\n#endif\n #ifndef HAS_GRADIENT\n #ifdef HAS_COLOR\n @location($o) vColor: vec4f,\n #endif\n #ifdef HAS_PATTERN\n #ifdef HAS_PATTERN_ANIM\n @location($o) vLinePatternAnimSpeed: f32,\n #endif\n #ifdef HAS_PATTERN_GAP\n @location($o) vLinePatternGap: f32,\n #endif\n @location($o) vTexInfo: vec4f,\n #endif\n #ifdef HAS_DASHARRAY\n #ifdef HAS_DASHARRAY_ATTR\n @location($o) vDasharray: vec4f,\n #endif\n #ifdef HAS_DASHARRAY_COLOR\n @location($o) vDashColor: vec4f,\n #endif\n #endif\n #endif\n #ifdef HAS_STROKE_COLOR\n @location($o) vStrokeColor: vec4f,\n #endif\n #ifdef HAS_OPACITY\n @location($o) vOpacity: f32,\n #endif\n #ifdef HAS_GRADIENT\n @location($o) vGradIndex: f32,\n #endif\n#else\n#endif\n};\n#ifndef PICKING_MODE\n #if HAS_SHADOWING && !HAS_BLOOM\n #include <vsm_shadow_vert>\n #endif\n#else\n #include <fbo_picking_vert>\n#endif\n#include <highlight_vert>\n#include <vt_position_vert>\n@vertex\nfn main(input: VertexInput) -> VertexOutput {\n var output: VertexOutput;\n let position = unpackVTPosition(input);\n let round = abs(f32(input.aExtrude.x)) % 2.0;\n let up = abs(f32(input.aExtrude.y)) % 2.0;\n let lineNormal = vec2f(round, up * 2.0 - 1.0);\n #ifndef PICKING_MODE\n output.vNormal = lineNormal;\n #endif\n let pos4 = vec4f(position, 1.0);\n let vertex = uniforms.projViewModelMatrix * uniforms.positionMatrix * pos4;\n #ifndef PICKING_MODE\n if (shaderUniforms.isRenderingTerrain == 1.0) {\n output.vVertex = (uniforms.positionMatrix * pos4).xyz;\n } else {\n output.vVertex = (uniforms.modelMatrix * uniforms.positionMatrix * pos4).xyz;\n }\n #endif\n#ifdef HAS_STROKE_WIDTH\n let strokeWidth = f32(input.aLineStrokeWidth) / 2.0 * shaderUniforms.layerScale;\n#else\n let strokeWidth = uniforms.lineStrokeWidth;\n#endif\n#ifdef HAS_LINE_WIDTH\n let myLineWidth = f32(input.aLineWidth) / 2.0 * shaderUniforms.layerScale;\n#else\n let myLineWidth = uniforms.lineWidth * shaderUniforms.layerScale;\n#endif\n let halfwidth = myLineWidth / 2.0 + strokeWidth;\n let gapwidth = sign(strokeWidth) * myLineWidth / 2.0;\n let inset = gapwidth + sign(gapwidth) * ANTIALIASING;\n var outset = halfwidth + sign(halfwidth) * ANTIALIASING;\n let extrudeXY = vec2f(input.aExtrude.xy);\n let extrude = extrudeXY / EXTRUDE_SCALE;\n var dist = outset * extrude;\n let resScale = uniforms.tileResolution / shaderUniforms.resolution;\n var localVertex = vec4f(position + vec3f(dist, 0.0) * uniforms.tileRatio / resScale, 1.0);\n output.position = uniforms.projViewModelMatrix * uniforms.positionMatrix * localVertex;\n#ifdef HAS_LINE_DX\n let myLineDx = f32(input.aLineDxDy.x);\n#else\n let myLineDx = uniforms.lineDx;\n#endif\n#ifdef HAS_LINE_DY\n let myLineDy = f32(input.aLineDxDy.y);\n#else\n let myLineDy = uniforms.lineDy;\n#endif\n let projDistance = output.position.w;\n output.position.x += f32(myLineDx) * 2.0 / shaderUniforms.canvasSize.x * projDistance;\n output.position.y += f32(myLineDy) * 2.0 / shaderUniforms.canvasSize.y * projDistance;\n#ifndef PICKING_MODE\n output.vWidth = vec2f(outset, inset);\n if (shaderUniforms.isRenderingTerrain == 1.0) {\n output.vGammaScale = 1.0;\n } else {\n output.vGammaScale = projDistance / shaderUniforms.cameraToCenterDistance;\n }\n #ifndef ENABLE_TILE_STENCIL\n output.vPosition = position.xy;\n #ifdef USE_LINE_OFFSET\n output.vPosition += uniforms.tileRatio * offset / EXTRUDE_SCALE;\n #endif\n #endif\n #if HAS_PATTERN || HAS_DASHARRAY || HAS_GRADIENT\n let aLinesofar = f32(input.aLinesofar);\n #ifdef HAS_GRADIENT\n output.vLinesofar = aLinesofar / MAX_LINE_DISTANCE;\n output.vGradIndex = f32(input.aGradIndex);\n #else\n let linesofar = aLinesofar - halfwidth * f32(input.aExtrude.z) / EXTRUDE_SCALE / resScale * uniforms.tileRatio;\n output.vLinesofar = linesofar / uniforms.tileRatio * resScale;\n #endif\n #endif\n #ifndef HAS_GRADIENT\n #ifdef HAS_COLOR\n output.vColor = vec4f(input.aColor);\n #endif\n #ifdef HAS_DASHARRAY\n #ifdef HAS_DASHARRAY_ATTR\n output.vDasharray = vec4f(input.aDasharray);\n #endif\n #ifdef HAS_DASHARRAY_COLOR\n output.vDashColor = vec4f(input.aDashColor) / 255.0;\n #endif\n #endif\n #ifdef HAS_PATTERN\n output.vTexInfo = vec4f(vec2f(input.aTexInfo.xy), vec2f(input.aTexInfo.zw) + 1.0);\n #ifdef HAS_PATTERN_ANIM\n output.vLinePatternAnimSpeed = f32(input.aLinePattern.x) / 127.0;\n #endif\n #ifdef HAS_PATTERN_GAP\n output.vLinePatternGap = f32(input.aLinePattern.y) / 10.0;\n #endif\n #endif\n #endif\n #ifdef HAS_STROKE_COLOR\n output.vStrokeColor = vec4f(input.aStrokeColor);\n #endif\n #ifdef HAS_OPACITY\n output.vOpacity = f32(input.aOpacity) / 255.0;\n #endif\n #if HAS_SHADOWING && !HAS_BLOOM\n shadow_computeShadowPars(localVertex, &output);\n #endif\n #if HAS_HIGHLIGHT_COLOR || HAS_HIGHLIGHT_OPACITY\n highlight_setVarying(input, output);\n #endif\n#else\n fbo_picking_setData(input, &output, projDistance, true);\n#endif\n return output;\n}";
|
|
13064
|
+
var ti = "#define SHADER_NAME LINE\n#define AA_CLIP_LIMIT 2.0\n#define AA_LINE_WIDTH 16.0\n#define DEVICE_PIXEL_RATIO 1.0\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n#define EXTRUDE_SCALE 63.0\n#define EXTRUDE_MOD 64.0\n#define MAX_LINE_DISTANCE 65535.0\n#ifdef PICKING_MODE\n#include <gl2_vert>\n#endif\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY)\nattribute vec3 aExtrude;\n#else\nattribute vec2 aExtrude;\n#endif\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY) || defined(HAS_GRADIENT) || defined(HAS_TRAIL)\nattribute float aLinesofar;\nvarying highp float vLinesofar;\n#endif\nuniform float cameraToCenterDistance;\n#if defined(HAS_STROKE_WIDTH)\nattribute float aLineStrokeWidth;\n#else\nuniform float lineStrokeWidth;\n#endif\nuniform mat4 positionMatrix;\nuniform mat4 projViewModelMatrix;\nuniform mat4 modelMatrix;\nuniform float tileResolution;\nuniform float resolution;\nuniform float tileRatio;\nuniform float isRenderingTerrain;\n#if defined(HAS_LINE_DX) || defined(HAS_LINE_DY)\nattribute vec2 aLineDxDy;\n#endif\n#ifndef HAS_LINE_DX\nuniform float lineDx;\n#endif\n#ifndef HAS_LINE_DY\nuniform float lineDy;\n#endif\nuniform vec2 canvasSize;\nuniform float layerScale;\nvarying vec2 vNormal;\nvarying vec2 vWidth;\nvarying float vGammaScale;\n#ifndef ENABLE_TILE_STENCIL\nvarying vec2 vPosition;\n#endif\n#ifdef USE_LINE_OFFSET\nattribute vec2 aExtrudeOffset;\n#endif\n#ifdef HAS_LINE_WIDTH\nattribute float aLineWidth;\n#else\nuniform float lineWidth;\n#endif\n#ifndef PICKING_MODE\n#ifndef HAS_GRADIENT\n#ifdef HAS_COLOR\nattribute vec4 aColor;\nvarying vec4 vColor;\n#endif\n#ifdef HAS_PATTERN\n#if defined(HAS_PATTERN_ANIM) || defined(HAS_PATTERN_GAP)\nattribute vec2 aLinePattern;\n#endif\n#ifdef HAS_PATTERN_ANIM\nvarying float vLinePatternAnimSpeed;\n#endif\n#ifdef HAS_PATTERN_GAP\nvarying float vLinePatternGap;\n#endif\nattribute vec4 aTexInfo;\nvarying vec4 vTexInfo;\n#endif\n#ifdef HAS_DASHARRAY\n#ifdef HAS_DASHARRAY_ATTR\nattribute vec4 aDasharray;\nvarying vec4 vDasharray;\n#endif\n#ifdef HAS_DASHARRAY_COLOR\nattribute vec4 aDashColor;\nvarying vec4 vDashColor;\n#endif\n#endif\n#endif\n#ifdef HAS_STROKE_COLOR\nattribute vec4 aStrokeColor;\nvarying vec4 vStrokeColor;\n#endif\n#ifdef HAS_OPACITY\nattribute float aOpacity;\nvarying float vOpacity;\n#endif\n#ifdef HAS_GRADIENT\nattribute float aGradIndex;\nvarying float vGradIndex;\n#endif\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\n#include <vsm_shadow_vert>\n#endif\n#include <highlight_vert>\n#else\n#include <fbo_picking_vert>\n#endif\nvarying vec3 vVertex;\n#include <vt_position_vert>\nvoid main() {\n vec3 c = unpackVTPosition();\n float d = mod(abs(aExtrude.x), 2.);\n float e = mod(abs(aExtrude.y), 2.);\n vNormal = vec2(d, e * 2. - 1.);\n vec4 f = vec4(c, 1.);\n vec4 h = projViewModelMatrix * positionMatrix * f;\n if(isRenderingTerrain == 1.) {\n vVertex = (positionMatrix * f).xyz;\n } else {\n vVertex = (modelMatrix * positionMatrix * f).xyz;\n }\n#ifdef HAS_STROKE_WIDTH\nfloat i = aLineStrokeWidth / 2. * layerScale;\n#else\nfloat i = lineStrokeWidth;\n#endif\n#ifdef HAS_LINE_WIDTH\nfloat j = aLineWidth / 2. * layerScale;\n#else\nfloat j = lineWidth * layerScale;\n#endif\nfloat k = j / 2. + i;\n float l = sign(i) * j / 2.;\n float m = l + sign(l) * ANTIALIASING;\n float n = k + sign(k) * ANTIALIASING;\n#ifdef USE_LINE_OFFSET\nvec2 o = lineOffset * (vNormal.y * (aExtrude.xy - aExtrudeOffset) + aExtrudeOffset);\n vec2 u = (n * aExtrude.xy + o) / EXTRUDE_SCALE;\n#else\nvec2 v = aExtrude.xy / EXTRUDE_SCALE;\n vec2 u = n * v;\n#endif\nfloat A = tileResolution / resolution;\n vec4 B = vec4(c + vec3(u, .0) * tileRatio / A, 1.);\n gl_Position = projViewModelMatrix * positionMatrix * B;\n#ifdef HAS_LINE_DX\nfloat C = aLineDxDy[0];\n#else\nfloat C = lineDx;\n#endif\n#ifdef HAS_LINE_DY\nfloat D = aLineDxDy[1];\n#else\nfloat D = lineDy;\n#endif\nfloat E = gl_Position.w;\n gl_Position.xy += vec2(C, D) * 2. / canvasSize * E;\n#ifndef PICKING_MODE\nvWidth = vec2(n, m);\n if(isRenderingTerrain == 1.) {\n vGammaScale = 1.;\n } else {\n vGammaScale = E / cameraToCenterDistance;\n }\n#ifndef ENABLE_TILE_STENCIL\nvPosition = c.xy;\n#ifdef USE_LINE_OFFSET\nvPosition += tileRatio * o / EXTRUDE_SCALE;\n#endif\n#endif\n#if defined(HAS_PATTERN) || defined(HAS_DASHARRAY) || defined(HAS_GRADIENT)\n#ifdef HAS_GRADIENT\nvLinesofar = aLinesofar / MAX_LINE_DISTANCE;\n vGradIndex = aGradIndex;\n#else\nfloat F = aLinesofar - k * aExtrude.z / EXTRUDE_SCALE / A * tileRatio;\n vLinesofar = F / tileRatio * A;\n#endif\n#endif\n#ifndef HAS_GRADIENT\n#ifdef HAS_COLOR\nvColor = aColor;\n#endif\n#ifdef HAS_DASHARRAY\n#ifdef HAS_DASHARRAY_ATTR\nvDasharray = aDasharray;\n#endif\n#ifdef HAS_DASHARRAY_COLOR\nvDashColor = aDashColor / 255.;\n#endif\n#endif\n#ifdef HAS_PATTERN\nvTexInfo = vec4(aTexInfo.xy, aTexInfo.zw + 1.);\n#ifdef HAS_PATTERN_ANIM\nvLinePatternAnimSpeed = aLinePattern[0] / 127.;\n#endif\n#ifdef HAS_PATTERN_GAP\nvLinePatternGap = aLinePattern[1] / 10.0;\n#endif\n#endif\n#endif\n#ifdef HAS_STROKE_COLOR\nvStrokeColor = aStrokeColor;\n#endif\n#ifdef HAS_OPACITY\nvOpacity = aOpacity / 255.;\n#endif\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\nshadow_computeShadowPars(B);\n#endif\nhighlight_setVarying();\n#else\nfbo_picking_setData(E, true);\n#endif\n}", ni = "#define AA_CLIP_LIMIT 2.0\n#define AA_LINE_WIDTH 16.0\n#define DEVICE_PIXEL_RATIO 1.0\n#define ANTIALIASING 1.0 / 1.0 / 2.0\n#define EXTRUDE_SCALE 63.0\n#define EXTRUDE_MOD 64.0\n#define MAX_LINE_DISTANCE 65535.0\nstruct LineUniforms {\n lineStrokeWidth: f32,\n positionMatrix: mat4x4f,\n projViewModelMatrix: mat4x4f,\n modelMatrix: mat4x4f,\n tileResolution: f32,\n tileRatio: f32,\n lineDx: f32,\n lineDy: f32,\n lineWidth: f32\n};\nstruct ShaderUniforms {\n resolution: f32,\n cameraToCenterDistance: f32,\n canvasSize: vec2f,\n layerScale: f32,\n isRenderingTerrain: f32,\n}\n@group(0) @binding($b) var<uniform> uniforms: LineUniforms;\n@group(0) @binding($b) var<uniform> shaderUniforms: ShaderUniforms;\nstruct VertexInput {\n#ifdef HAS_ALTITUDE\n @location($i) aPosition: POSITION_TYPE_2,\n @location($i) aAltitude: f32,\n#else\n @location($i) aPosition: POSITION_TYPE_3,\n#endif\n#if HAS_PATTERN || HAS_DASHARRAY\n @location($i) aExtrude: vec4i,\n#else\n @location($i) aExtrude: vec2i,\n#endif\n#if HAS_PATTERN || HAS_DASHARRAY || HAS_GRADIENT || HAS_TRAIL\n @location($i) aLinesofar: LINESOFAR_TYPE,\n#endif\n#ifdef HAS_STROKE_WIDTH\n @location($i) aLineStrokeWidth: u32,\n#endif\n#if HAS_LINE_DX || HAS_LINE_DY\n @location($i) aLineDxDy: vec2i,\n#endif\n#ifdef USE_LINE_OFFSET\n @location($i) aExtrudeOffset: vec2f,\n#endif\n#ifdef HAS_LINE_WIDTH\n @location($i) aLineWidth: u32,\n#endif\n#ifndef PICKING_MODE\n #ifndef HAS_GRADIENT\n #ifdef HAS_COLOR\n @location($i) aColor: vec4u,\n #endif\n #ifdef HAS_PATTERN\n #if HAS_PATTERN_ANIM || HAS_PATTERN_GAP\n @location($i) aLinePattern: vec2i,\n #endif\n @location($i) aTexInfo: vec4u,\n #endif\n #ifdef HAS_DASHARRAY\n #ifdef HAS_DASHARRAY_ATTR\n @location($i) aDasharray: vec4u,\n #endif\n #ifdef HAS_DASHARRAY_COLOR\n @location($i) aDashColor: vec4u,\n #endif\n #endif\n #endif\n #ifdef HAS_STROKE_COLOR\n @location($i) aStrokeColor: vec4u,\n #endif\n #ifdef HAS_OPACITY\n @location($i) aOpacity: u32,\n #endif\n #ifdef HAS_GRADIENT\n @location($i) aGradIndex: u32,\n #endif\n#endif\n};\nstruct VertexOutput {\n @builtin(position) position: vec4f,\n#ifndef PICKING_MODE\n @location($o) vNormal: vec2f,\n @location($o) vWidth: vec2f,\n @location($o) vGammaScale: f32,\n#ifndef ENABLE_TILE_STENCIL\n @location($o) vPosition: vec2f,\n#endif\n @location($o) vVertex: vec3f,\n#if HAS_PATTERN || HAS_DASHARRAY || HAS_GRADIENT || HAS_TRAIL\n @location($o) vLinesofar: f32,\n#endif\n #ifndef HAS_GRADIENT\n #ifdef HAS_COLOR\n @location($o) vColor: vec4f,\n #endif\n #ifdef HAS_PATTERN\n #ifdef HAS_PATTERN_ANIM\n @location($o) vLinePatternAnimSpeed: f32,\n #endif\n #ifdef HAS_PATTERN_GAP\n @location($o) vLinePatternGap: f32,\n #endif\n @location($o) vTexInfo: vec4f,\n #endif\n #ifdef HAS_DASHARRAY\n #ifdef HAS_DASHARRAY_ATTR\n @location($o) vDasharray: vec4f,\n #endif\n #ifdef HAS_DASHARRAY_COLOR\n @location($o) vDashColor: vec4f,\n #endif\n #endif\n #endif\n #ifdef HAS_STROKE_COLOR\n @location($o) vStrokeColor: vec4f,\n #endif\n #ifdef HAS_OPACITY\n @location($o) vOpacity: f32,\n #endif\n #ifdef HAS_GRADIENT\n @location($o) vGradIndex: f32,\n #endif\n#else\n#endif\n};\n#ifndef PICKING_MODE\n #if HAS_SHADOWING && !HAS_BLOOM\n #include <vsm_shadow_vert>\n #endif\n#else\n #include <fbo_picking_vert>\n#endif\n#include <highlight_vert>\n#include <vt_position_vert>\n@vertex\nfn main(input: VertexInput) -> VertexOutput {\n var output: VertexOutput;\n let position = unpackVTPosition(input);\n let round = abs(f32(input.aExtrude.x)) % 2.0;\n let up = abs(f32(input.aExtrude.y)) % 2.0;\n let lineNormal = vec2f(round, up * 2.0 - 1.0);\n #ifndef PICKING_MODE\n output.vNormal = lineNormal;\n #endif\n let pos4 = vec4f(position, 1.0);\n let vertex = uniforms.projViewModelMatrix * uniforms.positionMatrix * pos4;\n #ifndef PICKING_MODE\n if (shaderUniforms.isRenderingTerrain == 1.0) {\n output.vVertex = (uniforms.positionMatrix * pos4).xyz;\n } else {\n output.vVertex = (uniforms.modelMatrix * uniforms.positionMatrix * pos4).xyz;\n }\n #endif\n#ifdef HAS_STROKE_WIDTH\n let strokeWidth = f32(input.aLineStrokeWidth) / 2.0 * shaderUniforms.layerScale;\n#else\n let strokeWidth = uniforms.lineStrokeWidth;\n#endif\n#ifdef HAS_LINE_WIDTH\n let myLineWidth = f32(input.aLineWidth) / 2.0 * shaderUniforms.layerScale;\n#else\n let myLineWidth = uniforms.lineWidth * shaderUniforms.layerScale;\n#endif\n let halfwidth = myLineWidth / 2.0 + strokeWidth;\n let gapwidth = sign(strokeWidth) * myLineWidth / 2.0;\n let inset = gapwidth + sign(gapwidth) * ANTIALIASING;\n var outset = halfwidth + sign(halfwidth) * ANTIALIASING;\n let extrudeXY = vec2f(input.aExtrude.xy);\n let extrude = extrudeXY / EXTRUDE_SCALE;\n var dist = outset * extrude;\n let resScale = uniforms.tileResolution / shaderUniforms.resolution;\n var localVertex = vec4f(position + vec3f(dist, 0.0) * uniforms.tileRatio / resScale, 1.0);\n output.position = uniforms.projViewModelMatrix * uniforms.positionMatrix * localVertex;\n#ifdef HAS_LINE_DX\n let myLineDx = f32(input.aLineDxDy.x);\n#else\n let myLineDx = uniforms.lineDx;\n#endif\n#ifdef HAS_LINE_DY\n let myLineDy = f32(input.aLineDxDy.y);\n#else\n let myLineDy = uniforms.lineDy;\n#endif\n let projDistance = output.position.w;\n output.position.x += f32(myLineDx) * 2.0 / shaderUniforms.canvasSize.x * projDistance;\n output.position.y += f32(myLineDy) * 2.0 / shaderUniforms.canvasSize.y * projDistance;\n#ifndef PICKING_MODE\n output.vWidth = vec2f(outset, inset);\n if (shaderUniforms.isRenderingTerrain == 1.0) {\n output.vGammaScale = 1.0;\n } else {\n output.vGammaScale = projDistance / shaderUniforms.cameraToCenterDistance;\n }\n #ifndef ENABLE_TILE_STENCIL\n output.vPosition = position.xy;\n #ifdef USE_LINE_OFFSET\n output.vPosition += uniforms.tileRatio * offset / EXTRUDE_SCALE;\n #endif\n #endif\n #if HAS_PATTERN || HAS_DASHARRAY || HAS_GRADIENT\n let aLinesofar = f32(input.aLinesofar);\n #ifdef HAS_GRADIENT\n output.vLinesofar = aLinesofar / MAX_LINE_DISTANCE;\n output.vGradIndex = f32(input.aGradIndex);\n #else\n let linesofar = aLinesofar - halfwidth * f32(input.aExtrude.z) / EXTRUDE_SCALE / resScale * uniforms.tileRatio;\n output.vLinesofar = linesofar / uniforms.tileRatio * resScale;\n #endif\n #endif\n #ifndef HAS_GRADIENT\n #ifdef HAS_COLOR\n output.vColor = vec4f(input.aColor);\n #endif\n #ifdef HAS_DASHARRAY\n #ifdef HAS_DASHARRAY_ATTR\n output.vDasharray = vec4f(input.aDasharray);\n #endif\n #ifdef HAS_DASHARRAY_COLOR\n output.vDashColor = vec4f(input.aDashColor) / 255.0;\n #endif\n #endif\n #ifdef HAS_PATTERN\n output.vTexInfo = vec4f(vec2f(input.aTexInfo.xy), vec2f(input.aTexInfo.zw) + 1.0);\n #ifdef HAS_PATTERN_ANIM\n output.vLinePatternAnimSpeed = f32(input.aLinePattern.x) / 127.0;\n #endif\n #ifdef HAS_PATTERN_GAP\n output.vLinePatternGap = f32(input.aLinePattern.y) / 10.0;\n #endif\n #endif\n #endif\n #ifdef HAS_STROKE_COLOR\n output.vStrokeColor = vec4f(input.aStrokeColor);\n #endif\n #ifdef HAS_OPACITY\n output.vOpacity = f32(input.aOpacity) / 255.0;\n #endif\n #if HAS_SHADOWING && !HAS_BLOOM\n shadow_computeShadowPars(localVertex, &output);\n #endif\n #if HAS_HIGHLIGHT_COLOR || HAS_HIGHLIGHT_OPACITY\n highlight_setVarying(input, &output);\n #endif\n#else\n fbo_picking_setData(input, &output, projDistance, true);\n#endif\n return output;\n}";
|
|
13068
13065
|
|
|
13069
13066
|
const ii = g.identity([]), ri = [];
|
|
13070
13067
|
|
|
@@ -14485,7 +14482,7 @@ function Ri(e, t, n) {
|
|
|
14485
14482
|
return e[0] = t[0] - n, e[1] = t[1] - n, e[2] = t[2] + n, e[3] = t[3] + n, e;
|
|
14486
14483
|
}
|
|
14487
14484
|
|
|
14488
|
-
var Fi = "#include <gl2_vert>\n#define SHADER_NAME MARKER\n#define RAD 0.0174532925\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\nattribute vec4 aShape;\n#ifdef ENABLE_COLLISION\nattribute float aOpacity;\n#endif\n#ifdef HAS_OPACITY\nattribute vec2 aColorOpacity;\n#endif\n#ifdef HAS_TEXT_SIZE\nattribute float aTextSize;\n#else\nuniform float textSize;\n#endif\n#if defined(HAS_TEXT_DX) || defined(HAS_TEXT_DY) || defined(HAS_MARKER_DX) || defined(HAS_MARKER_DY)\nattribute vec4 aDxDy;\n#endif\n#ifndef HAS_MARKER_DX\nuniform float markerDx;\n#endif\n#ifndef HAS_MARKER_DY\nuniform float markerDy;\n#endif\n#ifndef HAS_TEXT_DX\nuniform float textDx;\n#endif\n#ifndef HAS_TEXT_DY\nuniform float textDy;\n#endif\n#ifdef HAS_MARKER_WIDTH\nattribute float aMarkerWidth;\n#else\nuniform float markerWidth;\n#endif\n#ifdef HAS_MARKER_HEIGHT\nattribute float aMarkerHeight;\n#else\nuniform float markerHeight;\n#endif\n#if defined(HAS_MARKER_PITCH_ALIGN) || defined(HAS_TEXT_PITCH_ALIGN)\nattribute vec2 aPitchAlign;\n#endif\n#ifndef HAS_MARKER_PITCH_ALIGN\nuniform float markerPitchWithMap;\n#endif\n#ifndef HAS_TEXT_PITCH_ALIGN\nuniform float textPitchWithMap;\n#endif\n#if defined(HAS_MARKER_ROTATION_ALIGN) || defined(HAS_TEXT_ROTATION_ALIGN)\nattribute vec2 aRotationAlign;\n#endif\n#ifndef HAS_MARKER_ROTATION_ALIGN\nuniform float markerRotateWithMap;\n#endif\n#ifndef HAS_TEXT_ROTATION_ALIGN\nuniform float textRotateWithMap;\n#endif\nuniform float flipY;\n#if defined(HAS_MARKER_ROTATION) || defined(HAS_TEXT_ROTATION)\nattribute vec2 aRotation;\n#endif\n#ifndef HAS_MARKER_ROTATION\nuniform float markerRotation;\n#endif\n#ifndef HAS_TEXT_ROTATION\nuniform float textRotation;\n#endif\n#ifdef HAS_PAD_OFFSET\nattribute vec2 aPadOffset;\n#endif\nuniform float cameraToCenterDistance;\nuniform mat4 positionMatrix;\nuniform mat4 projViewModelMatrix;\nuniform float textPerspectiveRatio;\nuniform float markerPerspectiveRatio;\nuniform float glyphSize;\nuniform vec2 iconSize;\nuniform vec2 canvasSize;\nuniform vec2 iconTexSize;\nuniform vec2 glyphTexSize;\nuniform float mapPitch;\nuniform float mapRotation;\nuniform float zoomScale;\nuniform float tileRatio;\nuniform float layerScale;\nuniform float isRenderingTerrain;\n#include <vt_position_vert>\nvarying float vIsText;\n#ifndef PICKING_MODE\nvarying vec2 vTexCoord;\nvarying float vOpacity;\nvarying float vGammaScale;\nvarying float vTextSize;\nvarying float vHalo;\n#ifdef HAS_TEXT_FILL\nattribute vec4 aTextFill;\nvarying vec4 vTextFill;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nattribute vec4 aTextHaloFill;\nvarying vec4 vTextHaloFill;\n#endif\n#if defined(HAS_TEXT_HALO_RADIUS) || defined(HAS_TEXT_HALO_OPACITY)\nattribute vec2 aTextHalo;\nvarying vec2 vTextHalo;\n#endif\n#include <highlight_vert>\n#else\n#include <fbo_picking_vert>\n#endif\nvoid main() {\n vec3 c = unpackVTPosition();\n#ifdef HAS_TEXT_SIZE\nfloat d = aTextSize * layerScale;\n#else\nfloat d = textSize * layerScale;\n#endif\n#ifdef HAS_TEXT_DX\nfloat e = aDxDy.z;\n#else\nfloat e = textDx;\n#endif\n#ifdef HAS_TEXT_DY\nfloat f = aDxDy.w;\n#else\nfloat f = textDy;\n#endif\n#ifdef HAS_MARKER_WIDTH\nfloat h = aMarkerWidth;\n#else\nfloat h = markerWidth;\n#endif\n#ifdef HAS_MARKER_HEIGHT\nfloat i = aMarkerHeight;\n#else\nfloat i = markerHeight;\n#endif\n#ifdef HAS_MARKER_DX\nfloat j = aDxDy.x;\n#else\nfloat j = markerDx;\n#endif\n#ifdef HAS_MARKER_DY\nfloat k = aDxDy.y;\n#else\nfloat k = markerDy;\n#endif\nfloat l = mod(aShape.z, 2.);\n float m;\n if(l > .5) {\n \n#ifdef HAS_TEXT_PITCH_ALIGN\nm = aPitchAlign.y;\n#else\nm = textPitchWithMap;\n#endif\n } else {\n \n#ifdef HAS_MARKER_PITCH_ALIGN\nm = aPitchAlign.x;\n#else\nm = markerPitchWithMap;\n#endif\n }\n float n;\n if(l > .5) {\n \n#ifdef HAS_TEXT_ROTATION_ALIGN\nn = aRotationAlign.y;\n#else\nn = textRotateWithMap;\n#endif\n } else {\n \n#ifdef HAS_MARKER_ROTATION_ALIGN\nn = aRotationAlign.x;\n#else\nn = markerRotateWithMap;\n#endif\n }\n gl_Position = projViewModelMatrix * positionMatrix * vec4(c, 1.);\n float o = gl_Position.w;\n float u;\n if(isRenderingTerrain == 1. && m == 1.) {\n u = 1.;\n } else {\n float v = (1. - cameraToCenterDistance / o) * markerPerspectiveRatio;\n u = clamp(.5 + .5 * (1. - v), .0, 4.);\n }\n float A;\n if(l > .5) {\n \n#ifdef HAS_TEXT_ROTATION\nA = -aRotation.y / 9362. - mapRotation * n;\n#else\nA = -textRotation - mapRotation * n;\n#endif\n } else {\n \n#ifdef HAS_MARKER_ROTATION\nA = -aRotation.x / 9362. - mapRotation * n;\n#else\nA = -markerRotation - mapRotation * n;\n#endif\n }\n if(m == 1.) {\n \n#ifdef REVERSE_MAP_ROTATION_ON_PITCH\nA += mapRotation;\n#else\nif(l > .5) {\n A -= mapRotation;\n } else {\n A += mapRotation;\n }\n#endif\n }\n float B = sin(A);\n float C = cos(A);\n mat2 D = mat2(C, -1. * B, B, C);\n vec2 E = (aShape.xy / 10.0);\n if(m == 1. && flipY == .0) {\n E *= vec2(1., -1.);\n }\n vIsText = l;\n if(l > .5) {\n E = E / glyphSize * d;\n } else {\n \n#ifdef HAS_PAD_OFFSET\nfloat F = aPadOffset.x - 1.;\n float G = aPadOffset.y;\n#else\nfloat F = .0;\n float G = .0;\n#endif\nE = (E / iconSize * vec2(h, i) + vec2(F, G)) * layerScale;\n }\n E = D * E;\n float H;\n if(isRenderingTerrain == 1.) {\n H = 1.;\n } else {\n H = o / cameraToCenterDistance;\n }\n if(m == .0) {\n vec2 I = E * 2. / canvasSize;\n gl_Position.xy += I * u * o;\n } else if(l > .5) {\n float J;\n if(isRenderingTerrain == 1.) {\n J = tileRatio / zoomScale;\n } else {\n J = tileRatio / zoomScale * H * u;\n }\n vec2 I = E;\n gl_Position = projViewModelMatrix * positionMatrix * vec4(c + vec3(I, .0) * J, 1.);\n } else {\n vec2 I = E;\n gl_Position = projViewModelMatrix * positionMatrix * vec4(c + vec3(I, .0) * tileRatio / zoomScale * H * u, 1.);\n }\n if(l > .5) {\n gl_Position.xy += vec2(e, -f) * 2. / canvasSize * o;\n } else {\n gl_Position.xy += vec2(j, -k) * 2. / canvasSize * o;\n }\n#ifndef PICKING_MODE\nif(m == .0) {\n vGammaScale = mix(1., H, textPerspectiveRatio);\n } else {\n vGammaScale = H + mapPitch / 4.;\n }\n vGammaScale = clamp(vGammaScale, .0, 1.);\n vec2 K = floor(aShape.zw / 2.);\n if(l > .5) {\n vTexCoord = K / glyphTexSize;\n } else {\n vTexCoord = K / iconTexSize;\n }\n vHalo = mod(aShape.w, 2.);\n vTextSize = d;\n#ifdef ENABLE_COLLISION\nvOpacity = aOpacity / 255.;\n#else\nvOpacity = 1.;\n#endif\n#ifdef HAS_OPACITY\nif(l > .5) {\n vOpacity *= aColorOpacity.y / 255.;\n } else {\n vOpacity *= aColorOpacity.x / 255.;\n }\n#endif\n#ifdef HAS_TEXT_FILL\nvTextFill = aTextFill / 255.;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nvTextHaloFill = aTextHaloFill / 255.;\n#endif\n#if defined(HAS_TEXT_HALO_RADIUS) || defined(HAS_TEXT_HALO_OPACITY)\nvTextHalo = aTextHalo;\n#endif\nhighlight_setVarying();\n#else\n#ifdef ENABLE_COLLISION\nbool L = aOpacity == 255.;\n#else\nbool L = true;\n#endif\nfbo_picking_setData(gl_Position.w, L);\n#endif\n}", Ei = "#define RAD 0.0174532925\nstruct MarkerUniforms {\n positionMatrix: mat4x4f,\n projViewModelMatrix: mat4x4f,\n textSize: f32,\n markerDx: f32,\n markerDy: f32,\n textDx: f32,\n textDy: f32,\n markerWidth: f32,\n markerHeight: f32,\n markerPitchWithMap: f32,\n textPitchWithMap: f32,\n markerRotateWithMap: f32,\n textRotateWithMap: f32,\n markerRotation: f32,\n textRotation: f32,\n flipY: f32,\n textPerspectiveRatio: f32,\n markerPerspectiveRatio: f32,\n iconTexSize: vec2f,\n glyphTexSize: vec2f,\n tileRatio: f32,\n zoomScale: f32\n}\nstruct ShaderUniforms {\n cameraToCenterDistance: f32,\n glyphSize: f32,\n iconSize: vec2f,\n canvasSize: vec2f,\n layerScale: f32,\n isRenderingTerrain: f32,\n mapPitch: f32,\n mapRotation: f32\n}\n@group(0) @binding($b) var<uniform> uniforms: MarkerUniforms;\n@group(0) @binding($b) var<uniform> shaderUniforms: ShaderUniforms;\nstruct VertexInput {\n#ifdef HAS_ALTITUDE\n @location($i) aPosition: POSITION_TYPE_2,\n @location($i) aAltitude: f32,\n#else\n @location($i) aPosition: POSITION_TYPE_3,\n#endif\n @location($i) aShape: vec4i,\n#ifdef ENABLE_COLLISION\n @location($i) aOpacity: u32,\n#endif\n#ifdef HAS_OPACITY\n @location($i) aColorOpacity: vec2u,\n#endif\n#ifdef HAS_TEXT_SIZE\n @location($i) aTextSize: u32,\n#endif\n#if HAS_TEXT_DX || HAS_TEXT_DY || HAS_MARKER_DX || HAS_MARKER_DY\n @location($i) aDxDy: vec4i,\n#endif\n#ifdef HAS_MARKER_WIDTH\n @location($i) aMarkerWidth: u32,\n#endif\n#ifdef HAS_MARKER_HEIGHT\n @location($i) aMarkerHeight: u32,\n#endif\n#if HAS_MARKER_PITCH_ALIGN || HAS_TEXT_PITCH_ALIGN\n @location($i) aPitchAlign: vec2u,\n#endif\n#if HAS_MARKER_ROTATION_ALIGN || HAS_TEXT_ROTATION_ALIGN\n @location($i) aRotationAlign: vec2u,\n#endif\n#if HAS_MARKER_ROTATION || HAS_TEXT_ROTATION\n @location($i) aRotation: vec2u,\n#endif\n#ifdef HAS_PAD_OFFSET\n @location($i) aPadOffset: vec2i,\n#endif\n#ifdef HAS_TEXT_FILL\n @location($i) aTextFill: vec4u,\n#endif\n#ifdef HAS_TEXT_HALO_FILL\n @location($i) aTextHaloFill: vec4u,\n#endif\n#if HAS_TEXT_HALO_RADIUS || HAS_TEXT_HALO_OPACITY\n @location($i) aTextHalo: vec2u,\n#endif\n};\nstruct VertexOutput {\n @builtin(position) position: vec4f,\n#ifndef PICKING_MODE\n @location($o) vTexCoord: vec2f,\n @location($o) vOpacity: f32,\n @location($o) vGammaScale: f32,\n @location($o) vTextSize: f32,\n @location($o) vHalo: f32,\n @location($o) vIsText: f32,\n #ifdef HAS_TEXT_FILL\n @location($o) vTextFill: vec4f,\n #endif\n #ifdef HAS_TEXT_HALO_FILL\n @location($o) vTextHaloFill: vec4f,\n #endif\n #if HAS_TEXT_HALO_RADIUS || HAS_TEXT_HALO_OPACITY\n @location($o) vTextHalo: vec2f,\n #endif\n#endif\n};\n#include <vt_position_vert>\n#ifndef PICKING_MODE\n#include <highlight_vert>\n#else\n#include <fbo_picking_vert>\n#endif\n@vertex\nfn main(vertexInput: VertexInput) -> VertexOutput {\n var output: VertexOutput;\n var position = unpackVTPosition(vertexInput);\n#ifdef HAS_TEXT_SIZE\n var myTextSize = f32(vertexInput.aTextSize) * shaderUniforms.layerScale;\n#else\n var myTextSize = uniforms.textSize * shaderUniforms.layerScale;\n#endif\n#ifdef HAS_TEXT_DX\n var myTextDx = f32(vertexInput.aDxDy.z);\n#else\n var myTextDx = uniforms.textDx;\n#endif\n#ifdef HAS_TEXT_DY\n var myTextDy = f32(vertexInput.aDxDy.w);\n#else\n var myTextDy = uniforms.textDy;\n#endif\n#ifdef HAS_MARKER_WIDTH\n var myMarkerWidth = f32(vertexInput.aMarkerWidth);\n#else\n var myMarkerWidth = uniforms.markerWidth;\n#endif\n#ifdef HAS_MARKER_HEIGHT\n var myMarkerHeight = f32(vertexInput.aMarkerHeight);\n#else\n var myMarkerHeight = uniforms.markerHeight;\n#endif\n#ifdef HAS_MARKER_DX\n var myMarkerDx = f32(vertexInput.aDxDy.x);\n#else\n var myMarkerDx = uniforms.markerDx;\n#endif\n#ifdef HAS_MARKER_DY\n var myMarkerDy = f32(vertexInput.aDxDy.y);\n#else\n var myMarkerDy = uniforms.markerDy;\n#endif\n var isText = f32(vertexInput.aShape.z) % 2.0;\n var isPitchWithMap: f32;\n if (isText > 0.5) {\n#ifdef HAS_TEXT_PITCH_ALIGN\n isPitchWithMap = f32(vertexInput.aPitchAlign.y);\n#else\n isPitchWithMap = uniforms.textPitchWithMap;\n#endif\n } else {\n#ifdef HAS_MARKER_PITCH_ALIGN\n isPitchWithMap = f32(vertexInput.aPitchAlign.x);\n#else\n isPitchWithMap = uniforms.markerPitchWithMap;\n#endif\n }\n var isRotateWithMap: f32;\n if (isText > 0.5) {\n#ifdef HAS_TEXT_ROTATION_ALIGN\n isRotateWithMap = f32(vertexInput.aRotationAlign.y);\n#else\n isRotateWithMap = uniforms.textRotateWithMap;\n#endif\n } else {\n#ifdef HAS_MARKER_ROTATION_ALIGN\n isRotateWithMap = f32(vertexInput.aRotationAlign.x);\n#else\n isRotateWithMap = uniforms.markerRotateWithMap;\n#endif\n }\n let positionMatrix = uniforms.positionMatrix;\n let projViewModelMatrix = uniforms.projViewModelMatrix;\n output.position = projViewModelMatrix * positionMatrix * vec4f(position, 1.0);\n var projDistance = output.position.w;\n var perspectiveRatio: f32;\n if (shaderUniforms.isRenderingTerrain == 1.0 && isPitchWithMap == 1.0) {\n perspectiveRatio = 1.0;\n } else {\n var distanceRatio = (1.0 - shaderUniforms.cameraToCenterDistance / projDistance) * uniforms.markerPerspectiveRatio;\n perspectiveRatio = clamp(\n 0.5 + 0.5 * (1.0 - distanceRatio),\n 0.0,\n 4.0);\n }\n var rotation: f32;\n let mapRotation = shaderUniforms.mapRotation;\n if (isText > 0.5) {\n#ifdef HAS_TEXT_ROTATION\n rotation = -f32(vertexInput.aRotation.y) / 9362.0 - mapRotation * isRotateWithMap;\n#else\n rotation = -uniforms.textRotation - mapRotation * isRotateWithMap;\n#endif\n } else {\n#ifdef HAS_MARKER_ROTATION\n rotation = -f32(vertexInput.aRotation.x) / 9362.0 - mapRotation * isRotateWithMap;\n#else\n rotation = -uniforms.markerRotation - mapRotation * isRotateWithMap;\n#endif\n }\n if (isPitchWithMap == 1.0) {\n#ifdef REVERSE_MAP_ROTATION_ON_PITCH\n rotation += mapRotation;\n#else\n if (isText > 0.5) {\n rotation -= mapRotation;\n } else {\n rotation += mapRotation;\n }\n#endif\n }\n var angleSin = sin(rotation);\n var angleCos = cos(rotation);\n var shapeMatrix = mat2x2f(angleCos, -1.0 * angleSin, angleSin, angleCos);\n var shape = vec2f(vertexInput.aShape.xy) / 10.0;\n if (isPitchWithMap == 1.0 && uniforms.flipY == 0.0) {\n shape *= vec2f(1.0, -1.0);\n }\n if (isText > 0.5) {\n shape = shape / shaderUniforms.glyphSize * myTextSize;\n } else {\n#ifdef HAS_PAD_OFFSET\n var padOffsetX = f32(vertexInput.aPadOffset.x) - 1.0;\n var padOffsetY = f32(vertexInput.aPadOffset.y);\n#else\n var padOffsetX = 0.0;\n var padOffsetY = 0.0;\n#endif\n shape = (shape / shaderUniforms.iconSize * vec2f(myMarkerWidth, myMarkerHeight) + vec2f(padOffsetX, padOffsetY)) * shaderUniforms.layerScale;\n }\n shape = shapeMatrix * shape;\n var cameraScale: f32;\n if (shaderUniforms.isRenderingTerrain == 1.0) {\n cameraScale = 1.0;\n } else {\n cameraScale = projDistance / shaderUniforms.cameraToCenterDistance;\n }\n let canvasSize = shaderUniforms.canvasSize;\n if (isPitchWithMap == 0.0) {\n var offset = shape * 2.0 / canvasSize;\n output.position.x += offset.x * perspectiveRatio * projDistance;\n output.position.y += offset.y * perspectiveRatio * projDistance;\n } else if (isText > 0.5) {\n var offsetScale: f32;\n if (shaderUniforms.isRenderingTerrain == 1.0) {\n offsetScale = uniforms.tileRatio / uniforms.zoomScale;\n } else {\n offsetScale = uniforms.tileRatio / uniforms.zoomScale * cameraScale * perspectiveRatio;\n }\n var offset = shape;\n output.position = projViewModelMatrix * positionMatrix * vec4f(position + vec3f(offset, 0.0) * offsetScale, 1.0);\n } else {\n var offset = shape;\n output.position = projViewModelMatrix * positionMatrix * vec4f(position + vec3f(offset, 0.0) * uniforms.tileRatio / uniforms.zoomScale * cameraScale * perspectiveRatio, 1.0);\n }\n if (isText > 0.5) {\n output.position.x += myTextDx * 2.0 / canvasSize.x * projDistance;\n output.position.y += -myTextDy * 2.0 / canvasSize.y * projDistance;\n } else {\n output.position.x += myMarkerDx * 2.0 / canvasSize.x * projDistance;\n output.position.y += -myMarkerDy * 2.0 / canvasSize.y * projDistance;\n }\n#ifndef PICKING_MODE\n output.vIsText = isText;\n if (isPitchWithMap == 0.0) {\n output.vGammaScale = mix(1.0, cameraScale, uniforms.textPerspectiveRatio);\n } else {\n output.vGammaScale = cameraScale + shaderUniforms.mapPitch / 4.0;\n }\n output.vGammaScale = clamp(output.vGammaScale, 0.0, 1.0);\n var texCoord = floor(vec2f(vertexInput.aShape.zw) / 2.0);\n if (isText > 0.5) {\n output.vTexCoord = texCoord / uniforms.glyphTexSize;\n } else {\n output.vTexCoord = texCoord / uniforms.iconTexSize;\n }\n output.vHalo = f32(vertexInput.aShape.w) % 2.0;\n output.vTextSize = myTextSize;\n#ifdef ENABLE_COLLISION\n output.vOpacity = f32(vertexInput.aOpacity) / 255.0;\n#else\n output.vOpacity = 1.0;\n#endif\n#ifdef HAS_OPACITY\n if (isText > 0.5) {\n output.vOpacity *= f32(vertexInput.aColorOpacity.y) / 255.0;\n } else {\n output.vOpacity *= f32(vertexInput.aColorOpacity.x) / 255.0;\n }\n#endif\n#ifdef HAS_TEXT_FILL\n output.vTextFill = vec4f(vertexInput.aTextFill) / 255.0;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\n output.vTextHaloFill = vec4f(vertexInput.aTextHaloFill) / 255.0;\n#endif\n#if HAS_TEXT_HALO_RADIUS || HAS_TEXT_HALO_OPACITY\n output.vTextHalo = vec2f(vertexInput.aTextHalo);\n#endif\n#if HAS_HIGHLIGHT_COLOR || HAS_HIGHLIGHT_OPACITY\n highlight_setVarying(vertexInput, output);\n#endif\n#else\n#ifdef ENABLE_COLLISION\n var visible = f32(vertexInput.aOpacity) == 255.0;\n#else\n var visible = true;\n#endif\n fbo_picking_setData(vertexInput, &output, output.position.w, visible);\n#endif\n return output;\n}";
|
|
14485
|
+
var Fi = "#include <gl2_vert>\n#define SHADER_NAME MARKER\n#define RAD 0.0174532925\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\nattribute vec4 aShape;\n#ifdef ENABLE_COLLISION\nattribute float aOpacity;\n#endif\n#ifdef HAS_OPACITY\nattribute vec2 aColorOpacity;\n#endif\n#ifdef HAS_TEXT_SIZE\nattribute float aTextSize;\n#else\nuniform float textSize;\n#endif\n#if defined(HAS_TEXT_DX) || defined(HAS_TEXT_DY) || defined(HAS_MARKER_DX) || defined(HAS_MARKER_DY)\nattribute vec4 aDxDy;\n#endif\n#ifndef HAS_MARKER_DX\nuniform float markerDx;\n#endif\n#ifndef HAS_MARKER_DY\nuniform float markerDy;\n#endif\n#ifndef HAS_TEXT_DX\nuniform float textDx;\n#endif\n#ifndef HAS_TEXT_DY\nuniform float textDy;\n#endif\n#ifdef HAS_MARKER_WIDTH\nattribute float aMarkerWidth;\n#else\nuniform float markerWidth;\n#endif\n#ifdef HAS_MARKER_HEIGHT\nattribute float aMarkerHeight;\n#else\nuniform float markerHeight;\n#endif\n#if defined(HAS_MARKER_PITCH_ALIGN) || defined(HAS_TEXT_PITCH_ALIGN)\nattribute vec2 aPitchAlign;\n#endif\n#ifndef HAS_MARKER_PITCH_ALIGN\nuniform float markerPitchWithMap;\n#endif\n#ifndef HAS_TEXT_PITCH_ALIGN\nuniform float textPitchWithMap;\n#endif\n#if defined(HAS_MARKER_ROTATION_ALIGN) || defined(HAS_TEXT_ROTATION_ALIGN)\nattribute vec2 aRotationAlign;\n#endif\n#ifndef HAS_MARKER_ROTATION_ALIGN\nuniform float markerRotateWithMap;\n#endif\n#ifndef HAS_TEXT_ROTATION_ALIGN\nuniform float textRotateWithMap;\n#endif\nuniform float flipY;\n#if defined(HAS_MARKER_ROTATION) || defined(HAS_TEXT_ROTATION)\nattribute vec2 aRotation;\n#endif\n#ifndef HAS_MARKER_ROTATION\nuniform float markerRotation;\n#endif\n#ifndef HAS_TEXT_ROTATION\nuniform float textRotation;\n#endif\n#ifdef HAS_PAD_OFFSET\nattribute vec2 aPadOffset;\n#endif\nuniform float cameraToCenterDistance;\nuniform mat4 positionMatrix;\nuniform mat4 projViewModelMatrix;\nuniform float textPerspectiveRatio;\nuniform float markerPerspectiveRatio;\nuniform float glyphSize;\nuniform vec2 iconSize;\nuniform vec2 canvasSize;\nuniform vec2 iconTexSize;\nuniform vec2 glyphTexSize;\nuniform float mapPitch;\nuniform float mapRotation;\nuniform float zoomScale;\nuniform float tileRatio;\nuniform float layerScale;\nuniform float isRenderingTerrain;\n#include <vt_position_vert>\nvarying float vIsText;\n#ifndef PICKING_MODE\nvarying vec2 vTexCoord;\nvarying float vOpacity;\nvarying float vGammaScale;\nvarying float vTextSize;\nvarying float vHalo;\n#ifdef HAS_TEXT_FILL\nattribute vec4 aTextFill;\nvarying vec4 vTextFill;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nattribute vec4 aTextHaloFill;\nvarying vec4 vTextHaloFill;\n#endif\n#if defined(HAS_TEXT_HALO_RADIUS) || defined(HAS_TEXT_HALO_OPACITY)\nattribute vec2 aTextHalo;\nvarying vec2 vTextHalo;\n#endif\n#include <highlight_vert>\n#else\n#include <fbo_picking_vert>\n#endif\nvoid main() {\n vec3 c = unpackVTPosition();\n#ifdef HAS_TEXT_SIZE\nfloat d = aTextSize * layerScale;\n#else\nfloat d = textSize * layerScale;\n#endif\n#ifdef HAS_TEXT_DX\nfloat e = aDxDy.z;\n#else\nfloat e = textDx;\n#endif\n#ifdef HAS_TEXT_DY\nfloat f = aDxDy.w;\n#else\nfloat f = textDy;\n#endif\n#ifdef HAS_MARKER_WIDTH\nfloat h = aMarkerWidth;\n#else\nfloat h = markerWidth;\n#endif\n#ifdef HAS_MARKER_HEIGHT\nfloat i = aMarkerHeight;\n#else\nfloat i = markerHeight;\n#endif\n#ifdef HAS_MARKER_DX\nfloat j = aDxDy.x;\n#else\nfloat j = markerDx;\n#endif\n#ifdef HAS_MARKER_DY\nfloat k = aDxDy.y;\n#else\nfloat k = markerDy;\n#endif\nfloat l = mod(aShape.z, 2.);\n float m;\n if(l > .5) {\n \n#ifdef HAS_TEXT_PITCH_ALIGN\nm = aPitchAlign.y;\n#else\nm = textPitchWithMap;\n#endif\n } else {\n \n#ifdef HAS_MARKER_PITCH_ALIGN\nm = aPitchAlign.x;\n#else\nm = markerPitchWithMap;\n#endif\n }\n float n;\n if(l > .5) {\n \n#ifdef HAS_TEXT_ROTATION_ALIGN\nn = aRotationAlign.y;\n#else\nn = textRotateWithMap;\n#endif\n } else {\n \n#ifdef HAS_MARKER_ROTATION_ALIGN\nn = aRotationAlign.x;\n#else\nn = markerRotateWithMap;\n#endif\n }\n gl_Position = projViewModelMatrix * positionMatrix * vec4(c, 1.);\n float o = gl_Position.w;\n float u;\n if(isRenderingTerrain == 1. && m == 1.) {\n u = 1.;\n } else {\n float v = (1. - cameraToCenterDistance / o) * markerPerspectiveRatio;\n u = clamp(.5 + .5 * (1. - v), .0, 4.);\n }\n float A;\n if(l > .5) {\n \n#ifdef HAS_TEXT_ROTATION\nA = -aRotation.y / 9362. - mapRotation * n;\n#else\nA = -textRotation - mapRotation * n;\n#endif\n } else {\n \n#ifdef HAS_MARKER_ROTATION\nA = -aRotation.x / 9362. - mapRotation * n;\n#else\nA = -markerRotation - mapRotation * n;\n#endif\n }\n if(m == 1.) {\n \n#ifdef REVERSE_MAP_ROTATION_ON_PITCH\nA += mapRotation;\n#else\nif(l > .5) {\n A -= mapRotation;\n } else {\n A += mapRotation;\n }\n#endif\n }\n float B = sin(A);\n float C = cos(A);\n mat2 D = mat2(C, -1. * B, B, C);\n vec2 E = (aShape.xy / 10.0);\n if(m == 1. && flipY == .0) {\n E *= vec2(1., -1.);\n }\n vIsText = l;\n if(l > .5) {\n E = E / glyphSize * d;\n } else {\n \n#ifdef HAS_PAD_OFFSET\nfloat F = aPadOffset.x - 1.;\n float G = aPadOffset.y;\n#else\nfloat F = .0;\n float G = .0;\n#endif\nE = (E / iconSize * vec2(h, i) + vec2(F, G)) * layerScale;\n }\n E = D * E;\n float H;\n if(isRenderingTerrain == 1.) {\n H = 1.;\n } else {\n H = o / cameraToCenterDistance;\n }\n if(m == .0) {\n vec2 I = E * 2. / canvasSize;\n gl_Position.xy += I * u * o;\n } else if(l > .5) {\n float J;\n if(isRenderingTerrain == 1.) {\n J = tileRatio / zoomScale;\n } else {\n J = tileRatio / zoomScale * H * u;\n }\n vec2 I = E;\n gl_Position = projViewModelMatrix * positionMatrix * vec4(c + vec3(I, .0) * J, 1.);\n } else {\n vec2 I = E;\n gl_Position = projViewModelMatrix * positionMatrix * vec4(c + vec3(I, .0) * tileRatio / zoomScale * H * u, 1.);\n }\n if(l > .5) {\n gl_Position.xy += vec2(e, -f) * 2. / canvasSize * o;\n } else {\n gl_Position.xy += vec2(j, -k) * 2. / canvasSize * o;\n }\n#ifndef PICKING_MODE\nif(m == .0) {\n vGammaScale = mix(1., H, textPerspectiveRatio);\n } else {\n vGammaScale = H + mapPitch / 4.;\n }\n vGammaScale = clamp(vGammaScale, .0, 1.);\n vec2 K = floor(aShape.zw / 2.);\n if(l > .5) {\n vTexCoord = K / glyphTexSize;\n } else {\n vTexCoord = K / iconTexSize;\n }\n vHalo = mod(aShape.w, 2.);\n vTextSize = d;\n#ifdef ENABLE_COLLISION\nvOpacity = aOpacity / 255.;\n#else\nvOpacity = 1.;\n#endif\n#ifdef HAS_OPACITY\nif(l > .5) {\n vOpacity *= aColorOpacity.y / 255.;\n } else {\n vOpacity *= aColorOpacity.x / 255.;\n }\n#endif\n#ifdef HAS_TEXT_FILL\nvTextFill = aTextFill / 255.;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nvTextHaloFill = aTextHaloFill / 255.;\n#endif\n#if defined(HAS_TEXT_HALO_RADIUS) || defined(HAS_TEXT_HALO_OPACITY)\nvTextHalo = aTextHalo;\n#endif\nhighlight_setVarying();\n#else\n#ifdef ENABLE_COLLISION\nbool L = aOpacity == 255.;\n#else\nbool L = true;\n#endif\nfbo_picking_setData(gl_Position.w, L);\n#endif\n}", Ei = "#define RAD 0.0174532925\nstruct MarkerUniforms {\n positionMatrix: mat4x4f,\n projViewModelMatrix: mat4x4f,\n textSize: f32,\n markerDx: f32,\n markerDy: f32,\n textDx: f32,\n textDy: f32,\n markerWidth: f32,\n markerHeight: f32,\n markerPitchWithMap: f32,\n textPitchWithMap: f32,\n markerRotateWithMap: f32,\n textRotateWithMap: f32,\n markerRotation: f32,\n textRotation: f32,\n flipY: f32,\n textPerspectiveRatio: f32,\n markerPerspectiveRatio: f32,\n iconTexSize: vec2f,\n glyphTexSize: vec2f,\n tileRatio: f32,\n zoomScale: f32\n}\nstruct ShaderUniforms {\n cameraToCenterDistance: f32,\n glyphSize: f32,\n iconSize: vec2f,\n canvasSize: vec2f,\n layerScale: f32,\n isRenderingTerrain: f32,\n mapPitch: f32,\n mapRotation: f32\n}\n@group(0) @binding($b) var<uniform> uniforms: MarkerUniforms;\n@group(0) @binding($b) var<uniform> shaderUniforms: ShaderUniforms;\nstruct VertexInput {\n#ifdef HAS_ALTITUDE\n @location($i) aPosition: POSITION_TYPE_2,\n @location($i) aAltitude: f32,\n#else\n @location($i) aPosition: POSITION_TYPE_3,\n#endif\n @location($i) aShape: vec4i,\n#ifdef ENABLE_COLLISION\n @location($i) aOpacity: u32,\n#endif\n#ifdef HAS_OPACITY\n @location($i) aColorOpacity: vec2u,\n#endif\n#ifdef HAS_TEXT_SIZE\n @location($i) aTextSize: u32,\n#endif\n#if HAS_TEXT_DX || HAS_TEXT_DY || HAS_MARKER_DX || HAS_MARKER_DY\n @location($i) aDxDy: vec4i,\n#endif\n#ifdef HAS_MARKER_WIDTH\n @location($i) aMarkerWidth: u32,\n#endif\n#ifdef HAS_MARKER_HEIGHT\n @location($i) aMarkerHeight: u32,\n#endif\n#if HAS_MARKER_PITCH_ALIGN || HAS_TEXT_PITCH_ALIGN\n @location($i) aPitchAlign: vec2u,\n#endif\n#if HAS_MARKER_ROTATION_ALIGN || HAS_TEXT_ROTATION_ALIGN\n @location($i) aRotationAlign: vec2u,\n#endif\n#if HAS_MARKER_ROTATION || HAS_TEXT_ROTATION\n @location($i) aRotation: vec2u,\n#endif\n#ifdef HAS_PAD_OFFSET\n @location($i) aPadOffset: vec2i,\n#endif\n#ifdef HAS_TEXT_FILL\n @location($i) aTextFill: vec4u,\n#endif\n#ifdef HAS_TEXT_HALO_FILL\n @location($i) aTextHaloFill: vec4u,\n#endif\n#if HAS_TEXT_HALO_RADIUS || HAS_TEXT_HALO_OPACITY\n @location($i) aTextHalo: vec2u,\n#endif\n};\nstruct VertexOutput {\n @builtin(position) position: vec4f,\n#ifndef PICKING_MODE\n @location($o) vTexCoord: vec2f,\n @location($o) vOpacity: f32,\n @location($o) vGammaScale: f32,\n @location($o) vTextSize: f32,\n @location($o) vHalo: f32,\n @location($o) vIsText: f32,\n #ifdef HAS_TEXT_FILL\n @location($o) vTextFill: vec4f,\n #endif\n #ifdef HAS_TEXT_HALO_FILL\n @location($o) vTextHaloFill: vec4f,\n #endif\n #if HAS_TEXT_HALO_RADIUS || HAS_TEXT_HALO_OPACITY\n @location($o) vTextHalo: vec2f,\n #endif\n#endif\n};\n#include <vt_position_vert>\n#ifndef PICKING_MODE\n#include <highlight_vert>\n#else\n#include <fbo_picking_vert>\n#endif\n@vertex\nfn main(vertexInput: VertexInput) -> VertexOutput {\n var output: VertexOutput;\n var position = unpackVTPosition(vertexInput);\n#ifdef HAS_TEXT_SIZE\n var myTextSize = f32(vertexInput.aTextSize) * shaderUniforms.layerScale;\n#else\n var myTextSize = uniforms.textSize * shaderUniforms.layerScale;\n#endif\n#ifdef HAS_TEXT_DX\n var myTextDx = f32(vertexInput.aDxDy.z);\n#else\n var myTextDx = uniforms.textDx;\n#endif\n#ifdef HAS_TEXT_DY\n var myTextDy = f32(vertexInput.aDxDy.w);\n#else\n var myTextDy = uniforms.textDy;\n#endif\n#ifdef HAS_MARKER_WIDTH\n var myMarkerWidth = f32(vertexInput.aMarkerWidth);\n#else\n var myMarkerWidth = uniforms.markerWidth;\n#endif\n#ifdef HAS_MARKER_HEIGHT\n var myMarkerHeight = f32(vertexInput.aMarkerHeight);\n#else\n var myMarkerHeight = uniforms.markerHeight;\n#endif\n#ifdef HAS_MARKER_DX\n var myMarkerDx = f32(vertexInput.aDxDy.x);\n#else\n var myMarkerDx = uniforms.markerDx;\n#endif\n#ifdef HAS_MARKER_DY\n var myMarkerDy = f32(vertexInput.aDxDy.y);\n#else\n var myMarkerDy = uniforms.markerDy;\n#endif\n var isText = f32(vertexInput.aShape.z) % 2.0;\n var isPitchWithMap: f32;\n if (isText > 0.5) {\n#ifdef HAS_TEXT_PITCH_ALIGN\n isPitchWithMap = f32(vertexInput.aPitchAlign.y);\n#else\n isPitchWithMap = uniforms.textPitchWithMap;\n#endif\n } else {\n#ifdef HAS_MARKER_PITCH_ALIGN\n isPitchWithMap = f32(vertexInput.aPitchAlign.x);\n#else\n isPitchWithMap = uniforms.markerPitchWithMap;\n#endif\n }\n var isRotateWithMap: f32;\n if (isText > 0.5) {\n#ifdef HAS_TEXT_ROTATION_ALIGN\n isRotateWithMap = f32(vertexInput.aRotationAlign.y);\n#else\n isRotateWithMap = uniforms.textRotateWithMap;\n#endif\n } else {\n#ifdef HAS_MARKER_ROTATION_ALIGN\n isRotateWithMap = f32(vertexInput.aRotationAlign.x);\n#else\n isRotateWithMap = uniforms.markerRotateWithMap;\n#endif\n }\n let positionMatrix = uniforms.positionMatrix;\n let projViewModelMatrix = uniforms.projViewModelMatrix;\n output.position = projViewModelMatrix * positionMatrix * vec4f(position, 1.0);\n var projDistance = output.position.w;\n var perspectiveRatio: f32;\n if (shaderUniforms.isRenderingTerrain == 1.0 && isPitchWithMap == 1.0) {\n perspectiveRatio = 1.0;\n } else {\n var distanceRatio = (1.0 - shaderUniforms.cameraToCenterDistance / projDistance) * uniforms.markerPerspectiveRatio;\n perspectiveRatio = clamp(\n 0.5 + 0.5 * (1.0 - distanceRatio),\n 0.0,\n 4.0);\n }\n var rotation: f32;\n let mapRotation = shaderUniforms.mapRotation;\n if (isText > 0.5) {\n#ifdef HAS_TEXT_ROTATION\n rotation = -f32(vertexInput.aRotation.y) / 9362.0 - mapRotation * isRotateWithMap;\n#else\n rotation = -uniforms.textRotation - mapRotation * isRotateWithMap;\n#endif\n } else {\n#ifdef HAS_MARKER_ROTATION\n rotation = -f32(vertexInput.aRotation.x) / 9362.0 - mapRotation * isRotateWithMap;\n#else\n rotation = -uniforms.markerRotation - mapRotation * isRotateWithMap;\n#endif\n }\n if (isPitchWithMap == 1.0) {\n#ifdef REVERSE_MAP_ROTATION_ON_PITCH\n rotation += mapRotation;\n#else\n if (isText > 0.5) {\n rotation -= mapRotation;\n } else {\n rotation += mapRotation;\n }\n#endif\n }\n var angleSin = sin(rotation);\n var angleCos = cos(rotation);\n var shapeMatrix = mat2x2f(angleCos, -1.0 * angleSin, angleSin, angleCos);\n var shape = vec2f(vertexInput.aShape.xy) / 10.0;\n if (isPitchWithMap == 1.0 && uniforms.flipY == 0.0) {\n shape *= vec2f(1.0, -1.0);\n }\n if (isText > 0.5) {\n shape = shape / shaderUniforms.glyphSize * myTextSize;\n } else {\n#ifdef HAS_PAD_OFFSET\n var padOffsetX = f32(vertexInput.aPadOffset.x) - 1.0;\n var padOffsetY = f32(vertexInput.aPadOffset.y);\n#else\n var padOffsetX = 0.0;\n var padOffsetY = 0.0;\n#endif\n shape = (shape / shaderUniforms.iconSize * vec2f(myMarkerWidth, myMarkerHeight) + vec2f(padOffsetX, padOffsetY)) * shaderUniforms.layerScale;\n }\n shape = shapeMatrix * shape;\n var cameraScale: f32;\n if (shaderUniforms.isRenderingTerrain == 1.0) {\n cameraScale = 1.0;\n } else {\n cameraScale = projDistance / shaderUniforms.cameraToCenterDistance;\n }\n let canvasSize = shaderUniforms.canvasSize;\n if (isPitchWithMap == 0.0) {\n var offset = shape * 2.0 / canvasSize;\n output.position.x += offset.x * perspectiveRatio * projDistance;\n output.position.y += offset.y * perspectiveRatio * projDistance;\n } else if (isText > 0.5) {\n var offsetScale: f32;\n if (shaderUniforms.isRenderingTerrain == 1.0) {\n offsetScale = uniforms.tileRatio / uniforms.zoomScale;\n } else {\n offsetScale = uniforms.tileRatio / uniforms.zoomScale * cameraScale * perspectiveRatio;\n }\n var offset = shape;\n output.position = projViewModelMatrix * positionMatrix * vec4f(position + vec3f(offset, 0.0) * offsetScale, 1.0);\n } else {\n var offset = shape;\n output.position = projViewModelMatrix * positionMatrix * vec4f(position + vec3f(offset, 0.0) * uniforms.tileRatio / uniforms.zoomScale * cameraScale * perspectiveRatio, 1.0);\n }\n if (isText > 0.5) {\n output.position.x += myTextDx * 2.0 / canvasSize.x * projDistance;\n output.position.y += -myTextDy * 2.0 / canvasSize.y * projDistance;\n } else {\n output.position.x += myMarkerDx * 2.0 / canvasSize.x * projDistance;\n output.position.y += -myMarkerDy * 2.0 / canvasSize.y * projDistance;\n }\n#ifndef PICKING_MODE\n output.vIsText = isText;\n if (isPitchWithMap == 0.0) {\n output.vGammaScale = mix(1.0, cameraScale, uniforms.textPerspectiveRatio);\n } else {\n output.vGammaScale = cameraScale + shaderUniforms.mapPitch / 4.0;\n }\n output.vGammaScale = clamp(output.vGammaScale, 0.0, 1.0);\n var texCoord = floor(vec2f(vertexInput.aShape.zw) / 2.0);\n if (isText > 0.5) {\n output.vTexCoord = texCoord / uniforms.glyphTexSize;\n } else {\n output.vTexCoord = texCoord / uniforms.iconTexSize;\n }\n output.vHalo = f32(vertexInput.aShape.w) % 2.0;\n output.vTextSize = myTextSize;\n#ifdef ENABLE_COLLISION\n output.vOpacity = f32(vertexInput.aOpacity) / 255.0;\n#else\n output.vOpacity = 1.0;\n#endif\n#ifdef HAS_OPACITY\n if (isText > 0.5) {\n output.vOpacity *= f32(vertexInput.aColorOpacity.y) / 255.0;\n } else {\n output.vOpacity *= f32(vertexInput.aColorOpacity.x) / 255.0;\n }\n#endif\n#ifdef HAS_TEXT_FILL\n output.vTextFill = vec4f(vertexInput.aTextFill) / 255.0;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\n output.vTextHaloFill = vec4f(vertexInput.aTextHaloFill) / 255.0;\n#endif\n#if HAS_TEXT_HALO_RADIUS || HAS_TEXT_HALO_OPACITY\n output.vTextHalo = vec2f(vertexInput.aTextHalo);\n#endif\n#if HAS_HIGHLIGHT_COLOR || HAS_HIGHLIGHT_OPACITY\n highlight_setVarying(vertexInput, &output);\n#endif\n#else\n#ifdef ENABLE_COLLISION\n var visible = f32(vertexInput.aOpacity) == 255.0;\n#else\n var visible = true;\n#endif\n fbo_picking_setData(vertexInput, &output, output.position.w, visible);\n#endif\n return output;\n}";
|
|
14489
14486
|
|
|
14490
14487
|
const Hi = [], Di = [], Li = [], Ni = [], zi = [], Vi = [];
|
|
14491
14488
|
|
|
@@ -14511,15 +14508,15 @@ function Bi(e, t, n, i, r) {
|
|
|
14511
14508
|
return A.set(e, s, -o, o, s);
|
|
14512
14509
|
}
|
|
14513
14510
|
|
|
14514
|
-
const Wi = 15, ji = 15, Xi = 2048, $i = 24, Yi = .01,
|
|
14511
|
+
const Wi = 15, ji = 15, Xi = 2048, $i = 24, Yi = .01, qi = [], Zi = [], Ki = [], Ji = [], Qi = [], er = [], tr = [], nr = [], ir = [ 1, -1 ], rr = [ 1, 1 ];
|
|
14515
14512
|
|
|
14516
14513
|
function or(e, t, n, r, o) {
|
|
14517
|
-
const s = i[o.id], a = t.material.uniforms, l = o.cameraToCenterDistance, h = t.geometry.properties, c = this.getSymbol(h.symbolIndex), u = t.geometry.desc.positionSize, f = h.aAnchor, d = p.set(
|
|
14514
|
+
const s = i[o.id], a = t.material.uniforms, l = o.cameraToCenterDistance, h = t.geometry.properties, c = this.getSymbol(h.symbolIndex), u = t.geometry.desc.positionSize, f = h.aAnchor, d = p.set(qi, f[n * u], f[n * u + 1], 2 === u ? 0 : f[n * u + 2]), {aTerrainAltitude: g} = h;
|
|
14518
14515
|
if (g) {
|
|
14519
14516
|
const e = 100 * g[2 * n];
|
|
14520
14517
|
e && (d[2] += e);
|
|
14521
14518
|
}
|
|
14522
|
-
let m = rn(
|
|
14519
|
+
let m = rn(Zi, d, r, o.width, o.height);
|
|
14523
14520
|
const y = m[2];
|
|
14524
14521
|
let x = 1;
|
|
14525
14522
|
if (a.markerPerspectiveRatio) {
|
|
@@ -14552,7 +14549,7 @@ function or(e, t, n, r, o) {
|
|
|
14552
14549
|
const {PackUtil: sr} = j(), ar = 1, lr = [], hr = [], cr = [], ur = [], fr = [], dr = [], pr = [ 1, -1 ];
|
|
14553
14550
|
|
|
14554
14551
|
function gr(e, t, n, r, o, s, a, l, h) {
|
|
14555
|
-
const c = r.material.uniforms, u = h.cameraToCenterDistance, f = r.geometry.properties, d = this.getSymbol(f.symbolIndex), g = "line" === d.textPlacement && !
|
|
14552
|
+
const c = r.material.uniforms, u = h.cameraToCenterDistance, f = r.geometry.properties, d = this.getSymbol(f.symbolIndex), g = "line" === d.textPlacement && !Ze(d), m = i[h.id], y = $i, x = n[2];
|
|
14556
14553
|
let _ = 1;
|
|
14557
14554
|
if (c.textPerspectiveRatio) {
|
|
14558
14555
|
_ = ze(.5 + .5 * (1 - (1 - u / x) * c.textPerspectiveRatio), 0, 4);
|
|
@@ -14745,7 +14742,7 @@ function Tr(e, t) {
|
|
|
14745
14742
|
}
|
|
14746
14743
|
|
|
14747
14744
|
function Sr(e, t, n) {
|
|
14748
|
-
const i = e.properties, r = this.getSymbol(i.symbolIndex), o = "line" === i.textPlacement && !
|
|
14745
|
+
const i = e.properties, r = this.getSymbol(i.symbolIndex), o = "line" === i.textPlacement && !Ze(r), {aPosition: s, aShape: a} = e.data, l = s.length / e.desc.positionSize;
|
|
14749
14746
|
if (i.vertexCount = l, i.aPickingId = e.data.aPickingId, i.aCount || (i.aCount = e.data.aCount,
|
|
14750
14747
|
delete e.data.aCount), t || o) {
|
|
14751
14748
|
let e = a;
|
|
@@ -14994,7 +14991,7 @@ const Mr = [], Ir = [], Cr = [], Or = [];
|
|
|
14994
14991
|
|
|
14995
14992
|
function kr(e, t, n, i, r, o, s) {
|
|
14996
14993
|
e = 1 === e ? 1 : 0;
|
|
14997
|
-
const a = this.getMap(), l = t.geometry.properties, h = this.getSymbol(l.symbolIndex), c = "line" === l.textPlacement && !
|
|
14994
|
+
const a = this.getMap(), l = t.geometry.properties, h = this.getSymbol(l.symbolIndex), c = "line" === l.textPlacement && !Ze(h), {aTextSize: u, aTextHalo: f, aShape: d} = l;
|
|
14998
14995
|
let p = u ? u[n[r]] : h.textSize;
|
|
14999
14996
|
null == p && (p = yr.textSize);
|
|
15000
14997
|
const g = f ? f[2 * n[r]] : t.properties.textHaloRadius, m = mr(Cr, t, n[r]), {aProjectedAnchor: y} = t.geometry.properties;
|
|
@@ -15573,7 +15570,7 @@ function Yr(e, t) {
|
|
|
15573
15570
|
}));
|
|
15574
15571
|
}
|
|
15575
15572
|
|
|
15576
|
-
const {FilterUtil:
|
|
15573
|
+
const {FilterUtil: qr} = j(), Zr = [], Kr = {
|
|
15577
15574
|
collides: -1
|
|
15578
15575
|
}, Jr = [ Xi, Xi ], Qr = g.identity([]), eo = [];
|
|
15579
15576
|
|
|
@@ -15588,7 +15585,7 @@ class to extends Ii {
|
|
|
15588
15585
|
needToRefreshTerrainTileOnZooming() {
|
|
15589
15586
|
for (let e = 0; e < this.symbolDef.length; e++) {
|
|
15590
15587
|
const t = this.symbolDef[e].markerPitchAlignment;
|
|
15591
|
-
if ("map" === t || M(t) ||
|
|
15588
|
+
if ("map" === t || M(t) || qr.isExpression(t)) return !0;
|
|
15592
15589
|
}
|
|
15593
15590
|
return !1;
|
|
15594
15591
|
}
|
|
@@ -15700,7 +15697,7 @@ class to extends Ii {
|
|
|
15700
15697
|
for (let e = 0; e < t.length; e++) {
|
|
15701
15698
|
if (!this.isMeshIterable(t[e])) continue;
|
|
15702
15699
|
const n = t[e].geometry, {symbolIndex: i} = n.properties;
|
|
15703
|
-
|
|
15700
|
+
Ze(this.getSymbolDef(i)) && Yr.call(this, this.getMap(), n);
|
|
15704
15701
|
}
|
|
15705
15702
|
const n = this.getMap(), i = e.MapStateCache[n.id], r = i ? i.zoom : n.getZoom();
|
|
15706
15703
|
for (let e = 0; e < t.length; e++) {
|
|
@@ -15773,7 +15770,7 @@ class to extends Ii {
|
|
|
15773
15770
|
_iterateMeshBox(e, t, n, i) {
|
|
15774
15771
|
const r = this.getMap(), {collideBoxIndex: o} = e.meshes[0].geometry.properties, s = o && o[t];
|
|
15775
15772
|
if (!s || !s.length) return !1;
|
|
15776
|
-
const a = g.multiply(
|
|
15773
|
+
const a = g.multiply(Zr, r.projViewMatrix, e.meshes[0].localTransform);
|
|
15777
15774
|
let l, h = !1;
|
|
15778
15775
|
const c = e.meshes;
|
|
15779
15776
|
let u = 0;
|
|
@@ -15902,12 +15899,12 @@ class to extends Ii {
|
|
|
15902
15899
|
offset: this.getPolygonOffset()
|
|
15903
15900
|
}
|
|
15904
15901
|
}, i = this._shaderDefines || {};
|
|
15905
|
-
if (this.shader = new d.MeshShader({
|
|
15902
|
+
if (i.HAS_HIGHLIGHT_COLOR_POINT = 1, this.shader = new d.MeshShader({
|
|
15906
15903
|
name: "marker",
|
|
15907
15904
|
vert: Fi,
|
|
15908
|
-
frag: "#define SHADER_NAME MARKER\
|
|
15905
|
+
frag: "#define SHADER_NAME MARKER\nprecision mediump float;\n#include <gl2_frag>\nuniform float alphaTest;\nuniform sampler2D iconTex;\nuniform lowp float markerOpacity;\nuniform lowp float blendSrcIsOne;\nuniform float layerOpacity;\n#include <highlight_frag>\nvarying vec2 vTexCoord;\nvarying float vOpacity;\nvarying float vIsText;\nvarying float vHalo;\n#include <text_render_frag>\nvoid main() {\n vec4 c;\n if(vIsText > .5) {\n c = renderText(vTexCoord);\n } else {\n c = texture2D(iconTex, vTexCoord) * markerOpacity;\n }\n c = c * vOpacity * layerOpacity;\n if(c.a < .05) {\n discard;\n }\n glFragColor = c;\n if(glFragColor.a < alphaTest) {\n discard;\n }\n glFragColor = highlight_blendColor(glFragColor);\n#if __VERSION__ == 100\ngl_FragColor = glFragColor;\n#endif\n}",
|
|
15909
15906
|
wgslVert: Ei,
|
|
15910
|
-
wgslFrag: "
|
|
15907
|
+
wgslFrag: "struct MarkerFragUniforms {\n alphaTest: f32,\n markerOpacity: f32\n};\nstruct ShaderUniforms {\n layerOpacity: f32\n}\n@group(0) @binding($b) var<uniform> uniforms: MarkerFragUniforms;\n@group(0) @binding($b) var<uniform> shaderUniforms: ShaderUniforms;\n@group(0) @binding($b) var iconTex: texture_2d<f32>;\n@group(0) @binding($b) var iconTexSampler: sampler;\n#include <highlight_frag>\n#include <text_render_frag>\n@fragment\nfn main(input: VertexOutput) -> @location(0) vec4f {\n var fragColor: vec4f;\n let isText = input.vIsText > 0.5;\n let textColor = renderText(input);\n let iconColor = textureSample(iconTex, iconTexSampler, input.vTexCoord) * uniforms.markerOpacity;\n if (isText) {\n fragColor = textColor;\n } else {\n fragColor = iconColor;\n }\n fragColor = fragColor * input.vOpacity * shaderUniforms.layerOpacity;\n if (fragColor.a < 0.05) {\n discard;\n }\n var color: vec4f;\n color = fragColor;\n if (color.a < uniforms.alphaTest) {\n discard;\n }\n #if HAS_HIGHLIGHT_OPACITY || HAS_HIGHLIGHT_COLOR\n return highlight_blendColor(color, input);\n #else\n return color;\n #endif\n}",
|
|
15911
15908
|
uniforms: [ {
|
|
15912
15909
|
name: "projViewModelMatrix",
|
|
15913
15910
|
type: "function",
|
|
@@ -16031,7 +16028,7 @@ function ho(e, t, n, i, r, o, s, a, l, h, c, u, f) {
|
|
|
16031
16028
|
return 2 * y + m;
|
|
16032
16029
|
}
|
|
16033
16030
|
|
|
16034
|
-
var co = "#define SHADER_NAME TEXT_VERT\n#define RAD 0.0174532925\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\nattribute vec4 aShape;\n#ifdef ENABLE_COLLISION\nattribute float aOpacity;\n#endif\n#ifdef HAS_OPACITY\nattribute float aColorOpacity;\n#endif\n#ifdef HAS_TEXT_SIZE\nattribute float aTextSize;\n#else\nuniform float textSize;\n#endif\n#ifdef HAS_TEXT_DX\nattribute float aTextDx;\n#else\nuniform float textDx;\n#endif\n#ifdef HAS_TEXT_DY\nattribute float aTextDy;\n#else\nuniform float textDy;\n#endif\n#if defined(HAS_PITCH_ALIGN)\nattribute float aPitchAlign;\n#else\nuniform float textPitchWithMap;\n#endif\n#if defined(HAS_TEXT_ROTATION_ALIGN)\nattribute float aRotationAlign;\n#else\nuniform float textRotateWithMap;\n#endif\nuniform float flipY;\n#if defined(HAS_TEXT_ROTATION)\nattribute float aRotation;\n#else\nuniform float textRotation;\n#endif\nuniform float cameraToCenterDistance;\nuniform mat4 positionMatrix;\nuniform mat4 projViewModelMatrix;\nuniform float textPerspectiveRatio;\nuniform vec2 glyphTexSize;\nuniform vec2 canvasSize;\nuniform float glyphSize;\nuniform float mapPitch;\nuniform float mapRotation;\nuniform float zoomScale;\nuniform float tileRatio;\nuniform float layerScale;\nuniform float isRenderingTerrain;\n#ifndef PICKING_MODE\nvarying vec2 vTexCoord;\nvarying float vGammaScale;\nvarying float vTextSize;\nvarying float vOpacity;\n#ifdef HAS_TEXT_FILL\nattribute vec4 aTextFill;\nvarying vec4 vTextFill;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nattribute vec4 aTextHaloFill;\nvarying vec4 vTextHaloFill;\n#endif\n#if defined(HAS_TEXT_HALO_RADIUS) || defined(HAS_TEXT_HALO_OPACITY)\nattribute vec2 aTextHalo;\nvarying vec2 vTextHalo;\n#endif\n#include <highlight_vert>\n#else\n#include <fbo_picking_vert>\n#endif\n#include <vt_position_vert>\nvoid main() {\n vec3 c = unpackVTPosition();\n#ifdef HAS_TEXT_SIZE\nfloat d = aTextSize * layerScale;\n#else\nfloat d = textSize * layerScale;\n#endif\n#ifdef HAS_TEXT_DX\nfloat e = aTextDx;\n#else\nfloat e = textDx;\n#endif\n#ifdef HAS_TEXT_DY\nfloat f = aTextDy;\n#else\nfloat f = textDy;\n#endif\n#if defined(HAS_PITCH_ALIGN)\nfloat h = aPitchAlign;\n#else\nfloat h = textPitchWithMap;\n#endif\n#if defined(HAS_ROTATION_ALIGN)\nfloat i = aRotationAlign;\n#else\nfloat i = textRotateWithMap;\n#endif\ngl_Position = projViewModelMatrix * positionMatrix * vec4(c, 1.);\n float j = gl_Position.w;\n float k;\n if(isRenderingTerrain == 1. && h == 1.) {\n k = 1.;\n } else {\n float l = (1. - cameraToCenterDistance / j) * textPerspectiveRatio;\n k = clamp(.5 + .5 * (1. - l), .0, 4.);\n }\n#ifdef HAS_TEXT_ROTATION\nfloat m = -aRotation / 9362. - mapRotation * i;\n#else\nfloat m = -textRotation - mapRotation * i;\n#endif\nif(h == 1.) {\n \n#ifdef REVERSE_MAP_ROTATION_ON_PITCH\nm += mapRotation;\n#else\nm -= mapRotation;\n#endif\n }\n float n = sin(m);\n float o = cos(m);\n mat2 u = mat2(o, -1. * n, n, o);\n vec2 v = aShape.xy / 10.0;\n if(h == 1. && flipY == .0) {\n v = v * vec2(1., -1.);\n }\n vec2 A = aShape.zw;\n v = u * (v / glyphSize * d);\n float B;\n if(isRenderingTerrain == 1.) {\n B = 1.;\n } else {\n B = j / cameraToCenterDistance;\n }\n if(h == .0) {\n vec2 C = v * 2. / canvasSize;\n gl_Position.xy += C * k * j;\n } else {\n float D;\n if(isRenderingTerrain == 1.) {\n D = tileRatio / zoomScale;\n } else {\n D = tileRatio / zoomScale * B * k;\n }\n vec2 C = v;\n gl_Position = projViewModelMatrix * positionMatrix * vec4(c + vec3(C, .0) * D, 1.);\n }\n gl_Position.xy += vec2(e, -f) * 2. / canvasSize * j;\n#ifndef PICKING_MODE\nif(h == .0) {\n vGammaScale = mix(1., B, textPerspectiveRatio);\n } else {\n vGammaScale = B + mapPitch / 4.;\n }\n vTexCoord = A / glyphTexSize;\n vGammaScale = clamp(vGammaScale, .0, 1.);\n vTextSize = d;\n#ifdef ENABLE_COLLISION\nvOpacity = aOpacity / 255.;\n#else\nvOpacity = 1.;\n#endif\n#ifdef HAS_OPACITY\nvOpacity *= aColorOpacity / 255.;\n#endif\n#ifdef HAS_TEXT_FILL\nvTextFill = aTextFill / 255.;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nvTextHaloFill = aTextHaloFill / 255.;\n#endif\n#if defined(HAS_TEXT_HALO_RADIUS) || defined(HAS_TEXT_HALO_OPACITY)\nvTextHalo = aTextHalo;\n#endif\nhighlight_setVarying();\n#else\n#ifdef ENABLE_COLLISION\nbool E = aOpacity == 255.;\n#else\nbool E = true;\n#endif\nfbo_picking_setData(gl_Position.w, E);\n#endif\n}", uo = "#define SHADER_NAME TEXT_VERT\n#define RAD 0.0174532925\nstruct TextVertexUniforms {\n textSize: f32,\n textDx: f32,\n textDy: f32,\n textPitchWithMap: f32,\n textRotateWithMap: f32,\n textRotation: f32,\n flipY: f32,\n textPerspectiveRatio: f32,\n glyphTexSize: vec2f,\n zoomScale: f32,\n tileRatio: f32,\n positionMatrix: mat4x4f,\n projViewModelMatrix: mat4x4f\n};\nstruct TextUniforms {\n cameraToCenterDistance: f32,\n canvasSize: vec2f,\n glyphSize: f32,\n mapPitch: f32,\n mapRotation: f32,\n layerScale: f32,\n isRenderingTerrain: f32\n};\n@group(0) @binding($b) var<uniform> uniforms: TextVertexUniforms;\n@group(0) @binding($b) var<uniform> textUniforms: TextUniforms;\nstruct VertexInput {\n#ifdef HAS_ALTITUDE\n @location($i) aPosition: POSITION_TYPE_2,\n @location($i) aAltitude: f32,\n#else\n @location($i) aPosition: POSITION_TYPE_3,\n#endif\n @location($i) aShape: vec4i,\n#ifdef ENABLE_COLLISION\n @location($i) aOpacity: u32,\n#endif\n#ifdef HAS_OPACITY\n @location($i) aColorOpacity: u32,\n#endif\n#ifdef HAS_TEXT_SIZE\n @location($i) aTextSize: u32,\n#endif\n#ifdef HAS_TEXT_DX\n @location($i) aTextDx: i32,\n#endif\n#ifdef HAS_TEXT_DY\n @location($i) aTextDy: i32,\n#endif\n#ifdef HAS_PITCH_ALIGN\n @location($i) aPitchAlign: u32,\n#endif\n#ifdef HAS_TEXT_ROTATION_ALIGN\n @location($i) aRotationAlign: u32,\n#endif\n#ifdef HAS_TEXT_ROTATION\n @location($i) aRotation: u32,\n#endif\n#ifdef HAS_TEXT_FILL\n @location($i) aTextFill: vec4u,\n#endif\n#ifdef HAS_TEXT_HALO_FILL\n @location($i) aTextHaloFill: vec4u,\n#endif\n#if HAS_TEXT_HALO_RADIUS || HAS_TEXT_HALO_OPACITY\n @location($i) aTextHalo: vec2u,\n#endif\n};\nstruct VertexOutput {\n @builtin(position) position: vec4f,\n#ifndef PICKING_MODE\n @location($o) vTexCoord: vec2f,\n @location($o) vGammaScale: f32,\n @location($o) vTextSize: f32,\n @location($o) vOpacity: f32,\n #ifdef HAS_TEXT_FILL\n @location($o) vTextFill: vec4f,\n #endif\n #ifdef HAS_TEXT_HALO_FILL\n @location($o) vTextHaloFill: vec4f,\n #endif\n #if HAS_TEXT_HALO_RADIUS || HAS_TEXT_HALO_OPACITY\n @location($o) vTextHalo: vec2f,\n #endif\n#endif\n};\n#include <vt_position_vert>\n#include <highlight_vert>\n#ifdef PICKING_MODE\n#include <fbo_picking_vert>\n#endif\n@vertex\nfn main(input: VertexInput) -> VertexOutput {\n let isRenderingTerrain = textUniforms.isRenderingTerrain;\n let layerScale = textUniforms.layerScale;\n var output: VertexOutput;\n var position = unpackVTPosition(input);\n#ifdef HAS_TEXT_SIZE\n var myTextSize = input.aTextSize * layerScale;\n#else\n var myTextSize = uniforms.textSize * layerScale;\n#endif\n#ifdef HAS_TEXT_DX\n var myTextDx = input.aTextDx;\n#else\n var myTextDx = uniforms.textDx;\n#endif\n#ifdef HAS_TEXT_DY\n var myTextDy = input.aTextDy;\n#else\n var myTextDy = uniforms.textDy;\n#endif\n#ifdef HAS_PITCH_ALIGN\n var isPitchWithMap = input.aPitchAlign;\n#else\n var isPitchWithMap = uniforms.textPitchWithMap;\n#endif\n#ifdef HAS_TEXT_ROTATION_ALIGN\n var isRotateWithMap = input.aRotationAlign;\n#else\n var isRotateWithMap = uniforms.textRotateWithMap;\n#endif\n output.position = uniforms.projViewModelMatrix * uniforms.positionMatrix * vec4f(position, 1.0);\n var projDistance = output.position.w;\n var perspectiveRatio: f32;\n if (isRenderingTerrain == 1.0 && isPitchWithMap == 1.0) {\n perspectiveRatio = 1.0;\n } else {\n var distanceRatio = (1.0 - textUniforms.cameraToCenterDistance / projDistance) * uniforms.textPerspectiveRatio;\n perspectiveRatio = clamp(\n 0.5 + 0.5 * (1.0 - distanceRatio),\n 0.0,\n 4.0);\n }\n let mapRotation = textUniforms.mapRotation;\n#ifdef HAS_TEXT_ROTATION\n var rotation = -input.aRotation / 9362.0 - mapRotation * isRotateWithMap;\n#else\n var rotation = -uniforms.textRotation - mapRotation * isRotateWithMap;\n#endif\n if (isPitchWithMap == 1.0) {\n#ifdef REVERSE_MAP_ROTATION_ON_PITCH\n rotation += mapRotation;\n#else\n rotation -= mapRotation;\n#endif\n }\n var angleSin = sin(rotation);\n var angleCos = cos(rotation);\n var shapeMatrix = mat2x2f(angleCos, -1.0 * angleSin, angleSin, angleCos);\n var shape = vec2f(input.aShape.xy) / 10.0;\n if (isPitchWithMap == 1.0 && uniforms.flipY == 0.0) {\n shape = shape * vec2f(1.0, -1.0);\n }\n var texCoord = vec2f(input.aShape.zw);\n shape = shapeMatrix * (shape / textUniforms.glyphSize * myTextSize);\n let tileRatio = uniforms.tileRatio;\n let zoomScale = uniforms.zoomScale;\n var cameraScale: f32;\n if (isRenderingTerrain == 1.0) {\n cameraScale = 1.0;\n } else {\n cameraScale = projDistance / textUniforms.cameraToCenterDistance;\n }\n let canvasSize = textUniforms.canvasSize;\n if (isPitchWithMap == 0.0) {\n var offset = shape * 2.0 / canvasSize;\n output.position = vec4(output.position.xy + offset * perspectiveRatio * projDistance, output.position.zw);\n } else {\n var offsetScale: f32;\n if (isRenderingTerrain == 1.0) {\n offsetScale = tileRatio / zoomScale;\n } else {\n offsetScale = tileRatio / zoomScale * cameraScale * perspectiveRatio;\n }\n var offset = shape;\n output.position = uniforms.projViewModelMatrix * uniforms.positionMatrix * vec4f(position + vec3f(offset, 0.0) * offsetScale, 1.0);\n }\n let dxdy = vec2f(myTextDx, -myTextDy) * 2.0 / canvasSize * projDistance;\n output.position = vec4(output.position.xy + dxdy, output.position.zw);\n#ifndef PICKING_MODE\n if (isPitchWithMap == 0.0) {\n output.vGammaScale = mix(1.0, cameraScale, uniforms.textPerspectiveRatio);\n } else {\n output.vGammaScale = cameraScale + textUniforms.mapPitch / 4.0;\n }\n output.vTexCoord = texCoord / uniforms.glyphTexSize;\n output.vGammaScale = clamp(output.vGammaScale, 0.0, 1.0);\n output.vTextSize = myTextSize;\n#ifdef ENABLE_COLLISION\n output.vOpacity = f32(input.aOpacity) / 255.0;\n#else\n output.vOpacity = 1.0;\n#endif\n#ifdef HAS_OPACITY\n output.vOpacity *= f32(input.aColorOpacity) / 255.0;\n#endif\n#ifdef HAS_TEXT_FILL\n output.vTextFill = vec4f(input.aTextFill) / 255.0;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\n output.vTextHaloFill = vec4f(input.aTextHaloFill) / 255.0;\n#endif\n#if HAS_TEXT_HALO_RADIUS || HAS_TEXT_HALO_OPACITY\n output.vTextHalo = vec2f(input.aTextHalo);\n#endif\n#if HAS_HIGHLIGHT_COLOR || HAS_HIGHLIGHT_OPACITY\n highlight_setVarying(input, output);\n#endif\n#else\n#ifdef ENABLE_COLLISION\n var visible = f32(input.aOpacity) == 255.0;\n#else\n var visible = true;\n#endif\n fbo_picking_setData(input, &output, output.position.w, visible);\n#endif\n return output;\n}", fo = "#define SHADER_NAME TEXT_LINE\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\nattribute vec2 aTexCoord;\n#ifdef HAS_OFFSET_Z\nattribute vec3 aOffset;\nuniform float altitudeScale;\n#else\nattribute vec2 aOffset;\n#endif\n#ifdef ENABLE_COLLISION\nattribute float aOpacity;\n#endif\n#ifdef HAS_OPACITY\nattribute float aColorOpacity;\n#endif\n#ifdef HAS_TEXT_SIZE\nattribute float aTextSize;\n#else\nuniform float textSize;\n#endif\n#ifdef HAS_TEXT_DX\nattribute float aTextDx;\n#else\nuniform float textDx;\n#endif\n#ifdef HAS_TEXT_DY\nattribute float aTextDy;\n#else\nuniform float textDy;\n#endif\n#if defined(HAS_PITCH_ALIGN)\nattribute float aPitchAlign;\n#else\nuniform float textPitchWithMap;\n#endif\nuniform float zoomScale;\nuniform float cameraToCenterDistance;\nuniform mat4 projViewModelMatrix;\nuniform float textPerspectiveRatio;\nuniform float mapPitch;\nuniform vec2 glyphTexSize;\nuniform vec2 canvasSize;\nuniform float tileRatio;\nuniform float layerScale;\nuniform float isRenderingTerrain;\nuniform float textPitchFilter;\n#ifndef PICKING_MODE\nvarying vec2 vTexCoord;\nvarying float vGammaScale;\nvarying float vTextSize;\nvarying float vOpacity;\n#ifdef HAS_TEXT_FILL\nattribute vec4 aTextFill;\nvarying vec4 vTextFill;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nattribute vec4 aTextHaloFill;\nvarying vec4 vTextHaloFill;\n#endif\n#if defined(HAS_TEXT_HALO_RADIUS) || defined(HAS_TEXT_HALO_OPACITY)\nattribute vec2 aTextHalo;\nvarying vec2 vTextHalo;\n#endif\n#include <highlight_vert>\n#else\n#include <fbo_picking_vert>\n#endif\n#include <vt_position_vert>\nvoid main() {\n vec3 c = unpackVTPosition();\n#ifdef HAS_TEXT_DX\nfloat d = aTextDx;\n#else\nfloat d = textDx;\n#endif\n#ifdef HAS_TEXT_DY\nfloat e = aTextDy;\n#else\nfloat e = textDy;\n#endif\n#ifdef HAS_TEXT_SIZE\nfloat f = aTextSize * layerScale;\n#else\nfloat f = textSize * layerScale;\n#endif\n#ifdef HAS_PITCH_ALIGN\nfloat h = aPitchAlign;\n#else\nfloat h = textPitchWithMap;\n#endif\ngl_Position = projViewModelMatrix * vec4(c, 1.);\n float i = gl_Position.w;\n float j = i / cameraToCenterDistance;\n float k;\n if(isRenderingTerrain == 1.) {\n k = 1.;\n } else {\n float l = (1. - cameraToCenterDistance / i) * textPerspectiveRatio;\n k = clamp(.5 + .5 * (1. - l), .0, 4.);\n }\n#ifdef HAS_OFFSET_Z\nvec3 m = aOffset / 10.0;\n m[2] /= altitudeScale;\n#else\nvec3 m = vec3(aOffset / 10.0, .0);\n#endif\nvec2 n = aTexCoord;\n if(h == 1.) {\n float o;\n if(isRenderingTerrain == 1.) {\n o = tileRatio;\n } else {\n o = tileRatio / zoomScale * j * k;\n }\n m.xy *= o;\n gl_Position = projViewModelMatrix * vec4(c + m, 1.);\n } else {\n gl_Position.xy += m.xy * 2. / canvasSize * k * i;\n }\n gl_Position.xy += vec2(d, -e) * 2. / canvasSize * i;\n if(textPitchFilter > .0) {\n if(textPitchFilter == 1. && h == .0 || textPitchFilter == 2. && h == 1.) {\n gl_Position = vec4(-9999., -9999., .0, 1.);\n }\n }\n#ifndef PICKING_MODE\nif(h == 1.) {\n vGammaScale = j + mapPitch / 4.;\n } else {\n vGammaScale = mix(1., j, textPerspectiveRatio);\n }\n vGammaScale = clamp(vGammaScale, .0, 1.);\n vTexCoord = n / glyphTexSize;\n vTextSize = f;\n#ifdef ENABLE_COLLISION\nvOpacity = aOpacity / 255.;\n#else\nvOpacity = 1.;\n#endif\n#ifdef HAS_OPACITY\nvOpacity *= aColorOpacity / 255.;\n#endif\n#ifdef HAS_TEXT_FILL\nvTextFill = aTextFill / 255.;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nvTextHaloFill = aTextHaloFill / 255.;\n#endif\n#if defined(HAS_TEXT_HALO_RADIUS) || defined(HAS_TEXT_HALO_OPACITY)\nvTextHalo = aTextHalo;\n#endif\nhighlight_setVarying();\n#else\n#ifdef ENABLE_COLLISION\nbool u = aOpacity == 255.;\n#else\nbool u = true;\n#endif\nfbo_picking_setData(gl_Position.w, u);\n#endif\n}", po = "#define SHADER_NAME TEXT_LINE\nstruct TextLineUniforms {\n textSize: f32,\n textDx: f32,\n textDy: f32,\n textPitchWithMap: f32,\n projViewModelMatrix: mat4x4f,\n textPerspectiveRatio: f32,\n glyphTexSize: vec2f,\n tileRatio: f32,\n zoomScale: f32,\n}\nstruct ShaderUniforms {\n cameraToCenterDistance: f32,\n mapPitch: f32,\n canvasSize: vec2f,\n textPitchFilter: f32,\n isRenderingTerrain: f32,\n layerScale: f32,\n #ifdef HAS_OFFSET_Z\n altitudeScale: f32,\n #endif\n}\n@group(0) @binding($b) var<uniform> uniforms: TextLineUniforms;\n@group(0) @binding($b) var<uniform> shaderUniforms: ShaderUniforms;\nstruct VertexInput {\n#ifdef HAS_ALTITUDE\n @location($i) aPosition: POSITION_TYPE_2,\n @location($i) aAltitude: f32,\n#else\n @location($i) aPosition: POSITION_TYPE_3,\n#endif\n @location($i) aTexCoord: vec2u,\n#ifdef HAS_OFFSET_Z\n @location($i) aOffset: vec3i,\n#else\n @location($i) aOffset: vec2i,\n#endif\n#ifdef ENABLE_COLLISION\n @location($i) aOpacity: u32,\n#endif\n#ifdef HAS_OPACITY\n @location($i) aColorOpacity: u32,\n#endif\n#ifdef HAS_TEXT_SIZE\n @location($i) aTextSize: u32,\n#endif\n#ifdef HAS_TEXT_DX\n @location($i) aTextDx: i32,\n#endif\n#ifdef HAS_TEXT_DY\n @location($i) aTextDy: i32,\n#endif\n#ifdef HAS_PITCH_ALIGN\n @location($i) aPitchAlign: u32,\n#endif\n#ifdef HAS_TEXT_FILL\n @location($i) aTextFill: vec4u,\n#endif\n#ifdef HAS_TEXT_HALO_FILL\n @location($i) aTextHaloFill: vec4u,\n#endif\n#if HAS_TEXT_HALO_RADIUS || HAS_TEXT_HALO_OPACITY\n @location($i) aTextHalo: vec2u,\n#endif\n};\nstruct VertexOutput {\n @builtin(position) position: vec4f,\n#ifndef PICKING_MODE\n @location($o) vTexCoord: vec2f,\n @location($o) vGammaScale: f32,\n @location($o) vTextSize: f32,\n @location($o) vOpacity: f32,\n #ifdef HAS_TEXT_FILL\n @location($o) vTextFill: vec4f,\n #endif\n #ifdef HAS_TEXT_HALO_FILL\n @location($o) vTextHaloFill: vec4f,\n #endif\n #if HAS_TEXT_HALO_RADIUS || HAS_TEXT_HALO_OPACITY\n @location($o) vTextHalo: vec2f,\n #endif\n#endif\n};\n#include <vt_position_vert>\n#include <fbo_picking_vert>\n@vertex\nfn main(input: VertexInput) -> VertexOutput {\n var output: VertexOutput;\n var position = unpackVTPosition(input);\n#ifdef HAS_TEXT_DX\n var myTextDx = f32(input.aTextDx);\n#else\n var myTextDx = uniforms.textDx;\n#endif\n#ifdef HAS_TEXT_DY\n var myTextDy = f32(input.aTextDy);\n#else\n var myTextDy = uniforms.textDy;\n#endif\n#ifdef HAS_TEXT_SIZE\n var myTextSize = f32(input.aTextSize) * shaderUniforms.layerScale;\n#else\n var myTextSize = uniforms.textSize * shaderUniforms.layerScale;\n#endif\n#ifdef HAS_PITCH_ALIGN\n var isPitchWithMap = f32(input.aPitchAlign);\n#else\n var isPitchWithMap = uniforms.textPitchWithMap;\n#endif\n output.position = uniforms.projViewModelMatrix * vec4f(position, 1.0);\n var projDistance = output.position.w;\n var cameraScale = projDistance / shaderUniforms.cameraToCenterDistance;\n var perspectiveRatio: f32;\n if (shaderUniforms.isRenderingTerrain == 1.0) {\n perspectiveRatio = 1.0;\n } else {\n var distanceRatio = (1.0 - shaderUniforms.cameraToCenterDistance / projDistance) * uniforms.textPerspectiveRatio;\n perspectiveRatio = clamp(\n 0.5 + 0.5 * (1.0 - distanceRatio),\n 0.0,\n 4.0);\n }\n#ifdef HAS_OFFSET_Z\n var offset = vec3f(input.aOffset) / 10.0;\n offset.z /= shaderUniforms.altitudeScale;\n#else\n var offset = vec3f(vec2f(input.aOffset) / 10.0, 0.0);\n#endif\n var texCoord = vec2f(input.aTexCoord);\n if (isPitchWithMap == 1.0) {\n var offsetScale: f32;\n if (shaderUniforms.isRenderingTerrain == 1.0) {\n offsetScale = uniforms.tileRatio;\n } else {\n offsetScale = uniforms.tileRatio / uniforms.zoomScale * cameraScale * perspectiveRatio;\n }\n offset = offset * offsetScale;\n output.position = uniforms.projViewModelMatrix * vec4f(position + offset, 1.0);\n } else {\n let perspOffset = offset.xy * 2.0 / shaderUniforms.canvasSize * perspectiveRatio * projDistance;\n output.position = vec4f(output.position.xy + perspOffset, output.position.zw);\n }\n let dxdy = vec2f(myTextDx, -myTextDy) * 2.0 / shaderUniforms.canvasSize * projDistance;\n output.position = vec4f(output.position.xy + dxdy, output.position.zw);\n if (shaderUniforms.textPitchFilter > 0.0) {\n if ((shaderUniforms.textPitchFilter == 1.0 && isPitchWithMap == 0.0) || (shaderUniforms.textPitchFilter == 2.0 && isPitchWithMap == 1.0)) {\n output.position = vec4f(-9999.0, -9999.0, 0.0, 1.0);\n }\n }\n#ifndef PICKING_MODE\n if (isPitchWithMap == 1.0) {\n output.vGammaScale = cameraScale + shaderUniforms.mapPitch / 4.0;\n } else {\n output.vGammaScale = mix(1.0, cameraScale, uniforms.textPerspectiveRatio);\n }\n output.vGammaScale = clamp(output.vGammaScale, 0.0, 1.0);\n output.vTexCoord = texCoord / uniforms.glyphTexSize;\n output.vTextSize = myTextSize;\n#ifdef ENABLE_COLLISION\n output.vOpacity = f32(input.aOpacity) / 255.0;\n#else\n output.vOpacity = 1.0;\n#endif\n#ifdef HAS_OPACITY\n output.vOpacity *= f32(input.aColorOpacity) / 255.0;\n#endif\n#ifdef HAS_TEXT_FILL\n output.vTextFill = vec4f(input.aTextFill) / 255.0;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\n output.vTextHaloFill = vec4f(input.aTextHaloFill) / 255.0;\n#endif\n#if HAS_TEXT_HALO_RADIUS || HAS_TEXT_HALO_OPACITY\n output.vTextHalo = vec2f(input.aTextHalo);\n#endif\n#if HAS_HIGHLIGHT_COLOR || HAS_HIGHLIGHT_OPACITY\n highlight_setVarying(input, output);\n#endif\n#else\n#ifdef ENABLE_COLLISION\n var visible = f32(input.aOpacity) == 255.0;\n#else\n var visible = true;\n#endif\n fbo_picking_setData(input, &output, output.position.w, visible);\n#endif\n return output;\n}", go = "#define SHADER_NAME TEXT_FRAG\nprecision mediump float;\nuniform float layerOpacity;\nvarying vec2 vTexCoord;\nvarying float vOpacity;\nuniform float alphaTest;\n#include <text_render_frag>\n#include <highlight_frag>\nvoid main() {\n gl_FragColor = renderText(vTexCoord) * vOpacity * layerOpacity;\n if(gl_FragColor.a < alphaTest) {\n discard;\n }\n gl_FragColor = highlight_blendColor(gl_FragColor);\n}", mo = "struct TextFragUniforms {\n layerOpacity: f32,\n}\nstruct TextUniforms {\n alphaTest: f32\n}\n@group(0) @binding($b) var<uniform> uniforms: TextFragUniforms;\n@group(0) @binding($b) var<uniform> textUniforms: TextUniforms;\n#include <text_render_frag>\n#include <highlight_frag>\n@fragment\nfn main(input: VertexOutput) -> @location(0) vec4f {\n var fragColor = renderText(input) * input.vOpacity * uniforms.layerOpacity;\n if (fragColor.a < textUniforms.alphaTest) {\n discard;\n }\n #if HAS_HIGHLIGHT_OPACITY || HAS_HIGHLIGHT_COLOR\n return highlight_blendColor(fragColor, input);\n #else\n return fragColor;\n #endif\n}";
|
|
16031
|
+
var co = "#define SHADER_NAME TEXT_VERT\n#define RAD 0.0174532925\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\nattribute vec4 aShape;\n#ifdef ENABLE_COLLISION\nattribute float aOpacity;\n#endif\n#ifdef HAS_OPACITY\nattribute float aColorOpacity;\n#endif\n#ifdef HAS_TEXT_SIZE\nattribute float aTextSize;\n#else\nuniform float textSize;\n#endif\n#ifdef HAS_TEXT_DX\nattribute float aTextDx;\n#else\nuniform float textDx;\n#endif\n#ifdef HAS_TEXT_DY\nattribute float aTextDy;\n#else\nuniform float textDy;\n#endif\n#if defined(HAS_PITCH_ALIGN)\nattribute float aPitchAlign;\n#else\nuniform float textPitchWithMap;\n#endif\n#if defined(HAS_TEXT_ROTATION_ALIGN)\nattribute float aRotationAlign;\n#else\nuniform float textRotateWithMap;\n#endif\nuniform float flipY;\n#if defined(HAS_TEXT_ROTATION)\nattribute float aRotation;\n#else\nuniform float textRotation;\n#endif\nuniform float cameraToCenterDistance;\nuniform mat4 positionMatrix;\nuniform mat4 projViewModelMatrix;\nuniform float textPerspectiveRatio;\nuniform vec2 glyphTexSize;\nuniform vec2 canvasSize;\nuniform float glyphSize;\nuniform float mapPitch;\nuniform float mapRotation;\nuniform float zoomScale;\nuniform float tileRatio;\nuniform float layerScale;\nuniform float isRenderingTerrain;\n#ifndef PICKING_MODE\nvarying vec2 vTexCoord;\nvarying float vGammaScale;\nvarying float vTextSize;\nvarying float vOpacity;\n#ifdef HAS_TEXT_FILL\nattribute vec4 aTextFill;\nvarying vec4 vTextFill;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nattribute vec4 aTextHaloFill;\nvarying vec4 vTextHaloFill;\n#endif\n#if defined(HAS_TEXT_HALO_RADIUS) || defined(HAS_TEXT_HALO_OPACITY)\nattribute vec2 aTextHalo;\nvarying vec2 vTextHalo;\n#endif\n#include <highlight_vert>\n#else\n#include <fbo_picking_vert>\n#endif\n#include <vt_position_vert>\nvoid main() {\n vec3 c = unpackVTPosition();\n#ifdef HAS_TEXT_SIZE\nfloat d = aTextSize * layerScale;\n#else\nfloat d = textSize * layerScale;\n#endif\n#ifdef HAS_TEXT_DX\nfloat e = aTextDx;\n#else\nfloat e = textDx;\n#endif\n#ifdef HAS_TEXT_DY\nfloat f = aTextDy;\n#else\nfloat f = textDy;\n#endif\n#if defined(HAS_PITCH_ALIGN)\nfloat h = aPitchAlign;\n#else\nfloat h = textPitchWithMap;\n#endif\n#if defined(HAS_ROTATION_ALIGN)\nfloat i = aRotationAlign;\n#else\nfloat i = textRotateWithMap;\n#endif\ngl_Position = projViewModelMatrix * positionMatrix * vec4(c, 1.);\n float j = gl_Position.w;\n float k;\n if(isRenderingTerrain == 1. && h == 1.) {\n k = 1.;\n } else {\n float l = (1. - cameraToCenterDistance / j) * textPerspectiveRatio;\n k = clamp(.5 + .5 * (1. - l), .0, 4.);\n }\n#ifdef HAS_TEXT_ROTATION\nfloat m = -aRotation / 9362. - mapRotation * i;\n#else\nfloat m = -textRotation - mapRotation * i;\n#endif\nif(h == 1.) {\n \n#ifdef REVERSE_MAP_ROTATION_ON_PITCH\nm += mapRotation;\n#else\nm -= mapRotation;\n#endif\n }\n float n = sin(m);\n float o = cos(m);\n mat2 u = mat2(o, -1. * n, n, o);\n vec2 v = aShape.xy / 10.0;\n if(h == 1. && flipY == .0) {\n v = v * vec2(1., -1.);\n }\n vec2 A = aShape.zw;\n v = u * (v / glyphSize * d);\n float B;\n if(isRenderingTerrain == 1.) {\n B = 1.;\n } else {\n B = j / cameraToCenterDistance;\n }\n if(h == .0) {\n vec2 C = v * 2. / canvasSize;\n gl_Position.xy += C * k * j;\n } else {\n float D;\n if(isRenderingTerrain == 1.) {\n D = tileRatio / zoomScale;\n } else {\n D = tileRatio / zoomScale * B * k;\n }\n vec2 C = v;\n gl_Position = projViewModelMatrix * positionMatrix * vec4(c + vec3(C, .0) * D, 1.);\n }\n gl_Position.xy += vec2(e, -f) * 2. / canvasSize * j;\n#ifndef PICKING_MODE\nif(h == .0) {\n vGammaScale = mix(1., B, textPerspectiveRatio);\n } else {\n vGammaScale = B + mapPitch / 4.;\n }\n vTexCoord = A / glyphTexSize;\n vGammaScale = clamp(vGammaScale, .0, 1.);\n vTextSize = d;\n#ifdef ENABLE_COLLISION\nvOpacity = aOpacity / 255.;\n#else\nvOpacity = 1.;\n#endif\n#ifdef HAS_OPACITY\nvOpacity *= aColorOpacity / 255.;\n#endif\n#ifdef HAS_TEXT_FILL\nvTextFill = aTextFill / 255.;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nvTextHaloFill = aTextHaloFill / 255.;\n#endif\n#if defined(HAS_TEXT_HALO_RADIUS) || defined(HAS_TEXT_HALO_OPACITY)\nvTextHalo = aTextHalo;\n#endif\nhighlight_setVarying();\n#else\n#ifdef ENABLE_COLLISION\nbool E = aOpacity == 255.;\n#else\nbool E = true;\n#endif\nfbo_picking_setData(gl_Position.w, E);\n#endif\n}", uo = "#define SHADER_NAME TEXT_VERT\n#define RAD 0.0174532925\nstruct TextVertexUniforms {\n textSize: f32,\n textDx: f32,\n textDy: f32,\n textPitchWithMap: f32,\n textRotateWithMap: f32,\n textRotation: f32,\n flipY: f32,\n textPerspectiveRatio: f32,\n glyphTexSize: vec2f,\n zoomScale: f32,\n tileRatio: f32,\n positionMatrix: mat4x4f,\n projViewModelMatrix: mat4x4f\n};\nstruct TextUniforms {\n cameraToCenterDistance: f32,\n canvasSize: vec2f,\n glyphSize: f32,\n mapPitch: f32,\n mapRotation: f32,\n layerScale: f32,\n isRenderingTerrain: f32\n};\n@group(0) @binding($b) var<uniform> uniforms: TextVertexUniforms;\n@group(0) @binding($b) var<uniform> textUniforms: TextUniforms;\nstruct VertexInput {\n#ifdef HAS_ALTITUDE\n @location($i) aPosition: POSITION_TYPE_2,\n @location($i) aAltitude: f32,\n#else\n @location($i) aPosition: POSITION_TYPE_3,\n#endif\n @location($i) aShape: vec4i,\n#ifdef ENABLE_COLLISION\n @location($i) aOpacity: u32,\n#endif\n#ifdef HAS_OPACITY\n @location($i) aColorOpacity: u32,\n#endif\n#ifdef HAS_TEXT_SIZE\n @location($i) aTextSize: u32,\n#endif\n#ifdef HAS_TEXT_DX\n @location($i) aTextDx: i32,\n#endif\n#ifdef HAS_TEXT_DY\n @location($i) aTextDy: i32,\n#endif\n#ifdef HAS_PITCH_ALIGN\n @location($i) aPitchAlign: u32,\n#endif\n#ifdef HAS_TEXT_ROTATION_ALIGN\n @location($i) aRotationAlign: u32,\n#endif\n#ifdef HAS_TEXT_ROTATION\n @location($i) aRotation: u32,\n#endif\n#ifdef HAS_TEXT_FILL\n @location($i) aTextFill: vec4u,\n#endif\n#ifdef HAS_TEXT_HALO_FILL\n @location($i) aTextHaloFill: vec4u,\n#endif\n#if HAS_TEXT_HALO_RADIUS || HAS_TEXT_HALO_OPACITY\n @location($i) aTextHalo: vec2u,\n#endif\n};\nstruct VertexOutput {\n @builtin(position) position: vec4f,\n#ifndef PICKING_MODE\n @location($o) vTexCoord: vec2f,\n @location($o) vGammaScale: f32,\n @location($o) vTextSize: f32,\n @location($o) vOpacity: f32,\n #ifdef HAS_TEXT_FILL\n @location($o) vTextFill: vec4f,\n #endif\n #ifdef HAS_TEXT_HALO_FILL\n @location($o) vTextHaloFill: vec4f,\n #endif\n #if HAS_TEXT_HALO_RADIUS || HAS_TEXT_HALO_OPACITY\n @location($o) vTextHalo: vec2f,\n #endif\n#endif\n};\n#include <vt_position_vert>\n#include <highlight_vert>\n#ifdef PICKING_MODE\n#include <fbo_picking_vert>\n#endif\n@vertex\nfn main(input: VertexInput) -> VertexOutput {\n let isRenderingTerrain = textUniforms.isRenderingTerrain;\n let layerScale = textUniforms.layerScale;\n var output: VertexOutput;\n var position = unpackVTPosition(input);\n#ifdef HAS_TEXT_SIZE\n var myTextSize = input.aTextSize * layerScale;\n#else\n var myTextSize = uniforms.textSize * layerScale;\n#endif\n#ifdef HAS_TEXT_DX\n var myTextDx = input.aTextDx;\n#else\n var myTextDx = uniforms.textDx;\n#endif\n#ifdef HAS_TEXT_DY\n var myTextDy = input.aTextDy;\n#else\n var myTextDy = uniforms.textDy;\n#endif\n#ifdef HAS_PITCH_ALIGN\n var isPitchWithMap = input.aPitchAlign;\n#else\n var isPitchWithMap = uniforms.textPitchWithMap;\n#endif\n#ifdef HAS_TEXT_ROTATION_ALIGN\n var isRotateWithMap = input.aRotationAlign;\n#else\n var isRotateWithMap = uniforms.textRotateWithMap;\n#endif\n output.position = uniforms.projViewModelMatrix * uniforms.positionMatrix * vec4f(position, 1.0);\n var projDistance = output.position.w;\n var perspectiveRatio: f32;\n if (isRenderingTerrain == 1.0 && isPitchWithMap == 1.0) {\n perspectiveRatio = 1.0;\n } else {\n var distanceRatio = (1.0 - textUniforms.cameraToCenterDistance / projDistance) * uniforms.textPerspectiveRatio;\n perspectiveRatio = clamp(\n 0.5 + 0.5 * (1.0 - distanceRatio),\n 0.0,\n 4.0);\n }\n let mapRotation = textUniforms.mapRotation;\n#ifdef HAS_TEXT_ROTATION\n var rotation = -input.aRotation / 9362.0 - mapRotation * isRotateWithMap;\n#else\n var rotation = -uniforms.textRotation - mapRotation * isRotateWithMap;\n#endif\n if (isPitchWithMap == 1.0) {\n#ifdef REVERSE_MAP_ROTATION_ON_PITCH\n rotation += mapRotation;\n#else\n rotation -= mapRotation;\n#endif\n }\n var angleSin = sin(rotation);\n var angleCos = cos(rotation);\n var shapeMatrix = mat2x2f(angleCos, -1.0 * angleSin, angleSin, angleCos);\n var shape = vec2f(input.aShape.xy) / 10.0;\n if (isPitchWithMap == 1.0 && uniforms.flipY == 0.0) {\n shape = shape * vec2f(1.0, -1.0);\n }\n var texCoord = vec2f(input.aShape.zw);\n shape = shapeMatrix * (shape / textUniforms.glyphSize * myTextSize);\n let tileRatio = uniforms.tileRatio;\n let zoomScale = uniforms.zoomScale;\n var cameraScale: f32;\n if (isRenderingTerrain == 1.0) {\n cameraScale = 1.0;\n } else {\n cameraScale = projDistance / textUniforms.cameraToCenterDistance;\n }\n let canvasSize = textUniforms.canvasSize;\n if (isPitchWithMap == 0.0) {\n var offset = shape * 2.0 / canvasSize;\n output.position = vec4(output.position.xy + offset * perspectiveRatio * projDistance, output.position.zw);\n } else {\n var offsetScale: f32;\n if (isRenderingTerrain == 1.0) {\n offsetScale = tileRatio / zoomScale;\n } else {\n offsetScale = tileRatio / zoomScale * cameraScale * perspectiveRatio;\n }\n var offset = shape;\n output.position = uniforms.projViewModelMatrix * uniforms.positionMatrix * vec4f(position + vec3f(offset, 0.0) * offsetScale, 1.0);\n }\n let dxdy = vec2f(myTextDx, -myTextDy) * 2.0 / canvasSize * projDistance;\n output.position = vec4(output.position.xy + dxdy, output.position.zw);\n#ifndef PICKING_MODE\n if (isPitchWithMap == 0.0) {\n output.vGammaScale = mix(1.0, cameraScale, uniforms.textPerspectiveRatio);\n } else {\n output.vGammaScale = cameraScale + textUniforms.mapPitch / 4.0;\n }\n output.vTexCoord = texCoord / uniforms.glyphTexSize;\n output.vGammaScale = clamp(output.vGammaScale, 0.0, 1.0);\n output.vTextSize = myTextSize;\n#ifdef ENABLE_COLLISION\n output.vOpacity = f32(input.aOpacity) / 255.0;\n#else\n output.vOpacity = 1.0;\n#endif\n#ifdef HAS_OPACITY\n output.vOpacity *= f32(input.aColorOpacity) / 255.0;\n#endif\n#ifdef HAS_TEXT_FILL\n output.vTextFill = vec4f(input.aTextFill) / 255.0;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\n output.vTextHaloFill = vec4f(input.aTextHaloFill) / 255.0;\n#endif\n#if HAS_TEXT_HALO_RADIUS || HAS_TEXT_HALO_OPACITY\n output.vTextHalo = vec2f(input.aTextHalo);\n#endif\n#if HAS_HIGHLIGHT_COLOR || HAS_HIGHLIGHT_OPACITY\n highlight_setVarying(input, &output);\n#endif\n#else\n#ifdef ENABLE_COLLISION\n var visible = f32(input.aOpacity) == 255.0;\n#else\n var visible = true;\n#endif\n fbo_picking_setData(input, &output, output.position.w, visible);\n#endif\n return output;\n}", fo = "#define SHADER_NAME TEXT_LINE\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\nattribute vec2 aTexCoord;\n#ifdef HAS_OFFSET_Z\nattribute vec3 aOffset;\nuniform float altitudeScale;\n#else\nattribute vec2 aOffset;\n#endif\n#ifdef ENABLE_COLLISION\nattribute float aOpacity;\n#endif\n#ifdef HAS_OPACITY\nattribute float aColorOpacity;\n#endif\n#ifdef HAS_TEXT_SIZE\nattribute float aTextSize;\n#else\nuniform float textSize;\n#endif\n#ifdef HAS_TEXT_DX\nattribute float aTextDx;\n#else\nuniform float textDx;\n#endif\n#ifdef HAS_TEXT_DY\nattribute float aTextDy;\n#else\nuniform float textDy;\n#endif\n#if defined(HAS_PITCH_ALIGN)\nattribute float aPitchAlign;\n#else\nuniform float textPitchWithMap;\n#endif\nuniform float zoomScale;\nuniform float cameraToCenterDistance;\nuniform mat4 projViewModelMatrix;\nuniform float textPerspectiveRatio;\nuniform float mapPitch;\nuniform vec2 glyphTexSize;\nuniform vec2 canvasSize;\nuniform float tileRatio;\nuniform float layerScale;\nuniform float isRenderingTerrain;\nuniform float textPitchFilter;\n#ifndef PICKING_MODE\nvarying vec2 vTexCoord;\nvarying float vGammaScale;\nvarying float vTextSize;\nvarying float vOpacity;\n#ifdef HAS_TEXT_FILL\nattribute vec4 aTextFill;\nvarying vec4 vTextFill;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nattribute vec4 aTextHaloFill;\nvarying vec4 vTextHaloFill;\n#endif\n#if defined(HAS_TEXT_HALO_RADIUS) || defined(HAS_TEXT_HALO_OPACITY)\nattribute vec2 aTextHalo;\nvarying vec2 vTextHalo;\n#endif\n#include <highlight_vert>\n#else\n#include <fbo_picking_vert>\n#endif\n#include <vt_position_vert>\nvoid main() {\n vec3 c = unpackVTPosition();\n#ifdef HAS_TEXT_DX\nfloat d = aTextDx;\n#else\nfloat d = textDx;\n#endif\n#ifdef HAS_TEXT_DY\nfloat e = aTextDy;\n#else\nfloat e = textDy;\n#endif\n#ifdef HAS_TEXT_SIZE\nfloat f = aTextSize * layerScale;\n#else\nfloat f = textSize * layerScale;\n#endif\n#ifdef HAS_PITCH_ALIGN\nfloat h = aPitchAlign;\n#else\nfloat h = textPitchWithMap;\n#endif\ngl_Position = projViewModelMatrix * vec4(c, 1.);\n float i = gl_Position.w;\n float j = i / cameraToCenterDistance;\n float k;\n if(isRenderingTerrain == 1.) {\n k = 1.;\n } else {\n float l = (1. - cameraToCenterDistance / i) * textPerspectiveRatio;\n k = clamp(.5 + .5 * (1. - l), .0, 4.);\n }\n#ifdef HAS_OFFSET_Z\nvec3 m = aOffset / 10.0;\n m[2] /= altitudeScale;\n#else\nvec3 m = vec3(aOffset / 10.0, .0);\n#endif\nvec2 n = aTexCoord;\n if(h == 1.) {\n float o;\n if(isRenderingTerrain == 1.) {\n o = tileRatio;\n } else {\n o = tileRatio / zoomScale * j * k;\n }\n m.xy *= o;\n gl_Position = projViewModelMatrix * vec4(c + m, 1.);\n } else {\n gl_Position.xy += m.xy * 2. / canvasSize * k * i;\n }\n gl_Position.xy += vec2(d, -e) * 2. / canvasSize * i;\n if(textPitchFilter > .0) {\n if(textPitchFilter == 1. && h == .0 || textPitchFilter == 2. && h == 1.) {\n gl_Position = vec4(-9999., -9999., .0, 1.);\n }\n }\n#ifndef PICKING_MODE\nif(h == 1.) {\n vGammaScale = j + mapPitch / 4.;\n } else {\n vGammaScale = mix(1., j, textPerspectiveRatio);\n }\n vGammaScale = clamp(vGammaScale, .0, 1.);\n vTexCoord = n / glyphTexSize;\n vTextSize = f;\n#ifdef ENABLE_COLLISION\nvOpacity = aOpacity / 255.;\n#else\nvOpacity = 1.;\n#endif\n#ifdef HAS_OPACITY\nvOpacity *= aColorOpacity / 255.;\n#endif\n#ifdef HAS_TEXT_FILL\nvTextFill = aTextFill / 255.;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nvTextHaloFill = aTextHaloFill / 255.;\n#endif\n#if defined(HAS_TEXT_HALO_RADIUS) || defined(HAS_TEXT_HALO_OPACITY)\nvTextHalo = aTextHalo;\n#endif\nhighlight_setVarying();\n#else\n#ifdef ENABLE_COLLISION\nbool u = aOpacity == 255.;\n#else\nbool u = true;\n#endif\nfbo_picking_setData(gl_Position.w, u);\n#endif\n}", po = "#define SHADER_NAME TEXT_LINE\nstruct TextLineUniforms {\n textSize: f32,\n textDx: f32,\n textDy: f32,\n textPitchWithMap: f32,\n projViewModelMatrix: mat4x4f,\n textPerspectiveRatio: f32,\n glyphTexSize: vec2f,\n tileRatio: f32,\n zoomScale: f32,\n}\nstruct ShaderUniforms {\n cameraToCenterDistance: f32,\n mapPitch: f32,\n canvasSize: vec2f,\n textPitchFilter: f32,\n isRenderingTerrain: f32,\n layerScale: f32,\n #ifdef HAS_OFFSET_Z\n altitudeScale: f32,\n #endif\n}\n@group(0) @binding($b) var<uniform> uniforms: TextLineUniforms;\n@group(0) @binding($b) var<uniform> shaderUniforms: ShaderUniforms;\nstruct VertexInput {\n#ifdef HAS_ALTITUDE\n @location($i) aPosition: POSITION_TYPE_2,\n @location($i) aAltitude: f32,\n#else\n @location($i) aPosition: POSITION_TYPE_3,\n#endif\n @location($i) aTexCoord: vec2u,\n#ifdef HAS_OFFSET_Z\n @location($i) aOffset: vec3i,\n#else\n @location($i) aOffset: vec2i,\n#endif\n#ifdef ENABLE_COLLISION\n @location($i) aOpacity: u32,\n#endif\n#ifdef HAS_OPACITY\n @location($i) aColorOpacity: u32,\n#endif\n#ifdef HAS_TEXT_SIZE\n @location($i) aTextSize: u32,\n#endif\n#ifdef HAS_TEXT_DX\n @location($i) aTextDx: i32,\n#endif\n#ifdef HAS_TEXT_DY\n @location($i) aTextDy: i32,\n#endif\n#ifdef HAS_PITCH_ALIGN\n @location($i) aPitchAlign: u32,\n#endif\n#ifdef HAS_TEXT_FILL\n @location($i) aTextFill: vec4u,\n#endif\n#ifdef HAS_TEXT_HALO_FILL\n @location($i) aTextHaloFill: vec4u,\n#endif\n#if HAS_TEXT_HALO_RADIUS || HAS_TEXT_HALO_OPACITY\n @location($i) aTextHalo: vec2u,\n#endif\n};\nstruct VertexOutput {\n @builtin(position) position: vec4f,\n#ifndef PICKING_MODE\n @location($o) vTexCoord: vec2f,\n @location($o) vGammaScale: f32,\n @location($o) vTextSize: f32,\n @location($o) vOpacity: f32,\n #ifdef HAS_TEXT_FILL\n @location($o) vTextFill: vec4f,\n #endif\n #ifdef HAS_TEXT_HALO_FILL\n @location($o) vTextHaloFill: vec4f,\n #endif\n #if HAS_TEXT_HALO_RADIUS || HAS_TEXT_HALO_OPACITY\n @location($o) vTextHalo: vec2f,\n #endif\n#endif\n};\n#include <vt_position_vert>\n#include <fbo_picking_vert>\n@vertex\nfn main(input: VertexInput) -> VertexOutput {\n var output: VertexOutput;\n var position = unpackVTPosition(input);\n#ifdef HAS_TEXT_DX\n var myTextDx = f32(input.aTextDx);\n#else\n var myTextDx = uniforms.textDx;\n#endif\n#ifdef HAS_TEXT_DY\n var myTextDy = f32(input.aTextDy);\n#else\n var myTextDy = uniforms.textDy;\n#endif\n#ifdef HAS_TEXT_SIZE\n var myTextSize = f32(input.aTextSize) * shaderUniforms.layerScale;\n#else\n var myTextSize = uniforms.textSize * shaderUniforms.layerScale;\n#endif\n#ifdef HAS_PITCH_ALIGN\n var isPitchWithMap = f32(input.aPitchAlign);\n#else\n var isPitchWithMap = uniforms.textPitchWithMap;\n#endif\n output.position = uniforms.projViewModelMatrix * vec4f(position, 1.0);\n var projDistance = output.position.w;\n var cameraScale = projDistance / shaderUniforms.cameraToCenterDistance;\n var perspectiveRatio: f32;\n if (shaderUniforms.isRenderingTerrain == 1.0) {\n perspectiveRatio = 1.0;\n } else {\n var distanceRatio = (1.0 - shaderUniforms.cameraToCenterDistance / projDistance) * uniforms.textPerspectiveRatio;\n perspectiveRatio = clamp(\n 0.5 + 0.5 * (1.0 - distanceRatio),\n 0.0,\n 4.0);\n }\n#ifdef HAS_OFFSET_Z\n var offset = vec3f(input.aOffset) / 10.0;\n offset.z /= shaderUniforms.altitudeScale;\n#else\n var offset = vec3f(vec2f(input.aOffset) / 10.0, 0.0);\n#endif\n var texCoord = vec2f(input.aTexCoord);\n if (isPitchWithMap == 1.0) {\n var offsetScale: f32;\n if (shaderUniforms.isRenderingTerrain == 1.0) {\n offsetScale = uniforms.tileRatio;\n } else {\n offsetScale = uniforms.tileRatio / uniforms.zoomScale * cameraScale * perspectiveRatio;\n }\n offset = offset * offsetScale;\n output.position = uniforms.projViewModelMatrix * vec4f(position + offset, 1.0);\n } else {\n let perspOffset = offset.xy * 2.0 / shaderUniforms.canvasSize * perspectiveRatio * projDistance;\n output.position = vec4f(output.position.xy + perspOffset, output.position.zw);\n }\n let dxdy = vec2f(myTextDx, -myTextDy) * 2.0 / shaderUniforms.canvasSize * projDistance;\n output.position = vec4f(output.position.xy + dxdy, output.position.zw);\n if (shaderUniforms.textPitchFilter > 0.0) {\n if ((shaderUniforms.textPitchFilter == 1.0 && isPitchWithMap == 0.0) || (shaderUniforms.textPitchFilter == 2.0 && isPitchWithMap == 1.0)) {\n output.position = vec4f(-9999.0, -9999.0, 0.0, 1.0);\n }\n }\n#ifndef PICKING_MODE\n if (isPitchWithMap == 1.0) {\n output.vGammaScale = cameraScale + shaderUniforms.mapPitch / 4.0;\n } else {\n output.vGammaScale = mix(1.0, cameraScale, uniforms.textPerspectiveRatio);\n }\n output.vGammaScale = clamp(output.vGammaScale, 0.0, 1.0);\n output.vTexCoord = texCoord / uniforms.glyphTexSize;\n output.vTextSize = myTextSize;\n#ifdef ENABLE_COLLISION\n output.vOpacity = f32(input.aOpacity) / 255.0;\n#else\n output.vOpacity = 1.0;\n#endif\n#ifdef HAS_OPACITY\n output.vOpacity *= f32(input.aColorOpacity) / 255.0;\n#endif\n#ifdef HAS_TEXT_FILL\n output.vTextFill = vec4f(input.aTextFill) / 255.0;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\n output.vTextHaloFill = vec4f(input.aTextHaloFill) / 255.0;\n#endif\n#if HAS_TEXT_HALO_RADIUS || HAS_TEXT_HALO_OPACITY\n output.vTextHalo = vec2f(input.aTextHalo);\n#endif\n#if HAS_HIGHLIGHT_COLOR || HAS_HIGHLIGHT_OPACITY\n highlight_setVarying(input, &output);\n#endif\n#else\n#ifdef ENABLE_COLLISION\n var visible = f32(input.aOpacity) == 255.0;\n#else\n var visible = true;\n#endif\n fbo_picking_setData(input, &output, output.position.w, visible);\n#endif\n return output;\n}", go = "#define SHADER_NAME TEXT_FRAG\nprecision mediump float;\nuniform float layerOpacity;\nvarying vec2 vTexCoord;\nvarying float vOpacity;\nuniform float alphaTest;\n#include <text_render_frag>\n#include <highlight_frag>\nvoid main() {\n gl_FragColor = renderText(vTexCoord) * vOpacity * layerOpacity;\n if(gl_FragColor.a < alphaTest) {\n discard;\n }\n gl_FragColor = highlight_blendColor(gl_FragColor);\n}", mo = "struct TextFragUniforms {\n layerOpacity: f32,\n}\nstruct TextUniforms {\n alphaTest: f32\n}\n@group(0) @binding($b) var<uniform> uniforms: TextFragUniforms;\n@group(0) @binding($b) var<uniform> textUniforms: TextUniforms;\n#include <text_render_frag>\n#include <highlight_frag>\n@fragment\nfn main(input: VertexOutput) -> @location(0) vec4f {\n var fragColor = renderText(input) * input.vOpacity * uniforms.layerOpacity;\n if (fragColor.a < textUniforms.alphaTest) {\n discard;\n }\n #if HAS_HIGHLIGHT_OPACITY || HAS_HIGHLIGHT_COLOR\n return highlight_blendColor(fragColor, input);\n #else\n return fragColor;\n #endif\n}";
|
|
16035
16032
|
|
|
16036
16033
|
const {TextUtil: yo, PackUtil: xo, FilterUtil: _o, TEXT_MAX_ANGLE: vo} = j(), Ao = function(e) {
|
|
16037
16034
|
const t = this.layer.getRenderer();
|
|
@@ -16045,9 +16042,9 @@ const {TextUtil: yo, PackUtil: xo, FilterUtil: _o, TEXT_MAX_ANGLE: vo} = j(), Ao
|
|
|
16045
16042
|
}, bo = function(e) {
|
|
16046
16043
|
const t = this.layer.getRenderer(), n = e.properties.tile.z, i = t.getCurrentTileZoom();
|
|
16047
16044
|
return !this._isHalo0(e) && !t.isForeground(e) && "line" === e.geometry.properties.textPlacement && n < i;
|
|
16048
|
-
}, Po = [ 0, 0, 3 ], wo = [], Mo = [], Io = [], Co = [], Oo = [], ko = [], Ro = [], Fo = [], Eo = [ 1, -1 ], Ho = new Int16Array(3), Do = [], Lo = [], No = [], zo = [], Vo = [], Uo = [], Go = [], Bo = {}, Wo = {}, jo = {}, Xo = [], $o = [], Yo = g.identity([]),
|
|
16045
|
+
}, Po = [ 0, 0, 3 ], wo = [], Mo = [], Io = [], Co = [], Oo = [], ko = [], Ro = [], Fo = [], Eo = [ 1, -1 ], Ho = new Int16Array(3), Do = [], Lo = [], No = [], zo = [], Vo = [], Uo = [], Go = [], Bo = {}, Wo = {}, jo = {}, Xo = [], $o = [], Yo = g.identity([]), qo = [];
|
|
16049
16046
|
|
|
16050
|
-
class
|
|
16047
|
+
class Zo extends Ii {
|
|
16051
16048
|
static getBloomSymbol() {
|
|
16052
16049
|
return [ "textBloom" ];
|
|
16053
16050
|
}
|
|
@@ -16118,7 +16115,7 @@ class qo extends Ii {
|
|
|
16118
16115
|
return wr(e, t);
|
|
16119
16116
|
}
|
|
16120
16117
|
isBloom(e) {
|
|
16121
|
-
return !!this.getSymbol(e.properties.symbolIndex)[
|
|
16118
|
+
return !!this.getSymbol(e.properties.symbolIndex)[Zo.getBloomSymbol()[0]];
|
|
16122
16119
|
}
|
|
16123
16120
|
createGeometry(e, t, n) {
|
|
16124
16121
|
const i = e;
|
|
@@ -16279,7 +16276,7 @@ class qo extends Ii {
|
|
|
16279
16276
|
e ? (E = p.set($o, ...k), E[2] = 100 * e, E = rn(E, E, s, d.width, d.height)) : E = R;
|
|
16280
16277
|
} else E = R;
|
|
16281
16278
|
const H = i[d.id], D = H ? H.devicePixelRatio : d.getdevicePixelRatio();
|
|
16282
|
-
if (x.scale(
|
|
16279
|
+
if (x.scale(qo, E, 1 / D), d.isOffscreen(qo)) return f || Ko(A, t, n, r), w[3 * C] = Me,
|
|
16283
16280
|
w[3 * C + 1] = Me, w[3 * C + 2] = Me, !1;
|
|
16284
16281
|
I && (k = R), w[3 * C] = E[0], w[3 * C + 1] = E[1], w[3 * C + 2] = E[2];
|
|
16285
16282
|
const L = I ? 1 : m.properties.tileExtent / this.layer.getTileSize().width;
|
|
@@ -16351,7 +16348,9 @@ class qo extends Ii {
|
|
|
16351
16348
|
height: (e, t) => t.viewport ? t.viewport.height : i ? i.height : 1
|
|
16352
16349
|
};
|
|
16353
16350
|
n.viewport = r;
|
|
16354
|
-
const o = {
|
|
16351
|
+
const o = {
|
|
16352
|
+
HAS_HIGHLIGHT_COLOR_POINT: 1
|
|
16353
|
+
};
|
|
16355
16354
|
this.shader = new d.MeshShader({
|
|
16356
16355
|
name: "text",
|
|
16357
16356
|
vert: co,
|
|
@@ -16442,15 +16441,15 @@ function Jo(e, t) {
|
|
|
16442
16441
|
return 0 === n ? e.properties.meshKey - t.properties.meshKey : n;
|
|
16443
16442
|
}
|
|
16444
16443
|
|
|
16445
|
-
var Qo = "#define SHADER_NAME NATIVE_POINT\n#include <gl2_vert>\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\n#ifdef HAS_COLOR\nattribute vec4 aColor;\nvarying vec4 vColor;\n#endif\nuniform mat4 positionMatrix;\nuniform mat4 projViewModelMatrix;\nuniform float markerSize;\n#ifdef PICKING_MODE\n#include <fbo_picking_vert>\n#endif\n#include <vt_position_vert>\nvoid main() {\n vec3 c = unpackVTPosition();\n gl_Position = projViewModelMatrix * positionMatrix * vec4(c, 1.);\n gl_PointSize = markerSize;\n#ifdef HAS_COLOR\nvColor = aColor / 255.;\n#endif\n#ifdef PICKING_MODE\nfbo_picking_setData(gl_Position.w, true);\n#endif\n}";
|
|
16444
|
+
var Qo = "#define SHADER_NAME NATIVE_POINT\n#include <gl2_vert>\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\n#ifdef HAS_COLOR\nattribute vec4 aColor;\nvarying vec4 vColor;\n#endif\nuniform mat4 positionMatrix;\nuniform mat4 projViewModelMatrix;\nuniform float markerSize;\n#ifdef PICKING_MODE\n#include <fbo_picking_vert>\n#endif\n#include <vt_position_vert>\nvoid main() {\n vec3 c = unpackVTPosition();\n gl_Position = projViewModelMatrix * positionMatrix * vec4(c, 1.);\n gl_PointSize = markerSize;\n#ifdef HAS_COLOR\nvColor = aColor / 255.;\n#endif\n#ifdef PICKING_MODE\nfbo_picking_setData(gl_Position.w, true);\n#endif\n}", es = "struct AttributeInput {\n @location($i) aPosition: vec2i,\n#ifdef HAS_ALTITUDE\n @location($i) instancePosition: vec2i,\n @location($i) instanceAltitude: f32,\n#else\n @location($i) instancePosition: vec4i,\n#endif\n#ifndef PICKING_MODE\n #ifdef HAS_COLOR\n @location($i) aColor: vec4u,\n #endif\n#endif\n};\nstruct VertexInput {\n#ifdef HAS_ALTITUDE\n aPosition: vec2i,\n aAltitude: f32,\n#else\n aPosition: vec4i,\n#endif\n aPickingId: f32,\n}\nstruct VertexOutput {\n @builtin(position) position: vec4f,\n #ifndef PICKING_MODE\n #ifdef HAS_COLOR\n @location($o) vColor: vec4f,\n #endif\n #endif\n};\nstruct MarkerUniforms {\n positionMatrix: mat4x4f,\n projViewModelMatrix: mat4x4f,\n markerSize: f32,\n};\n@group(0) @binding($b) var<uniform> uniforms: MarkerUniforms;\n@group(0) @binding($b) var<uniform> resolution: vec2f;\n#ifdef PICKING_MODE\n #include <fbo_picking_vert>\n#endif\n#include <vt_position_vert>\n@vertex\nfn main(\n input: AttributeInput\n) -> VertexOutput {\n var out: VertexOutput;\n var inputVertex: VertexInput;\n inputVertex.aPosition = input.instancePosition;\n #ifdef HAS_ALTITUDE\n inputVertex.aAltitude = input.instanceAltitude;\n #endif\n let position = unpackVTPosition(inputVertex);\n out.position = uniforms.projViewModelMatrix * uniforms.positionMatrix * vec4f(position, 1.0);\n let markerSize = uniforms.markerSize / resolution;\n let w = out.position.w;\n out.position.x += f32(input.aPosition.x) * markerSize.x * w;\n out.position.y += f32(input.aPosition.y) * markerSize.y * w;\n #ifndef PICKING_MODE\n #ifdef HAS_COLOR\n out.vColor = vec4f(input.aColor) / 255.0;\n #endif\n #endif\n #ifdef PICKING_MODE\n inputVertex.aPickingId = input.aPickingId;\n fbo_picking_setData(inputVertex, &out, w, true);\n #endif\n return out;\n}";
|
|
16446
16445
|
|
|
16447
|
-
const
|
|
16446
|
+
const ts = {
|
|
16448
16447
|
markerFill: [ 0, 0, 0 ],
|
|
16449
16448
|
markerOpacity: 1,
|
|
16450
16449
|
markerSize: 10
|
|
16451
16450
|
};
|
|
16452
16451
|
|
|
16453
|
-
class
|
|
16452
|
+
class ns extends On {
|
|
16454
16453
|
getPrimitive() {
|
|
16455
16454
|
return this.isWebGPU() ? "triangles" : "points";
|
|
16456
16455
|
}
|
|
@@ -16471,7 +16470,7 @@ class ts extends On {
|
|
|
16471
16470
|
const s = {};
|
|
16472
16471
|
Be(s, "markerOpacity", o, "markerOpacity", 1), Be(s, "markerSize", o, "markerSize", 10),
|
|
16473
16472
|
Be(s, "markerFill", o, "markerFill", "#000", Xe(this.colorCache, 3));
|
|
16474
|
-
const a = new d.Material(s,
|
|
16473
|
+
const a = new d.Material(s, ts);
|
|
16475
16474
|
a.createDefines = () => "square" !== o.markerType ? {
|
|
16476
16475
|
USE_CIRCLE: 1
|
|
16477
16476
|
} : null, a.appendDefines = e => ("square" !== o.markerType && (e.USE_CIRCLE = 1),
|
|
@@ -16482,16 +16481,18 @@ class ts extends On {
|
|
|
16482
16481
|
};
|
|
16483
16482
|
let h;
|
|
16484
16483
|
if (this.isWebGPU()) {
|
|
16485
|
-
const {aPosition: e, aAltitude: t, aColor: i} = n.data,
|
|
16486
|
-
|
|
16484
|
+
const {aPosition: e, aAltitude: t, aColor: i, aPickingId: r} = n.data, o = new Int16Array([ -1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1 ]), s = new d.Geometry({
|
|
16485
|
+
pointPosition: o
|
|
16487
16486
|
}, 6, 0, {
|
|
16488
|
-
positionSize: 2
|
|
16487
|
+
positionSize: 2,
|
|
16488
|
+
positionAttribute: "pointPosition"
|
|
16489
16489
|
});
|
|
16490
|
-
|
|
16490
|
+
Ne(s.properties, n.properties), s.generateBuffers(this.regl), h = new d.InstancedMesh({
|
|
16491
16491
|
instancePosition: e,
|
|
16492
16492
|
instanceAltitude: t,
|
|
16493
|
-
aColor: i
|
|
16494
|
-
|
|
16493
|
+
aColor: i,
|
|
16494
|
+
aPickingId: r
|
|
16495
|
+
}, n.getVertexCount(), s, a, l), h.generateInstancedBuffers(this.regl);
|
|
16495
16496
|
} else h = new d.Mesh(n, a, l);
|
|
16496
16497
|
const c = {};
|
|
16497
16498
|
return h.geometry.data.aAltitude && (c.HAS_ALTITUDE = 1), n.data.aColor && (c.HAS_COLOR = 1),
|
|
@@ -16520,9 +16521,9 @@ class ts extends On {
|
|
|
16520
16521
|
const t = [], n = {
|
|
16521
16522
|
name: "vt-native-point",
|
|
16522
16523
|
vert: Qo,
|
|
16523
|
-
frag: "#define SHADER_NAME NATIVE_POINT\nprecision mediump float;\n#include <gl2_frag>\n#ifdef USE_CIRCLE\n#if __VERSION__ == 100\n#ifdef GL_OES_standard_derivatives\n#define STANDARD_DERIVATIVES_ENABLED 1\n#extension GL_OES_standard_derivatives : enable\n#endif\n#else\n#define STANDARD_DERIVATIVES_ENABLED 1\n#endif\n#endif\n#ifdef HAS_COLOR\nvarying vec4 vColor;\n#else\nuniform vec3 markerFill;\n#endif\nuniform float markerOpacity;\nuniform float layerOpacity;\nvoid main() {\n float c = 1.;\n#ifdef USE_CIRCLE\nfloat r = .0, d = .0;\n vec2 e = 2. * gl_PointCoord - 1.;\n r = dot(e, e);\n if(r > 1.) {\n discard;\n }\n#ifdef STANDARD_DERIVATIVES_ENABLED\nd = fwidth(r);\n c = 1. - smoothstep(1. - d, 1. + d, r);\n#endif\n#endif\n#ifdef HAS_COLOR\nvec4 f = vColor;\n#else\nvec4 f = vec4(markerFill, 1.);\n#endif\nglFragColor = f * markerOpacity * c * layerOpacity;\n#if __VERSION__ == 100\ngl_FragColor = glFragColor;\n#endif\n}",
|
|
16524
|
-
wgslVert:
|
|
16525
|
-
wgslFrag: "struct MarkerFragmentUniforms {\n markerOpacity: f32,\n #ifndef HAS_COLOR\n markerFill: vec3f,\n #endif\n}\n@group(0) @binding($b) var<uniform> uniforms: MarkerFragmentUniforms;\n@group(0) @binding($b) var<uniform> layerOpacity: f32;\n#ifdef HAS_COLOR\nstruct VertexOuput {\n @location($i) vColor: vec4f,\n}\n#endif\n@fragment\nfn main(\n #ifdef HAS_COLOR\n vertexOutput: VertexOuput,\n #endif\n) -> @location(0) vec4f {\n var alpha: f32 = 1.0;\n #ifdef USE_CIRCLE\n #endif\n var pointColor: vec4f;\n #ifdef HAS_COLOR\n pointColor = vertexOutput.vColor;\n #else\n pointColor = vec4f(uniforms.markerFill, 1.0);\n #endif\n
|
|
16524
|
+
frag: "#define SHADER_NAME NATIVE_POINT\nprecision mediump float;\n#include <gl2_frag>\n#ifdef USE_CIRCLE\n#if __VERSION__ == 100\n#ifdef GL_OES_standard_derivatives\n#define STANDARD_DERIVATIVES_ENABLED 1\n#extension GL_OES_standard_derivatives : enable\n#endif\n#else\n#define STANDARD_DERIVATIVES_ENABLED 1\n#endif\n#endif\n#ifdef HAS_COLOR\nvarying vec4 vColor;\n#else\nuniform vec3 markerFill;\n#endif\nuniform float markerOpacity;\nuniform float layerOpacity;\nvoid main() {\n float c = 1.;\n#ifdef USE_CIRCLE\nfloat r = .0, d = .0;\n vec2 e = 2. * gl_PointCoord - 1.;\n r = dot(e, e);\n if(r > 1.) {\n discard;\n }\n#ifdef STANDARD_DERIVATIVES_ENABLED\nd = fwidth(r);\n c = 1. - smoothstep(1. - d, 1. + d, r);\n#endif\n#endif\n#ifdef HAS_COLOR\nvec4 f = vColor;\n#else\nvec4 f = vec4(markerFill, 1.);\n#endif\nglFragColor = f * markerOpacity * c * layerOpacity;\n if(glFragColor.a <= .01) {\n discard;\n }\n#if __VERSION__ == 100\ngl_FragColor = glFragColor;\n#endif\n}",
|
|
16525
|
+
wgslVert: es,
|
|
16526
|
+
wgslFrag: "struct MarkerFragmentUniforms {\n markerOpacity: f32,\n #ifndef HAS_COLOR\n markerFill: vec3f,\n #endif\n}\n@group(0) @binding($b) var<uniform> uniforms: MarkerFragmentUniforms;\n@group(0) @binding($b) var<uniform> layerOpacity: f32;\n#ifdef HAS_COLOR\nstruct VertexOuput {\n @location($i) vColor: vec4f,\n}\n#endif\n@fragment\nfn main(\n #ifdef HAS_COLOR\n vertexOutput: VertexOuput,\n #endif\n) -> @location(0) vec4f {\n var alpha: f32 = 1.0;\n #ifdef USE_CIRCLE\n #endif\n var pointColor: vec4f;\n #ifdef HAS_COLOR\n pointColor = vertexOutput.vColor;\n #else\n pointColor = vec4f(uniforms.markerFill, 1.0);\n #endif\n let color = pointColor * uniforms.markerOpacity * alpha * layerOpacity;\n if (color.a <= 0.01) {\n discard;\n }\n return color;\n}",
|
|
16526
16527
|
uniforms: [ {
|
|
16527
16528
|
name: "projViewModelMatrix",
|
|
16528
16529
|
type: "function",
|
|
@@ -16540,7 +16541,6 @@ class ts extends On {
|
|
|
16540
16541
|
},
|
|
16541
16542
|
depth: {
|
|
16542
16543
|
enable: !0,
|
|
16543
|
-
mask: !1,
|
|
16544
16544
|
range: this.sceneConfig.depthRange || [ 0, 1 ],
|
|
16545
16545
|
func: this.sceneConfig.depthFunc || "always"
|
|
16546
16546
|
},
|
|
@@ -16555,6 +16555,7 @@ class ts extends On {
|
|
|
16555
16555
|
const e = [];
|
|
16556
16556
|
this.picking = [ new d.FBORayPicking(this.renderer, {
|
|
16557
16557
|
vert: Qo,
|
|
16558
|
+
wgslVert: es,
|
|
16558
16559
|
uniforms: [ {
|
|
16559
16560
|
name: "projViewModelMatrix",
|
|
16560
16561
|
type: "function",
|
|
@@ -16579,11 +16580,11 @@ class ts extends On {
|
|
|
16579
16580
|
}
|
|
16580
16581
|
}
|
|
16581
16582
|
|
|
16582
|
-
var
|
|
16583
|
+
var is = "#define SHADER_NAME NATIVE_LINE\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\nuniform mat4 projViewModelMatrix;\nuniform mat4 positionMatrix;\n#ifndef PICKING_MODE\n#if defined(HAS_COLOR)\nattribute vec4 aColor;\nvarying vec4 vColor;\n#endif\n#else\n#include <fbo_picking_vert>\n#endif\n#include <vt_position_vert>\nvoid main() {\n vec3 c = unpackVTPosition();\n gl_Position = projViewModelMatrix * positionMatrix * vec4(c, 1.);\n#ifndef PICKING_MODE\n#if defined(HAS_COLOR)\nvColor = aColor / 255.;\n#endif\n#else\nfbo_picking_setData(gl_Position.w, true);\n#endif\n}", rs = "struct VertexInput {\n#ifdef HAS_ALTITUDE\n @location($i) aPosition: vec2i,\n @location($i) aAltitude: f32,\n#else\n @location($i) aPosition: vec4i,\n#endif\n#ifndef PICKING_MODE\n #if HAS_COLOR\n @location($i) aColor: vec4u,\n #endif\n#endif\n}\nstruct MyAppUniforms {\n projViewModelMatrix: mat4x4f,\n positionMatrix: mat4x4f,\n};\n@group(0) @binding($b) var<uniform> uniforms: MyAppUniforms;\nstruct VertexOutput {\n @builtin(position) position: vec4f,\n#ifndef PICKING_MODE\n #if HAS_COLOR\n @location($o) vColor: vec4f,\n #endif\n#endif\n}\n#ifdef PICKING_MODE\n #include <fbo_picking_vert>\n#endif\n#include <vt_position_vert>\n@vertex\nfn main(\n vertexInput: VertexInput\n) -> VertexOutput {\n var out: VertexOutput;\n let position = unpackVTPosition(vertexInput);\n out.position = uniforms.projViewModelMatrix * uniforms.positionMatrix * vec4f(position, 1.0);\n #ifndef PICKING_MODE\n #if HAS_COLOR\n out.vColor = vertexInputWithColor.aColor / 255.0;\n #endif\n #else\n fbo_picking_setData(vertexInput, &out, out.position.w, true);\n #endif\n return out;\n}";
|
|
16583
16584
|
|
|
16584
|
-
const
|
|
16585
|
+
const os = g.identity([]);
|
|
16585
16586
|
|
|
16586
|
-
class
|
|
16587
|
+
class ss extends On {
|
|
16587
16588
|
constructor(e, t, n, r, o, s) {
|
|
16588
16589
|
if (super(e, t, n, r, o, s), this.primitive = "lines", M(this.symbolDef.lineColor)) {
|
|
16589
16590
|
const e = t.getMap(), n = C(this.symbolDef.lineColor);
|
|
@@ -16632,9 +16633,9 @@ class os extends On {
|
|
|
16632
16633
|
}
|
|
16633
16634
|
} ], r = this.sceneConfig.depthRange, o = {
|
|
16634
16635
|
name: "vt-native-line",
|
|
16635
|
-
vert:
|
|
16636
|
+
vert: is,
|
|
16636
16637
|
frag: "#define SHADER_NAME NATIVE_LINE\nprecision mediump float;\nuniform float lineOpacity;\nuniform vec4 lineColor;\nuniform float layerOpacity;\n#if defined(HAS_COLOR)\nvarying vec4 vColor;\n#endif\nvoid main() {\n gl_FragColor = lineColor * lineOpacity;\n#if defined(HAS_COLOR)\ngl_FragColor *= vColor;\n#endif\ngl_FragColor *= layerOpacity;\n}",
|
|
16637
|
-
wgslVert:
|
|
16638
|
+
wgslVert: rs,
|
|
16638
16639
|
wgslFrag: "struct Uniforms {\n lineOpacity: f32,\n lineColor: vec4f,\n};\n@group(0) @binding($b) var<uniform> uniforms: Uniforms;\n@group(0) @binding($b) var<uniform> layerOpacity: f32;\n#if HAS_COLOR\n struct VertexOuput {\n @location(0) vColor: vec4f,\n };\n#endif\n@fragment\nfn main(\n #if HAS_COLOR\n input: VertexOuput\n #endif\n) -> @location(0) vec4f {\n var outputColor: vec4f = uniforms.lineColor * uniforms.lineOpacity;\n #if HAS_COLOR\n outputColor *= input.vColor;\n #endif\n outputColor *= layerOpacity;\n return outputColor;\n}",
|
|
16639
16640
|
uniforms: i,
|
|
16640
16641
|
defines: null,
|
|
@@ -16669,8 +16670,9 @@ class os extends On {
|
|
|
16669
16670
|
}
|
|
16670
16671
|
};
|
|
16671
16672
|
this.shader = new d.MeshShader(o), this.pickingFBO && (this.picking = [ new d.FBORayPicking(this.renderer, {
|
|
16672
|
-
|
|
16673
|
-
|
|
16673
|
+
name: "vt-native-line-picking",
|
|
16674
|
+
wgslVert: rs,
|
|
16675
|
+
vert: is,
|
|
16674
16676
|
uniforms: i,
|
|
16675
16677
|
defines: {
|
|
16676
16678
|
PICKING_MODE: 1
|
|
@@ -16683,7 +16685,7 @@ class os extends On {
|
|
|
16683
16685
|
getUniformValues(e, t) {
|
|
16684
16686
|
const n = t && t.isRenderingTerrainSkin;
|
|
16685
16687
|
return {
|
|
16686
|
-
projViewMatrix: n ?
|
|
16688
|
+
projViewMatrix: n ? os : e.projViewMatrix,
|
|
16687
16689
|
viewport: n && t && t.viewport
|
|
16688
16690
|
};
|
|
16689
16691
|
}
|
|
@@ -16692,9 +16694,9 @@ class os extends On {
|
|
|
16692
16694
|
}
|
|
16693
16695
|
}
|
|
16694
16696
|
|
|
16695
|
-
const {DEFAULT_TEX_WIDTH:
|
|
16697
|
+
const {DEFAULT_TEX_WIDTH: as} = j(), ls = [ 1, 1, 1 ], hs = [ 1, 1, 1, 1 ], cs = [ 0, 0 ], us = [ 1, 1 ], fs = [], ds = new e.Coordinate(0, 0), ps = new e.Coordinate(0, 0), gs = [], ms = [];
|
|
16696
16698
|
|
|
16697
|
-
class
|
|
16699
|
+
class ys extends Mn {
|
|
16698
16700
|
isEnableTileStencil() {
|
|
16699
16701
|
return !1;
|
|
16700
16702
|
}
|
|
@@ -16714,9 +16716,9 @@ class ms extends Mn {
|
|
|
16714
16716
|
if (!this.material) return this.setToRedraw(), null;
|
|
16715
16717
|
const {geometry: r, symbolIndex: o} = t, s = this.layer instanceof e.TileLayer, a = new d.Mesh(r, this.material);
|
|
16716
16718
|
if (this.sceneConfig.animation) {
|
|
16717
|
-
|
|
16719
|
+
ls[2] = .01;
|
|
16718
16720
|
const e = [];
|
|
16719
|
-
g.fromScaling(e,
|
|
16721
|
+
g.fromScaling(e, ls), g.multiply(e, n, e), n = e;
|
|
16720
16722
|
}
|
|
16721
16723
|
const l = this.getSymbolDef(o), h = this.getFnTypeConfig(o);
|
|
16722
16724
|
Vt(r, l, h, this.layer);
|
|
@@ -16734,16 +16736,16 @@ class ms extends Mn {
|
|
|
16734
16736
|
enumerable: !0,
|
|
16735
16737
|
get: () => {
|
|
16736
16738
|
const e = this.dataConfig.defaultAltitude * (this.dataConfig.altitudeScale || 1);
|
|
16737
|
-
return
|
|
16739
|
+
return qe(e) ? e : 0;
|
|
16738
16740
|
}
|
|
16739
16741
|
});
|
|
16740
16742
|
} else {
|
|
16741
|
-
Be(a.uniforms, "polygonFill", f, "polygonFill",
|
|
16743
|
+
Be(a.uniforms, "polygonFill", f, "polygonFill", hs, p), Be(a.uniforms, "polygonOpacity", f, "polygonOpacity", 1);
|
|
16742
16744
|
const e = [];
|
|
16743
16745
|
Object.defineProperty(a.uniforms, "vertexColorsOfType", {
|
|
16744
16746
|
enumerable: !0,
|
|
16745
16747
|
get: () => {
|
|
16746
|
-
const t = p(f.bottomPolygonFill ||
|
|
16748
|
+
const t = p(f.bottomPolygonFill || hs), n = p(f.topPolygonFill || hs);
|
|
16747
16749
|
e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[4] = n[0], e[5] = n[1], e[6] = n[2],
|
|
16748
16750
|
e[7] = n[3];
|
|
16749
16751
|
const i = a.geometry.properties.vertexColors;
|
|
@@ -16800,15 +16802,15 @@ class ms extends Mn {
|
|
|
16800
16802
|
if (1 === this.dataConfig.topUVMode) return e[0] = 0, e[1] = 0, e;
|
|
16801
16803
|
const s = this.getMap(), a = this.getSymbol(t).material;
|
|
16802
16804
|
let l = n;
|
|
16803
|
-
!this.dataConfig.side && a && a.textureOrigin && (
|
|
16804
|
-
s.coordToPointAtRes(
|
|
16805
|
+
!this.dataConfig.side && a && a.textureOrigin && (ds.set(a.textureOrigin[0], a.textureOrigin[1]),
|
|
16806
|
+
s.coordToPointAtRes(ds, i, ps), l = v.set(gs, n[0] - ps.x, n[1] - ps.y));
|
|
16805
16807
|
const h = !!a && a.uvOffsetInMeter;
|
|
16806
|
-
let c = a && a.uvOffset ||
|
|
16808
|
+
let c = a && a.uvOffset || cs;
|
|
16807
16809
|
const u = this.getUVOffsetAnim();
|
|
16808
16810
|
u && (c = this.getUVOffset(u));
|
|
16809
|
-
const f = a && a.uvScale ||
|
|
16811
|
+
const f = a && a.uvScale || us;
|
|
16810
16812
|
let d = this.dataConfig.side ? 0 : l[0], p = this.dataConfig.side ? 0 : l[1];
|
|
16811
|
-
const g = a && a.textureWidth ||
|
|
16813
|
+
const g = a && a.textureWidth || as, m = g * f[1] / f[0];
|
|
16812
16814
|
h && (d += c[0] / r, p += c[1] / r);
|
|
16813
16815
|
const y = h ? 0 : c[0], x = h ? 0 : c[1], _ = v.set(e, d * r * f[0] / g + y, p * r * f[1] / m + x);
|
|
16814
16816
|
return o || (_[1] *= -1), _;
|
|
@@ -16819,7 +16821,7 @@ class ms extends Mn {
|
|
|
16819
16821
|
super.callShader(e, t);
|
|
16820
16822
|
}
|
|
16821
16823
|
getShadowMeshes() {
|
|
16822
|
-
if (!this.isVisible()) return
|
|
16824
|
+
if (!this.isVisible()) return fs;
|
|
16823
16825
|
this.shadowCount = this.scene.getMeshes().length;
|
|
16824
16826
|
const e = this.scene.getMeshes().filter((e => 0 === e.properties.level));
|
|
16825
16827
|
for (let t = 0; t < e.length; t++) {
|
|
@@ -16833,7 +16835,7 @@ class ms extends Mn {
|
|
|
16833
16835
|
return e.material && e.material.uvOffsetAnim;
|
|
16834
16836
|
}
|
|
16835
16837
|
getUVOffset(e) {
|
|
16836
|
-
const t = this.getSymbols()[0], n = t.material && t.material.uvOffset ||
|
|
16838
|
+
const t = this.getSymbols()[0], n = t.material && t.material.uvOffset || cs, i = !!t.material && t.material.uvOffsetInMeter, r = performance.now() / 1e3, o = v.set(ms, n[0], n[1]);
|
|
16837
16839
|
return o[0] = r * e[0], o[1] = r * e[0], i || (o[0] %= 1, o[1] %= 1), o;
|
|
16838
16840
|
}
|
|
16839
16841
|
needPolygonOffset() {
|
|
@@ -16849,7 +16851,7 @@ class ms extends Mn {
|
|
|
16849
16851
|
_prepareMesh(e, t) {
|
|
16850
16852
|
if (null !== t) {
|
|
16851
16853
|
const n = e.localTransform;
|
|
16852
|
-
0 === t && (t = .01),
|
|
16854
|
+
0 === t && (t = .01), ls[2] = t, g.fromScaling(n, ls), g.multiply(n, e.properties.tileTransform, n),
|
|
16853
16855
|
e.setLocalTransform(n);
|
|
16854
16856
|
} else e.setLocalTransform(e.properties.tileTransform);
|
|
16855
16857
|
e.material !== this.material && e.setMaterial(this.material), e.geometry.properties.maxAltitude <= 0 && (this._needPolygonOffset = !0),
|
|
@@ -16906,31 +16908,31 @@ class ms extends Mn {
|
|
|
16906
16908
|
updateSymbol(e, t) {
|
|
16907
16909
|
let n = !1;
|
|
16908
16910
|
e && e.material && (n = function(e, t) {
|
|
16909
|
-
for (const n in t) if (
|
|
16911
|
+
for (const n in t) if (_s[n] && t[n] !== e[n] && (!e[n] || !t[n])) return !0;
|
|
16910
16912
|
return !1;
|
|
16911
16913
|
}(this.symbolDef[0].material || {}, e.material));
|
|
16912
16914
|
const i = super.updateSymbol(e, t);
|
|
16913
16915
|
return e && e.material && this._updateMaterial(e.material), n || i;
|
|
16914
16916
|
}
|
|
16915
16917
|
_isNeedRefreshStyle(e, t) {
|
|
16916
|
-
return
|
|
16918
|
+
return xs(e) !== xs(t);
|
|
16917
16919
|
}
|
|
16918
16920
|
}
|
|
16919
16921
|
|
|
16920
|
-
function
|
|
16922
|
+
function xs(e) {
|
|
16921
16923
|
if (!e || !e.material) return !1;
|
|
16922
16924
|
for (const t in e.material) if (t.indexOf("Texture") > 0 && e.material[t]) return !0;
|
|
16923
16925
|
return !1;
|
|
16924
16926
|
}
|
|
16925
16927
|
|
|
16926
|
-
const
|
|
16928
|
+
const _s = {
|
|
16927
16929
|
normalTexture: 1,
|
|
16928
16930
|
bumpTexture: 1
|
|
16929
16931
|
};
|
|
16930
16932
|
|
|
16931
|
-
const
|
|
16933
|
+
const vs = d.ShaderLib.get("mesh_picking_vert"), As = d.WgslShaderLib.get("mesh_picking").vert;
|
|
16932
16934
|
|
|
16933
|
-
class
|
|
16935
|
+
class Ts extends ys {
|
|
16934
16936
|
createGeometry(e) {
|
|
16935
16937
|
const t = e.data, n = this.getSymbols()[0];
|
|
16936
16938
|
if (n.material && n.material.extrusionOpacity) {
|
|
@@ -17051,10 +17053,10 @@ class As extends ms {
|
|
|
17051
17053
|
return s.outSize = [ a.width, a.height ], s;
|
|
17052
17054
|
}
|
|
17053
17055
|
getPickingVert() {
|
|
17054
|
-
return
|
|
17056
|
+
return vs;
|
|
17055
17057
|
}
|
|
17056
17058
|
getPickingWGSLVert() {
|
|
17057
|
-
return
|
|
17059
|
+
return As;
|
|
17058
17060
|
}
|
|
17059
17061
|
_getLightUniformValues() {
|
|
17060
17062
|
const e = this.getMap().getLightManager(), t = e && e.getAmbientLight() || {}, n = e && e.getDirectionalLight() || {};
|
|
@@ -17067,9 +17069,9 @@ class As extends ms {
|
|
|
17067
17069
|
}
|
|
17068
17070
|
}
|
|
17069
17071
|
|
|
17070
|
-
const
|
|
17072
|
+
const Ss = [ 1, 1, 1 ];
|
|
17071
17073
|
|
|
17072
|
-
class
|
|
17074
|
+
class bs extends Mn {
|
|
17073
17075
|
createGeometry(e) {
|
|
17074
17076
|
const {data: t, indices: n} = e, i = new d.Geometry(t, n, 0, {
|
|
17075
17077
|
primitive: "lines"
|
|
@@ -17084,9 +17086,9 @@ class Ss extends Mn {
|
|
|
17084
17086
|
createMesh(e, t) {
|
|
17085
17087
|
const {geometry: n} = e, i = new d.Mesh(n);
|
|
17086
17088
|
if (i.castShadow = !1, this.sceneConfig.animation) {
|
|
17087
|
-
|
|
17089
|
+
Ss[2] = .01;
|
|
17088
17090
|
const e = [];
|
|
17089
|
-
g.fromScaling(e,
|
|
17091
|
+
g.fromScaling(e, Ss), g.multiply(e, t, e), t = e;
|
|
17090
17092
|
}
|
|
17091
17093
|
return i.setLocalTransform(t), i.properties.symbolIndex = {
|
|
17092
17094
|
index: 0
|
|
@@ -17095,7 +17097,7 @@ class Ss extends Mn {
|
|
|
17095
17097
|
addMesh(e, t) {
|
|
17096
17098
|
if (!e.length) return this;
|
|
17097
17099
|
let n;
|
|
17098
|
-
null !== t ? (0 === t && (t = .01), n = e[0].localTransform,
|
|
17100
|
+
null !== t ? (0 === t && (t = .01), n = e[0].localTransform, Ss[2] = t, g.fromScaling(n, Ss),
|
|
17099
17101
|
g.multiply(n, e[0].properties.tileTransform, n)) : n = e[0].properties.tileTransform;
|
|
17100
17102
|
for (let t = 0; t < e.length; t++) e[t].setLocalTransform(n);
|
|
17101
17103
|
return this.scene.addMesh(e), this;
|
|
@@ -17152,9 +17154,9 @@ class Ss extends Mn {
|
|
|
17152
17154
|
}
|
|
17153
17155
|
}
|
|
17154
17156
|
|
|
17155
|
-
const
|
|
17157
|
+
const Ps = d.ShaderLib.get("mesh_picking_vert"), ws = d.WgslShaderLib.get("mesh_picking").vert, {getPBRUniforms: Ms} = d.pbr.PBRUtils;
|
|
17156
17158
|
|
|
17157
|
-
class
|
|
17159
|
+
class Is extends ys {
|
|
17158
17160
|
constructor(...e) {
|
|
17159
17161
|
super(...e), this._loader = new d.ResourceLoader(null, this.layer.getURLModifier());
|
|
17160
17162
|
}
|
|
@@ -17221,8 +17223,8 @@ class Ms extends ms {
|
|
|
17221
17223
|
this._bindDisposeCachedTexture = this.disposeCachedTexture.bind(this), this._bindOnMaterialComplete = this._onMaterialComplete.bind(this),
|
|
17222
17224
|
this._updateMaterial(), this._createShader(e);
|
|
17223
17225
|
const n = {
|
|
17224
|
-
vert:
|
|
17225
|
-
wgslVert:
|
|
17226
|
+
vert: Ps,
|
|
17227
|
+
wgslVert: ws,
|
|
17226
17228
|
uniforms: [ {
|
|
17227
17229
|
name: "projViewModelMatrix",
|
|
17228
17230
|
type: "function",
|
|
@@ -17322,7 +17324,7 @@ class Ms extends ms {
|
|
|
17322
17324
|
return this.shader;
|
|
17323
17325
|
}
|
|
17324
17326
|
getUniformValues(e, t) {
|
|
17325
|
-
const {iblTexes: n, dfgLUT: i} = this.getIBLRes(), r =
|
|
17327
|
+
const {iblTexes: n, dfgLUT: i} = this.getIBLRes(), r = Ms(e, n, i, t && t.ssr, t && t.jitter);
|
|
17326
17328
|
return this.setIncludeUniformValues(r, t), r;
|
|
17327
17329
|
}
|
|
17328
17330
|
_getDefines(e) {
|
|
@@ -17335,11 +17337,11 @@ class Ms extends ms {
|
|
|
17335
17337
|
}
|
|
17336
17338
|
}
|
|
17337
17339
|
|
|
17338
|
-
var
|
|
17340
|
+
var Cs = "#include <gl2_vert>\n#define EXTRUDE_SCALE 63.0\n#define EXTRUDE_MOD 64.0\n#define MAX_LINE_DISTANCE 65535.0\nuniform mat4 projViewModelMatrix;\nuniform mat4 positionMatrix;\nuniform vec2 centiMeterToLocal;\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\nattribute vec4 aTubeNormal;\n#ifdef HAS_LINE_WIDTH\nattribute float aLineWidth;\n#else\nuniform float lineWidth;\n#endif\n#include <vt_position_vert>\n#ifdef PICKING_MODE\n#include <fbo_picking_vert>\n#else\nuniform mat4 modelViewMatrix;\nuniform mat3 modelNormalMatrix;\nuniform mat4 modelMatrix;\n#if defined(HAS_PATTERN)\nuniform float resolution;\nuniform float tileResolution;\nuniform float tileRatio;\nattribute float aLinesofar;\nvarying highp float vLinesofar;\nattribute vec4 aTexInfo;\nvarying vec4 vTexInfo;\nvarying float vNormalY;\nvarying float vPatternHeight;\nattribute float aNormalDistance;\n#if defined(HAS_PATTERN_ANIM)\nattribute float aLinePatternAnimSpeed;\nvarying float vLinePatternAnimSpeed;\n#endif\n#if defined(HAS_PATTERN_GAP)\nattribute float aLinePatternGap;\nvarying float vLinePatternGap;\n#endif\n#endif\n#ifdef HAS_COLOR\nattribute vec4 aColor;\nvarying vec4 vColor;\n#endif\n#ifdef HAS_OPACITY\nattribute float aOpacity;\n#endif\nvarying float vOpacity;\nvarying vec3 vModelNormal;\nvarying vec4 vViewVertex;\nvarying vec3 vModelVertex;\n#endif\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\n#include <vsm_shadow_vert>\n#endif\n#include <highlight_vert>\nvoid main() {\n \n#ifdef HAS_LINE_WIDTH\nfloat c = aLineWidth;\n#else\nfloat c = lineWidth;\n#endif\nfloat d = c / 2.;\n vec3 e = aTubeNormal.xyz / EXTRUDE_SCALE;\n vec3 f = unpackVTPosition();\n vec4 h = vec4(f, 1.);\n h.xy += e.xy * d * centiMeterToLocal;\n h.z += e.z * d;\n gl_Position = projViewModelMatrix * h;\n#ifdef PICKING_MODE\nfbo_picking_setData(gl_Position.w, true);\n#else\nvViewVertex = modelViewMatrix * h;\n vec3 i = normalize(e);\n vModelNormal = modelNormalMatrix * i;\n vModelVertex = (modelMatrix * h).xyz;\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\nshadow_computeShadowPars(h);\n#endif\n#ifdef HAS_COLOR\nvColor = aColor / 255.;\n#endif\n#ifdef HAS_OPACITY\nvOpacity = aOpacity / 255.;\n#else\nvOpacity = 1.;\n#endif\n#ifdef HAS_PATTERN\nfloat j = tileResolution / resolution;\n float k = aLinesofar - d * centiMeterToLocal.y * aNormalDistance / EXTRUDE_SCALE;\n vLinesofar = k / tileRatio * j;\n vTexInfo = vec4(aTexInfo.xy, aTexInfo.zw + 1.);\n vPatternHeight = c * centiMeterToLocal.x / tileRatio * j;\n vNormalY = aTubeNormal.w / EXTRUDE_SCALE;\n#if defined(HAS_PATTERN_ANIM)\nvLinePatternAnimSpeed = aLinePatternAnimSpeed / 127.;\n#endif\n#if defined(HAS_PATTERN_GAP)\nvLinePatternGap = aLinePatternGap / 10.0;\n#endif\n#endif\nhighlight_setVarying();\n#endif\n}", Os = "#define EXTRUDE_SCALE 63.0\n#define EXTRUDE_MOD 64.0\n#define MAX_LINE_DISTANCE 65535.0\nstruct TubeUniforms {\n projViewModelMatrix: mat4x4f,\n positionMatrix: mat4x4f,\n centiMeterToLocal: vec2f,\n lineWidth: f32,\n modelViewMatrix: mat4x4f,\n modelNormalMatrix: mat3x3f,\n modelMatrix: mat4x4f,\n tileResolution: f32,\n tileRatio: f32,\n};\nstruct TubeShaderUniforms {\n resolution: f32,\n}\n@group(0) @binding($b) var<uniform> uniforms: TubeUniforms;\n@group(0) @binding($b) var<uniform> shaderUniforms: TubeShaderUniforms;\nstruct VertexInput {\n #ifdef HAS_ALTITUDE\n @location($i) aPosition: POSITION_TYPE_2,\n @location($i) aAltitude: f32,\n #else\n @location($i) aPosition: POSITION_TYPE_3,\n #endif\n @location($i) aTubeNormal: vec4i,\n #ifdef HAS_LINE_WIDTH\n @location($i) aLineWidth: u32,\n #endif\n #ifdef HAS_PATTERN\n @location($i) aLinesofar: u32,\n @location($i) aTexInfo: vec4u,\n @location($i) aNormalDistance: i32,\n #if HAS_PATTERN_ANIM\n @location($i) aLinePatternAnimSpeed: i32,\n #endif\n #if HAS_PATTERN_GAP\n @location($i) aLinePatternGap: i32,\n #endif\n #endif\n #ifdef HAS_COLOR\n @location($i) aColor: vec4u,\n #endif\n #ifdef HAS_OPACITY\n @location($i) aOpacity: u32,\n #endif\n};\nstruct VertexOutput {\n @builtin(position) position: vec4f,\n #ifndef PICKING_MODE\n @location($o) vModelNormal: vec3f,\n @location($o) vViewVertex: vec4f,\n @location($o) vModelVertex: vec3f,\n #ifdef HAS_COLOR\n @location($o) vColor: vec4f,\n #endif\n @location($o) vOpacity: f32,\n #ifdef HAS_PATTERN\n @location($o) vLinesofar: f32,\n @location($o) vTexInfo: vec4f,\n @location($o) vNormalY: f32,\n @location($o) vPatternHeight: f32,\n #if HAS_PATTERN_ANIM\n @location($o) vLinePatternAnimSpeed: f32,\n #endif\n #if HAS_PATTERN_GAP\n @location($o) vLinePatternGap: f32,\n #endif\n #endif\n #endif\n};\n#include <vt_position_vert>\n#ifdef PICKING_MODE\n #include <fbo_picking_vert>\n#else\n #if HAS_SHADOWING && !HAS_BLOOM\n #include <vsm_shadow_vert>\n #endif\n#endif\n#include <highlight_vert>\n@vertex\nfn main(input: VertexInput) -> VertexOutput {\n var output: VertexOutput;\n #ifdef HAS_LINE_WIDTH\n let myLineWidth = input.aLineWidth;\n #else\n let myLineWidth = uniforms.lineWidth;\n #endif\n let halfwidth = myLineWidth / 2.0;\n let tubeNormal = vec3f(input.aTubeNormal.xyz) / EXTRUDE_SCALE;\n let position = unpackVTPosition(input);\n var localVertex = vec4f(position, 1.0);\n let dxy = tubeNormal.xy * halfwidth * uniforms.centiMeterToLocal;\n let dz = tubeNormal.z * halfwidth;\n localVertex = vec4f(localVertex.xy + dxy, localVertex.z + dz, localVertex.w);\n output.position = uniforms.projViewModelMatrix * localVertex;\n #ifdef PICKING_MODE\n fbo_picking_setData(input, &output, output.position.w, true);\n #else\n output.vViewVertex = uniforms.modelViewMatrix * localVertex;\n let localNormal = normalize(tubeNormal);\n output.vModelNormal = uniforms.modelNormalMatrix * localNormal;\n output.vModelVertex = (uniforms.modelMatrix * localVertex).xyz;\n #if HAS_SHADOWING && !HAS_BLOOM\n shadow_computeShadowPars(localVertex);\n #endif\n #ifdef HAS_COLOR\n output.vColor = vec4f(input.aColor) / 255.0;\n #endif\n #ifdef HAS_OPACITY\n output.vOpacity = f32(input.aOpacity) / 255.0;\n #else\n output.vOpacity = 1.0;\n #endif\n #ifdef HAS_PATTERN\n let scale = uniforms.tileResolution / shaderUniforms.resolution;\n #ifdef HAS_ALTITUDE\n let linesofar = f32(input.aLinesofar) - halfwidth * uniforms.centiMeterToLocal.y * f32(input.aNormalDistance) / EXTRUDE_SCALE;\n #else\n let linesofar = f32(input.aLinesofar);\n #endif\n output.vLinesofar = linesofar / uniforms.tileRatio * scale;\n output.vTexInfo = vec4f(vec2f(input.aTexInfo.xy), vec2f(input.aTexInfo.zw) + 1.0);\n output.vPatternHeight = myLineWidth * uniforms.centiMeterToLocal.x / uniforms.tileRatio * scale;\n output.vNormalY = f32(input.aTubeNormal.w) / EXTRUDE_SCALE;\n #if HAS_PATTERN_ANIM\n output.vLinePatternAnimSpeed = input.aLinePatternAnimSpeed / 127.0;\n #endif\n #if HAS_PATTERN_GAP\n output.vLinePatternGap = f32(input.aLinePatternGap) / 10.0;\n #endif\n #endif\n #if HAS_HIGHLIGHT_COLOR || HAS_HIGHLIGHT_OPACITY\n highlight_setVarying(input, &output);\n #endif\n #endif\n return output;\n}";
|
|
17339
17341
|
|
|
17340
|
-
const {StyleUtil:
|
|
17342
|
+
const {StyleUtil: ks} = j(), {getPBRUniforms: Rs} = d.pbr.PBRUtils;
|
|
17341
17343
|
|
|
17342
|
-
class
|
|
17344
|
+
class Fs extends On {
|
|
17343
17345
|
needToRedraw() {
|
|
17344
17346
|
return super.needToRedraw() || this.isAnimating();
|
|
17345
17347
|
}
|
|
@@ -17375,7 +17377,7 @@ class ks extends On {
|
|
|
17375
17377
|
tileRatio: c
|
|
17376
17378
|
};
|
|
17377
17379
|
Be(u, "lineColor", l, "lineColor", "#fff", Xe(this.colorCache)), Be(u, "linePatternGapColor", l, "linePatternGapColor", [ 1, 1, 1, 1 ], Xe(this.colorCache)),
|
|
17378
|
-
Be(u, "lineWidth", l, "lineWidth", 2, (e =>
|
|
17380
|
+
Be(u, "lineWidth", l, "lineWidth", 2, (e => ks.getTubeSizeScale(this.dataConfig.metric) * e)),
|
|
17379
17381
|
Be(u, "lineOpacity", l, "lineOpacity", 1), Be(u, "linePatternAnimSpeed", l, "linePatternAnimSpeed", 0),
|
|
17380
17382
|
Be(u, "linePatternGap", l, "linePatternGap", 0), Be(u, "metallicFactor", l, "metallicFactor", 0),
|
|
17381
17383
|
Be(u, "roughnessFactor", l, "roughnessFactor", .4), Be(u, "emissiveFactor", l, "emissiveFactor", [ 0, 0, 0 ]),
|
|
@@ -17411,23 +17413,29 @@ class ks extends On {
|
|
|
17411
17413
|
this.getMap().on("updatelights", this._onUpdatelights, this), this.createIBLTextures();
|
|
17412
17414
|
const t = this.regl;
|
|
17413
17415
|
if (this.renderer = new d.Renderer(t), this.createShader(e), this.pickingFBO) {
|
|
17414
|
-
const e = [];
|
|
17416
|
+
const e = [], t = [], n = [];
|
|
17415
17417
|
this.picking = [ new d.FBORayPicking(this.renderer, {
|
|
17416
|
-
vert:
|
|
17418
|
+
vert: Cs,
|
|
17419
|
+
wgslVert: Os,
|
|
17417
17420
|
defines: {
|
|
17418
17421
|
PICKING_MODE: 1
|
|
17419
17422
|
},
|
|
17420
17423
|
uniforms: [ {
|
|
17421
17424
|
name: "projViewModelMatrix",
|
|
17422
17425
|
type: "function",
|
|
17423
|
-
fn: function(
|
|
17424
|
-
|
|
17425
|
-
return g.multiply(n, t.projViewMatrix, t.modelMatrix), n;
|
|
17426
|
+
fn: function(t, n) {
|
|
17427
|
+
return g.multiply(e, n.projViewMatrix, n.modelMatrix), e;
|
|
17426
17428
|
}
|
|
17427
17429
|
}, {
|
|
17428
17430
|
name: "modelNormalMatrix",
|
|
17429
17431
|
type: "function",
|
|
17430
|
-
fn: (
|
|
17432
|
+
fn: (e, n) => S.fromMat4(t, n.modelMatrix)
|
|
17433
|
+
}, {
|
|
17434
|
+
name: "modelViewMatrix",
|
|
17435
|
+
type: "function",
|
|
17436
|
+
fn: function(e, t) {
|
|
17437
|
+
return g.multiply(n, t.viewMatrix, t.modelMatrix);
|
|
17438
|
+
}
|
|
17431
17439
|
} ],
|
|
17432
17440
|
extraCommandProps: this.getExtraCommandProps()
|
|
17433
17441
|
}, this.pickingFBO, this.getMap()) ];
|
|
@@ -17436,17 +17444,18 @@ class ks extends On {
|
|
|
17436
17444
|
createShader(e) {
|
|
17437
17445
|
this._context = e;
|
|
17438
17446
|
const t = [], n = {};
|
|
17439
|
-
this.fillIncludes(n, t, e)
|
|
17447
|
+
this.fillIncludes(n, t, e);
|
|
17448
|
+
const i = [];
|
|
17449
|
+
t.push({
|
|
17440
17450
|
name: "projViewModelMatrix",
|
|
17441
17451
|
type: "function",
|
|
17442
17452
|
fn: function(e, t) {
|
|
17443
|
-
|
|
17444
|
-
return g.multiply(n, t.projViewMatrix, t.modelMatrix), n;
|
|
17453
|
+
return g.multiply(i, t.projViewMatrix, t.modelMatrix), i;
|
|
17445
17454
|
}
|
|
17446
17455
|
}), this.shader = new d.pbr.StandardShader({
|
|
17447
17456
|
name: "vt-tube",
|
|
17448
|
-
vert:
|
|
17449
|
-
wgslVert:
|
|
17457
|
+
vert: Cs,
|
|
17458
|
+
wgslVert: Os,
|
|
17450
17459
|
uniforms: t,
|
|
17451
17460
|
defines: this._getDefines(n),
|
|
17452
17461
|
extraCommandProps: this.getExtraCommandProps()
|
|
@@ -17495,7 +17504,7 @@ class ks extends On {
|
|
|
17495
17504
|
};
|
|
17496
17505
|
}
|
|
17497
17506
|
getUniformValues(e, t) {
|
|
17498
|
-
const {iblTexes: n, dfgLUT: i} = this.getIBLRes(), r =
|
|
17507
|
+
const {iblTexes: n, dfgLUT: i} = this.getIBLRes(), r = Rs(e, n, i, null, t && t.jitter), o = e.projViewMatrix, s = e.viewMatrix;
|
|
17499
17508
|
return r.projViewMatrix = o, r.viewMatrix = s, r.resolution = e.getResolution(),
|
|
17500
17509
|
r.currentTime = this.layer.getRenderer().getFrameTimestamp() || 0, this.setIncludeUniformValues(r, t),
|
|
17501
17510
|
r;
|
|
@@ -17582,7 +17591,7 @@ class ks extends On {
|
|
|
17582
17591
|
}
|
|
17583
17592
|
}
|
|
17584
17593
|
|
|
17585
|
-
const
|
|
17594
|
+
const Es = d.ShaderLib.get("mesh_picking_vert"), Hs = d.WgslShaderLib.get("mesh_picking").vert, {PackUtil: Ds} = j(), Ls = [], Ns = [], zs = [], Vs = [], Us = [], Gs = [], Bs = [], Ws = [ 0, 0, 0 ], js = [ 0, 0, 0 ], Xs = [ 1, 1, 1 ], $s = [], Ys = [ 1, 1, 1, 1 ], qs = [], Zs = [ 1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1 ], Ks = e => class extends e {
|
|
17586
17595
|
constructor(e, t, n, i, r, o) {
|
|
17587
17596
|
super(e, t, n, i, r, o), this._ready = !1;
|
|
17588
17597
|
const s = i.fetchOptions || {};
|
|
@@ -17617,7 +17626,7 @@ const Rs = d.ShaderLib.get("mesh_picking_vert"), Fs = d.WgslShaderLib.get("mesh_
|
|
|
17617
17626
|
};
|
|
17618
17627
|
}
|
|
17619
17628
|
getFnTypeConfig() {
|
|
17620
|
-
return
|
|
17629
|
+
return $s;
|
|
17621
17630
|
}
|
|
17622
17631
|
createMesh(e, t, {tileTranslationMatrix: n, tileExtent: i, tilePoint: r}, {timestamp: o}) {
|
|
17623
17632
|
if (!this._ready) return null;
|
|
@@ -17661,9 +17670,9 @@ const Rs = d.ShaderLib.get("mesh_picking_vert"), Fs = d.WgslShaderLib.get("mesh_
|
|
|
17661
17670
|
let c = 0;
|
|
17662
17671
|
i.forEach((e => {
|
|
17663
17672
|
const {geometry: n, nodeMatrix: i} = e;
|
|
17664
|
-
g.multiply(
|
|
17665
|
-
let r = g.multiply(
|
|
17666
|
-
v && (r = g.multiply(
|
|
17673
|
+
g.multiply(qs, Zs, i);
|
|
17674
|
+
let r = g.multiply(qs, h, qs);
|
|
17675
|
+
v && (r = g.multiply(qs, T, qs));
|
|
17667
17676
|
const o = n.boundingBox.copy();
|
|
17668
17677
|
o.transform(r);
|
|
17669
17678
|
const s = this._calAnchorTranslation(o, t);
|
|
@@ -17690,15 +17699,15 @@ const Rs = d.ShaderLib.get("mesh_picking_vert"), Fs = d.WgslShaderLib.get("mesh_
|
|
|
17690
17699
|
k *= P(R).alpha();
|
|
17691
17700
|
}
|
|
17692
17701
|
O.setUniform("hasAlpha", w.alphaMode && "BLEND" === w.alphaMode.toUpperCase() || k < 1),
|
|
17693
|
-
Be(O.uniforms, "polygonFill", t, "markerFill",
|
|
17702
|
+
Be(O.uniforms, "polygonFill", t, "markerFill", Ys, Xe(this.colorCache)), Be(O.uniforms, "polygonOpacity", t, "markerOpacity", 1);
|
|
17694
17703
|
const F = [];
|
|
17695
17704
|
O.setPositionMatrix((() => {
|
|
17696
17705
|
const t = this._getMeshNodeMatrix(e, v, M);
|
|
17697
|
-
g.multiply(F,
|
|
17698
|
-
const n = g.identity(
|
|
17699
|
-
if (0 !== c && (g.fromTranslation(n, A), g.multiply(F, n, F)),
|
|
17706
|
+
g.multiply(F, Zs, t), g.multiply(F, h, F);
|
|
17707
|
+
const n = g.identity(qs);
|
|
17708
|
+
if (0 !== c && (g.fromTranslation(n, A), g.multiply(F, n, F)), qe(l)) {
|
|
17700
17709
|
const e = s.getGLScale() / s.getGLScale(l);
|
|
17701
|
-
return p.set(
|
|
17710
|
+
return p.set(Ls, e, e, e), g.fromScaling(n, Ls), g.multiply(n, n, F);
|
|
17702
17711
|
}
|
|
17703
17712
|
return F;
|
|
17704
17713
|
}));
|
|
@@ -17744,17 +17753,17 @@ const Rs = d.ShaderLib.get("mesh_picking_vert"), Fs = d.WgslShaderLib.get("mesh_
|
|
|
17744
17753
|
I = t;
|
|
17745
17754
|
continue;
|
|
17746
17755
|
}
|
|
17747
|
-
d ? p.set(b, f[e], f[e + 1], d[e / a]) :
|
|
17756
|
+
d ? p.set(b, f[e], f[e + 1], d[e / a]) : Ds.unpackPosition(b, f[e], f[e + 1], f[e + 2]);
|
|
17748
17757
|
const [i, r, o] = b;
|
|
17749
17758
|
let s = e + a;
|
|
17750
|
-
d ? p.set(P, f[s], f[s + 1], d[s / a]) :
|
|
17759
|
+
d ? p.set(P, f[s], f[s + 1], d[s / a]) : Ds.unpackPosition(P, f[s], f[s + 1], f[s + 2]);
|
|
17751
17760
|
const [h, O, k] = P, R = g[e / a], F = m.set(i * w, r * w, o * M), E = y.set(h * w, O * w, k * M), H = F.distanceTo(E);
|
|
17752
17761
|
this._getSymbolRotationScaleMatrix(C, n, g, e / a);
|
|
17753
17762
|
const D = u.arrangeAlongLine(F, E, H, l, 1, C, c);
|
|
17754
17763
|
for (let e = 0; e < D.length; e++) {
|
|
17755
17764
|
const t = D[e];
|
|
17756
17765
|
m.set(i, r, o), y.set(h, O, k);
|
|
17757
|
-
const n =
|
|
17766
|
+
const n = Js(m, y, t.t);
|
|
17758
17767
|
x.push(n.x, n.y), _.push(n.z), v.push(R), A.push(-t.rotationZ * Math.PI / 180),
|
|
17759
17768
|
T.push(t.rotationXY * Math.PI / 180), S.push(...t.scale);
|
|
17760
17769
|
}
|
|
@@ -17772,7 +17781,7 @@ const Rs = d.ShaderLib.get("mesh_picking_vert"), Fs = d.WgslShaderLib.get("mesh_
|
|
|
17772
17781
|
if (i) {
|
|
17773
17782
|
this._gltfPack[e][0].calModelHeightScale(n, i);
|
|
17774
17783
|
}
|
|
17775
|
-
return p.set(
|
|
17784
|
+
return p.set(Us, t.scaleX || 1, t.scaleY || 1, t.scaleZ || 1), p.multiply(n, n, Us);
|
|
17776
17785
|
}
|
|
17777
17786
|
_getMeshNodeMatrix(e, t, n) {
|
|
17778
17787
|
const i = e, r = this._gltfMeshInfos[i][t];
|
|
@@ -17820,7 +17829,7 @@ const Rs = d.ShaderLib.get("mesh_picking_vert"), Fs = d.WgslShaderLib.get("mesh_
|
|
|
17820
17829
|
n && this.setToRedraw(!0), super.prepareRender(e);
|
|
17821
17830
|
}
|
|
17822
17831
|
getShadowMeshes() {
|
|
17823
|
-
if (!this.isVisible()) return
|
|
17832
|
+
if (!this.isVisible()) return $s;
|
|
17824
17833
|
this.shadowCount = this.scene.getMeshes().length;
|
|
17825
17834
|
return this.scene.getMeshes().filter((e => 0 === e.properties.level));
|
|
17826
17835
|
}
|
|
@@ -17836,26 +17845,26 @@ const Rs = d.ShaderLib.get("mesh_picking_vert"), Fs = d.WgslShaderLib.get("mesh_
|
|
|
17836
17845
|
let v = 1 / 0, A = 1 / 0, T = 1 / 0, S = -1 / 0, b = -1 / 0, P = -1 / 0;
|
|
17837
17846
|
const w = [], M = [];
|
|
17838
17847
|
for (let e = 0; e < m; e++) {
|
|
17839
|
-
f ? p.set(M, l[e * o], l[e * o + 1], f[e]) :
|
|
17848
|
+
f ? p.set(M, l[e * o], l[e * o + 1], f[e]) : Ds.unpackPosition(M, l[e * o], l[e * o + 1], l[e * o + 2]);
|
|
17840
17849
|
const t = p.set(w, M[0] * y, -M[1] * y, (M[2] + _) * x);
|
|
17841
17850
|
t[0] < v && (v = t[0]), t[0] > S && (S = t[0]), t[1] < A && (A = t[1]), t[1] > b && (b = t[1]),
|
|
17842
17851
|
t[2] < T && (T = t[2]), t[2] > P && (P = t[2]);
|
|
17843
17852
|
}
|
|
17844
17853
|
const I = (v + S) / 2, C = (A + b) / 2, O = (T + P) / 2, k = [], R = this._hasFuncType(), F = [ 0, 0, 1 ], E = [ 0, 0, 0 ];
|
|
17845
17854
|
for (let t = 0; t < m; t++) {
|
|
17846
|
-
f ? p.set(M, l[t * o], l[t * o + 1], f[t]) :
|
|
17847
|
-
const n = M[0], i = M[1], r = p.set(w, n * y - I, -i * y - C, (M[2] + _) * x - O), m = p.set(
|
|
17848
|
-
d && (p.set(m, d[3 * t], d[3 * t + 1], d[3 * t + 2]), g.fromScaling(
|
|
17855
|
+
f ? p.set(M, l[t * o], l[t * o + 1], f[t]) : Ds.unpackPosition(M, l[t * o], l[t * o + 1], l[t * o + 2]);
|
|
17856
|
+
const n = M[0], i = M[1], r = p.set(w, n * y - I, -i * y - C, (M[2] + _) * x - O), m = p.set(Us, 1, 1, 1);
|
|
17857
|
+
d && (p.set(m, d[3 * t], d[3 * t + 1], d[3 * t + 2]), g.fromScaling(Gs, m));
|
|
17849
17858
|
const v = c && c[t] || 0, A = u && u[t] || 0;
|
|
17850
17859
|
if (v || A) {
|
|
17851
17860
|
g.fromRotation(k, A, F);
|
|
17852
|
-
const e = p.set(
|
|
17853
|
-
g.rotate(k, k, v, t), d && g.multiply(k, k,
|
|
17854
|
-
const n = g.fromTranslation(
|
|
17861
|
+
const e = p.set(Ls, Math.cos(A), Math.sin(A), 0), t = p.rotateZ(e, e, E, 90 * Math.PI / 180);
|
|
17862
|
+
g.rotate(k, k, v, t), d && g.multiply(k, k, Gs);
|
|
17863
|
+
const n = g.fromTranslation(qs, r);
|
|
17855
17864
|
g.multiply(k, n, k);
|
|
17856
|
-
} else g.fromTranslation(k, r), d && g.multiply(k, k,
|
|
17865
|
+
} else g.fromTranslation(k, r), d && g.multiply(k, k, Gs);
|
|
17857
17866
|
if (R) {
|
|
17858
|
-
let e = this._getSymbolTRSMatrix(
|
|
17867
|
+
let e = this._getSymbolTRSMatrix(qs, s, h, t);
|
|
17859
17868
|
const n = this._getMeterScale(), i = g.identity([]);
|
|
17860
17869
|
g.scale(i, i, [ n, n, n ]), e = g.multiply([], i, e), g.multiply(k, k, e);
|
|
17861
17870
|
}
|
|
@@ -17882,11 +17891,11 @@ const Rs = d.ShaderLib.get("mesh_picking_vert"), Fs = d.WgslShaderLib.get("mesh_
|
|
|
17882
17891
|
const _ = n && n[r], v = t && t[_], A = i[s.id], T = A ? A.zoom : s.getZoom(), S = v && v.feature && v.feature.properties, b = this._getModelHeightScale(T, S);
|
|
17883
17892
|
o || (this._txFn && (h = this._txFn(T, S)), this._tyFn && (c = this._tyFn(T, S)),
|
|
17884
17893
|
this._tzFn && (u = this._tzFn(T, S)));
|
|
17885
|
-
const P = p.set(
|
|
17894
|
+
const P = p.set(Ns, h * l, c * l, u * l);
|
|
17886
17895
|
this._rxFn && (f = this._rxFn(T, S)), this._ryFn && (d = this._ryFn(T, S)), this._rzFn && (g = this._rzFn(T, S));
|
|
17887
|
-
const w = p.set(
|
|
17896
|
+
const w = p.set(zs, f, d, g);
|
|
17888
17897
|
this._sxFn && (m = this._sxFn(T, S)), this._syFn && (y = this._syFn(T, S)), this._szFn && (x = this._szFn(T, S));
|
|
17889
|
-
const M = p.set(
|
|
17898
|
+
const M = p.set(Vs, m * b, y * b, x * b);
|
|
17890
17899
|
return this._getGLTFMatrix(e, P, w, M);
|
|
17891
17900
|
}
|
|
17892
17901
|
_getModelHeightScale(e, t) {
|
|
@@ -17939,10 +17948,10 @@ const Rs = d.ShaderLib.get("mesh_picking_vert"), Fs = d.WgslShaderLib.get("mesh_
|
|
|
17939
17948
|
this._loaded >= e.length && (this._ready = !0);
|
|
17940
17949
|
}
|
|
17941
17950
|
getPickingVert() {
|
|
17942
|
-
return
|
|
17951
|
+
return Es;
|
|
17943
17952
|
}
|
|
17944
17953
|
getPickingWGSLVert() {
|
|
17945
|
-
return
|
|
17954
|
+
return Hs;
|
|
17946
17955
|
}
|
|
17947
17956
|
deleteMesh(e) {
|
|
17948
17957
|
if (e) {
|
|
@@ -17974,7 +17983,7 @@ const Rs = d.ShaderLib.get("mesh_picking_vert"), Fs = d.WgslShaderLib.get("mesh_
|
|
|
17974
17983
|
delete this._nodeMatrixMap;
|
|
17975
17984
|
}
|
|
17976
17985
|
_getGLTFMatrix(e, t, n, i) {
|
|
17977
|
-
const r = p.set(
|
|
17986
|
+
const r = p.set(Ls, ...t || Ws), o = n || js, s = i || Xs, a = T.fromEuler(Bs, o[0], o[1], o[2]);
|
|
17978
17987
|
return g.fromRotationTranslationScale(e, a, r, s);
|
|
17979
17988
|
}
|
|
17980
17989
|
shouldDrawParentTile() {
|
|
@@ -17982,35 +17991,35 @@ const Rs = d.ShaderLib.get("mesh_picking_vert"), Fs = d.WgslShaderLib.get("mesh_
|
|
|
17982
17991
|
}
|
|
17983
17992
|
};
|
|
17984
17993
|
|
|
17985
|
-
function
|
|
17986
|
-
const i =
|
|
17994
|
+
function Js(e, t, n) {
|
|
17995
|
+
const i = Qs(e.x, t.x, n), r = Qs(e.y, t.y, n), o = Qs(e.z || 0, t.z || 0, n);
|
|
17987
17996
|
return new e.constructor(i, r, o);
|
|
17988
17997
|
}
|
|
17989
17998
|
|
|
17990
|
-
function
|
|
17999
|
+
function Qs(e, t, n) {
|
|
17991
18000
|
return e + n * (t - e);
|
|
17992
18001
|
}
|
|
17993
18002
|
|
|
17994
|
-
class
|
|
18003
|
+
class ea extends(Ks(Ts)){
|
|
17995
18004
|
getMaterialClazz(e) {
|
|
17996
18005
|
return e.diffuseFactor ? d.PhongSpecularGlossinessMaterial : d.PhongMaterial;
|
|
17997
18006
|
}
|
|
17998
18007
|
}
|
|
17999
18008
|
|
|
18000
|
-
class
|
|
18009
|
+
class ta extends(Ks(Is)){
|
|
18001
18010
|
getMaterialClazz(e) {
|
|
18002
18011
|
return e.specularGlossinessTexture || e.diffuseTexture ? d.pbr.StandardSpecularGlossinessMaterial : d.pbr.StandardMaterial;
|
|
18003
18012
|
}
|
|
18004
18013
|
}
|
|
18005
18014
|
|
|
18006
|
-
const {getPBRUniforms:
|
|
18015
|
+
const {getPBRUniforms: na} = d.pbr.PBRUtils, ia = {
|
|
18007
18016
|
color: [ 2.0303, 2.028, 2.028 ],
|
|
18008
18017
|
direction: [ 0, -.2717, -1 ]
|
|
18009
|
-
},
|
|
18018
|
+
}, ra = .3737, oa = {
|
|
18010
18019
|
index: 0
|
|
18011
|
-
},
|
|
18020
|
+
}, sa = [ 0, 0, 0 ], aa = [ 2, 2 ];
|
|
18012
18021
|
|
|
18013
|
-
class
|
|
18022
|
+
class la extends On {
|
|
18014
18023
|
supportRenderMode(e) {
|
|
18015
18024
|
return "fxaa" === e || "fxaaBeforeTaa" === e;
|
|
18016
18025
|
}
|
|
@@ -18025,7 +18034,7 @@ class sa extends On {
|
|
|
18025
18034
|
}
|
|
18026
18035
|
needToRedraw() {
|
|
18027
18036
|
if (super.needToRedraw()) return !0;
|
|
18028
|
-
return this.getSymbol(
|
|
18037
|
+
return this.getSymbol(oa).animation;
|
|
18029
18038
|
}
|
|
18030
18039
|
createMesh(e, t) {
|
|
18031
18040
|
const {geometry: n} = e;
|
|
@@ -18034,7 +18043,7 @@ class sa extends On {
|
|
|
18034
18043
|
castShadow: !1,
|
|
18035
18044
|
picking: !0
|
|
18036
18045
|
});
|
|
18037
|
-
return i.properties.symbolIndex =
|
|
18046
|
+
return i.properties.symbolIndex = oa, i.setLocalTransform(t), i;
|
|
18038
18047
|
}
|
|
18039
18048
|
callShader(e, t) {
|
|
18040
18049
|
super.callShader(e, t), this.transformWater();
|
|
@@ -18045,13 +18054,13 @@ class sa extends On {
|
|
|
18045
18054
|
this._prepareMesh(e, t), super.addMesh(...arguments);
|
|
18046
18055
|
}
|
|
18047
18056
|
_prepareMesh(e) {
|
|
18048
|
-
const t = this.getSymbol(
|
|
18057
|
+
const t = this.getSymbol(oa).ssr;
|
|
18049
18058
|
for (let n = 0; n < e.length; n++) e[n].ssr = t ? 1 : 0;
|
|
18050
18059
|
}
|
|
18051
18060
|
paint(e) {
|
|
18052
18061
|
e.states && e.states.includesChanged && (this.shader.dispose(), this._waterShader.dispose(),
|
|
18053
18062
|
this._createShader(e));
|
|
18054
|
-
const t = !!e.ssr && this.getSymbol(
|
|
18063
|
+
const t = !!e.ssr && this.getSymbol(oa).ssr, n = this._waterShader, i = n.shaderDefines;
|
|
18055
18064
|
if (t) {
|
|
18056
18065
|
const t = Ne({}, i, e.ssr.defines);
|
|
18057
18066
|
n.shaderDefines = t;
|
|
@@ -18146,7 +18155,7 @@ class sa extends On {
|
|
|
18146
18155
|
return S.fromRotation(n, Math.PI * i / 180);
|
|
18147
18156
|
}
|
|
18148
18157
|
} ], r = {
|
|
18149
|
-
TIME_NOISE_TEXTURE_REPEAT:
|
|
18158
|
+
TIME_NOISE_TEXTURE_REPEAT: ra
|
|
18150
18159
|
};
|
|
18151
18160
|
this.fillIncludes(r, i, e);
|
|
18152
18161
|
const o = {
|
|
@@ -18225,24 +18234,24 @@ class sa extends On {
|
|
|
18225
18234
|
};
|
|
18226
18235
|
}
|
|
18227
18236
|
_getWaterUniform(e, t) {
|
|
18228
|
-
const {iblTexes: n, dfgLUT: i} = this.getIBLRes(), r =
|
|
18237
|
+
const {iblTexes: n, dfgLUT: i} = this.getIBLRes(), r = na(e, n, i, t && t.ssr, t && t.jitter), o = e.getLightManager();
|
|
18229
18238
|
let s = o && o.getDirectionalLight() || {};
|
|
18230
|
-
const a = o && o.getAmbientLight() || {}, l = this.getSymbol(
|
|
18239
|
+
const a = o && o.getAmbientLight() || {}, l = this.getSymbol(oa), h = this._waterDir = this._waterDir || [], c = this._waveParams = this._waveParams || [];
|
|
18231
18240
|
x.set(c, .09, l.uvScale || 3, .03, -.5);
|
|
18232
18241
|
Ne(r, {
|
|
18233
18242
|
ambientColor: a.color || [ .2, .2, .2 ],
|
|
18234
18243
|
viewMatrix: e.viewMatrix,
|
|
18235
|
-
lightDirection: s.direction ||
|
|
18236
|
-
lightColor: s.color ||
|
|
18244
|
+
lightDirection: s.direction || ia.direction,
|
|
18245
|
+
lightColor: s.color || ia.color,
|
|
18237
18246
|
camPos: e.cameraPosition,
|
|
18238
18247
|
timeElapsed: l.animation ? (this.layer.getRenderer().getFrameTimestamp() || 0) / (1 / (l.waterSpeed || 1) * 1e4) : 0,
|
|
18239
18248
|
normalTexture: this._normalTex || this._emptyTex,
|
|
18240
18249
|
heightTexture: this._pertTex || this._emptyTex,
|
|
18241
18250
|
waveParams: c,
|
|
18242
|
-
waterDir:
|
|
18251
|
+
waterDir: ha(h, l.waterDirection || 0),
|
|
18243
18252
|
waterBaseColor: l.waterBaseColor || [ .1451, .2588, .4863, 1 ],
|
|
18244
18253
|
contrast: l.contrast || 1,
|
|
18245
|
-
hsv: l.hsv ||
|
|
18254
|
+
hsv: l.hsv || sa
|
|
18246
18255
|
});
|
|
18247
18256
|
const u = this.layer.getRenderer();
|
|
18248
18257
|
return r.layerOpacity = u._getLayerOpacity(), this.setIncludeUniformValues(r, t),
|
|
@@ -18265,29 +18274,29 @@ class sa extends On {
|
|
|
18265
18274
|
transformWater() {
|
|
18266
18275
|
const e = this.getMap(), t = y.getGroundTransform(this._water.localTransform, e);
|
|
18267
18276
|
this._water.setLocalTransform(t);
|
|
18268
|
-
const n = e._get2DExtentAtRes(e.getGLRes()), i = n.getWidth(), r = n.getHeight(), o = e.cameraLookAt, s = o[0] - i, a = o[1] + r, l = s /
|
|
18277
|
+
const n = e._get2DExtentAtRes(e.getGLRes()), i = n.getWidth(), r = n.getHeight(), o = e.cameraLookAt, s = o[0] - i, a = o[1] + r, l = s / aa[0], h = a / aa[1], c = l % 1, u = h % 1, f = l * ra % 1, d = h * ra % 1, p = i / aa[0] * 2, g = r / aa[1] * 2;
|
|
18269
18278
|
this._water.setUniform("uvOffset", [ c, u ]), this._water.setUniform("noiseUvOffset", [ f, d ]),
|
|
18270
18279
|
this._water.setUniform("uvScale", [ p, -g ]);
|
|
18271
18280
|
}
|
|
18272
18281
|
}
|
|
18273
18282
|
|
|
18274
|
-
function
|
|
18283
|
+
function ha(e, t) {
|
|
18275
18284
|
var n;
|
|
18276
18285
|
return n = t, t = Math.PI * n / 180, e[0] = Math.sin(t), e[1] = Math.cos(t), e;
|
|
18277
18286
|
}
|
|
18278
18287
|
|
|
18279
|
-
var
|
|
18288
|
+
var ca = "#define SHADER_NAME BILL_BOARD\n#include <gl2_vert>\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\nattribute vec2 aExtrude;\nattribute vec2 aTexCoord;\nattribute vec4 aQuat;\nvarying vec2 vTexCoord;\nuniform mat4 positionMatrix;\nuniform mat4 projViewModelMatrix;\nuniform float extrudeScale;\n#ifdef PICKING_MODE\n#include <fbo_picking_vert>\n#endif\n#include <vt_position_vert>\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\n#include <vsm_shadow_vert>\n#endif\nmat4 c(vec4 q) {\n float x = q.x, y = q.y, z = q.z, w = q.w;\n float d = x * x, e = y * y, f = z * z;\n float xy = x * y, xz = x * z, yz = y * z;\n float wx = w * x, wy = w * y, wz = w * z;\n return mat4(1. - 2. * (e + f), 2. * (xy + wz), 2. * (xz - wy), .0, 2. * (xy - wz), 1. - 2. * (d + f), 2. * (yz + wx), .0, 2. * (xz + wy), 2. * (yz - wx), 1. - 2. * (d + e), .0, .0, .0, .0, 1.);\n}\nvoid main() {\n vec4 h = vec4(aExtrude.x * extrudeScale, .0, aExtrude.y, 1.);\n mat4 i = c(aQuat);\n vec3 j = (i * h).xyz;\n vec3 k = unpackVTPosition(j);\n vTexCoord = aTexCoord;\n gl_Position = projViewModelMatrix * positionMatrix * vec4(k, 1.);\n#ifdef PICKING_MODE\nfbo_picking_setData(gl_Position.w, true);\n#elif defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\nshadow_computeShadowPars(vec4(k, 1.));\n#endif\n}", ua = "#ifdef HAS_ALTITUDE\n struct VertexInput {\n @location($i) aPosition: vec2i,\n @location($i) aAltitude: f32,\n#else\n struct VertexInput {\n @location($i) aPosition: vec4i,\n#endif\n @location($i) aExtrude: vec2i,\n @location($i) aTexCoord: vec2i,\n @location($i) aQuat: vec4f,\n };\nstruct VertexOutput {\n @builtin(position) position: vec4f,\n @location($o) vTexCoord: vec2f,\n};\nstruct BillboardUniforms {\n positionMatrix: mat4x4f,\n projViewModelMatrix: mat4x4f,\n extrudeScale: f32,\n};\n@group(0) @binding($b) var<uniform> uniforms: BillboardUniforms;\n#ifdef PICKING_MODE\n #include <fbo_picking_vert>\n#endif\n#include <vt_position_vert>\n#if HAS_SHADOWING && !HAS_BLOOM\n #include <vsm_shadow_vert>\n#endif\nfn quatToMat4(q: vec4f) -> mat4x4f {\n let x = q.x;\n let y = q.y;\n let z = q.z;\n let w = q.w;\n let x2 = x * x;\n let y2 = y * y;\n let z2 = z * z;\n let xy = x * y;\n let xz = x * z;\n let yz = y * z;\n let wx = w * x;\n let wy = w * y;\n let wz = w * z;\n return mat4x4f(\n 1.0 - 2.0 * (y2 + z2), 2.0 * (xy - wz), 2.0 * (xz + wy), 0.0,\n 2.0 * (xy + wz), 1.0 - 2.0 * (x2 + z2), 2.0 * (yz - wx), 0.0,\n 2.0 * (xz - wy), 2.0 * (yz + wx), 1.0 - 2.0 * (x2 + y2), 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n}\n@vertex\nfn main(\n input: VertexInput\n) -> VertexOutput {\n var output: VertexOutput;\n let extrude = vec4f(f32(input.aExtrude.x) * uniforms.extrudeScale, 0.0, f32(input.aExtrude.y), 1.0);\n let rotationMat4 = quatToMat4(input.aQuat);\n let offset = (rotationMat4 * extrude).xyz;\n let position = unpackVTPositionOffset(input, offset);\n output.vTexCoord = vec2f(input.aTexCoord);\n output.position = uniforms.projViewModelMatrix * uniforms.positionMatrix * vec4f(position, 1.0);\n #ifdef PICKING_MODE\n fbo_picking_setData(output.position.w, true);\n #elif HAS_SHADOWING && !HAS_BLOOM\n shadow_computeShadowPars(vec4f(position, 1.0), &output);\n #endif\n return output;\n}";
|
|
18280
18289
|
|
|
18281
|
-
function
|
|
18290
|
+
function fa(e, t, n) {
|
|
18282
18291
|
n = n || {}, this.w = e || 64, this.h = t || 64, this.autoResize = !!n.autoResize,
|
|
18283
18292
|
this.shelves = [], this.freebins = [], this.stats = {}, this.bins = {}, this.maxId = 0;
|
|
18284
18293
|
}
|
|
18285
18294
|
|
|
18286
|
-
function
|
|
18295
|
+
function da(e, t, n) {
|
|
18287
18296
|
this.x = 0, this.y = e, this.w = this.free = t, this.h = n;
|
|
18288
18297
|
}
|
|
18289
18298
|
|
|
18290
|
-
function
|
|
18299
|
+
function pa(e, t, n, i, r, o, s) {
|
|
18291
18300
|
this.id = e, this.x = t, this.y = n, this.w = i, this.h = r, this.maxw = o || i,
|
|
18292
18301
|
this.maxh = s || r, this.refcount = 0;
|
|
18293
18302
|
}
|
|
@@ -18296,14 +18305,14 @@ function ua(e, t, n, i, r, o, s) {
|
|
|
18296
18305
|
* Codes from mapbox-gl-js
|
|
18297
18306
|
* github.com/mapbox/mapbox-gl-js
|
|
18298
18307
|
* MIT License
|
|
18299
|
-
*/ function
|
|
18308
|
+
*/ function ga(e, {width: t, height: n}, i, r) {
|
|
18300
18309
|
if (r) {
|
|
18301
18310
|
if (r.length !== t * n * i) throw new RangeError("mismatched image size");
|
|
18302
18311
|
} else r = new Uint8Array(t * n * i);
|
|
18303
18312
|
return e.width = t, e.height = n, e.data = r, e;
|
|
18304
18313
|
}
|
|
18305
18314
|
|
|
18306
|
-
function
|
|
18315
|
+
function ma(e, t, n, i, r, o) {
|
|
18307
18316
|
if (0 === r.width || 0 === r.height) return t;
|
|
18308
18317
|
if (r.width > e.width || r.height > e.height || n.x > e.width - r.width || n.y > e.height - r.height) throw new RangeError("out of range source coordinates for image copy");
|
|
18309
18318
|
if (r.width > t.width || r.height > t.height || i.x > t.width - r.width || i.y > t.height - r.height) throw new RangeError("out of range destination coordinates for image copy");
|
|
@@ -18316,7 +18325,7 @@ function da(e, t, n, i, r, o) {
|
|
|
18316
18325
|
return t;
|
|
18317
18326
|
}
|
|
18318
18327
|
|
|
18319
|
-
|
|
18328
|
+
fa.prototype.pack = function(e, t) {
|
|
18320
18329
|
e = [].concat(e), t = t || {};
|
|
18321
18330
|
for (var n, i, r, o, s = [], a = 0; a < e.length; a++) if (n = e[a].w || e[a].width,
|
|
18322
18331
|
i = e[a].h || e[a].height, r = e[a].id, n && i) {
|
|
@@ -18324,7 +18333,7 @@ ha.prototype.pack = function(e, t) {
|
|
|
18324
18333
|
t.inPlace && (e[a].x = o.x, e[a].y = o.y, e[a].id = o.id), s.push(o);
|
|
18325
18334
|
}
|
|
18326
18335
|
return this.shrink(), s;
|
|
18327
|
-
},
|
|
18336
|
+
}, fa.prototype.packOne = function(e, t, n) {
|
|
18328
18337
|
var i, r, o, s, a, l, h, c, u = {
|
|
18329
18338
|
freebin: -1,
|
|
18330
18339
|
shelf: -1,
|
|
@@ -18344,18 +18353,18 @@ ha.prototype.pack = function(e, t) {
|
|
|
18344
18353
|
t > r.h || t < r.h && (o = (r.h - t) * e) < u.waste && (u.freebin = -1, u.waste = o,
|
|
18345
18354
|
u.shelf = s);
|
|
18346
18355
|
}
|
|
18347
|
-
return -1 !== u.freebin ? this.allocFreebin(u.freebin, e, t, n) : -1 !== u.shelf ? this.allocShelf(u.shelf, e, t, n) : t <= this.h - f && e <= this.w ? (r = new
|
|
18356
|
+
return -1 !== u.freebin ? this.allocFreebin(u.freebin, e, t, n) : -1 !== u.shelf ? this.allocShelf(u.shelf, e, t, n) : t <= this.h - f && e <= this.w ? (r = new da(f, this.w, t),
|
|
18348
18357
|
this.allocShelf(this.shelves.push(r) - 1, e, t, n)) : this.autoResize ? (a = l = this.h,
|
|
18349
18358
|
((h = c = this.w) <= a || e > h) && (c = 2 * Math.max(e, h)), (a < h || t > a) && (l = 2 * Math.max(t, a)),
|
|
18350
18359
|
this.resize(c, l), this.packOne(e, t, n)) : null;
|
|
18351
|
-
},
|
|
18360
|
+
}, fa.prototype.allocFreebin = function(e, t, n, i) {
|
|
18352
18361
|
var r = this.freebins.splice(e, 1)[0];
|
|
18353
18362
|
return r.id = i, r.w = t, r.h = n, r.refcount = 0, this.bins[i] = r, this.ref(r),
|
|
18354
18363
|
r;
|
|
18355
|
-
},
|
|
18364
|
+
}, fa.prototype.allocShelf = function(e, t, n, i) {
|
|
18356
18365
|
var r = this.shelves[e].alloc(t, n, i);
|
|
18357
18366
|
return this.bins[i] = r, this.ref(r), r;
|
|
18358
|
-
},
|
|
18367
|
+
}, fa.prototype.shrink = function() {
|
|
18359
18368
|
if (this.shelves.length > 0) {
|
|
18360
18369
|
for (var e = 0, t = 0, n = 0; n < this.shelves.length; n++) {
|
|
18361
18370
|
var i = this.shelves[n];
|
|
@@ -18363,43 +18372,43 @@ ha.prototype.pack = function(e, t) {
|
|
|
18363
18372
|
}
|
|
18364
18373
|
this.resize(e, t);
|
|
18365
18374
|
}
|
|
18366
|
-
},
|
|
18375
|
+
}, fa.prototype.getBin = function(e) {
|
|
18367
18376
|
return this.bins[e];
|
|
18368
|
-
},
|
|
18377
|
+
}, fa.prototype.ref = function(e) {
|
|
18369
18378
|
if (1 == ++e.refcount) {
|
|
18370
18379
|
var t = e.h;
|
|
18371
18380
|
this.stats[t] = 1 + (0 | this.stats[t]);
|
|
18372
18381
|
}
|
|
18373
18382
|
return e.refcount;
|
|
18374
|
-
},
|
|
18383
|
+
}, fa.prototype.unref = function(e) {
|
|
18375
18384
|
return 0 === e.refcount ? 0 : (0 == --e.refcount && (this.stats[e.h]--, delete this.bins[e.id],
|
|
18376
18385
|
this.freebins.push(e)), e.refcount);
|
|
18377
|
-
},
|
|
18386
|
+
}, fa.prototype.clear = function() {
|
|
18378
18387
|
this.shelves = [], this.freebins = [], this.stats = {}, this.bins = {}, this.maxId = 0;
|
|
18379
|
-
},
|
|
18388
|
+
}, fa.prototype.resize = function(e, t) {
|
|
18380
18389
|
this.w = e, this.h = t;
|
|
18381
18390
|
for (var n = 0; n < this.shelves.length; n++) this.shelves[n].resize(e);
|
|
18382
18391
|
return !0;
|
|
18383
|
-
},
|
|
18392
|
+
}, da.prototype.alloc = function(e, t, n) {
|
|
18384
18393
|
if (e > this.free || t > this.h) return null;
|
|
18385
18394
|
var i = this.x;
|
|
18386
|
-
return this.x += e, this.free -= e, new
|
|
18387
|
-
},
|
|
18395
|
+
return this.x += e, this.free -= e, new pa(n, i, this.y, e, t, e, this.h);
|
|
18396
|
+
}, da.prototype.resize = function(e) {
|
|
18388
18397
|
return this.free += e - this.w, this.w = e, !0;
|
|
18389
18398
|
};
|
|
18390
18399
|
|
|
18391
|
-
class
|
|
18400
|
+
class ya {
|
|
18392
18401
|
constructor(e, t) {
|
|
18393
|
-
|
|
18402
|
+
ga(this, e, 4, t);
|
|
18394
18403
|
}
|
|
18395
18404
|
resize(e) {
|
|
18396
18405
|
!function(e, {width: t, height: n}, i) {
|
|
18397
18406
|
if (t === e.width && n === e.height) return;
|
|
18398
|
-
const r =
|
|
18407
|
+
const r = ga({}, {
|
|
18399
18408
|
width: t,
|
|
18400
18409
|
height: n
|
|
18401
18410
|
}, i);
|
|
18402
|
-
|
|
18411
|
+
ma(e, r, {
|
|
18403
18412
|
x: 0,
|
|
18404
18413
|
y: 0
|
|
18405
18414
|
}, {
|
|
@@ -18412,21 +18421,21 @@ class pa {
|
|
|
18412
18421
|
}(this, e, 4);
|
|
18413
18422
|
}
|
|
18414
18423
|
clone() {
|
|
18415
|
-
return new
|
|
18424
|
+
return new ya({
|
|
18416
18425
|
width: this.width,
|
|
18417
18426
|
height: this.height
|
|
18418
18427
|
}, new Uint8Array(this.data));
|
|
18419
18428
|
}
|
|
18420
18429
|
static copy(e, t, n, i, r) {
|
|
18421
|
-
|
|
18430
|
+
ma(e, t, n, i, r, 4);
|
|
18422
18431
|
}
|
|
18423
18432
|
}
|
|
18424
18433
|
|
|
18425
|
-
const
|
|
18434
|
+
const xa = new e.Point(0, 0), _a = [], va = [];
|
|
18426
18435
|
|
|
18427
|
-
let
|
|
18436
|
+
let Aa;
|
|
18428
18437
|
|
|
18429
|
-
class
|
|
18438
|
+
class Ta extends On {
|
|
18430
18439
|
constructor(...e) {
|
|
18431
18440
|
super(...e), this._ready = !0;
|
|
18432
18441
|
const t = this.getSymbolDef({
|
|
@@ -18482,8 +18491,7 @@ class _a extends On {
|
|
|
18482
18491
|
});
|
|
18483
18492
|
}
|
|
18484
18493
|
if (f) {
|
|
18485
|
-
const e = d ? s.properties.aTexCoord : null, t = this._fillFnTextureData(e, s, o)
|
|
18486
|
-
u({
|
|
18494
|
+
const e = d ? s.properties.aTexCoord : null, t = this._fillFnTextureData(e, s, o), n = {
|
|
18487
18495
|
width: t.width,
|
|
18488
18496
|
height: t.height,
|
|
18489
18497
|
data: t.data,
|
|
@@ -18492,7 +18500,8 @@ class _a extends On {
|
|
|
18492
18500
|
min: "linear",
|
|
18493
18501
|
flipY: !1,
|
|
18494
18502
|
premultiplyAlpha: !0
|
|
18495
|
-
}
|
|
18503
|
+
};
|
|
18504
|
+
u.update ? u.update(n) : u(n), d && s.updateData("aTexCoord", s.properties.aTexCoord);
|
|
18496
18505
|
}
|
|
18497
18506
|
}
|
|
18498
18507
|
return e;
|
|
@@ -18519,7 +18528,7 @@ class _a extends On {
|
|
|
18519
18528
|
castShadow: !1,
|
|
18520
18529
|
picking: !0
|
|
18521
18530
|
}), c = this.getMap();
|
|
18522
|
-
|
|
18531
|
+
xa.set(n[0], n[1]);
|
|
18523
18532
|
const u = c.altitudeToPoint(1, o) * s;
|
|
18524
18533
|
h.setUniform("extrudeScale", u / 100);
|
|
18525
18534
|
const f = [];
|
|
@@ -18602,32 +18611,32 @@ class _a extends On {
|
|
|
18602
18611
|
let r = this._rotationX || 0, o = this._rotationY || 0, s = this._rotationZ || 0;
|
|
18603
18612
|
const a = n && n.feature && n.feature.properties;
|
|
18604
18613
|
this._rotationXFn && (r = this._rotationXFn(i, a)), this._rotationYFn && (o = this._rotationYFn(i, a)),
|
|
18605
|
-
this._rotationZFn && (s = this._rotationZFn(i, a)), T.fromEuler(
|
|
18614
|
+
this._rotationZFn && (s = this._rotationZFn(i, a)), T.fromEuler(va, r, o, -s);
|
|
18606
18615
|
const l = 6 * t;
|
|
18607
|
-
for (let t = 0; t < 6; t++) e.set(
|
|
18616
|
+
for (let t = 0; t < 6; t++) e.set(va, 4 * (l + t));
|
|
18608
18617
|
}
|
|
18609
18618
|
_fillExtrude(e, t, n, i) {
|
|
18610
18619
|
let r = this._width || 0, o = this._height || 0;
|
|
18611
18620
|
const s = n && n.feature && n.feature.properties;
|
|
18612
18621
|
this._widthFn && (r = this._widthFn(i, s)), this._heightFn && (o = this._heightFn(i, s));
|
|
18613
18622
|
const a = r / 2 * 100, l = o / 2 * 100;
|
|
18614
|
-
|
|
18623
|
+
_a[0] = -a, _a[1] = -l;
|
|
18615
18624
|
const h = 12 * t;
|
|
18616
|
-
e.set(
|
|
18617
|
-
|
|
18618
|
-
|
|
18625
|
+
e.set(_a, h), _a[0] = a, _a[1] = l, e.set(_a, h + 2), _a[0] = -a, _a[1] = l, e.set(_a, h + 4),
|
|
18626
|
+
_a[0] = -a, _a[1] = -l, e.set(_a, h + 6), _a[0] = a, _a[1] = -l, e.set(_a, h + 8),
|
|
18627
|
+
_a[0] = a, _a[1] = l, e.set(_a, h + 10);
|
|
18619
18628
|
}
|
|
18620
18629
|
_fillFnTextureData(e, t, n) {
|
|
18621
|
-
const i = t.properties, {textureCache: r, oldPickingId: o} = i, s = o.length, a = new
|
|
18630
|
+
const i = t.properties, {textureCache: r, oldPickingId: o} = i, s = o.length, a = new fa(0, 0, {
|
|
18622
18631
|
autoResize: !0
|
|
18623
|
-
}), l = (
|
|
18632
|
+
}), l = (Aa || (Aa = document.createElement("canvas")), Aa), h = l.getContext("2d");
|
|
18624
18633
|
a.pack(n, {
|
|
18625
18634
|
inPlace: !0
|
|
18626
18635
|
});
|
|
18627
18636
|
const c = this.sceneConfig.textureLimit || 1024;
|
|
18628
18637
|
let u = 1;
|
|
18629
18638
|
a.w * a.h > c * c && (u = Math.sqrt(c * c / (a.w * a.h)), a.resize(Math.floor(a.w * u), Math.floor(a.h * u)));
|
|
18630
|
-
const f = new
|
|
18639
|
+
const f = new ya({
|
|
18631
18640
|
width: a.w,
|
|
18632
18641
|
height: a.h
|
|
18633
18642
|
});
|
|
@@ -18639,7 +18648,7 @@ class _a extends On {
|
|
|
18639
18648
|
const s = Math.floor(i.w * u), a = Math.floor(i.h * u);
|
|
18640
18649
|
l.width = s, l.height = a, h.drawImage(o, 0, 0, s, a);
|
|
18641
18650
|
const c = h.getImageData(0, 0, s, a);
|
|
18642
|
-
|
|
18651
|
+
ya.copy(c, f, {
|
|
18643
18652
|
x: 0,
|
|
18644
18653
|
y: 0
|
|
18645
18654
|
}, {
|
|
@@ -18654,16 +18663,18 @@ class _a extends On {
|
|
|
18654
18663
|
}
|
|
18655
18664
|
_fillTexCoord(e, t, n, i) {
|
|
18656
18665
|
const {x: r, y: o, w: s, h: a} = n, l = Math.floor(r * i), h = Math.floor((r + s) * i), c = Math.floor(o * i), u = Math.floor((o + a) * i), f = 12 * t;
|
|
18657
|
-
|
|
18658
|
-
|
|
18659
|
-
|
|
18666
|
+
_a[0] = l, _a[1] = u, e.set(_a, f), _a[0] = h, _a[1] = c, e.set(_a, f + 2), _a[0] = l,
|
|
18667
|
+
_a[1] = c, e.set(_a, f + 4), _a[0] = l, _a[1] = u, e.set(_a, f + 6), _a[0] = h,
|
|
18668
|
+
_a[1] = u, e.set(_a, f + 8), _a[0] = h, _a[1] = c, e.set(_a, f + 10);
|
|
18660
18669
|
}
|
|
18661
18670
|
init() {
|
|
18662
18671
|
const e = this.regl;
|
|
18663
18672
|
this.renderer = new d.Renderer(e);
|
|
18664
18673
|
const t = [], n = {
|
|
18665
|
-
vert:
|
|
18674
|
+
vert: ca,
|
|
18666
18675
|
frag: "#define SHADER_NAME BILL_BOARD\nprecision mediump float;\n#include <gl2_frag>\nuniform sampler2D billTexture;\nuniform vec2 textureSize;\nvarying vec2 vTexCoord;\nvoid main() {\n glFragColor = texture2D(billTexture, vTexCoord / textureSize);\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\nfloat c = shadow_computeShadow();\n glFragColor.rgb = shadow_blend(glFragColor.rgb, c);\n#endif\n#if __VERSION__ == 100\ngl_FragColor = glFragColor;\n#endif\n}",
|
|
18676
|
+
wgslVert: ua,
|
|
18677
|
+
wgslFrag: "struct BillboardFragmentUniforms {\n textureSize: vec2f,\n};\n@group(0) @binding($b) var<uniform> uniforms: BillboardFragmentUniforms;\n@group(0) @binding($b) var billTexture: texture_2d<f32>;\n@group(0) @binding($b) var billTextureSampler: sampler;\n#if HAS_SHADOWING && !HAS_BLOOM\n #include <vsm_shadow_frag>\n#endif\n@fragment\nfn main(vertexOutput: VertexOutput) -> @location(0) vec4f {\n var fragColor: vec4f = textureSample(billTexture, billTextureSampler, vertexOutput.vTexCoord / uniforms.textureSize);\n #if HAS_SHADOWING && !HAS_BLOOM\n let shadowCoeff = shadow_computeShadow();\n fragColor.rgb = shadow_blend(fragColor.rgb, shadowCoeff);\n #endif\n return fragColor;\n}",
|
|
18667
18678
|
uniforms: [ {
|
|
18668
18679
|
name: "projViewModelMatrix",
|
|
18669
18680
|
type: "function",
|
|
@@ -18697,7 +18708,8 @@ class _a extends On {
|
|
|
18697
18708
|
if (this.shader = new d.MeshShader(n), this.shader.version = 300, this.pickingFBO) {
|
|
18698
18709
|
const e = [];
|
|
18699
18710
|
this.picking = [ new d.FBORayPicking(this.renderer, {
|
|
18700
|
-
vert:
|
|
18711
|
+
vert: ca,
|
|
18712
|
+
wgslVert: ua,
|
|
18701
18713
|
uniforms: [ {
|
|
18702
18714
|
name: "projViewModelMatrix",
|
|
18703
18715
|
type: "function",
|
|
@@ -18742,9 +18754,9 @@ class _a extends On {
|
|
|
18742
18754
|
}
|
|
18743
18755
|
}
|
|
18744
18756
|
|
|
18745
|
-
const
|
|
18757
|
+
const Sa = g.identity([]), ba = {};
|
|
18746
18758
|
|
|
18747
|
-
class
|
|
18759
|
+
class Pa extends On {
|
|
18748
18760
|
isEnableTileStencil() {
|
|
18749
18761
|
return !1;
|
|
18750
18762
|
}
|
|
@@ -18755,7 +18767,7 @@ class Ta extends On {
|
|
|
18755
18767
|
return !1;
|
|
18756
18768
|
}
|
|
18757
18769
|
createMesh(e, t) {
|
|
18758
|
-
const {geometry: n, symbolIndex: i} = e, r = new d.Material({},
|
|
18770
|
+
const {geometry: n, symbolIndex: i} = e, r = new d.Material({}, ba), o = new d.Mesh(n, r, {
|
|
18759
18771
|
castShadow: !1,
|
|
18760
18772
|
picking: !1
|
|
18761
18773
|
});
|
|
@@ -18798,63 +18810,63 @@ class Ta extends On {
|
|
|
18798
18810
|
}
|
|
18799
18811
|
getUniformValues(e, t) {
|
|
18800
18812
|
return {
|
|
18801
|
-
projViewMatrix:
|
|
18813
|
+
projViewMatrix: Sa,
|
|
18802
18814
|
viewport: t && t.maskViewport
|
|
18803
18815
|
};
|
|
18804
18816
|
}
|
|
18805
18817
|
}
|
|
18806
18818
|
|
|
18807
|
-
const
|
|
18808
|
-
|
|
18809
|
-
Sa.registerAt(St);
|
|
18810
|
-
|
|
18811
|
-
const ba = Ht("line", oi);
|
|
18812
|
-
|
|
18813
|
-
ba.registerAt(St);
|
|
18814
|
-
|
|
18815
|
-
const Pa = Ht("line-gradient", yi);
|
|
18816
|
-
|
|
18817
|
-
Pa.registerAt(St);
|
|
18818
|
-
|
|
18819
|
-
const wa = Ht("icon", to);
|
|
18819
|
+
const wa = Ht("fill", ei);
|
|
18820
18820
|
|
|
18821
18821
|
wa.registerAt(St);
|
|
18822
18822
|
|
|
18823
|
-
const Ma = Ht("
|
|
18823
|
+
const Ma = Ht("line", oi);
|
|
18824
18824
|
|
|
18825
18825
|
Ma.registerAt(St);
|
|
18826
18826
|
|
|
18827
|
-
const Ia = Ht("
|
|
18827
|
+
const Ia = Ht("line-gradient", yi);
|
|
18828
18828
|
|
|
18829
18829
|
Ia.registerAt(St);
|
|
18830
18830
|
|
|
18831
|
-
Ht("
|
|
18832
|
-
|
|
18833
|
-
const Ca = Ht("phong", As);
|
|
18831
|
+
const Ca = Ht("icon", to);
|
|
18834
18832
|
|
|
18835
18833
|
Ca.registerAt(St);
|
|
18836
18834
|
|
|
18837
|
-
const Oa = Ht("
|
|
18835
|
+
const Oa = Ht("text", Zo);
|
|
18838
18836
|
|
|
18839
18837
|
Oa.registerAt(St);
|
|
18840
18838
|
|
|
18841
|
-
const ka = Ht("
|
|
18839
|
+
const ka = Ht("native-line", ss);
|
|
18842
18840
|
|
|
18843
18841
|
ka.registerAt(St);
|
|
18844
18842
|
|
|
18845
|
-
|
|
18843
|
+
Ht("native-point", ns).registerAt(St);
|
|
18844
|
+
|
|
18845
|
+
const Ra = Ht("phong", Ts);
|
|
18846
18846
|
|
|
18847
18847
|
Ra.registerAt(St);
|
|
18848
18848
|
|
|
18849
|
-
const Fa = Ht("
|
|
18849
|
+
const Fa = Ht("wireframe", bs);
|
|
18850
18850
|
|
|
18851
18851
|
Fa.registerAt(St);
|
|
18852
18852
|
|
|
18853
|
-
const Ea = Ht("
|
|
18853
|
+
const Ea = Ht("lit", Is);
|
|
18854
18854
|
|
|
18855
18855
|
Ea.registerAt(St);
|
|
18856
18856
|
|
|
18857
|
-
const Ha = Ht("
|
|
18857
|
+
const Ha = Ht("tube", Fs);
|
|
18858
|
+
|
|
18859
|
+
Ha.registerAt(St);
|
|
18860
|
+
|
|
18861
|
+
const Da = Ht("gltf-phong", ea);
|
|
18862
|
+
|
|
18863
|
+
Da.registerAt(St);
|
|
18864
|
+
|
|
18865
|
+
const La = Ht("gltf-lit", ta);
|
|
18866
|
+
|
|
18867
|
+
La.registerAt(St);
|
|
18868
|
+
|
|
18869
|
+
const Na = Ht("heatmap", class extends On {
|
|
18858
18870
|
createFnTypeConfig(e, t) {
|
|
18859
18871
|
const n = I(t.heatmapWeight), r = new Int16Array(1);
|
|
18860
18872
|
return [ {
|
|
@@ -18918,39 +18930,39 @@ const Ha = Ht("heatmap", class extends On {
|
|
|
18918
18930
|
}
|
|
18919
18931
|
});
|
|
18920
18932
|
|
|
18921
|
-
|
|
18933
|
+
Na.registerAt(St);
|
|
18922
18934
|
|
|
18923
|
-
const
|
|
18935
|
+
const za = Ht("water", la);
|
|
18924
18936
|
|
|
18925
|
-
|
|
18937
|
+
za.registerAt(St);
|
|
18926
18938
|
|
|
18927
|
-
const
|
|
18939
|
+
const Va = Ht("billboard", Ta);
|
|
18928
18940
|
|
|
18929
|
-
|
|
18941
|
+
Va.registerAt(St);
|
|
18930
18942
|
|
|
18931
|
-
const
|
|
18943
|
+
const Ua = Ht("terrain-flat-mask", Pa);
|
|
18932
18944
|
|
|
18933
|
-
|
|
18945
|
+
Ua.registerAt(St), kt.registerPainter("lit", Is), kt.registerPainter("icon", to),
|
|
18934
18946
|
kt.registerPainter("fill", ei), kt.registerPainter("line", oi), kt.registerPainter("line-gradient", yi),
|
|
18935
|
-
kt.registerPainter("water",
|
|
18947
|
+
kt.registerPainter("water", la), kt.registerPainter("tube", Fs), kt.registerPainter("billboard", Ta);
|
|
18936
18948
|
|
|
18937
|
-
class
|
|
18949
|
+
class Ga extends St {
|
|
18938
18950
|
getTileUrl(e, t, n) {
|
|
18939
18951
|
const i = this.getMap().getResolution(n);
|
|
18940
18952
|
return super.getTileUrl(e, t, function(e) {
|
|
18941
|
-
return 19 - Math.log(e /
|
|
18953
|
+
return 19 - Math.log(e / Ba) / Math.LN2;
|
|
18942
18954
|
}(i));
|
|
18943
18955
|
}
|
|
18944
18956
|
static fromJSON(e) {
|
|
18945
|
-
return e && "MapboxVectorTileLayer" === e.type ? new
|
|
18957
|
+
return e && "MapboxVectorTileLayer" === e.type ? new Ga(e.id, e.options) : null;
|
|
18946
18958
|
}
|
|
18947
18959
|
}
|
|
18948
18960
|
|
|
18949
|
-
|
|
18961
|
+
Ga.registerJSONType("MapboxVectorTileLayer");
|
|
18950
18962
|
|
|
18951
|
-
const
|
|
18963
|
+
const Ba = 12756274 * Math.PI / (256 * Math.pow(2, 20));
|
|
18952
18964
|
|
|
18953
|
-
class
|
|
18965
|
+
class Wa extends St {
|
|
18954
18966
|
constructor(e, t) {
|
|
18955
18967
|
(t = t || {}).spatialReference = null, super(e, t), this._idMaps = new Map, this.setData(t.data);
|
|
18956
18968
|
}
|
|
@@ -18993,7 +19005,7 @@ class Ua extends St {
|
|
|
18993
19005
|
getWorkerOptions() {
|
|
18994
19006
|
const e = super.getWorkerOptions();
|
|
18995
19007
|
let t = this.options.data;
|
|
18996
|
-
return J(t) || t && t.url ? (t.url && (t = JSON.parse(JSON.stringify(t))), t =
|
|
19008
|
+
return J(t) || t && t.url ? (t.url && (t = JSON.parse(JSON.stringify(t))), t = Xa(t, this.getURLModifier())) : t = this.features,
|
|
18997
19009
|
e.data = t, e.tileBuffer = this.options.tileBuffer, e.extent = this.options.extent,
|
|
18998
19010
|
e.hasAltitude = this.options.enableAltitude, e.simplifyTolerance = this.options.simplifyTolerance,
|
|
18999
19011
|
e.projection = this.getSpatialReference().getProjection().code, e.generateOMBB = this.options.generateOMBB,
|
|
@@ -19017,7 +19029,7 @@ class Ua extends St {
|
|
|
19017
19029
|
const t = e.getWorkerConnection();
|
|
19018
19030
|
if (t) {
|
|
19019
19031
|
let n = this.options.data;
|
|
19020
|
-
J(n) || n && n.url ? (n.url && (n = JSON.parse(JSON.stringify(n))), n =
|
|
19032
|
+
J(n) || n && n.url ? (n.url && (n = JSON.parse(JSON.stringify(n))), n = Xa(n, this.getURLModifier())) : n = this.features,
|
|
19021
19033
|
t.setData(n, ((t, n) => {
|
|
19022
19034
|
e.clear(), this.onWorkerReady(null, n), e.setToRedraw(), setTimeout((() => {
|
|
19023
19035
|
e.setToRedraw();
|
|
@@ -19053,7 +19065,7 @@ class Ua extends St {
|
|
|
19053
19065
|
return this._idMaps ? this._idMaps.get(e) : null;
|
|
19054
19066
|
}
|
|
19055
19067
|
static fromJSON(e) {
|
|
19056
|
-
return e && "GeoJSONVectorTileLayer" === e.type ? new
|
|
19068
|
+
return e && "GeoJSONVectorTileLayer" === e.type ? new Wa(e.id, e.options) : null;
|
|
19057
19069
|
}
|
|
19058
19070
|
getGeometryById(e) {
|
|
19059
19071
|
return this.getFeature(e);
|
|
@@ -19077,16 +19089,16 @@ class Ua extends St {
|
|
|
19077
19089
|
}
|
|
19078
19090
|
}
|
|
19079
19091
|
|
|
19080
|
-
function
|
|
19092
|
+
function ja(e) {
|
|
19081
19093
|
let t = document.createElement("a");
|
|
19082
19094
|
return t.href = e, e = t.href, t = null, e;
|
|
19083
19095
|
}
|
|
19084
19096
|
|
|
19085
|
-
function
|
|
19086
|
-
return e.url ? e.url = t ? t(e.url) :
|
|
19097
|
+
function Xa(e, t) {
|
|
19098
|
+
return e.url ? e.url = t ? t(e.url) : ja(e.url) : e = t ? t(e) : ja(e), e;
|
|
19087
19099
|
}
|
|
19088
19100
|
|
|
19089
|
-
|
|
19101
|
+
Wa.registerJSONType("GeoJSONVectorTileLayer"), Wa.mergeOptions({
|
|
19090
19102
|
features: !0,
|
|
19091
19103
|
tileBuffer: 64,
|
|
19092
19104
|
extent: 8192,
|
|
@@ -19096,17 +19108,17 @@ Ua.registerJSONType("GeoJSONVectorTileLayer"), Ua.mergeOptions({
|
|
|
19096
19108
|
generateOMBB: !0
|
|
19097
19109
|
});
|
|
19098
19110
|
|
|
19099
|
-
const {LayerAbstractRenderer:
|
|
19111
|
+
const {LayerAbstractRenderer: $a} = e.renderer, {SYMBOLS_NEED_REBUILD_IN_VECTOR: Ya, GlyphRequestor: qa, PointPack: Za, LinePack: Ka, StyledPoint: Ja, VectorPack: Qa, StyledVector: el} = j();
|
|
19100
19112
|
|
|
19101
|
-
let
|
|
19113
|
+
let tl = !1, nl = 1;
|
|
19102
19114
|
|
|
19103
|
-
const
|
|
19115
|
+
const il = "_symbol_".trim(), rl = (we + "").trim();
|
|
19104
19116
|
|
|
19105
|
-
let
|
|
19117
|
+
let ol = new Float32Array(1);
|
|
19106
19118
|
|
|
19107
|
-
const
|
|
19119
|
+
const sl = [], al = [];
|
|
19108
19120
|
|
|
19109
|
-
class
|
|
19121
|
+
class ll extends(m($a)){
|
|
19110
19122
|
constructor(...e) {
|
|
19111
19123
|
super(...e), this.features = {}, this.featuresArray = [], this.featuresChanged = !1,
|
|
19112
19124
|
this._geometries = {}, this._counter = 0, this._allFeatures = {}, this._featureMapping = {},
|
|
@@ -19127,7 +19139,7 @@ class ol extends(m(Wa)){
|
|
|
19127
19139
|
return e || (this.painter && this.painter.needToRedraw() || this._markerPainter && this._markerPainter.needToRedraw() || this._linePainter && this._linePainter.needToRedraw());
|
|
19128
19140
|
}
|
|
19129
19141
|
getAnalysisMeshes() {
|
|
19130
|
-
return this.painter && this.painter.getAnalysisMeshes() ||
|
|
19142
|
+
return this.painter && this.painter.getAnalysisMeshes() || sl;
|
|
19131
19143
|
}
|
|
19132
19144
|
getRayCastData() {
|
|
19133
19145
|
return null;
|
|
@@ -19138,7 +19150,7 @@ class ol extends(m(Wa)){
|
|
|
19138
19150
|
if (!e) return this;
|
|
19139
19151
|
for (let t = 0, n = e.length; t < n; t++) {
|
|
19140
19152
|
let n = e[t];
|
|
19141
|
-
if (n && (Array.isArray(n) || (
|
|
19153
|
+
if (n && (Array.isArray(n) || (al[0] = n, n = al), n.length)) for (let e = 0; e < n.length; e++) {
|
|
19142
19154
|
const t = n[e];
|
|
19143
19155
|
if (!t) continue;
|
|
19144
19156
|
const i = t.getVisible;
|
|
@@ -19243,12 +19255,12 @@ class ol extends(m(Wa)){
|
|
|
19243
19255
|
if (!this.features[s]) continue;
|
|
19244
19256
|
const a = this.features[s];
|
|
19245
19257
|
if (Array.isArray(a)) for (let r = 0; r < a.length; r++) {
|
|
19246
|
-
const o = a[r], s = o[
|
|
19258
|
+
const o = a[r], s = o[rl];
|
|
19247
19259
|
(!e || e[s] || t && (!t || t[s])) && (o.visible || (this._showHideUpdated = !0),
|
|
19248
19260
|
this._addCoordsToCenter(o.geometry, i, o.coordinates), n.push(o));
|
|
19249
19261
|
} else {
|
|
19250
19262
|
a.visible || (this._showHideUpdated = !0);
|
|
19251
|
-
const r = a[
|
|
19263
|
+
const r = a[rl];
|
|
19252
19264
|
if (e && !e[r] && (!t || t && !t[r])) continue;
|
|
19253
19265
|
this._addCoordsToCenter(a.geometry, i, a.coordinates), n.push(a);
|
|
19254
19266
|
}
|
|
@@ -19300,8 +19312,8 @@ class ol extends(m(Wa)){
|
|
|
19300
19312
|
_addCoord(e, t, n, i, r, o) {
|
|
19301
19313
|
const s = this.getMap().getProjection().isSphere();
|
|
19302
19314
|
let a = !1;
|
|
19303
|
-
(o[0] > 180 || o[0] < -180) && s && !
|
|
19304
|
-
(o[1] > 90 || o[1] < -90) && s && !
|
|
19315
|
+
(o[0] > 180 || o[0] < -180) && s && !tl && (a = !0, tl = !0, console.warn(`Layer(${this.layer.getId()}) has invalid longitude value: ${o[0]}`)),
|
|
19316
|
+
(o[1] > 90 || o[1] < -90) && s && !tl && (a = !0, tl = !0, console.warn(`Layer(${this.layer.getId()}) has invalid latitude value: ${o[1]}`)),
|
|
19305
19317
|
a || (e[0] += t, e[1] += n, e[2] += i || 0, e[3] += r);
|
|
19306
19318
|
}
|
|
19307
19319
|
_fillCommonProps(e) {
|
|
@@ -19310,7 +19322,7 @@ class ol extends(m(Wa)){
|
|
|
19310
19322
|
n.aPickingId = e.data.aPickingId;
|
|
19311
19323
|
}
|
|
19312
19324
|
_isEnableWorkAround(e) {
|
|
19313
|
-
return "win-intel-gpu-crash" === e && (this.gl && this.layer.options.workarounds["win-intel-gpu-crash"] &&
|
|
19325
|
+
return "win-intel-gpu-crash" === e && (this.gl && this.layer.options.workarounds["win-intel-gpu-crash"] && cl(this.gl));
|
|
19314
19326
|
}
|
|
19315
19327
|
prepareRequestors() {
|
|
19316
19328
|
if (this._iconRequestor) return;
|
|
@@ -19323,7 +19335,7 @@ class ol extends(m(Wa)){
|
|
|
19323
19335
|
}
|
|
19324
19336
|
});
|
|
19325
19337
|
const t = !this._isEnableWorkAround("win-intel-gpu-crash");
|
|
19326
|
-
this._glyphRequestor = new
|
|
19338
|
+
this._glyphRequestor = new qa((t => {
|
|
19327
19339
|
e.getMap().getRenderer().callInNextFrame(t);
|
|
19328
19340
|
}), e.options.glyphSdfLimitPerFrame, t), this.requestor = this._fetchPattern.bind(this),
|
|
19329
19341
|
this._markerRequestor = this._fetchIconGlyphs.bind(this);
|
|
@@ -19356,7 +19368,7 @@ class ol extends(m(Wa)){
|
|
|
19356
19368
|
delete this._markerMeshes));
|
|
19357
19369
|
const {features: i, center: r} = this._getFeaturesToRender(this._markerFeatures, this._textFeatures), o = [], s = [];
|
|
19358
19370
|
for (let e = 0; e < i.length; e++) {
|
|
19359
|
-
const t = i[e][
|
|
19371
|
+
const t = i[e][rl];
|
|
19360
19372
|
this._markerFeatures[t] && o.push(i[e]), this._textFeatures[t] && s.push(i[e]);
|
|
19361
19373
|
}
|
|
19362
19374
|
if (!o.length && !s.length) return void (this._markerMeshes && (this._markerPainter.deleteMesh(this._markerMeshes),
|
|
@@ -19378,7 +19390,7 @@ class ol extends(m(Wa)){
|
|
|
19378
19390
|
g.translate(o, o, p.set(c, r[0], r[1], 0)), g.scale(o, o, p.set(h, 1, 1, this._zScale));
|
|
19379
19391
|
const s = this._markerPainter.createMeshes(t, o);
|
|
19380
19392
|
for (let e = 0; e < s.length; e++) s[e].geometry.properties.originElements = s[e].geometry.properties.elements.slice(),
|
|
19381
|
-
s[e].properties.level = 0, s[e].material.set("flipY", 1), s[e].properties.meshKey =
|
|
19393
|
+
s[e].properties.level = 0, s[e].material.set("flipY", 1), s[e].properties.meshKey = nl++;
|
|
19382
19394
|
this._markerMeshes = s, a && (this._showHideUpdated = !0), this._isCreatingMarkerMesh = !1,
|
|
19383
19395
|
this.setToRedraw(), this.layer.fire("buildmarkermesh");
|
|
19384
19396
|
}));
|
|
@@ -19415,7 +19427,7 @@ class ol extends(m(Wa)){
|
|
|
19415
19427
|
const r = this._getPackOptions(n, i);
|
|
19416
19428
|
return r.defaultAltitude = 0, r.forceAltitudeAttribute = !0, r.requestor = this._markerRequestor,
|
|
19417
19429
|
r.markerWidthType = Uint16Array, r.markerHeightType = Uint16Array, r.defaultMarkerVerticalAlignment = "top",
|
|
19418
|
-
r.allowEmptyPack = 1, [ this._markerSymbol ].map(((n, i) => new
|
|
19430
|
+
r.allowEmptyPack = 1, [ this._markerSymbol ].map(((n, i) => new Za(0 === i ? e : t, n, r).load()));
|
|
19419
19431
|
}
|
|
19420
19432
|
updateMesh() {}
|
|
19421
19433
|
_updateMarkerMesh(t) {
|
|
@@ -19430,15 +19442,15 @@ class ol extends(m(Wa)){
|
|
|
19430
19442
|
const h = [], c = [], u = [];
|
|
19431
19443
|
let f, d;
|
|
19432
19444
|
f = Array.isArray(o) ? o.map((e => e ? O(e, (() => (h[0] = r, h))) : e)) : O(o, (() => (h[0] = r,
|
|
19433
|
-
h))), d = Array.isArray(o) ? o.map((e => e ?
|
|
19445
|
+
h))), d = Array.isArray(o) ? o.map((e => e ? Qa.genFnTypes(e) : e)) : Qa.genFnTypes(o);
|
|
19434
19446
|
for (let e = 0; e < l.length; e++) {
|
|
19435
19447
|
if (!l[e]) continue;
|
|
19436
|
-
const t = Array.isArray(o) ? o[e] : o, n = Array.isArray(f) ? f[e] : f, i = Array.isArray(d) ? d[e] : d, r = new
|
|
19437
|
-
if (!this._markerAtlas ||
|
|
19448
|
+
const t = Array.isArray(o) ? o[e] : o, n = Array.isArray(f) ? f[e] : f, i = Array.isArray(d) ? d[e] : d, r = new Ja(l, t, n, i, s).getIconAndGlyph();
|
|
19449
|
+
if (!this._markerAtlas || !Za.isAtlasLoaded(r, this._markerAtlas)) return this.markRebuild(),
|
|
19438
19450
|
this.setToRedraw(), !1;
|
|
19439
19451
|
}
|
|
19440
19452
|
for (let e = 0; e < l.length; e++) {
|
|
19441
|
-
const t = l[e][
|
|
19453
|
+
const t = l[e][rl];
|
|
19442
19454
|
this._markerFeatures[t] && c.push(l[e]), this._textFeatures[t] && u.push(l[e]);
|
|
19443
19455
|
}
|
|
19444
19456
|
const p = l[0].id, g = this._createPointPacks(c, u, this._markerAtlas, this._markerCenter), m = this._markerMeshes;
|
|
@@ -19460,7 +19472,7 @@ class ol extends(m(Wa)){
|
|
|
19460
19472
|
})), !0;
|
|
19461
19473
|
}
|
|
19462
19474
|
_updateLineMesh(e) {
|
|
19463
|
-
return this._updateMesh(e, this._lineMeshes, this._lineAtlas, this._lineCenter, this._linePainter,
|
|
19475
|
+
return this._updateMesh(e, this._lineMeshes, this._lineAtlas, this._lineCenter, this._linePainter, Ka, li, this._groupLineFeas);
|
|
19464
19476
|
}
|
|
19465
19477
|
_updateMesh(t, n, i, r, o, s, a, l) {
|
|
19466
19478
|
if (!n) return !1;
|
|
@@ -19474,8 +19486,8 @@ class ol extends(m(Wa)){
|
|
|
19474
19486
|
for (let e = 0; e < p.length; e++) {
|
|
19475
19487
|
const t = p[e];
|
|
19476
19488
|
if (!t) continue;
|
|
19477
|
-
const n = Array.isArray(h) ? h[e] : h, r =
|
|
19478
|
-
if (!
|
|
19489
|
+
const n = Array.isArray(h) ? h[e] : h, r = Qa.genFnTypes(n), o = new el(p, n, r, f), a = s === Ka ? o.getLineResource() : o.getPolygonResource();
|
|
19490
|
+
if (!Qa.isAtlasLoaded(a, i[e])) return this.markRebuild(), this.setToRedraw(), !1;
|
|
19479
19491
|
g.push(t);
|
|
19480
19492
|
}
|
|
19481
19493
|
const m = p[0].id, y = l.call(this, g);
|
|
@@ -19512,7 +19524,7 @@ class ol extends(m(Wa)){
|
|
|
19512
19524
|
let n = r + 1;
|
|
19513
19525
|
for (;i[n] === t; ) n++;
|
|
19514
19526
|
const o = n - r, s = e.geometry.desc.positionSize;
|
|
19515
|
-
|
|
19527
|
+
ol.length !== 3 * o && (ol = new Float32Array(o * s), ol.fill(-1 / 0, 0)), e.geometry.updateSubData(e.geometry.desc.positionAttribute, ol, r * s);
|
|
19516
19528
|
}
|
|
19517
19529
|
this.layer.fire("updatemesh"), this.setToRedraw();
|
|
19518
19530
|
}
|
|
@@ -19524,7 +19536,7 @@ class ol extends(m(Wa)){
|
|
|
19524
19536
|
if (!t.length) return;
|
|
19525
19537
|
const i = this._showHideUpdated;
|
|
19526
19538
|
this._lineCenter = n;
|
|
19527
|
-
const r = this._groupLineFeas(t), o = K({}, li), s = r.map(((t, i) => this.createMesh(this._linePainter,
|
|
19539
|
+
const r = this._groupLineFeas(t), o = K({}, li), s = r.map(((t, i) => this.createMesh(this._linePainter, Ka, o, t, e && e[i], n)));
|
|
19528
19540
|
this._isCreatingLineMesh = !0, Promise.all(s).then((e => {
|
|
19529
19541
|
this._lineMeshes && this._linePainter.deleteMesh(this._lineMeshes);
|
|
19530
19542
|
const t = [], n = [];
|
|
@@ -19543,10 +19555,10 @@ class ol extends(m(Wa)){
|
|
|
19543
19555
|
}));
|
|
19544
19556
|
}
|
|
19545
19557
|
_groupLineFeas(e) {
|
|
19546
|
-
const t = (
|
|
19558
|
+
const t = (il + "lineDasharray").trim(), n = (il + "linePatternFile").trim(), i = [], r = [], o = [];
|
|
19547
19559
|
for (let s = 0; s < e.length; s++) {
|
|
19548
19560
|
const a = e[s], l = a.properties && a.properties[t];
|
|
19549
|
-
l &&
|
|
19561
|
+
l && ml(l) ? o.push(a) : a.properties && a.properties[n] ? r.push(a) : i.push(a);
|
|
19550
19562
|
}
|
|
19551
19563
|
return [ i, r, o ];
|
|
19552
19564
|
}
|
|
@@ -19581,23 +19593,23 @@ class ol extends(m(Wa)){
|
|
|
19581
19593
|
if (!e) return;
|
|
19582
19594
|
const n = Array.isArray(e) ? e[0].id : e.id;
|
|
19583
19595
|
if (this._featureMapping[n] = e, Array.isArray(e)) for (let n = 0; n < e.length; n++) {
|
|
19584
|
-
const i = e[n][
|
|
19596
|
+
const i = e[n][rl];
|
|
19585
19597
|
if (e[n][fi] = t, this._allFeatures[i] = {
|
|
19586
19598
|
feature: e[n]
|
|
19587
19599
|
}, this._allFeatures[i][fi] = t, !this.needCheckPointLineSymbols()) continue;
|
|
19588
19600
|
const r = {
|
|
19589
19601
|
feature: e[n]
|
|
19590
19602
|
};
|
|
19591
|
-
(
|
|
19592
|
-
|
|
19603
|
+
(ul(e[n]) || fl(e[n])) && (this._markerFeatures[i] = r), fl(e[n]) && (this._textFeatures[i] = r),
|
|
19604
|
+
gl(e[n]) && (this._lineFeatures[i] = r);
|
|
19593
19605
|
} else {
|
|
19594
19606
|
e[fi] = t;
|
|
19595
19607
|
const n = {
|
|
19596
19608
|
feature: e
|
|
19597
|
-
}, i = e[
|
|
19609
|
+
}, i = e[rl];
|
|
19598
19610
|
if (this._allFeatures[i] = n, !this.needCheckPointLineSymbols()) return;
|
|
19599
|
-
(
|
|
19600
|
-
|
|
19611
|
+
(ul(e) || fl(e)) && (this._markerFeatures[i] = n), fl(e) && (this._textFeatures[i] = n),
|
|
19612
|
+
gl(e) && (this._lineFeatures[i] = n);
|
|
19601
19613
|
}
|
|
19602
19614
|
}
|
|
19603
19615
|
needCheckPointLineSymbols() {
|
|
@@ -19606,11 +19618,11 @@ class ol extends(m(Wa)){
|
|
|
19606
19618
|
_removeFeatures(e) {
|
|
19607
19619
|
const t = this.features[e];
|
|
19608
19620
|
if (t) if (Array.isArray(t)) for (let e = 0; e < t.length; e++) {
|
|
19609
|
-
const n = t[e][
|
|
19621
|
+
const n = t[e][rl], i = t[e].id;
|
|
19610
19622
|
delete this._featureMapping[i], delete this._allFeatures[n], delete this._markerFeatures[n],
|
|
19611
19623
|
delete this._textFeatures[n], delete this._lineFeatures[n];
|
|
19612
19624
|
} else {
|
|
19613
|
-
const e = t[
|
|
19625
|
+
const e = t[rl], n = t.id;
|
|
19614
19626
|
delete this._featureMapping[n], delete this._allFeatures[e], delete this._markerFeatures[e],
|
|
19615
19627
|
delete this._textFeatures[e], delete this._lineFeatures[e];
|
|
19616
19628
|
}
|
|
@@ -19634,7 +19646,7 @@ class ol extends(m(Wa)){
|
|
|
19634
19646
|
}
|
|
19635
19647
|
_getFeaKeyId(e) {
|
|
19636
19648
|
const t = e[fi], n = this.features[t];
|
|
19637
|
-
return Array.isArray(n) ? n[0][
|
|
19649
|
+
return Array.isArray(n) ? n[0][rl] : n[rl];
|
|
19638
19650
|
}
|
|
19639
19651
|
_updateDirtyTargets() {
|
|
19640
19652
|
let e = !1;
|
|
@@ -19653,10 +19665,10 @@ class ol extends(m(Wa)){
|
|
|
19653
19665
|
e = e || t;
|
|
19654
19666
|
}
|
|
19655
19667
|
}
|
|
19656
|
-
this._dirtyTargetsInCurrentFrame = {}, e && (
|
|
19668
|
+
this._dirtyTargetsInCurrentFrame = {}, e && (hl(this), this.layer.fire("partialupdate"));
|
|
19657
19669
|
}
|
|
19658
19670
|
_convertAndRebuild(e) {
|
|
19659
|
-
this._convertGeo(e), this.markRebuild(),
|
|
19671
|
+
this._convertGeo(e), this.markRebuild(), hl(this);
|
|
19660
19672
|
}
|
|
19661
19673
|
onGeometryAdd(e) {
|
|
19662
19674
|
if (this.setToRedraw(), this.canvas && e && e.length) {
|
|
@@ -19664,7 +19676,7 @@ class ol extends(m(Wa)){
|
|
|
19664
19676
|
const n = e[t];
|
|
19665
19677
|
n && delete n[fi];
|
|
19666
19678
|
}
|
|
19667
|
-
this._convertGeometries(e), this.markRebuild(),
|
|
19679
|
+
this._convertGeometries(e), this.markRebuild(), hl(this);
|
|
19668
19680
|
}
|
|
19669
19681
|
}
|
|
19670
19682
|
onGeometryRemove(e) {
|
|
@@ -19674,7 +19686,7 @@ class ol extends(m(Wa)){
|
|
|
19674
19686
|
void 0 !== i && (delete n[fi], delete this._geometries[i], this._removeFeatures(i),
|
|
19675
19687
|
delete this.features[i], this.featuresChanged = !0);
|
|
19676
19688
|
}
|
|
19677
|
-
this.markRebuild(),
|
|
19689
|
+
this.markRebuild(), hl(this), this.layer.fire("removegeo", {
|
|
19678
19690
|
type: "removegeo",
|
|
19679
19691
|
target: this,
|
|
19680
19692
|
geometries: e
|
|
@@ -19694,26 +19706,26 @@ class ol extends(m(Wa)){
|
|
|
19694
19706
|
for (const t in i) i[t] && K(e, i[t]);
|
|
19695
19707
|
i = e;
|
|
19696
19708
|
}
|
|
19697
|
-
for (const e in i) if (oe(i, e) &&
|
|
19709
|
+
for (const e in i) if (oe(i, e) && Ya[e]) return void this._convertAndRebuild(t);
|
|
19698
19710
|
const r = t._getInternalSymbol(), o = this.features[n];
|
|
19699
19711
|
if (this._convertGeo(t), o) if (function(e, t) {
|
|
19700
19712
|
return Array.isArray(e) ? !!Array.isArray(t) && e.length === t.length : !Array.isArray(t);
|
|
19701
19713
|
}(r, o)) {
|
|
19702
19714
|
if (Array.isArray(r)) for (let e = 0; e < r.length; e++) {
|
|
19703
|
-
if (!
|
|
19704
|
-
} else if (!
|
|
19715
|
+
if (!yl(r[e], o[e])) return void this._convertAndRebuild(t);
|
|
19716
|
+
} else if (!yl(r, o)) return void this._convertAndRebuild(t);
|
|
19705
19717
|
this.onGeometryPositionChange(e);
|
|
19706
19718
|
} else this._convertAndRebuild(t); else this._convertAndRebuild(t);
|
|
19707
19719
|
}
|
|
19708
19720
|
onGeometryShapeChange(e) {
|
|
19709
19721
|
const t = e.target._getParent() || e.target;
|
|
19710
19722
|
void 0 !== t[fi] && (this._convertGeometries([ t ]), this.markRebuildGeometry(),
|
|
19711
|
-
|
|
19723
|
+
hl(this));
|
|
19712
19724
|
}
|
|
19713
19725
|
onGeometryPositionChange(e) {
|
|
19714
19726
|
const t = e.target._getParent() || e.target, n = t[fi];
|
|
19715
19727
|
void 0 !== n && (this._convertGeometries([ t ]), this._dirtyTargetsInCurrentFrame[n] = t,
|
|
19716
|
-
|
|
19728
|
+
hl(this));
|
|
19717
19729
|
}
|
|
19718
19730
|
onGeometryZIndexChange(e) {
|
|
19719
19731
|
void 0 !== (e.target._getParent() || e.target)[fi] && this.markRebuild();
|
|
@@ -19735,7 +19747,7 @@ class ol extends(m(Wa)){
|
|
|
19735
19747
|
if (e === i.visible) return;
|
|
19736
19748
|
i.visible = e;
|
|
19737
19749
|
}
|
|
19738
|
-
this._markShowHide(),
|
|
19750
|
+
this._markShowHide(), hl(this);
|
|
19739
19751
|
}
|
|
19740
19752
|
}
|
|
19741
19753
|
_markShowHide() {
|
|
@@ -19745,7 +19757,7 @@ class ol extends(m(Wa)){
|
|
|
19745
19757
|
const t = e.target._getParent() || e.target, n = t[fi];
|
|
19746
19758
|
void 0 !== n && this.features[n] && (this.features[n] = gi(t, this._kidGen), this._refreshFeatures(this.features[n], n),
|
|
19747
19759
|
this._markerMeshes && this._markerMeshes.length && this._markerPainter.needRebuildOnGometryPropertiesChanged() || this._lineMeshes && this._lineMeshes.length && this._linePainter.needRebuildOnGometryPropertiesChanged() || this.meshes && this.meshes.length && this.painter.needRebuildOnGometryPropertiesChanged() ? this.markRebuild() : this.meshes && this.painter.onFeatureChange(this.features[n], this.meshes),
|
|
19748
|
-
|
|
19760
|
+
hl(this));
|
|
19749
19761
|
}
|
|
19750
19762
|
initContext() {
|
|
19751
19763
|
super.initContext();
|
|
@@ -19843,7 +19855,7 @@ class ol extends(m(Wa)){
|
|
|
19843
19855
|
delete this._outlineAll, delete this._outlineFeatures, this.setToRedraw();
|
|
19844
19856
|
}
|
|
19845
19857
|
isEnableWorkAround(e) {
|
|
19846
|
-
return "win-intel-gpu-crash" === e && (this.layer.options.workarounds["win-intel-gpu-crash"] &&
|
|
19858
|
+
return "win-intel-gpu-crash" === e && (this.layer.options.workarounds["win-intel-gpu-crash"] && cl(this.gl));
|
|
19847
19859
|
}
|
|
19848
19860
|
_getCentiMeterScale(e) {
|
|
19849
19861
|
return se(e, this.getMap());
|
|
@@ -19858,11 +19870,11 @@ class ol extends(m(Wa)){
|
|
|
19858
19870
|
}
|
|
19859
19871
|
}
|
|
19860
19872
|
|
|
19861
|
-
function
|
|
19873
|
+
function hl(e) {
|
|
19862
19874
|
e.setToRedraw();
|
|
19863
19875
|
}
|
|
19864
19876
|
|
|
19865
|
-
function
|
|
19877
|
+
function cl(e) {
|
|
19866
19878
|
const t = e.getExtension("WEBGL_debug_renderer_info");
|
|
19867
19879
|
if (t && "undefined" != typeof navigator) {
|
|
19868
19880
|
const n = e.getParameter(t.UNMASKED_RENDERER_WEBGL), i = "Win32" === navigator.platform || "Win64" === navigator.platform;
|
|
@@ -19871,38 +19883,38 @@ function al(e) {
|
|
|
19871
19883
|
return !1;
|
|
19872
19884
|
}
|
|
19873
19885
|
|
|
19874
|
-
function
|
|
19875
|
-
const t = (
|
|
19886
|
+
function ul({properties: e}) {
|
|
19887
|
+
const t = (il + "markerFile").trim(), n = (il + "markerType").trim();
|
|
19876
19888
|
return e[t] || e[n];
|
|
19877
19889
|
}
|
|
19878
19890
|
|
|
19879
|
-
function
|
|
19880
|
-
return e[(
|
|
19891
|
+
function fl({properties: e}) {
|
|
19892
|
+
return e[(il + "textName").trim()];
|
|
19881
19893
|
}
|
|
19882
19894
|
|
|
19883
|
-
const
|
|
19895
|
+
const dl = (il + "lineWidth").trim(), pl = (hi + "").trim();
|
|
19884
19896
|
|
|
19885
|
-
function
|
|
19886
|
-
return 2 === e.type && !e.properties[
|
|
19897
|
+
function gl(e) {
|
|
19898
|
+
return 2 === e.type && !e.properties[pl] || 3 === e.type && void 0 !== e.properties[dl];
|
|
19887
19899
|
}
|
|
19888
19900
|
|
|
19889
|
-
function
|
|
19901
|
+
function ml(e) {
|
|
19890
19902
|
if (!Array.isArray(e)) return 0;
|
|
19891
19903
|
let t = 0;
|
|
19892
19904
|
for (let n = 0; n < e.length; n++) t += e[n];
|
|
19893
19905
|
return t;
|
|
19894
19906
|
}
|
|
19895
19907
|
|
|
19896
|
-
function
|
|
19897
|
-
if (Object.keys(e).sort().join() !== Object.keys(t.properties || {}).filter((e => 0 === e.indexOf(
|
|
19908
|
+
function yl(e, t) {
|
|
19909
|
+
if (Object.keys(e).sort().join() !== Object.keys(t.properties || {}).filter((e => 0 === e.indexOf(il))).map((e => e.substring(il.length))).sort().join()) return !1;
|
|
19898
19910
|
for (const n in e) if (oe(e, n)) {
|
|
19899
|
-
const i = (
|
|
19911
|
+
const i = (il + n).trim();
|
|
19900
19912
|
if (M(e[n]) !== M(t.properties[i])) return !1;
|
|
19901
19913
|
}
|
|
19902
19914
|
return !0;
|
|
19903
19915
|
}
|
|
19904
19916
|
|
|
19905
|
-
function
|
|
19917
|
+
function xl(t, n, i) {
|
|
19906
19918
|
if (!t || t.type !== n) return null;
|
|
19907
19919
|
const r = new i(t.id, t.options), o = t.geometries, s = [];
|
|
19908
19920
|
for (let t = 0; t < o.length; t++) {
|
|
@@ -19912,9 +19924,9 @@ function gl(t, n, i) {
|
|
|
19912
19924
|
return r.addGeometry(s), r;
|
|
19913
19925
|
}
|
|
19914
19926
|
|
|
19915
|
-
class
|
|
19927
|
+
class _l extends kt {
|
|
19916
19928
|
static fromJSON(e) {
|
|
19917
|
-
return
|
|
19929
|
+
return xl(e, "PointLayer", _l);
|
|
19918
19930
|
}
|
|
19919
19931
|
constructor(...e) {
|
|
19920
19932
|
super(...e), this.options.sceneConfig || (this.options.sceneConfig = K({}, _e));
|
|
@@ -19927,7 +19939,7 @@ class ml extends kt {
|
|
|
19927
19939
|
}
|
|
19928
19940
|
}
|
|
19929
19941
|
|
|
19930
|
-
|
|
19942
|
+
_l.mergeOptions({
|
|
19931
19943
|
glyphSdfLimitPerFrame: 15,
|
|
19932
19944
|
iconErrorUrl: null,
|
|
19933
19945
|
workarounds: {
|
|
@@ -19935,9 +19947,9 @@ ml.mergeOptions({
|
|
|
19935
19947
|
},
|
|
19936
19948
|
collision: !1,
|
|
19937
19949
|
collisionFrameLimit: 1
|
|
19938
|
-
}),
|
|
19950
|
+
}), _l.registerJSONType("PointLayer"), _l.registerRenderer("canvas", null);
|
|
19939
19951
|
|
|
19940
|
-
class
|
|
19952
|
+
class vl extends ll {
|
|
19941
19953
|
constructor(...t) {
|
|
19942
19954
|
super(...t), this.GeometryTypes = [ e.Marker, e.MultiPoint ];
|
|
19943
19955
|
}
|
|
@@ -19948,30 +19960,30 @@ class yl extends ol {
|
|
|
19948
19960
|
}
|
|
19949
19961
|
}
|
|
19950
19962
|
|
|
19951
|
-
|
|
19963
|
+
_l.registerRenderer("gl", vl), _l.registerRenderer("gpu", vl);
|
|
19952
19964
|
|
|
19953
|
-
const {LinePack:
|
|
19965
|
+
const {LinePack: Al} = j();
|
|
19954
19966
|
|
|
19955
|
-
class
|
|
19967
|
+
class Tl extends kt {
|
|
19956
19968
|
static fromJSON(e) {
|
|
19957
|
-
return
|
|
19969
|
+
return xl(e, "LineStringLayer", Tl);
|
|
19958
19970
|
}
|
|
19959
19971
|
}
|
|
19960
19972
|
|
|
19961
|
-
|
|
19973
|
+
Tl.mergeOptions({
|
|
19962
19974
|
meshRenderOrder: 1
|
|
19963
|
-
}),
|
|
19975
|
+
}), Tl.registerJSONType("LineStringLayer");
|
|
19964
19976
|
|
|
19965
|
-
const
|
|
19977
|
+
const Sl = (hi + "").trim();
|
|
19966
19978
|
|
|
19967
|
-
class
|
|
19979
|
+
class bl extends ll {
|
|
19968
19980
|
constructor(...t) {
|
|
19969
19981
|
super(...t), this.GeometryTypes = [ e.LineString, e.MultiLineString ];
|
|
19970
19982
|
}
|
|
19971
19983
|
createPainter() {
|
|
19972
19984
|
const e = kt.get3DPainterClass("line-gradient");
|
|
19973
19985
|
this.painterSymbol = K({}, {
|
|
19974
|
-
lineGradientProperty:
|
|
19986
|
+
lineGradientProperty: Sl
|
|
19975
19987
|
}, li), this._defineSymbolBloom(this.painterSymbol, e.getBloomSymbol(), "enableLineBloom");
|
|
19976
19988
|
const t = K({}, this.layer.options.sceneConfig || {});
|
|
19977
19989
|
void 0 === t.depthMask && (t.depthMask = !0);
|
|
@@ -19979,10 +19991,10 @@ class Al extends ol {
|
|
|
19979
19991
|
}
|
|
19980
19992
|
buildMesh() {
|
|
19981
19993
|
let {features: e, center: t} = this._getFeaturesToRender();
|
|
19982
|
-
if (e = e.filter((e => !!e.properties[
|
|
19994
|
+
if (e = e.filter((e => !!e.properties[Sl])), !e.length) return;
|
|
19983
19995
|
const n = this._showHideUpdated;
|
|
19984
19996
|
this._meshCenter = t;
|
|
19985
|
-
const i = K({}, this.painterSymbol), r = this.createMesh(this.painter,
|
|
19997
|
+
const i = K({}, this.painterSymbol), r = this.createMesh(this.painter, Al, i, e, null, t);
|
|
19986
19998
|
this._isCreatingMesh = !0, r.then((e => {
|
|
19987
19999
|
this.meshes && this.painter.deleteMesh(this.meshes);
|
|
19988
20000
|
const t = [], i = e && e.meshes;
|
|
@@ -19995,19 +20007,19 @@ class Al extends ol {
|
|
|
19995
20007
|
}
|
|
19996
20008
|
}
|
|
19997
20009
|
|
|
19998
|
-
|
|
20010
|
+
Tl.registerRenderer("gl", bl), Tl.registerRenderer("gpu", bl), Tl.registerRenderer("canvas", null);
|
|
19999
20011
|
|
|
20000
|
-
const {PolygonPack:
|
|
20012
|
+
const {PolygonPack: Pl} = j();
|
|
20001
20013
|
|
|
20002
|
-
class
|
|
20014
|
+
class wl extends kt {
|
|
20003
20015
|
static fromJSON(e) {
|
|
20004
|
-
return
|
|
20016
|
+
return xl(e, "PolygonLayer", wl);
|
|
20005
20017
|
}
|
|
20006
20018
|
}
|
|
20007
20019
|
|
|
20008
|
-
|
|
20020
|
+
wl.registerJSONType("PolygonLayer");
|
|
20009
20021
|
|
|
20010
|
-
const
|
|
20022
|
+
const Ml = {
|
|
20011
20023
|
polygonFill: {
|
|
20012
20024
|
type: "identity",
|
|
20013
20025
|
default: [ 1, 1, 1, 1 ],
|
|
@@ -20060,7 +20072,7 @@ const bl = {
|
|
|
20060
20072
|
}
|
|
20061
20073
|
};
|
|
20062
20074
|
|
|
20063
|
-
class
|
|
20075
|
+
class Il extends ll {
|
|
20064
20076
|
constructor() {
|
|
20065
20077
|
super(...arguments), this.GeometryTypes = [ e.Polygon, e.MultiPolygon ];
|
|
20066
20078
|
}
|
|
@@ -20072,7 +20084,7 @@ class Pl extends ol {
|
|
|
20072
20084
|
if (!t.length) return;
|
|
20073
20085
|
const i = this._showHideUpdated;
|
|
20074
20086
|
this._meshCenter = n;
|
|
20075
|
-
const r = this._groupPolygonFeatures(t), o = K({},
|
|
20087
|
+
const r = this._groupPolygonFeatures(t), o = K({}, Ml), s = r.map(((t, i) => this.createMesh(this.painter, Pl, o, t, e && e[i], n)));
|
|
20076
20088
|
this._isCreatingMesh = !0, Promise.all(s).then((e => {
|
|
20077
20089
|
this.meshes && this.painter.deleteMesh(this.meshes), e = function(e) {
|
|
20078
20090
|
const t = [];
|
|
@@ -20108,16 +20120,16 @@ class Pl extends ol {
|
|
|
20108
20120
|
return [ t, n ];
|
|
20109
20121
|
}
|
|
20110
20122
|
createPainter() {
|
|
20111
|
-
const e = kt.get3DPainterClass("fill"), t = this.painterSymbol = K({},
|
|
20123
|
+
const e = kt.get3DPainterClass("fill"), t = this.painterSymbol = K({}, Ml);
|
|
20112
20124
|
this._defineSymbolBloom(t, e.getBloomSymbol(), "enablePolygonBloom");
|
|
20113
20125
|
return new e(this.regl || this.device, this.layer, t, this.layer.options.sceneConfig, 0);
|
|
20114
20126
|
}
|
|
20115
20127
|
updateMesh(e) {
|
|
20116
|
-
return this._updateMesh(e, this.meshes, this.atlas, this._meshCenter, this.painter,
|
|
20128
|
+
return this._updateMesh(e, this.meshes, this.atlas, this._meshCenter, this.painter, Pl, Ml, this._groupPolygonFeatures);
|
|
20117
20129
|
}
|
|
20118
20130
|
}
|
|
20119
20131
|
|
|
20120
|
-
function
|
|
20132
|
+
function Cl(e, t, n, i, r, o, s) {
|
|
20121
20133
|
const a = n && Array.isArray(n[0]);
|
|
20122
20134
|
for (let o = 0, l = n.length; o < l; o++) {
|
|
20123
20135
|
e[t] = (a ? n[o][0] : n[o].x) * i, e[t + 1] = (a ? n[o][1] : n[o].y) * i, s !== Float32Array && (e[t] = Math.round(e[t]),
|
|
@@ -20128,25 +20140,25 @@ function wl(e, t, n, i, r, o, s) {
|
|
|
20128
20140
|
return e.trySetLength && e.trySetLength(t), t;
|
|
20129
20141
|
}
|
|
20130
20142
|
|
|
20131
|
-
function
|
|
20143
|
+
function Ol(e, t, n, i) {
|
|
20132
20144
|
const r = e[3 * t], o = e[3 * t + 1], s = e[3 * n], a = e[3 * n + 1];
|
|
20133
20145
|
return r === s && (r < 0 || r > i) || o === a && (o < 0 || o > i);
|
|
20134
20146
|
}
|
|
20135
20147
|
|
|
20136
|
-
|
|
20148
|
+
wl.registerRenderer("gl", Il), wl.registerRenderer("gpu", Il), wl.registerRenderer("canvas", null);
|
|
20137
20149
|
|
|
20138
|
-
const
|
|
20150
|
+
const kl = Math.PI / 180, Rl = 6378137 * Math.PI / 180, Fl = 85.0511287798;
|
|
20139
20151
|
|
|
20140
|
-
function
|
|
20152
|
+
function El(e, t, n) {
|
|
20141
20153
|
return function(e, t) {
|
|
20142
|
-
const n =
|
|
20154
|
+
const n = Fl, i = t[0], r = Math.max(Math.min(n, t[1]), -n);
|
|
20143
20155
|
let o;
|
|
20144
|
-
o = 0 === r ? 0 : Math.log(Math.tan((90 + r) *
|
|
20145
|
-
return e[0] = i *
|
|
20156
|
+
o = 0 === r ? 0 : Math.log(Math.tan((90 + r) * kl / 2)) / kl;
|
|
20157
|
+
return e[0] = i * Rl, e[1] = o * Rl, e;
|
|
20146
20158
|
}(e, t);
|
|
20147
20159
|
}
|
|
20148
20160
|
|
|
20149
|
-
function
|
|
20161
|
+
function Hl(e, t, n, i, r, o, s, a, l, h, c, u, f, d, p) {
|
|
20150
20162
|
0 === e ? function(e, t, n, i, r, o, s, a, l, h) {
|
|
20151
20163
|
const c = 1 / (100 * o[0]), u = 1 / (100 * o[1]), f = h && h[0] || 0, d = h && h[1] || 0, p = [ 0, 0 ];
|
|
20152
20164
|
for (let r = e; r < t; r += 3) {
|
|
@@ -20161,27 +20173,27 @@ function Rl(e, t, n, i, r, o, s, a, l, h, c, u, f, d, p) {
|
|
|
20161
20173
|
const g = E.distance(u, f), m = E.distance(f, d), y = [], x = [], _ = [];
|
|
20162
20174
|
for (let e = t; e < n; e += 3) {
|
|
20163
20175
|
const t = e / 3 * 2, n = (o.x / l + r[e] / s) * a, d = o.y / l * a + (c ? r[e + 1] : -r[e + 1]) / s * a;
|
|
20164
|
-
E.set(y, n, d), "EPSG:4326" !== h && "EPSG:4490" !== h ||
|
|
20165
|
-
|
|
20176
|
+
E.set(y, n, d), "EPSG:4326" !== h && "EPSG:4490" !== h || El(y, y), Dl(x, y, u, f),
|
|
20177
|
+
Dl(_, y, p, u), i[t] = E.distance(u, x) / g, i[t + 1] = E.distance(u, _) / m;
|
|
20166
20178
|
}
|
|
20167
20179
|
}(c, t, n, i, r, o, a, u, f, d, !!p);
|
|
20168
20180
|
}
|
|
20169
20181
|
|
|
20170
|
-
function
|
|
20182
|
+
function Dl(e, t, n, i) {
|
|
20171
20183
|
const r = n[0] - i[0], o = n[1] - i[1];
|
|
20172
20184
|
let s = (t[0] - n[0]) * (n[0] - i[0]) + (t[1] - n[1]) * (n[1] - i[1]);
|
|
20173
20185
|
return s /= r * r + o * o, e[0] = n[0] + s * r, e[1] = n[1] + s * o, e;
|
|
20174
20186
|
}
|
|
20175
20187
|
|
|
20176
|
-
function
|
|
20188
|
+
function Ll(e, t, n, i, r) {
|
|
20177
20189
|
const o = 3 * t[n - 1], s = 3 * t[n - 1] + 1, a = e[o], l = e[s];
|
|
20178
20190
|
return h = i, c = r, u = a, f = l, Math.sqrt((u - h) * (u - h) + (f - c) * (f - c));
|
|
20179
20191
|
var h, c, u, f;
|
|
20180
20192
|
}
|
|
20181
20193
|
|
|
20182
|
-
const {PackUtil:
|
|
20194
|
+
const {PackUtil: Nl, ArrayPool: zl} = j();
|
|
20183
20195
|
|
|
20184
|
-
function
|
|
20196
|
+
function Vl(e, t, n, i, r, o, s, a, l, h, c, u, f, d, p, g, m) {
|
|
20185
20197
|
const y = t.getLength(), x = r / 3;
|
|
20186
20198
|
for (let n = 2, i = y; n < i; n += 3) e[r + n - 2] = t[n - 2], e[r + n - 1] = t[n - 1],
|
|
20187
20199
|
e[r + n - 0] = t[n] - s;
|
|
@@ -20192,15 +20204,15 @@ function Ll(e, t, n, i, r, o, s, a, l, h, c, u, f, d, p, g, m) {
|
|
|
20192
20204
|
e.copyWithin(r, r - 2 * y, r - y), r += y, (n = n || []).push(y / 3);
|
|
20193
20205
|
const _ = n.getLength();
|
|
20194
20206
|
for (let t = 0; t < _; t++) {
|
|
20195
|
-
|
|
20207
|
+
Ul(x + (n[t - 1] || 0), x + n[t], e, y / 3, l, i, h, c, u, f, o, d, p, g, m);
|
|
20196
20208
|
}
|
|
20197
20209
|
return r;
|
|
20198
20210
|
}
|
|
20199
20211
|
|
|
20200
|
-
function
|
|
20212
|
+
function Ul(e, t, n, i, r, o, s, a, l, h, c, u, f, d, p) {
|
|
20201
20213
|
const g = o.getLength();
|
|
20202
20214
|
let m, y;
|
|
20203
|
-
for (let s = e, a = t; s < a - 1; s++) if (m = s, y = s + 1, r === 1 / 0 || !
|
|
20215
|
+
for (let s = e, a = t; s < a - 1; s++) if (m = s, y = s + 1, r === 1 / 0 || !Ol(n, m, y, r)) if ((s - e) % 2 == 1 && (m += 2 * i,
|
|
20204
20216
|
y += 2 * i), p) {
|
|
20205
20217
|
let e = o.currentIndex;
|
|
20206
20218
|
o[e++] = m + i, o[e++] = y, o[e++] = m, o[e++] = y + i, o[e++] = y, o[e++] = m + i,
|
|
@@ -20219,7 +20231,7 @@ function Nl(e, t, n, i, r, o, s, a, l, h, c, u, f, d, p) {
|
|
|
20219
20231
|
f = d - p);
|
|
20220
20232
|
let S = g;
|
|
20221
20233
|
const b = u % 6;
|
|
20222
|
-
0 === e ? (5 === b && (m =
|
|
20234
|
+
0 === e ? (5 === b && (m = Ll(r, o, u, v, A)), S = b === y[0] || b === y[1] || b === y[2] ? g : g + m) : 1 === e && (b === y[0] || b === y[1] || b === y[2] ? S = 0 : 5 === b ? (m = Ll(r, o, u, v, A),
|
|
20223
20235
|
S = m) : S = m);
|
|
20224
20236
|
const P = S / h * (1 / (100 * c)) / a;
|
|
20225
20237
|
let w;
|
|
@@ -20229,7 +20241,7 @@ function Nl(e, t, n, i, r, o, s, a, l, h, c, u, f, d, p) {
|
|
|
20229
20241
|
}(a, l, h, c, n, o, g, u[0], u[1], f, d, p);
|
|
20230
20242
|
}
|
|
20231
20243
|
|
|
20232
|
-
function
|
|
20244
|
+
function Gl(e) {
|
|
20233
20245
|
const t = [ e[0] ];
|
|
20234
20246
|
let n = e[0];
|
|
20235
20247
|
for (let i = 1; i < e.length; i++) Array.isArray(e[i]) ? e[i][0] === n[0] && e[i][1] === n[1] && e[i][2] === n[2] || t.push(e[i]) : e[i].x === n.x && e[i].y === n.y && e[i].z === n.z || t.push(e[i]),
|
|
@@ -20237,10 +20249,10 @@ function zl(e) {
|
|
|
20237
20249
|
return t;
|
|
20238
20250
|
}
|
|
20239
20251
|
|
|
20240
|
-
const {StyleUtil:
|
|
20252
|
+
const {StyleUtil: Bl, PackUtil: Wl, ArrayPool: jl} = j(), Xl = jl.getInstance();
|
|
20241
20253
|
|
|
20242
|
-
function
|
|
20243
|
-
void 0 === t.top && (t.top = !0), void 0 === t.side && (t.side = !0),
|
|
20254
|
+
function $l(e, t, n, i, r, o, s, a, l, h, c, u, f, d, p, g) {
|
|
20255
|
+
void 0 === t.top && (t.top = !0), void 0 === t.side && (t.side = !0), Xl.reset();
|
|
20244
20256
|
const {altitudeScale: m, altitudeProperty: y, defaultAltitude: x, heightProperty: _, minHeightProperty: v, defaultHeight: A, tangent: T, uv: S, topUVMode: b, sideUVMode: P, sideVerticalUVMode: w, top: O, side: k, textureYOrigin: R, topThickness: F} = t, E = !!g, U = function(e, t, {altitudeScale: n, altitudeProperty: i, defaultAltitude: r, heightProperty: o, minHeightProperty: s, defaultHeight: a}, {center: l, side: h, top: c, topThickness: u, uvOrigin: f, uv: d, uvSize: p, topUVMode: g, sideUVMode: m, sideVerticalUVMode: y, textureYOrigin: x, tileRatio: _, centimeterToPoint: v, verticalCentimeterToPoint: A, positionType: T, res: S, glScale: b, projectionCode: P}, w, M) {
|
|
20245
20257
|
let I = t / e[0].extent;
|
|
20246
20258
|
t === 1 / 0 && (I = 1);
|
|
@@ -20260,12 +20272,12 @@ function Wl(e, t, n, i, r, o, s, a, l, h, c, u, f, d, p, g) {
|
|
|
20260
20272
|
}
|
|
20261
20273
|
c = h.length, d = H.currentIndex;
|
|
20262
20274
|
for (let e = 0; e < c; e++) H[d++] = h[e];
|
|
20263
|
-
H.currentIndex = d, N &&
|
|
20264
|
-
u > 0 && !V && (n =
|
|
20275
|
+
H.currentIndex = d, N && Hl(g || 0, e, n, U, E, f, v, _, p[0], p[1], o, S, b, P, l),
|
|
20276
|
+
u > 0 && !V && (n = Vl(E, F, i, H, n, U, 0, u, t, N, m || 0, y || 0, x, p, _, A, r < 0 ? !s : s)),
|
|
20265
20277
|
D.setLength(n / 3), D.fill(1, a / 3, n / 3);
|
|
20266
20278
|
}
|
|
20267
20279
|
if (V) {
|
|
20268
|
-
z && (u = 0), a = n, n =
|
|
20280
|
+
z && (u = 0), a = n, n = Vl(E, F, i, H, n, U, u, r, t, N, m || 0, y || 0, x, p, _, A, r < 0 ? !s : s),
|
|
20269
20281
|
D.setLength(n / 3);
|
|
20270
20282
|
const e = F.getLength() / 3;
|
|
20271
20283
|
D.fill(1, a / 3, a / 3 + e), D.fill(0, a / 3 + e, a / 3 + 2 * e), D.fill(1, a / 3 + 2 * e, a / 3 + 3 * e),
|
|
@@ -20277,27 +20289,27 @@ function Wl(e, t, n, i, r, o, s, a, l, h, c, u, f, d, p, g) {
|
|
|
20277
20289
|
const X = [ -1, -1, t + 1, t + 1 ];
|
|
20278
20290
|
let $ = 0, Y = e.length;
|
|
20279
20291
|
Q(w) && ($ = w, Y = w + 1);
|
|
20280
|
-
let
|
|
20292
|
+
let q = 0, Z = !1;
|
|
20281
20293
|
const K = M.getProxy();
|
|
20282
20294
|
let J, ee = !1;
|
|
20283
20295
|
for (;$ < Y; $++) {
|
|
20284
20296
|
const l = e[$], h = l.id;
|
|
20285
|
-
Q(h) && (Math.abs(h) >
|
|
20297
|
+
Q(h) && (Math.abs(h) > q && (q = Math.abs(h)), h < 0 && (Z = !0));
|
|
20286
20298
|
const c = l.geometry, u = l.properties[Ce];
|
|
20287
20299
|
let f = Array.isArray(u && u[0] && u[0][0]) ? u[0] : u;
|
|
20288
|
-
const {altitude: d, height: p} =
|
|
20300
|
+
const {altitude: d, height: p} = Nl.getFeaAltitudeAndHeight(l, n, i, r, o, a, s);
|
|
20289
20301
|
p < 0 ? (ee = !0, W = Math.min(d, W), B = Math.max(d - p, B)) : (B = Math.max(d, B),
|
|
20290
20302
|
W = Math.min(d - p, W));
|
|
20291
20303
|
const g = E.getLength();
|
|
20292
20304
|
let m = 0, y = j;
|
|
20293
20305
|
K.setLength(0), F.setLength(0);
|
|
20294
|
-
const x =
|
|
20306
|
+
const x = Nl.calculateSignedArea(c[0]) < 0;
|
|
20295
20307
|
for (let e = 0, n = c.length; e < n; e++) {
|
|
20296
20308
|
let i = c[e];
|
|
20297
|
-
x && (i = i.reverse()), i =
|
|
20298
|
-
const r =
|
|
20309
|
+
x && (i = i.reverse()), i = Gl(i);
|
|
20310
|
+
const r = Nl.calculateSignedArea(i) < 0;
|
|
20299
20311
|
if (!r && e > 0 && (m++, f = u && u[m], j = G(y, j, K, p * I, f, C), F.setLength(0),
|
|
20300
|
-
K.setLength(0), y = j), t !== 1 / 0 && (i =
|
|
20312
|
+
K.setLength(0), y = j), t !== 1 / 0 && (i = Nl.clipPolygon(i, X)), !i.length) {
|
|
20301
20313
|
e === n - 1 && (j = G(y, j, K, p * I, f, C));
|
|
20302
20314
|
continue;
|
|
20303
20315
|
}
|
|
@@ -20307,7 +20319,7 @@ function Wl(e, t, n, i, r, o, s, a, l, h, c, u, f, d, p, g) {
|
|
|
20307
20319
|
let e = K.currentIndex;
|
|
20308
20320
|
K[e++] = F.getLength() / 3, K.currentIndex = e;
|
|
20309
20321
|
}
|
|
20310
|
-
|
|
20322
|
+
Cl(F, F.getLength(), i, I, d, 0, T), e === n - 1 && (j = G(y, j, K, p * I, f, C));
|
|
20311
20323
|
}
|
|
20312
20324
|
const _ = E.getLength() - g, v = (we + "").trim();
|
|
20313
20325
|
for (let e = 0; e < _ / 3; e++) {
|
|
@@ -20316,7 +20328,7 @@ function Wl(e, t, n, i, r, o, s, a, l, h, c, u, f, d, p, g) {
|
|
|
20316
20328
|
O.currentIndex = e, Q(h) && (e = R.currentIndex, R[e++] = h, R.currentIndex = e);
|
|
20317
20329
|
}
|
|
20318
20330
|
}
|
|
20319
|
-
J = l ? Float32Array :
|
|
20331
|
+
J = l ? Float32Array : Nl.getUnsignedArrayType(k.getLength() ? k[k.getLength() - 1] : 0);
|
|
20320
20332
|
const te = {
|
|
20321
20333
|
hasNegativeHeight: ee,
|
|
20322
20334
|
maxAltitude: B === -1 / 0 ? 0 : B,
|
|
@@ -20324,12 +20336,12 @@ function Wl(e, t, n, i, r, o, s, a, l, h, c, u, f, d, p, g) {
|
|
|
20324
20336
|
vertices: E,
|
|
20325
20337
|
verticeTypes: D,
|
|
20326
20338
|
indices: H,
|
|
20327
|
-
pickingIds:
|
|
20339
|
+
pickingIds: zl.createTypedArray(k, J),
|
|
20328
20340
|
featureIndexes: O
|
|
20329
20341
|
};
|
|
20330
20342
|
if (R.getLength()) {
|
|
20331
|
-
const e =
|
|
20332
|
-
te.featureIds =
|
|
20343
|
+
const e = Z ? Nl.getPosArrayType(q) : Nl.getUnsignedArrayType(q);
|
|
20344
|
+
te.featureIds = zl.createTypedArray(R, e);
|
|
20333
20345
|
} else te.featureIds = [];
|
|
20334
20346
|
return U && (U.setLength(E.getLength() / 3 * 2), te.uvs = U), te;
|
|
20335
20347
|
}(e, n, {
|
|
@@ -20358,22 +20370,22 @@ function Wl(e, t, n, i, r, o, s, a, l, h, c, u, f, d, p, g) {
|
|
|
20358
20370
|
res: o,
|
|
20359
20371
|
glScale: s,
|
|
20360
20372
|
projectionCode: f
|
|
20361
|
-
}, d,
|
|
20373
|
+
}, d, Xl), G = [], B = U.vertices.getLength() / 3, W = Wl.getIndexArrayType(B), j = jl.createTypedArray(U.indices, W);
|
|
20362
20374
|
delete U.indices, G.push(j.buffer, U.pickingIds.buffer);
|
|
20363
|
-
const X = Math.max(Math.abs(U.maxAltitude), Math.abs(U.minAltitude)), $ = p ||
|
|
20364
|
-
U.vertices =
|
|
20365
|
-
const Y = T ?
|
|
20375
|
+
const X = Math.max(Math.abs(U.maxAltitude), Math.abs(U.minAltitude)), $ = p || Wl.getPosArrayType(Math.max(512, X));
|
|
20376
|
+
U.vertices = jl.createTypedArray(U.vertices, $);
|
|
20377
|
+
const Y = T ? Xl.getProxy() : new Float32Array(3 * B);
|
|
20366
20378
|
Y.setLength && Y.setLength(3 * B);
|
|
20367
|
-
const
|
|
20368
|
-
let
|
|
20369
|
-
const K =
|
|
20379
|
+
const q = N(U.vertices, j, Y);
|
|
20380
|
+
let Z = !0;
|
|
20381
|
+
const K = q.getLength ? q.getLength() : q.length;
|
|
20370
20382
|
for (let e = 0; e < K; e++) {
|
|
20371
|
-
E || (
|
|
20372
|
-
const t =
|
|
20373
|
-
1 - Math.abs(t) > 1e-6 ?
|
|
20383
|
+
E || (q[e] = -q[e]);
|
|
20384
|
+
const t = q[e] % 1;
|
|
20385
|
+
1 - Math.abs(t) > 1e-6 ? Z = !1 : 0 !== t && (q[e] = Math.round(q[e]));
|
|
20374
20386
|
}
|
|
20375
|
-
if (U.normals =
|
|
20376
|
-
let e =
|
|
20387
|
+
if (U.normals = q, T) {
|
|
20388
|
+
let e = Xl.get();
|
|
20377
20389
|
e.setLength(4 * B), e = z(U.vertices, U.normals, U.uvs, j, e), e = function(e, t) {
|
|
20378
20390
|
const n = t.getLength(), i = new Float32Array(n), r = [], o = [], s = [];
|
|
20379
20391
|
for (let a = 0; a < n; a += 4) {
|
|
@@ -20384,10 +20396,10 @@ function Wl(e, t, n, i, r, o, s, a, l, h, c, u, f, d, p, g) {
|
|
|
20384
20396
|
return i;
|
|
20385
20397
|
}(U.normals, e), U.tangents = e, G.push(e.buffer), delete U.normals;
|
|
20386
20398
|
}
|
|
20387
|
-
if (U.normals && (
|
|
20399
|
+
if (U.normals && (Z && (U.normals = jl.createTypedArray(U.normals, Int8Array)),
|
|
20388
20400
|
G.push(U.normals.buffer)), U.uvs) {
|
|
20389
20401
|
const e = U.uvs;
|
|
20390
|
-
U.uvs =
|
|
20402
|
+
U.uvs = jl.createTypedArray(e, Float32Array), G.push(U.uvs.buffer);
|
|
20391
20403
|
}
|
|
20392
20404
|
if (g) {
|
|
20393
20405
|
const e = U.vertices, t = e.length;
|
|
@@ -20404,8 +20416,8 @@ function Wl(e, t, n, i, r, o, s, a, l, h, c, u, f, d, p, g) {
|
|
|
20404
20416
|
s.$layer = o.layer, s.$type = o.type;
|
|
20405
20417
|
let h = a(n, s);
|
|
20406
20418
|
M(h) && (r.aColor = 1, a = C(h), h = a(n, s)), delete s.$layer, delete s.$type,
|
|
20407
|
-
|
|
20408
|
-
l[4 * t + 3] =
|
|
20419
|
+
Bl.normalizeColor(Yl, h), l[4 * t] = Yl[0], l[4 * t + 1] = Yl[1], l[4 * t + 2] = Yl[2],
|
|
20420
|
+
l[4 * t + 3] = Yl[3];
|
|
20409
20421
|
}
|
|
20410
20422
|
o.aColor = l;
|
|
20411
20423
|
}
|
|
@@ -20441,10 +20453,10 @@ function Wl(e, t, n, i, r, o, s, a, l, h, c, u, f, d, p, g) {
|
|
|
20441
20453
|
const m = n[t[i]], y = m.properties || {};
|
|
20442
20454
|
y.$layer = m.layer, y.$type = m.type;
|
|
20443
20455
|
let x = h ? c : u, _ = x(r, y);
|
|
20444
|
-
M(_) && (x = C(_), _ = x(r, y)), delete y.$layer, delete y.$type,
|
|
20445
|
-
D.divide(
|
|
20446
|
-
let v =
|
|
20447
|
-
v < 0 && (v = o.length, o.push(D.copy([],
|
|
20456
|
+
M(_) && (x = C(_), _ = x(r, y)), delete y.$layer, delete y.$type, Bl.normalizeColor(Yl, _),
|
|
20457
|
+
D.divide(Yl, Yl, l);
|
|
20458
|
+
let v = ql(o, Yl);
|
|
20459
|
+
v < 0 && (v = o.length, o.push(D.copy([], Yl))), e[i] = v, h ? (f = t[i], p = v) : (d = t[i],
|
|
20448
20460
|
g = v);
|
|
20449
20461
|
}
|
|
20450
20462
|
}
|
|
@@ -20452,7 +20464,7 @@ function Wl(e, t, n, i, r, o, s, a, l, h, c, u, f, d, p, g) {
|
|
|
20452
20464
|
}(U.verticeTypes, U.featureIndexes, e, c, u), te = {
|
|
20453
20465
|
data: {
|
|
20454
20466
|
data: {
|
|
20455
|
-
aVertexColorType: ee.length <= 252 ?
|
|
20467
|
+
aVertexColorType: ee.length <= 252 ? jl.createTypedArray(U.verticeTypes, Uint8Array) : jl.createTypedArray(U.verticeTypes, Uint16Array),
|
|
20456
20468
|
aPosition: U.vertices,
|
|
20457
20469
|
aNormal: U.normals,
|
|
20458
20470
|
aTexCoord0: U.uvs,
|
|
@@ -20473,21 +20485,21 @@ function Wl(e, t, n, i, r, o, s, a, l, h, c, u, f, d, p, g) {
|
|
|
20473
20485
|
return U.featureIds.length ? (te.data.featureIds = U.featureIds, G.push(te.data.featureIds.buffer)) : te.data.featureIds = [],
|
|
20474
20486
|
J.aColor && (te.data.data.aColor = J.aColor, te.buffers.push(J.aColor.buffer)),
|
|
20475
20487
|
J.aOpacity && (te.data.data.aOpacity = J.aOpacity, te.buffers.push(J.aOpacity.buffer)),
|
|
20476
|
-
te.buffers.push(te.data.data.aPosition.buffer), te.data.pickingIdIndiceMap =
|
|
20488
|
+
te.buffers.push(te.data.data.aPosition.buffer), te.data.pickingIdIndiceMap = Wl.generatePickingIndiceIndex(te.data.data.aPickingId, te.data.indices),
|
|
20477
20489
|
te;
|
|
20478
20490
|
}
|
|
20479
20491
|
|
|
20480
|
-
const
|
|
20492
|
+
const Yl = [];
|
|
20481
20493
|
|
|
20482
|
-
function
|
|
20494
|
+
function ql(e, t) {
|
|
20483
20495
|
for (let n = 0; n < e.length; n++) if (D.exactEquals(t, e[n])) return n;
|
|
20484
20496
|
return -1;
|
|
20485
20497
|
}
|
|
20486
20498
|
|
|
20487
20499
|
j();
|
|
20488
20500
|
|
|
20489
|
-
class
|
|
20490
|
-
constructor(e = [], t =
|
|
20501
|
+
class Zl {
|
|
20502
|
+
constructor(e = [], t = Kl) {
|
|
20491
20503
|
if (this.data = e, this.length = this.data.length, this.compare = t, this.length > 0) for (let e = (this.length >> 1) - 1; e >= 0; e--) this._down(e);
|
|
20492
20504
|
}
|
|
20493
20505
|
push(e) {
|
|
@@ -20522,13 +20534,13 @@ class $l {
|
|
|
20522
20534
|
}
|
|
20523
20535
|
}
|
|
20524
20536
|
|
|
20525
|
-
function
|
|
20537
|
+
function Kl(e, t) {
|
|
20526
20538
|
return e < t ? -1 : e > t ? 1 : 0;
|
|
20527
20539
|
}
|
|
20528
20540
|
|
|
20529
|
-
var
|
|
20541
|
+
var Jl = {
|
|
20530
20542
|
exports: {}
|
|
20531
|
-
},
|
|
20543
|
+
}, Ql = function(e, t, n, i) {
|
|
20532
20544
|
var r = e[0], o = e[1], s = !1;
|
|
20533
20545
|
void 0 === n && (n = 0), void 0 === i && (i = t.length);
|
|
20534
20546
|
for (var a = (i - n) / 2, l = 0, h = a - 1; l < a; h = l++) {
|
|
@@ -20536,7 +20548,7 @@ var Zl = {
|
|
|
20536
20548
|
u > o != d > o && r < (f - c) * (o - u) / (d - u) + c && (s = !s);
|
|
20537
20549
|
}
|
|
20538
20550
|
return s;
|
|
20539
|
-
},
|
|
20551
|
+
}, eh = function(e, t, n, i) {
|
|
20540
20552
|
var r = e[0], o = e[1], s = !1;
|
|
20541
20553
|
void 0 === n && (n = 0), void 0 === i && (i = t.length);
|
|
20542
20554
|
for (var a = i - n, l = 0, h = a - 1; l < a; h = l++) {
|
|
@@ -20546,17 +20558,17 @@ var Zl = {
|
|
|
20546
20558
|
return s;
|
|
20547
20559
|
};
|
|
20548
20560
|
|
|
20549
|
-
|
|
20550
|
-
return t.length > 0 && Array.isArray(t[0]) ?
|
|
20561
|
+
Jl.exports = function(e, t, n, i) {
|
|
20562
|
+
return t.length > 0 && Array.isArray(t[0]) ? eh(e, t, n, i) : Ql(e, t, n, i);
|
|
20551
20563
|
};
|
|
20552
20564
|
|
|
20553
|
-
var
|
|
20565
|
+
var th = Jl.exports.nested = eh;
|
|
20554
20566
|
|
|
20555
|
-
|
|
20567
|
+
Jl.exports.flat = Ql;
|
|
20556
20568
|
|
|
20557
|
-
const
|
|
20569
|
+
const nh = 11102230246251565e-32, ih = 134217729, rh = (3 + 8 * nh) * nh;
|
|
20558
20570
|
|
|
20559
|
-
function
|
|
20571
|
+
function oh(e, t, n, i, r) {
|
|
20560
20572
|
let o, s, a, l, h = t[0], c = i[0], u = 0, f = 0;
|
|
20561
20573
|
c > h == c > -h ? (o = h, h = t[++u]) : (o = c, c = i[++f]);
|
|
20562
20574
|
let d = 0;
|
|
@@ -20571,60 +20583,60 @@ function nh(e, t, n, i, r) {
|
|
|
20571
20583
|
return 0 === o && 0 !== d || (r[d++] = o), d;
|
|
20572
20584
|
}
|
|
20573
20585
|
|
|
20574
|
-
function
|
|
20586
|
+
function sh(e) {
|
|
20575
20587
|
return new Float64Array(e);
|
|
20576
20588
|
}
|
|
20577
20589
|
|
|
20578
|
-
const
|
|
20590
|
+
const ah = 33306690738754716e-32, lh = 22204460492503146e-32, hh = 11093356479670487e-47, ch = sh(4), uh = sh(8), fh = sh(12), dh = sh(16), ph = sh(4);
|
|
20579
20591
|
|
|
20580
|
-
function
|
|
20592
|
+
function gh(e, t, n, i, r, o) {
|
|
20581
20593
|
const s = (t - o) * (n - r), a = (e - r) * (i - o), l = s - a;
|
|
20582
20594
|
if (0 === s || 0 === a || s > 0 != a > 0) return l;
|
|
20583
20595
|
const h = Math.abs(s + a);
|
|
20584
|
-
return Math.abs(l) >=
|
|
20596
|
+
return Math.abs(l) >= ah * h ? l : -function(e, t, n, i, r, o, s) {
|
|
20585
20597
|
let a, l, h, c, u, f, d, p, g, m, y, x, _, v, A, T, S, b;
|
|
20586
20598
|
const P = e - r, w = n - r, M = t - o, I = i - o;
|
|
20587
|
-
v = P * I, f =
|
|
20588
|
-
m = I - g, A = p * m - (v - d * g - p * g - d * m), T = M * w, f =
|
|
20589
|
-
p = M - d, f =
|
|
20590
|
-
y = A - S, u = A - y,
|
|
20591
|
-
y = _ - T, u = _ - y,
|
|
20592
|
-
|
|
20599
|
+
v = P * I, f = ih * P, d = f - (f - P), p = P - d, f = ih * I, g = f - (f - I),
|
|
20600
|
+
m = I - g, A = p * m - (v - d * g - p * g - d * m), T = M * w, f = ih * M, d = f - (f - M),
|
|
20601
|
+
p = M - d, f = ih * w, g = f - (f - w), m = w - g, S = p * m - (T - d * g - p * g - d * m),
|
|
20602
|
+
y = A - S, u = A - y, ch[0] = A - (y + u) + (u - S), x = v + y, u = x - v, _ = v - (x - u) + (y - u),
|
|
20603
|
+
y = _ - T, u = _ - y, ch[1] = _ - (y + u) + (u - T), b = x + y, u = b - x, ch[2] = x - (b - u) + (y - u),
|
|
20604
|
+
ch[3] = b;
|
|
20593
20605
|
let C = function(e, t) {
|
|
20594
20606
|
let n = t[0];
|
|
20595
20607
|
for (let i = 1; i < e; i++) n += t[i];
|
|
20596
20608
|
return n;
|
|
20597
|
-
}(4,
|
|
20609
|
+
}(4, ch), O = lh * s;
|
|
20598
20610
|
if (C >= O || -C >= O) return C;
|
|
20599
20611
|
if (u = e - P, a = e - (P + u) + (u - r), u = n - w, h = n - (w + u) + (u - r),
|
|
20600
20612
|
u = t - M, l = t - (M + u) + (u - o), u = i - I, c = i - (I + u) + (u - o), 0 === a && 0 === l && 0 === h && 0 === c) return C;
|
|
20601
|
-
if (O =
|
|
20602
|
-
v = a * I, f =
|
|
20603
|
-
m = I - g, A = p * m - (v - d * g - p * g - d * m), T = l * w, f =
|
|
20604
|
-
p = l - d, f =
|
|
20605
|
-
y = A - S, u = A - y,
|
|
20606
|
-
y = _ - T, u = _ - y,
|
|
20607
|
-
|
|
20608
|
-
const k =
|
|
20609
|
-
v = P * c, f =
|
|
20610
|
-
m = c - g, A = p * m - (v - d * g - p * g - d * m), T = M * h, f =
|
|
20611
|
-
p = M - d, f =
|
|
20612
|
-
y = A - S, u = A - y,
|
|
20613
|
-
y = _ - T, u = _ - y,
|
|
20614
|
-
|
|
20615
|
-
const R =
|
|
20616
|
-
v = a * c, f =
|
|
20617
|
-
m = c - g, A = p * m - (v - d * g - p * g - d * m), T = l * h, f =
|
|
20618
|
-
p = l - d, f =
|
|
20619
|
-
y = A - S, u = A - y,
|
|
20620
|
-
y = _ - T, u = _ - y,
|
|
20621
|
-
|
|
20622
|
-
const F =
|
|
20623
|
-
return
|
|
20613
|
+
if (O = hh * s + rh * Math.abs(C), C += P * c + I * a - (M * h + w * l), C >= O || -C >= O) return C;
|
|
20614
|
+
v = a * I, f = ih * a, d = f - (f - a), p = a - d, f = ih * I, g = f - (f - I),
|
|
20615
|
+
m = I - g, A = p * m - (v - d * g - p * g - d * m), T = l * w, f = ih * l, d = f - (f - l),
|
|
20616
|
+
p = l - d, f = ih * w, g = f - (f - w), m = w - g, S = p * m - (T - d * g - p * g - d * m),
|
|
20617
|
+
y = A - S, u = A - y, ph[0] = A - (y + u) + (u - S), x = v + y, u = x - v, _ = v - (x - u) + (y - u),
|
|
20618
|
+
y = _ - T, u = _ - y, ph[1] = _ - (y + u) + (u - T), b = x + y, u = b - x, ph[2] = x - (b - u) + (y - u),
|
|
20619
|
+
ph[3] = b;
|
|
20620
|
+
const k = oh(4, ch, 4, ph, uh);
|
|
20621
|
+
v = P * c, f = ih * P, d = f - (f - P), p = P - d, f = ih * c, g = f - (f - c),
|
|
20622
|
+
m = c - g, A = p * m - (v - d * g - p * g - d * m), T = M * h, f = ih * M, d = f - (f - M),
|
|
20623
|
+
p = M - d, f = ih * h, g = f - (f - h), m = h - g, S = p * m - (T - d * g - p * g - d * m),
|
|
20624
|
+
y = A - S, u = A - y, ph[0] = A - (y + u) + (u - S), x = v + y, u = x - v, _ = v - (x - u) + (y - u),
|
|
20625
|
+
y = _ - T, u = _ - y, ph[1] = _ - (y + u) + (u - T), b = x + y, u = b - x, ph[2] = x - (b - u) + (y - u),
|
|
20626
|
+
ph[3] = b;
|
|
20627
|
+
const R = oh(k, uh, 4, ph, fh);
|
|
20628
|
+
v = a * c, f = ih * a, d = f - (f - a), p = a - d, f = ih * c, g = f - (f - c),
|
|
20629
|
+
m = c - g, A = p * m - (v - d * g - p * g - d * m), T = l * h, f = ih * l, d = f - (f - l),
|
|
20630
|
+
p = l - d, f = ih * h, g = f - (f - h), m = h - g, S = p * m - (T - d * g - p * g - d * m),
|
|
20631
|
+
y = A - S, u = A - y, ph[0] = A - (y + u) + (u - S), x = v + y, u = x - v, _ = v - (x - u) + (y - u),
|
|
20632
|
+
y = _ - T, u = _ - y, ph[1] = _ - (y + u) + (u - T), b = x + y, u = b - x, ph[2] = x - (b - u) + (y - u),
|
|
20633
|
+
ph[3] = b;
|
|
20634
|
+
const F = oh(R, fh, 4, ph, dh);
|
|
20635
|
+
return dh[F - 1];
|
|
20624
20636
|
}(e, t, n, i, r, o, h);
|
|
20625
20637
|
}
|
|
20626
20638
|
|
|
20627
|
-
function
|
|
20639
|
+
function mh(e, t, n) {
|
|
20628
20640
|
t = Math.max(0, void 0 === t ? 2 : t), n = n || 0;
|
|
20629
20641
|
var i = function(e) {
|
|
20630
20642
|
for (var t = e[0], n = e[0], i = e[0], r = e[0], o = 0; o < e.length; o++) {
|
|
@@ -20632,15 +20644,15 @@ function dh(e, t, n) {
|
|
|
20632
20644
|
s[0] < t[0] && (t = s), s[0] > i[0] && (i = s), s[1] < n[1] && (n = s), s[1] > r[1] && (r = s);
|
|
20633
20645
|
}
|
|
20634
20646
|
var a = [ t, n, i, r ], l = a.slice();
|
|
20635
|
-
for (o = 0; o < e.length; o++)
|
|
20647
|
+
for (o = 0; o < e.length; o++) th(e[o], a) || l.push(e[o]);
|
|
20636
20648
|
return function(e) {
|
|
20637
|
-
e.sort(
|
|
20649
|
+
e.sort(Ih);
|
|
20638
20650
|
for (var t = [], n = 0; n < e.length; n++) {
|
|
20639
|
-
for (;t.length >= 2 &&
|
|
20651
|
+
for (;t.length >= 2 && Th(t[t.length - 2], t[t.length - 1], e[n]) <= 0; ) t.pop();
|
|
20640
20652
|
t.push(e[n]);
|
|
20641
20653
|
}
|
|
20642
20654
|
for (var i = [], r = e.length - 1; r >= 0; r--) {
|
|
20643
|
-
for (;i.length >= 2 &&
|
|
20655
|
+
for (;i.length >= 2 && Th(i[i.length - 2], i[i.length - 1], e[r]) <= 0; ) i.pop();
|
|
20644
20656
|
i.push(e[r]);
|
|
20645
20657
|
}
|
|
20646
20658
|
return i.pop(), t.pop(), t.concat(i);
|
|
@@ -20660,16 +20672,16 @@ function dh(e, t, n) {
|
|
|
20660
20672
|
}, r.load(e);
|
|
20661
20673
|
for (var o, s = [], a = 0; a < i.length; a++) {
|
|
20662
20674
|
var l = i[a];
|
|
20663
|
-
r.remove(l), o =
|
|
20675
|
+
r.remove(l), o = bh(l, o), s.push(o);
|
|
20664
20676
|
}
|
|
20665
20677
|
var h = new U(16);
|
|
20666
|
-
for (a = 0; a < s.length; a++) h.insert(
|
|
20678
|
+
for (a = 0; a < s.length; a++) h.insert(Sh(s[a]));
|
|
20667
20679
|
for (var c = t * t, u = n * n; s.length; ) {
|
|
20668
|
-
var f = s.shift(), d = f.p, p = f.next.p, g =
|
|
20680
|
+
var f = s.shift(), d = f.p, p = f.next.p, g = Ph(d, p);
|
|
20669
20681
|
if (!(g < u)) {
|
|
20670
20682
|
var m = g / c;
|
|
20671
|
-
(l =
|
|
20672
|
-
s.push(
|
|
20683
|
+
(l = yh(r, f.prev.p, d, p, f.next.next.p, m, h)) && Math.min(Ph(l, d), Ph(l, p)) <= m && (s.push(f),
|
|
20684
|
+
s.push(bh(l, f)), r.remove(l), h.remove(f), h.insert(Sh(f)), h.insert(Sh(f.next)));
|
|
20673
20685
|
}
|
|
20674
20686
|
}
|
|
20675
20687
|
f = o;
|
|
@@ -20680,65 +20692,65 @@ function dh(e, t, n) {
|
|
|
20680
20692
|
return y.push(f.p), y;
|
|
20681
20693
|
}
|
|
20682
20694
|
|
|
20683
|
-
function
|
|
20684
|
-
for (var a = new
|
|
20695
|
+
function yh(e, t, n, i, r, o, s) {
|
|
20696
|
+
for (var a = new Zl([], xh), l = e.data; l; ) {
|
|
20685
20697
|
for (var h = 0; h < l.children.length; h++) {
|
|
20686
|
-
var c = l.children[h], u = l.leaf ?
|
|
20698
|
+
var c = l.children[h], u = l.leaf ? wh(c, n, i) : _h(n, i, c);
|
|
20687
20699
|
u > o || a.push({
|
|
20688
20700
|
node: c,
|
|
20689
20701
|
dist: u
|
|
20690
20702
|
});
|
|
20691
20703
|
}
|
|
20692
20704
|
for (;a.length && !a.peek().node.children; ) {
|
|
20693
|
-
var f = a.pop(), d = f.node, p =
|
|
20694
|
-
if (f.dist < p && f.dist < g &&
|
|
20705
|
+
var f = a.pop(), d = f.node, p = wh(d, t, n), g = wh(d, i, r);
|
|
20706
|
+
if (f.dist < p && f.dist < g && Ah(n, d, s) && Ah(i, d, s)) return d;
|
|
20695
20707
|
}
|
|
20696
20708
|
(l = a.pop()) && (l = l.node);
|
|
20697
20709
|
}
|
|
20698
20710
|
return null;
|
|
20699
20711
|
}
|
|
20700
20712
|
|
|
20701
|
-
function
|
|
20713
|
+
function xh(e, t) {
|
|
20702
20714
|
return e.dist - t.dist;
|
|
20703
20715
|
}
|
|
20704
20716
|
|
|
20705
|
-
function
|
|
20706
|
-
if (
|
|
20707
|
-
var i =
|
|
20717
|
+
function _h(e, t, n) {
|
|
20718
|
+
if (vh(e, n) || vh(t, n)) return 0;
|
|
20719
|
+
var i = Mh(e[0], e[1], t[0], t[1], n.minX, n.minY, n.maxX, n.minY);
|
|
20708
20720
|
if (0 === i) return 0;
|
|
20709
|
-
var r =
|
|
20721
|
+
var r = Mh(e[0], e[1], t[0], t[1], n.minX, n.minY, n.minX, n.maxY);
|
|
20710
20722
|
if (0 === r) return 0;
|
|
20711
|
-
var o =
|
|
20723
|
+
var o = Mh(e[0], e[1], t[0], t[1], n.maxX, n.minY, n.maxX, n.maxY);
|
|
20712
20724
|
if (0 === o) return 0;
|
|
20713
|
-
var s =
|
|
20725
|
+
var s = Mh(e[0], e[1], t[0], t[1], n.minX, n.maxY, n.maxX, n.maxY);
|
|
20714
20726
|
return 0 === s ? 0 : Math.min(i, r, o, s);
|
|
20715
20727
|
}
|
|
20716
20728
|
|
|
20717
|
-
function
|
|
20729
|
+
function vh(e, t) {
|
|
20718
20730
|
return e[0] >= t.minX && e[0] <= t.maxX && e[1] >= t.minY && e[1] <= t.maxY;
|
|
20719
20731
|
}
|
|
20720
20732
|
|
|
20721
|
-
function
|
|
20733
|
+
function Ah(e, t, n) {
|
|
20722
20734
|
for (var i, r, o, s, a = Math.min(e[0], t[0]), l = Math.min(e[1], t[1]), h = Math.max(e[0], t[0]), c = Math.max(e[1], t[1]), u = n.search({
|
|
20723
20735
|
minX: a,
|
|
20724
20736
|
minY: l,
|
|
20725
20737
|
maxX: h,
|
|
20726
20738
|
maxY: c
|
|
20727
|
-
}), f = 0; f < u.length; f++) if (i = u[f].p, r = u[f].next.p, o = e, i !== (s = t) && r !== o &&
|
|
20739
|
+
}), f = 0; f < u.length; f++) if (i = u[f].p, r = u[f].next.p, o = e, i !== (s = t) && r !== o && Th(i, r, o) > 0 != Th(i, r, s) > 0 && Th(o, s, i) > 0 != Th(o, s, r) > 0) return !1;
|
|
20728
20740
|
return !0;
|
|
20729
20741
|
}
|
|
20730
20742
|
|
|
20731
|
-
function
|
|
20732
|
-
return
|
|
20743
|
+
function Th(e, t, n) {
|
|
20744
|
+
return gh(e[0], e[1], t[0], t[1], n[0], n[1]);
|
|
20733
20745
|
}
|
|
20734
20746
|
|
|
20735
|
-
function
|
|
20747
|
+
function Sh(e) {
|
|
20736
20748
|
var t = e.p, n = e.next.p;
|
|
20737
20749
|
return e.minX = Math.min(t[0], n[0]), e.minY = Math.min(t[1], n[1]), e.maxX = Math.max(t[0], n[0]),
|
|
20738
20750
|
e.maxY = Math.max(t[1], n[1]), e;
|
|
20739
20751
|
}
|
|
20740
20752
|
|
|
20741
|
-
function
|
|
20753
|
+
function bh(e, t) {
|
|
20742
20754
|
var n = {
|
|
20743
20755
|
p: e,
|
|
20744
20756
|
prev: null,
|
|
@@ -20752,12 +20764,12 @@ function Ah(e, t) {
|
|
|
20752
20764
|
n.next = n), n;
|
|
20753
20765
|
}
|
|
20754
20766
|
|
|
20755
|
-
function
|
|
20767
|
+
function Ph(e, t) {
|
|
20756
20768
|
var n = e[0] - t[0], i = e[1] - t[1];
|
|
20757
20769
|
return n * n + i * i;
|
|
20758
20770
|
}
|
|
20759
20771
|
|
|
20760
|
-
function
|
|
20772
|
+
function wh(e, t, n) {
|
|
20761
20773
|
var i = t[0], r = t[1], o = n[0] - i, s = n[1] - r;
|
|
20762
20774
|
if (0 !== o || 0 !== s) {
|
|
20763
20775
|
var a = ((e[0] - i) * o + (e[1] - r) * s) / (o * o + s * s);
|
|
@@ -20766,7 +20778,7 @@ function Sh(e, t, n) {
|
|
|
20766
20778
|
return (o = e[0] - i) * o + (s = e[1] - r) * s;
|
|
20767
20779
|
}
|
|
20768
20780
|
|
|
20769
|
-
function
|
|
20781
|
+
function Mh(e, t, n, i, r, o, s, a) {
|
|
20770
20782
|
var l, h, c, u, f = n - e, d = i - t, p = s - r, g = a - o, m = e - r, y = t - o, x = f * f + d * d, _ = f * p + d * g, v = p * p + g * g, A = f * m + d * y, T = p * m + g * y, S = x * v - _ * _, b = S, P = S;
|
|
20771
20783
|
0 === S ? (h = 0, b = 1, u = T, P = v) : (u = x * T - _ * A, (h = _ * T - v * A) < 0 ? (h = 0,
|
|
20772
20784
|
u = T, P = v) : h > b && (h = b, u = T + _, P = v)), u < 0 ? (u = 0, -A < 0 ? h = 0 : -A > x ? h = b : (h = -A,
|
|
@@ -20776,18 +20788,18 @@ function bh(e, t, n, i, r, o, s, a) {
|
|
|
20776
20788
|
return w * w + M * M;
|
|
20777
20789
|
}
|
|
20778
20790
|
|
|
20779
|
-
function
|
|
20791
|
+
function Ih(e, t) {
|
|
20780
20792
|
return e[0] === t[0] ? e[1] - t[1] : e[0] - t[0];
|
|
20781
20793
|
}
|
|
20782
20794
|
|
|
20783
|
-
const {PackUtil:
|
|
20795
|
+
const {PackUtil: Ch} = j();
|
|
20784
20796
|
|
|
20785
|
-
class
|
|
20797
|
+
class Oh {
|
|
20786
20798
|
constructor(e, t) {
|
|
20787
20799
|
this.x = e, this.y = t;
|
|
20788
20800
|
}
|
|
20789
20801
|
clone() {
|
|
20790
|
-
return new
|
|
20802
|
+
return new Oh(this.x, this.y);
|
|
20791
20803
|
}
|
|
20792
20804
|
normalize() {
|
|
20793
20805
|
const e = this.length();
|
|
@@ -20800,7 +20812,7 @@ class Mh {
|
|
|
20800
20812
|
return Math.sqrt(this.x * this.x + this.y * this.y);
|
|
20801
20813
|
}
|
|
20802
20814
|
diff(e) {
|
|
20803
|
-
return new
|
|
20815
|
+
return new Oh(this.x - e.x, this.y - e.y);
|
|
20804
20816
|
}
|
|
20805
20817
|
distance(e) {
|
|
20806
20818
|
const t = this.x - e.x, n = this.y - e.y;
|
|
@@ -20813,51 +20825,51 @@ class Mh {
|
|
|
20813
20825
|
return this.x === e.x && this.y === e.y;
|
|
20814
20826
|
}
|
|
20815
20827
|
orthogonal() {
|
|
20816
|
-
return new
|
|
20828
|
+
return new Oh(this.y, -this.x);
|
|
20817
20829
|
}
|
|
20818
20830
|
}
|
|
20819
20831
|
|
|
20820
|
-
function
|
|
20832
|
+
function kh(e, t, n, i) {
|
|
20821
20833
|
const r = t.x * i.y - t.y * i.x, o = n.x - e.x, s = n.y - e.y, a = (o * i.y - s * i.x) / r;
|
|
20822
|
-
return new
|
|
20834
|
+
return new Oh(e.x + a * t.x, e.y + a * t.y);
|
|
20823
20835
|
}
|
|
20824
20836
|
|
|
20825
|
-
const
|
|
20837
|
+
const Rh = [], Fh = [];
|
|
20826
20838
|
|
|
20827
|
-
function
|
|
20839
|
+
function Eh(e) {
|
|
20828
20840
|
if (Q(e[0] && e[0].x)) {
|
|
20829
20841
|
const t = [];
|
|
20830
20842
|
let n = 0;
|
|
20831
|
-
for (let i = 0; i < e.length; i++)
|
|
20832
|
-
t.push(
|
|
20843
|
+
for (let i = 0; i < e.length; i++) Fh[n] ? (Fh[n][0] = e[i].x, Fh[n][1] = e[i].y) : Fh[n] = [ e[i].x, e[i].y ],
|
|
20844
|
+
t.push(Fh[n]), n++;
|
|
20833
20845
|
e = t;
|
|
20834
20846
|
}
|
|
20835
20847
|
try {
|
|
20836
|
-
const t =
|
|
20848
|
+
const t = mh(e, 1 / 0);
|
|
20837
20849
|
let n = [ 1 / 0, 1 / 0 ], i = [ -1 / 0, -1 / 0 ];
|
|
20838
20850
|
for (let e = 0; e < t.length; e++) t[e][0] < n[0] && (n[0] = t[e][0]), t[e][0] > i[0] && (i[0] = t[e][0]),
|
|
20839
20851
|
t[e][1] < n[1] && (n[1] = t[e][1]), t[e][1] > i[1] && (i[1] = t[e][1]);
|
|
20840
20852
|
const r = [];
|
|
20841
20853
|
let o = [], s = 0;
|
|
20842
|
-
for (let e = 0; e < t.length; e++) e === t.length - 1 && t[e][0] === t[0][0] && t[e][1] === t[0][1] || (
|
|
20843
|
-
|
|
20854
|
+
for (let e = 0; e < t.length; e++) e === t.length - 1 && t[e][0] === t[0][0] && t[e][1] === t[0][1] || (El(r, t[e]),
|
|
20855
|
+
Rh[s] ? (Rh[s].x = r[0], Rh[s].y = r[1]) : Rh[s] = new Oh(r[0], r[1]), o.push(Rh[s]),
|
|
20844
20856
|
s++);
|
|
20845
|
-
|
|
20857
|
+
Ch.calculateSignedArea(o) < 0 && (o = o.reverse());
|
|
20846
20858
|
const a = function(e) {
|
|
20847
20859
|
let t, n = Number.MAX_VALUE;
|
|
20848
20860
|
const i = function(e, i, r, o, s, a, l, h) {
|
|
20849
|
-
var c =
|
|
20861
|
+
var c = kh(e, i, s, a), u = kh(r, o, s, a), f = kh(l, h, e, i), d = kh(l, h, r, o), p = c.distance(u) * c.distance(f);
|
|
20850
20862
|
0 !== p && p < n && (t = [ c, f, d, u ], n = p);
|
|
20851
20863
|
};
|
|
20852
20864
|
var r = [];
|
|
20853
20865
|
for (let t = 0; t < e.length; t++) r.push(e[(t + 1) % e.length].diff(e[t])), r[t].normalize();
|
|
20854
|
-
var o, s, a, l, h = new
|
|
20866
|
+
var o, s, a, l, h = new Oh(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY), c = new Oh(Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY);
|
|
20855
20867
|
for (let t = 0; t < e.length; t++) {
|
|
20856
20868
|
var u = e[t];
|
|
20857
20869
|
u.x < h.x && (h.x = u.x, o = t), u.x > c.x && (c.x = u.x, s = t), u.y < h.y && (h.y = u.y,
|
|
20858
20870
|
l = t), u.y > c.y && (c.y = u.y, a = t);
|
|
20859
20871
|
}
|
|
20860
|
-
var f = new
|
|
20872
|
+
var f = new Oh(0, -1), d = new Oh(0, 1), p = new Oh(-1, 0), g = new Oh(1, 0);
|
|
20861
20873
|
for (let t = 0; t < e.length; t++) {
|
|
20862
20874
|
var m = [ Math.acos(f.dot(r[o])), Math.acos(d.dot(r[s])), Math.acos(p.dot(r[a])), Math.acos(g.dot(r[l])) ];
|
|
20863
20875
|
switch (m.indexOf(Math.min.apply(Math, m))) {
|
|
@@ -20892,11 +20904,11 @@ function kh(e) {
|
|
|
20892
20904
|
}
|
|
20893
20905
|
}
|
|
20894
20906
|
|
|
20895
|
-
const
|
|
20907
|
+
const Hh = [], {DEFAULT_TEX_WIDTH: Dh} = j();
|
|
20896
20908
|
|
|
20897
|
-
class
|
|
20909
|
+
class Lh extends kt {
|
|
20898
20910
|
static fromJSON(e) {
|
|
20899
|
-
return
|
|
20911
|
+
return xl(e, "ExtrudePolygonLayer", Lh);
|
|
20900
20912
|
}
|
|
20901
20913
|
getPolygonOffsetCount() {
|
|
20902
20914
|
return 0;
|
|
@@ -20929,12 +20941,12 @@ class Eh extends kt {
|
|
|
20929
20941
|
}
|
|
20930
20942
|
}
|
|
20931
20943
|
|
|
20932
|
-
|
|
20944
|
+
Lh.registerJSONType("ExtrudePolygonLayer"), Lh.mergeOptions({
|
|
20933
20945
|
cullFace: !1,
|
|
20934
20946
|
castShadow: !0
|
|
20935
20947
|
});
|
|
20936
20948
|
|
|
20937
|
-
const
|
|
20949
|
+
const Nh = {
|
|
20938
20950
|
polygonFill: {
|
|
20939
20951
|
type: "identity",
|
|
20940
20952
|
default: [ 1, 1, 1, 1 ],
|
|
@@ -20955,13 +20967,13 @@ const Hh = {
|
|
|
20955
20967
|
default: [ 1, 1, 1, 1 ],
|
|
20956
20968
|
property: "_symbol_bottomPolygonFill"
|
|
20957
20969
|
}
|
|
20958
|
-
},
|
|
20970
|
+
}, zh = {
|
|
20959
20971
|
altitudeProperty: "height",
|
|
20960
20972
|
minHeightProperty: "min_height",
|
|
20961
20973
|
defaultAltitude: 20
|
|
20962
|
-
},
|
|
20974
|
+
}, Vh = e => 1 === e.properties.top;
|
|
20963
20975
|
|
|
20964
|
-
class
|
|
20976
|
+
class Uh extends Il {
|
|
20965
20977
|
constructor(...e) {
|
|
20966
20978
|
super(...e), this.GeometryTypes = [ o, s ];
|
|
20967
20979
|
}
|
|
@@ -20998,8 +21010,8 @@ class Nh extends Pl {
|
|
|
20998
21010
|
}
|
|
20999
21011
|
createPainter() {
|
|
21000
21012
|
const e = kt.get3DPainterClass("lit");
|
|
21001
|
-
this.painterSymbol = K({},
|
|
21002
|
-
const t = this.layer, n = K({},
|
|
21013
|
+
this.painterSymbol = K({}, Nh), this.sidePainterSymbol = K({}, Nh), this._defineSymbolBloom(this.painterSymbol, e.getBloomSymbol(), "enablePolygonBloom");
|
|
21014
|
+
const t = this.layer, n = K({}, zh, t.options.dataConfig || {});
|
|
21003
21015
|
t.options.material && (this.painterSymbol.material = t.options.material), t.options.sideMaterial ? this.sidePainterSymbol.material = t.options.sideMaterial : this.sidePainterSymbol.material = t.options.material;
|
|
21004
21016
|
const i = {
|
|
21005
21017
|
cullFace: t.options.cullFace
|
|
@@ -21024,9 +21036,9 @@ class Nh extends Pl {
|
|
|
21024
21036
|
}
|
|
21025
21037
|
_renderMeshes(...e) {
|
|
21026
21038
|
const t = e[0], n = t.sceneFilter;
|
|
21027
|
-
t.sceneFilter = e => (!n || n(e)) &&
|
|
21039
|
+
t.sceneFilter = e => (!n || n(e)) && Vh(e);
|
|
21028
21040
|
const i = super._renderMeshes(...e);
|
|
21029
|
-
t.sceneFilter = e => (!n || n(e)) &&
|
|
21041
|
+
t.sceneFilter = e => (!n || n(e)) && Vh(e);
|
|
21030
21042
|
const r = this.painter;
|
|
21031
21043
|
this.painter = this.sidePainter;
|
|
21032
21044
|
const o = t.sceneFilter = e => (!n || n(e)) && (e => 1 === e.properties.side)(e);
|
|
@@ -21051,12 +21063,12 @@ class Nh extends Pl {
|
|
|
21051
21063
|
}
|
|
21052
21064
|
_createPackData(e, t, n, o) {
|
|
21053
21065
|
const s = this.getMap();
|
|
21054
|
-
t =
|
|
21055
|
-
const l = this._extrudeCenter, h = 1 / 0, c = i[s.id], u = c ? c.zoom : s.getZoom(), f = new a(0, 0), d = new r(0, 0), p = K({},
|
|
21066
|
+
t = Nh;
|
|
21067
|
+
const l = this._extrudeCenter, h = 1 / 0, c = i[s.id], u = c ? c.zoom : s.getZoom(), f = new a(0, 0), d = new r(0, 0), p = K({}, zh, this.layer.options.dataConfig);
|
|
21056
21068
|
if (p.uv = !0, p.top && (p.top = n), p.side && (p.side = o), !1 === p.top && !1 === p.side) return null;
|
|
21057
21069
|
if (!e.length) return null;
|
|
21058
|
-
const g = s.getGLRes(), m = s.getProjection().code, y = n ? this.painterSymbol && this.painterSymbol.material : this.sidePainterSymbol && this.sidePainterSymbol.material, x = y && y.textureWidth ||
|
|
21059
|
-
return
|
|
21070
|
+
const g = s.getGLRes(), m = s.getProjection().code, y = n ? this.painterSymbol && this.painterSymbol.material : this.sidePainterSymbol && this.sidePainterSymbol.material, x = y && y.textureWidth || Dh, _ = [ et(s, 1, d, g) / 100, et(s, 1, d, g, 1) / 100 ];
|
|
21071
|
+
return $l(e, p, h, f, x, s.getGLRes(), 1, 1, _, this._zScale, t, u, m, undefined, Float32Array, l);
|
|
21060
21072
|
}
|
|
21061
21073
|
updateMesh(e) {
|
|
21062
21074
|
const t = e[fi];
|
|
@@ -21075,14 +21087,14 @@ class Nh extends Pl {
|
|
|
21075
21087
|
const n = [];
|
|
21076
21088
|
for (let e = 0; e < t.length; e++) {
|
|
21077
21089
|
const i = t[e] && t[e][0];
|
|
21078
|
-
n[e] =
|
|
21090
|
+
n[e] = Eh(i);
|
|
21079
21091
|
}
|
|
21080
21092
|
e.getProperties()[Ce] = n;
|
|
21081
21093
|
} else {
|
|
21082
21094
|
(function(e) {
|
|
21083
21095
|
return !!e && (e instanceof l || e instanceof h || e instanceof c || e instanceof u);
|
|
21084
|
-
})(e) && (
|
|
21085
|
-
const n =
|
|
21096
|
+
})(e) && (Hh[0] = e.getShell(), t = Hh);
|
|
21097
|
+
const n = Eh(t[0]);
|
|
21086
21098
|
e.getProperties()[Ce] = n;
|
|
21087
21099
|
}
|
|
21088
21100
|
}
|
|
@@ -21103,18 +21115,18 @@ class Nh extends Pl {
|
|
|
21103
21115
|
}
|
|
21104
21116
|
}
|
|
21105
21117
|
|
|
21106
|
-
|
|
21107
|
-
e.DrawToolLayer.setLayerClass(
|
|
21118
|
+
Lh.registerRenderer("gl", Uh), Lh.registerRenderer("gpu", Uh), Lh.registerRenderer("canvas", null),
|
|
21119
|
+
e.DrawToolLayer.setLayerClass(_l, Tl, wl);
|
|
21108
21120
|
|
|
21109
|
-
const {PackUtil:
|
|
21121
|
+
const {PackUtil: Gh, FilterUtil: Bh, SYMBOLS_NEED_REBUILD_IN_VT: Wh, SYMBOLS_NEED_REBUILD_IN_VECTOR: jh} = j();
|
|
21110
21122
|
|
|
21111
21123
|
d.ShaderLib.register("vt_position_vert", "#ifdef HAS_TERRAIN_ALTITUDE\n attribute float aTerrainAltitude;\n#endif\nuniform float minAltitude;\nvec3 unpackVTPosition(vec2 aPosition, float aAltitude) {\n float altitude = aAltitude;\n #ifdef HAS_TERRAIN_ALTITUDE\n altitude += aTerrainAltitude * 100.0;\n #endif\n altitude += minAltitude * 100.0;\n return vec3(aPosition, altitude);\n}\n#ifdef HAS_ALTITUDE\n vec3 unpackVTPosition(vec3 offset) {\n return unpackVTPosition(aPosition + offset.xy, aAltitude + offset.z);\n }\n vec3 unpackVTPosition() {\n return unpackVTPosition(aPosition, aAltitude);\n }\n#else\n float position_modValue = 16384.0;\n float position_delta = 0.00001;\n vec3 unpackVTPosition(vec3 offset) {\n float z = aPosition.z;\n vec2 pos = sign(aPosition.xy + position_delta) * mod(abs(aPosition.xy), position_modValue);\n vec2 highs = floor(abs(aPosition.xy) / position_modValue);\n float altitude = sign(z + position_delta) * (highs.x * 2.0 + highs.y) * pow(2.0, 15.0) + z;\n return unpackVTPosition(pos + offset.xy, altitude + offset.z);\n }\n vec3 unpackVTPosition() {\n return unpackVTPosition(vec3(0.0));\n }\n#endif"),
|
|
21112
|
-
d.ShaderLib.register("text_render_frag", "#define
|
|
21124
|
+
d.ShaderLib.register("text_render_frag", "#define SDF_PX 8.0\n#define DEVICE_PIXEL_RATIO 1.0\n#define EDGE_GAMMA 0.105 / DEVICE_PIXEL_RATIO\nuniform sampler2D glyphTex;\nuniform float textOpacity;\nuniform highp float gammaScale;\nuniform float isHalo;\nuniform highp float textHaloBlur;\n#if defined(HAS_TEXT_HALO_OPACITY) || defined(HAS_TEXT_HALO_RADIUS)\n varying vec2 vTextHalo;\n#endif\n#ifndef HAS_TEXT_HALO_OPACITY\n uniform float textHaloOpacity;\n#endif\n#ifndef HAS_TEXT_HALO_RADIUS\n uniform highp float textHaloRadius;\n#endif\nvarying float vTextSize;\nvarying float vGammaScale;\n#ifdef HAS_TEXT_FILL\n varying vec4 vTextFill;\n#else\n uniform vec4 textFill;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\n varying vec4 vTextHaloFill;\n#else\n uniform vec4 textHaloFill;\n#endif\nvec4 renderText(vec2 texCoord) {\n #ifdef HAS_TEXT_FILL\n vec4 myTextFill = vTextFill;\n #else\n vec4 myTextFill = textFill;\n #endif\n float fontScale = vTextSize / 24.0;\n vec4 color = myTextFill;\n highp float gamma = EDGE_GAMMA / (fontScale * gammaScale);\n lowp float buff = 185.0 / 256.0; bool isHaloText;\n #ifdef HAS_HALO_ATTR\n isHaloText = vHalo > 0.5;\n #else\n isHaloText = isHalo == 1.0;\n #endif\n if (isHaloText) {\n #ifdef HAS_TEXT_HALO_FILL\n vec4 haloFill = vTextHaloFill;\n #else\n vec4 haloFill = textHaloFill;\n #endif\n #ifdef HAS_TEXT_HALO_RADIUS\n float haloRadius = vTextHalo.x;\n #else\n float haloRadius = textHaloRadius;\n #endif\n if (haloRadius == 0.0) {\n discard;\n }\n color = haloFill;\n gamma = (textHaloBlur * 1.19 / SDF_PX + EDGE_GAMMA) / (fontScale * gammaScale);\n buff = (6.0 - haloRadius / fontScale) / SDF_PX;\n #ifdef HAS_TEXT_HALO_OPACITY\n float haloOpacity = vTextHalo.y / 255.0;\n #else\n float haloOpacity = textHaloOpacity;\n #endif\n color *= haloOpacity * 1.25;\n }\n float dist = texture2D(glyphTex, texCoord).a;\n highp float gammaScaled = gamma * vGammaScale * 0.7;\n float alpha = clamp(smoothstep(buff - gammaScaled, buff + gammaScaled, dist), 0.0, 1.0);\n return color * (alpha * textOpacity);\n}"),
|
|
21113
21125
|
d.WgslShaderLib.register("vt_position", X), d.WgslShaderLib.register("text_render", $);
|
|
21114
21126
|
|
|
21115
21127
|
f.mat4.create();
|
|
21116
21128
|
|
|
21117
|
-
const
|
|
21129
|
+
const Xh = function(e, t) {
|
|
21118
21130
|
const n = e.toString(), i = n.indexOf("{") + 1, r = n.substring(0, i);
|
|
21119
21131
|
let o = `${r}\n (` + t.toString() + ")({});\n";
|
|
21120
21132
|
return o += "\n" + n.substring(r.length), o;
|
|
@@ -21123,14 +21135,14 @@ const Bh = function(e, t) {
|
|
|
21123
21135
|
if (f.transcoders) {
|
|
21124
21136
|
const t = e.Map.VERSION;
|
|
21125
21137
|
if (t.indexOf("1.0.0-beta") >= 0 || t.indexOf("1.0.0-alpha") >= 0) {
|
|
21126
|
-
const t = f.transcoders.inject(
|
|
21138
|
+
const t = f.transcoders.inject(Xh);
|
|
21127
21139
|
e.registerWorkerAdapter("@maptalks/vt", t);
|
|
21128
21140
|
} else e.registerWorkerAdapter("@maptalks/vt", (function() {
|
|
21129
|
-
return f.transcoders.inject(
|
|
21141
|
+
return f.transcoders.inject(Xh);
|
|
21130
21142
|
}));
|
|
21131
|
-
} else e.registerWorkerAdapter("@maptalks/vt",
|
|
21143
|
+
} else e.registerWorkerAdapter("@maptalks/vt", Xh);
|
|
21132
21144
|
|
|
21133
|
-
export {
|
|
21145
|
+
export { Ta as BillBoardPainter, Va as BillBoardPlugin, Lh as ExtrudePolygonLayer, ei as FillPainter, wa as FillPlugin, Bh as FilterUtil, Da as GLTFPhongPlugin, La as GLTFStandardPlugin, Wa as GeoJSONVectorTileLayer, Na as HeatmapPlugin, to as IconPainter, Ca as IconPlugin, Ia as LineGradientPlugin, oi as LinePainter, Ma as LinePlugin, Tl as LineStringLayer, Ea as LitPlugin, Ga as MapboxVectorTileLayer, ss as NativeLinePainter, ka as NativeLinePlugin, ns as NativePointPainter, Gh as PackUtil, Ts as PhongPainter, Ra as PhongPlugin, _l as PointLayer, vl as PointLayerRenderer, wl as PolygonLayer, jh as SYMBOLS_NEED_REBUILD_IN_VECTOR, Wh as SYMBOLS_NEED_REBUILD_IN_VT, Pa as TerrainFlatMaskPainter, Ua as TerrainFlatMaskPlugin, Zo as TextPainter, Oa as TextPlugin, Ha as TubePlugin, kt as Vector3DLayer, St as VectorTileLayer, ct as VectorTileLayerRenderer, za as WaterPlugin, bs as WireframePainter, Fa as WireframePlugin, j as getVectorPacker };
|
|
21134
21146
|
|
|
21135
|
-
"undefined" != typeof console && console.log("@maptalks/vt v0.
|
|
21147
|
+
"undefined" != typeof console && console.log("@maptalks/vt v0.120.0");
|
|
21136
21148
|
//# sourceMappingURL=maptalks.vt.es.js.map
|