@maptalks/vt 0.105.1 → 0.105.3
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 +1 -1
- package/dist/maptalks.vt.es.js +215 -205
- package/dist/maptalks.vt.es.js.map +1 -1
- package/dist/maptalks.vt.js +287 -277
- package/dist/maptalks.vt.js.map +1 -1
- package/package.json +3 -3
package/dist/maptalks.vt.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @maptalks/vt v0.105.
|
|
2
|
+
* @maptalks/vt v0.105.3
|
|
3
3
|
* LICENSE : undefined
|
|
4
4
|
* (c) 2016-2025 maptalks.org
|
|
5
5
|
*/
|
|
@@ -27,9 +27,9 @@ import { vec2 as w, vec3 as M, vec4 as P } from "gl-matrix";
|
|
|
27
27
|
|
|
28
28
|
import I from "earcut";
|
|
29
29
|
|
|
30
|
-
import { buildNormals as C, buildTangents as k, packTangentFrame as
|
|
30
|
+
import { buildNormals as C, buildTangents as k, packTangentFrame as F } from "@maptalks/tbn-packer";
|
|
31
31
|
|
|
32
|
-
import
|
|
32
|
+
import O from "rbush";
|
|
33
33
|
|
|
34
34
|
const R = "${", E = `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 M=t.stops[e];void 0===m[M[0].zoom]&&(m[M[0].zoom]={zoom:M[0].zoom,type:t.type,property:t.property,default:t.default,stops:[]}),m[M[0].zoom].stops.push([M[0].value,M[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: ${R}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: ${R}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 M(t){return b(t,"interval")}function b(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=b(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 I(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 A(t){return!k(t)&&("string"==typeof t||null!==t.constructor&&t.constructor===String)}function S(t){return"number"==typeof t&&!isNaN(t)}function F(t){return!k(t)&&("function"==typeof t||null!==t.constructor&&t.constructor===Function)}function T(t){return!Array.isArray(t)&&"object"==typeof t&&!!t}function k(t){return null==t}function B(t){return w(t)&&t.property}const L="function"==typeof fetch&&"function"==typeof AbortController,C={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(F(e)){const t=n;n=e,e=t}(e=e||{}).method&&(e.method=e.method.toUpperCase());const r="POST"===e.method;if(L){const r=new AbortController,i=e;i.signal=r.signal,i.referrerPolicy=i.referrerPolicy||"origin",i.method=i.method||"GET";const o=new Request(t,i);return e.returnJSON&&o.headers.set("Accept","application/json"),fetch(o).then((r=>{const i=this._parseResponse(r,e.returnJSON,e.responseType);i.message?(i.url=t,n(i)):i.then((t=>{"arraybuffer"===e.responseType?n(null,{data:t,cacheControl:r.headers.get("Cache-Control"),expires:r.headers.get("Expires"),contentType:r.headers.get("Content-Type")}):n(null,t)})).catch((e=>{e.code&&e.code===DOMException.ABORT_ERR||(console.error("Fetch error:",t,e),n(e))}))})).catch((e=>{e.code&&e.code===DOMException.ABORT_ERR||(console.error("Fetch error:",t,e),n(e))})),r}{const i=C._getClient(n);if(i.open(e.method||"GET",t,!0),e){for(const t in e.headers)i.setRequestHeader(t,e.headers[t]);i.withCredentials="include"===e.credentials,e.responseType&&(i.responseType=e.responseType)}return i.send(r?e.body:null),i}},_parseResponse:(t,e,n)=>200!==t.status?{status:t.status,statusText:t.statusText,message:\`incorrect http request with status code(${R}t.status}): ${R}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(${R}t.status}): ${R}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=C._wrapCallback(e,t),e},getArrayBuffer(t,e,n){if(F(e)){const t=n;n=e,e=t}return e||(e={}),e.responseType="arraybuffer",C.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 O(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)X(t,n,e);else if("Polygon"===r)X(t,n[0],e);else if("MultiLineString"===r)for(const r of n)X(t,r,e);else if("MultiPolygon"===r)for(const r of n)X(t,r[0],e)}(s,o?4:3),s}function X(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 N(t,e,n,r){if(r.layer=e,"FeatureCollection"===n.type)for(let e=0;e<n.features.length;e++)E(t,n.features[e],r,e);else"Feature"===n.type?E(t,n,r):E(t,{geometry:n},r)}function E(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)z(i,a,n);else if("MultiPoint"===o)for(const t of i)z(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(O(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)E(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(O(l,o,a,e.properties,n.layer,n.hasAltitude))}function z(t,e,n){e.push(D(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=D(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 D(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)G(t,h,n,r,i,a.hasAltitude);else if("LineString"===o)U(t,h,n,r,i,!1,a.lineMetrics,a.hasAltitude);else if("MultiLineString"===o)J(t,h,n,r,i,!1,a.hasAltitude);else if("Polygon"===o)J(t,h,n,r,i,!0,a.hasAltitude);else if("MultiPolygon"===o)for(const e of t){const t=[];J(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(O(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(O(e.id,o,h,e.tags,e.layer,a.hasAltitude))}}return l.length?l:null}function G(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&&(H(e,t[a],t[a+1],t[a+2]),o&&e.push(t[a+3]))}}function U(t,e,n,r,i,o,s,a){let l=R(t);const u=0===i?W:K;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,M,b;o&&g===d-p?(v=t[0],w=t[1]):(v=t[g+p],w=t[g+p+1]),a&&(M=t[g+3],b=o&&g===d-p?t[3]:t[g+p+3]);const P=0===i?y:x,_=0===i?v:w;let I=!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(Q(M,b,c)),s&&(l.start=f+h*c)):P>r?_<r&&(c=u(l,y,x,v,w,r),a&&l.push(Q(M,b,c)),s&&(l.start=f+h*c)):(H(l,y,x,m),a&&l.push(M)),_<n&&P>=n&&(c=u(l,y,x,v,w,n),a&&l.push(Q(M,b,c)),I=!0),_>r&&P<=r&&(c=u(l,y,x,v,w,r),a&&l.push(Q(M,b,c)),I=!0),!o&&I&&(s&&(l.end=f+h*c),e.push(l),l=R(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&&H(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])&&(H(l,l[0],l[1],l[2]),a&&l.push(l[3])),l.length&&e.push(l)}function R(t){const e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function J(t,e,n,r,i,o,s){for(const a of t)U(a,e,n,r,i,o,!1,s)}function H(t,e,n,r){t.push(e,n,r)}function W(t,e,n,r,i,o){const s=(o-e)/(r-e);return H(t,o,n+(i-n)*s,1),s}function K(t,e,n,r,i,o){const s=(o-n)/(i-n);return H(t,e+(r-e)*s,o,1),s}function Q(t,e,n){return t+(e-t)*n}function tt(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=et(o.geometry,e,n);else if("MultiLineString"===s||"Polygon"===s){a=[];for(const t of o.geometry)a.push(et(t,e,n))}else if("MultiPolygon"===s){a=[];for(const t of o.geometry){const r=[];for(const i of t)r.push(et(i,e,n));a.push(r)}}r.push(O(o.id,s,a,o.tags,o.layer,n))}return r}function et(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 nt(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(rt(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(rt(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 rt(t,e,n,r,i,o){return[Math.round(n*(t*r-i)),Math.round(n*(e*r-o))]}function it(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)ot(s,e,o,i);return s}function ot(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)at(s,i,t,n,!1,!1,r);else if("MultiLineString"===o||"Polygon"===o)for(let e=0;e<i.length;e++)at(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++)at(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 st(t,e,n){return 0===t[e+2]&&t[e+3]>0&&n}function at(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||st(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)}C.getJSON=function(t,e,n){if(F(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?C.jsonp(t,r):((e=e||{}).returnJSON=!0,C.get(t,e,r))};const lt={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 ut{constructor(t,e){const n=(e=this.options=function(t,e){for(const n in e)t[n]=e[n];return t}(Object.create(lt),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++)N(n,t[r].layer,t[r].data,e);return n}if("FeatureCollection"===t.type)for(let r=0;r<t.features.length;r++)E(n,t.features[r],e,r);else"Feature"===t.type?E(n,t,e):E(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=tt(i,1,e.hasAltitude).concat(r)),o&&(r=r.concat(tt(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=ht(e,n,r);let f=this.tiles[c];if(!f&&(u>1&&console.time("creation"),f=this.tiles[c]=it(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${R}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,M=Z(t,h,n-p,n+g,0,f.minX,f.maxX,l),b=Z(t,h,n+d,n+y,0,f.minX,f.maxX,l);t=null,M&&(x=Z(M,h,r-p,r+g,1,f.minY,f.maxY,l),m=Z(M,h,r+d,r+y,1,f.minY,f.maxY,l),M=null),b&&(v=Z(b,h,r-p,r+g,1,f.minY,f.maxY,l),w=Z(b,h,r+d,r+y,1,f.minY,f.maxY,l),b=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=ht(t,e,n);if(this.tiles[l])return nt(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[ht(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]?nt(this.tiles[l],i,s):null):null}}function ht(t,e,n){return 32*((1<<t)*n+e)+t}function ct(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 ft(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 pt="undefined"!=typeof Float32Array?Float32Array:Array;function dt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function gt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function yt(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function xt(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 mt(t,e,n){return t[0]=e,t[1]=n,t}function vt(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 pt(3),pt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t)}(),function(){var t,e=(t=new pt(4),pt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}(),function(){var t,e=(t=new pt(2),pt!=Float32Array&&(t[0]=0,t[1]=0),t)}();const wt=Math.PI/180,Mt=6378137*Math.PI/180,bt=85.0511287798;function Pt(t,e,n){if("EPSG:3857"===n)return function(t,e){const n=bt,r=e[0],i=Math.max(Math.min(n,e[1]),-n);let o;o=0===i?0:Math.log(Math.tan((90+i)*wt/2))/wt;return t[0]=r*Mt,t[1]=o*Mt,t}(t,e);if("EPSG:4326"===n||"EPSG:4490"===n||"identity"===n)return _t(t,e);if("baidu"===n)return _t(t,e);throw new Error("unsupported projection:"+n)}function _t(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=vt(c,f),y=vt(f,p),x=[],m=[],v=[];for(let t=e;t<n;t+=3){const e=t/3*2;mt(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||Pt(x,x,"EPSG:3857"),At(m,x,c,f),At(v,x,d,c),r[e]=vt(c,m)/g,r[e+1]=vt(c,v)/y}}(h,e,n,r,i,o,a,c,f,p,!!d)}function At(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 St(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=Tt(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=Tt(t,e[n]*r,n<o-1?e[n+1]*r:t.length,r,!1);s===s.next&&(s.steiner=!0),i.push(zt(s))}i.sort(Ot);for(let t=0;t<i.length;t++)n=Xt(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 Tt(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=Wt(i/r|0,t[i],t[i+1],o);else for(let i=n-r;i>=e;i-=r)o=Wt(i/r|0,t[i],t[i+1],o);return o&&Zt(o,o.next)&&(Kt(o),o=o.next),o}function kt(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(Kt(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=Et(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?Ct(t,r,i,o):Lt(t))e.push(l.i,t.i,u.i),Kt(t),t=u.next,a=u.next;else if((t=u)===a){s?1===s?Bt(t=Yt(kt(t),e),e,n,r,i,o,2):2===s&&Vt(t,e,n,r,i,o):Bt(kt(t),e,n,r,i,o,1);break}}}function Lt(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 Ct(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=Et(p,d,e,n,r),m=Et(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)&&Gt(r,n,n.next,i)&&Jt(r,i)&&Jt(i,r)&&(e.push(r.i,n.i,i.i),Kt(n),Kt(n.next),n=t=i),n=n.next}while(n!==t);return kt(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&&Dt(s,t)){let a=Ht(s,t);return s=kt(s,s.next),a=kt(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 Ot(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 Xt(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);Jt(n,t)&&(e<h||e===h&&(n.x>o.x||n.x===o.x&&Nt(o,n)))&&(o=n,h=e)}n=n.next}while(n!==a);return o}(t,e);if(!n)return e;const r=Ht(n,t);return kt(r,r.next),kt(n,n.next)}function Nt(t,e){return jt(t.prev,t,e.prev)<0&&jt(e.next,t,t.next)<0}function Et(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 zt(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 Dt(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&&Gt(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Jt(t,e)&&Jt(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 Gt(t,e,n,r){const i=Rt(jt(t,e,n)),o=Rt(jt(t,e,r)),s=Rt(jt(n,r,t)),a=Rt(jt(n,r,e));return i!==o&&s!==a||(!(0!==i||!Ut(t,n,e))||(!(0!==o||!Ut(t,r,e))||(!(0!==s||!Ut(n,t,r))||!(0!==a||!Ut(n,e,r)))))}function Ut(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 Rt(t){return t>0?1:t<0?-1:0}function Jt(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 Ht(t,e){const n=Qt(t.i,t.x,t.y),r=Qt(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 Wt(t,e,n,r){const i=Qt(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 Kt(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 Qt(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}const te="__fea_idx";new Float32Array([-1e12])[0];const ee="maptalks_ombb";function ne(){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:re,ArrayPool:ie}=ne();function oe(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++){se(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 se(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||!ft(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],M=i[m],b=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=St(i,o,c,w,M)),P=_===x[0]||_===x[1]||_===x[2]?g:g+y):1===t&&(_===x[0]||_===x[1]||_===x[2]?P=0:5===_?(y=St(i,o,c,w,M),P=y):P=y);const I=P/u*(1/(100*h))/a;let A;A=1===e?b===p?1:0:"bottom"===n?b===p?f/100/l:0:b===p?0:-f/100/l,r[2*s]=I,r[2*s+1]=A,0===_&&(g+=y)}}(a,l,u,h,n,o,g,c[0],c[1],f,p,d)}function ae(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 le="undefined"!=typeof Float32Array?Float32Array:Array;function ue(){var t=new le(3);return le!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function he(t,e,n){var r=new le(3);return r[0]=t,r[1]=e,r[2]=n,r}function ce(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function fe(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function pe(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function de(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 ge(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ye(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 xe=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 me(){var t=new le(4);return le!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ve(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=ue()}(),function(){var t,e=(t=new le(4),le!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();var we,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},be=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};ue(),he(1,0,0),he(0,1,0),me(),me(),we=new le(9),le!=Float32Array&&(we[1]=0,we[2]=0,we[3]=0,we[5]=0,we[6]=0,we[7]=0),we[0]=1,we[4]=1,we[8]=1;\n/*!\n * Contains code from google filament\n * https://github.com/google/filament/\n * License Apache-2.0\n */\nconst Pe=8,_e=[],Ie=[],Ae=[],Se=[];function Fe(t,e,n){const r=ye(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}(_e,n[0],n[1],n[2],...r,...e);t=ve(t,i),t=function(t){return t[3]<0?Me(t,t,-1):t}(t=be(t,t));const o=1/((1<<2*Pe-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?ye(Ae,n,e):ye(Ae,e,n);return ge(ye(Se,n,e),s)<0&&Me(t,t,-1),t}const Te=[];const ke=[],Be=[],Le=[],Ce=[],Ye=[],Ve=[],Oe=[];function Xe(t,e,n,r,i,o){fe(Ce,t[3*e],t[3*e+1],t[3*e+2]),fe(Ye,t[3*n],t[3*n+1],t[3*n+2]),fe(Ve,t[3*r],t[3*r+1],t[3*r+2]);const s=xe(ke,Ve,Ye),a=xe(Be,Ce,Ye),l=ye(Le,s,a);de(Oe,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]+=Oe[0],i[3*n]+=Oe[0],i[3*r]+=Oe[0],i[3*e+1]+=Oe[1],i[3*n+1]+=Oe[1],i[3*r+1]+=Oe[1],i[3*e+2]+=Oe[2],i[3*n+2]+=Oe[2],i[3*r+2]+=Oe[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 Ne(t,e,n){return t[0]=e[n],t[1]=e[n+1],t[2]=e[n+2],t}function Ee(t,e,n){return t[0]=e[n],t[1]=e[n+1],t}const{StyleUtil:ze,PackUtil:$e,ArrayPool:qe}=ne(),De=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),De.reset();const{altitudeScale:y,altitudeProperty:x,defaultAltitude:m,heightProperty:v,minHeightProperty:P,defaultHeight:_,tangent:I,uv:A,topUVMode:F,sideUVMode:T,sideVerticalUVMode:k,top:L,side:C,textureYOrigin:Y,topThickness:V}=e,O=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:M,positionType:b,res:P,glScale:_,projectionCode:I},A,F){let T=e/t[0].extent;e===1/0&&(T=1);const k=e===1/0,B=F.get(),L=F.get(),C=F.get(),Y=F.getProxy(),V=F.get(),O=F.get(),X=F.get(),N=!!p,E=!!h,z=!!u,$=N?F.get():null;function q(t,n,r,i,o,s){let a=n;if(E){const u=Ft(Y,r,3);if(0===u.length)return n;let h=Y.getLength(),p=V.currentIndex;for(let t=0;t<h;t++)V[p++]=Y[t];if(V.currentIndex=p,n+=Y.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=O.currentIndex;for(let t=0;t<h;t++)O[p++]=u[t];O.currentIndex=p,N&&It(g||0,t,n,$,V,f,w,v,d[0],d[1],o,P,_,I,l),c>0&&!z&&(n=oe(V,Y,r,O,n,$,0,c,e,N,y||0,x||0,m,d,v,M,i<0?!s:s)),X.setLength(n/3),X.fill(1,a/3,n/3)}if(z){E&&(c=0),a=n,n=oe(V,Y,r,O,n,$,c,i,e,N,y||0,x||0,m,d,v,M,i<0?!s:s),X.setLength(n/3);const t=Y.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 D=-1/0,j=1/0,Z=0;const G=[-1,-1,e+1,e+1];let U=0,R=t.length;S(A)&&(U=A,R=A+1);let J=0,H=!1;const W=F.getProxy();let K=!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[ee];let f=Array.isArray(c&&c[0]&&c[0][0])?c[0]:c;const{altitude:p,height:d}=re.getFeaAltitudeAndHeight(l,n,r,i,o,a,s);d<0?(K=!0,j=Math.min(p,j),D=Math.max(p-d,D)):(D=Math.max(p,D),j=Math.min(p-d,j));const g=V.getLength();let y=0,x=Z;W.setLength(0),Y.setLength(0);const m=re.calculateSignedArea(h[0])<0;for(let t=0,n=h.length;t<n;t++){let r=h[t];m&&(r=r.reverse()),r=ae(r);const i=re.calculateSignedArea(r)<0;if(!i&&t>0&&(y++,f=c&&c[y],Z=q(x,Z,W,d*T,f,k),Y.setLength(0),W.setLength(0),x=Z),e!==1/0&&(r=re.clipPolygon(r,G)),!r.length){t===n-1&&(Z=q(x,Z,W,d*T,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++]=Y.getLength()/3,W.currentIndex=t}ct(Y,Y.getLength(),r,T,p,!1,b),t===n-1&&(Z=q(x,Z,W,d*T,f,k))}const v=V.getLength()-g,w=(te+"").trim();for(let t=0;t<v/3;t++){let t=L.currentIndex;L[t++]=void 0===l[w]?U:l[w],L.currentIndex=t,t=B.currentIndex,B[t++]=U,B.currentIndex=t,S(u)&&(t=C.currentIndex,C[t++]=u,C.currentIndex=t)}}const Q=re.getUnsignedArrayType(L.getLength()?L[L.getLength()-1]:0),tt={hasNegativeHeight:K,maxAltitude:D===-1/0?0:D,minAltitude:j===1/0?0:j,vertices:V,verticeTypes:X,indices:O,pickingIds:ie.createTypedArray(L,Q),featureIndexes:B};if(C.getLength()){const t=H?re.getPosArrayType(J):re.getUnsignedArrayType(J);tt.featureIds=ie.createTypedArray(C,t)}else tt.featureIds=[];return $&&($.setLength(V.getLength()/3*2),tt.uvs=$),tt}(t,n,{altitudeScale:y,altitudeProperty:x,defaultAltitude:m||0,heightProperty:v,minHeightProperty:P,defaultHeight:_||0},{center:g,top:L,side:C,topThickness:10*V||0,uv:A||I,uvSize:[i,i],uvOrigin:r,topUVMode:F,sideUVMode:T,sideVerticalUVMode:k,textureYOrigin:Y,tileRatio:a,centimeterToPoint:l,verticalCentimeterToPoint:u,positionType:d,res:o,glScale:s,projectionCode:f},p,De),X=[],N=O.vertices.getLength()/3,E=$e.getIndexArrayType(N),z=qe.createTypedArray(O.indices,E);delete O.indices,X.push(z.buffer,O.pickingIds.buffer);const $=Math.max(Math.abs(O.maxAltitude),Math.abs(O.minAltitude)),q=$e.getPosArrayType(Math.max(512,$));O.vertices=qe.createTypedArray(O.vertices,q);const D=I?De.getProxy():new Float32Array(3*N);D.setLength&&D.setLength(3*N);const j=function(t,e,n){const r=n||[];r.setLength&&r.setLength(t.length);const i=Te;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?Xe(t,3*n,3*n+1,3*n+2,r,i):Xe(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}(O.vertices,z,D);let Z=!0;const G=j.getLength?j.getLength():j.length;for(let t=0;t<G;t++){j[t]=-j[t];const e=j[t]%1;1-Math.abs(e)>1e-6?Z=!1:0!==e&&(j[t]=Math.round(j[t]))}if(O.normals=j,I){let t=De.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){Ne(u,t,3*e),Ne(h,t,3*r),Ne(c,t,3*i),Ee(f,n,2*e),Ee(p,n,2*r),Ee(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],M=p[0]-f[0],b=d[0]-f[0],P=p[1]-f[1],_=d[1]-f[1],I=1/(M*_-b*P);fe(g,(_*o-P*s)*I,(_*x-P*m)*I,(_*v-P*w)*I),fe(y,(M*s-b*o)*I,(M*m-b*x)*I,(M*w-b*v)*I),pe(a[e],a[e],g),pe(a[r],a[r],g),pe(a[i],a[i],g),pe(l[e],l[e],y),pe(l[r],l[r],y),pe(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=[],M=[];let b,P,_;function I(t){Ne(w,e,3*t),ce(M,w),P=a[t],ce(m,P),xe(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,ge(w,P))),de(m,m),ye(v,M,P),_=ge(v,l[t]),b=_<0?-1:1,s[4*t]=m[0],s[4*t+1]=m[1],s[4*t+2]=m[2],s[4*t+3]=b}for(let t=0,e=r.length;t<e;t+=3)I(r[t+0]),I(r[t+1]),I(r[t+2]);return s}(O.vertices,O.normals,O.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;dt(o,t[n]||0,t[n+1]||0,t[n+2]||0),yt(i,e[a]||0,e[a+1]||0,e[a+2]||0,e[a+3]||0),Fe(s,o,i),gt(r.subarray(a,a+4),s)}return r}(O.normals,t),O.tangents=t,X.push(t.buffer),delete O.normals}if(O.normals&&(Z&&(O.normals=qe.createTypedArray(O.normals,Int8Array)),X.push(O.normals.buffer)),O.uvs){const t=O.uvs;O.uvs=qe.createTypedArray(t,Float32Array),X.push(O.uvs.buffer)}const U=function(t,e,n,r){const i={},o={},s=r.getLength();if(B(e.polygonFill)){let a=M(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=M(u),u=a(n,s)),delete s.$layer,delete s.$type,ze.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(B(e.polygonOpacity)){let a=b(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=M(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,O.featureIndexes),R=function(t,e,n,r,i){const o=[[],[]],s=B(r.topPolygonFill),a=B(r.bottomPolygonFill),l=[255,255,255,255],u=e.getLength();if(s||a){let h=s&&M(r.topPolygonFill),c=a&&M(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=M(v),v=m(i,x)),delete x.$layer,delete x.$type,ze.normalizeColor(Ze,v),xt(Ze,Ze,l);let b=Ge(o,Ze);b<0&&(b=o.length,o.push(gt([],Ze))),t[r]=b,u?(f=e[r],d=b):(p=e[r],g=b)}}return o.slice(2)}(O.verticeTypes,O.featureIndexes,t,h,c),J={data:{data:{aVertexColorType:R.length<=252?qe.createTypedArray(O.verticeTypes,Uint8Array):qe.createTypedArray(O.verticeTypes,Uint16Array),aPosition:O.vertices,aNormal:O.normals,aTexCoord0:O.uvs,aTangent:O.tangents,aPickingId:O.pickingIds},indices:z,properties:{maxAltitude:O.maxAltitude/100,minAltitude:O.minAltitude/100,hasNegativeHeight:O.hasNegativeHeight},dynamicAttributes:U.dynamicAttributes,vertexColors:R},buffers:X};return O.featureIds.length?(J.data.featureIds=O.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 Ge(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:Ue,StyleUtil:Re,FilterUtil:Je}=ne();function He(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=Je.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),ft(g,u,h,e)||(x.push(u,h),c&&x.push(u+l,h+l),We(g,u,e)||x.push(u,u+l));return n+i}let v=0,M=-1/0,b=1/0;const P=(te+"").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,Re.normalizeColor(_,t)}else dt(_,255,255,255);const p=v/3*4,{altitude:w,height:I}=Ue.getFeaAltitudeAndHeight(h,i,o,s,a,u,l);I<0?(b=Math.min(w,b),M=Math.max(w-I,M)):(b=Math.min(w-I,b),M=Math.max(w,M));let A=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=ct(g,A,e,f,w),v=m(A,v,I*f),A=v}const S=A/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 F=x.length-d.length;for(let t=0;t<F;t++)d.push(h[P])}const I=x.reduce(((t,e)=>Math.max(t,e)),0),A=new(Ue.getIndexArrayType(I))(x),F=Ue.getUnsignedArrayType(t.length),T=Math.max(Math.abs(M,Math.abs(b)));return{aPosition:new(Ue.getPosArrayType(Math.max(512,T)))(g),indices:A,aPickingId:new F(d),aColor:y,maxAltitude:M===-1/0?0:M/100,minAltitude:b===1/0?0:b/100}}function We(t,e,n){const r=t[3*e],i=t[3*e+1];return r<0||r>n||i<0||i>n}function Ke(t,e,n,r){const i=He(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 Qe=["Unknown","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"];function tn(t){if(!t)return"true";const e=t[0];if(t.length<=1)return"any"===e?"false":"true";return\`(${R}"=="===e?nn(t[1],t[2],"===",!1):"!="===e?nn(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?nn(t[1],t[2],e,!0):"any"===e?on(t.slice(1),"||"):"all"===e?on(t.slice(1),"&&"):"none"===e?ln(on(t.slice(1),"||")):"in"===e?sn(t[1],t.slice(2)):"!in"===e?ln(sn(t[1],t.slice(2))):"has"===e?an(t[1]):"!has"===e?ln(an(t[1])):"contains"===e?function(t,e,n){const r=en(t);return void 0!==n?\`(${R}r} + '').indexOf("${R}e}") === ${R}n}\`:\`(${R}r} + '').indexOf("${R}e}") >= 0\`}(t[1],t[2],t[3]):"true"})\`}function en(t){return"$"===t[0]?"f."+t.substring(1):"p["+JSON.stringify(t)+"]"}function nn(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=en(i);return"length"!==o?(console.error(\`not support ${R}o} op\`),"false"):(s=\`((${R}s}+='').length)\`,rn(s,i,e,n,r))}(t,e,n,r);var i;return rn(en(t),t,e,n,r)}function rn(t,e,n,r,i){const o="$type"===e?Qe.indexOf(n):JSON.stringify(n);return(i?\`typeof ${R}t}=== typeof ${R}o}&&\`:"")+t+r+o}function on(t,e){return t.map(tn).join(e)}function sn(t,e){"$type"===t&&(e=e.map((t=>Qe.indexOf(t))));const n=JSON.stringify(e.sort(un)),r=en(t);return e.length<=200?\`${R}n}.indexOf(${R}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; }(${R}r}, ${R}n},0,${R}e.length-1})\`}function an(t){return"$id"===t?'"id" in f':\`${R}JSON.stringify(t)} in p\`}function ln(t){return\`!(${R}t})\`}function un(t,e){return t<e?-1:t>e?1:0}let hn=!1;try{const t=new OffscreenCanvas(1,1);t.getContext("2d").fillText("hello",0,0),hn=!0}catch(t){hn=!1}var cn=hn;const{VectorPack:fn,PolygonPack:pn,NativeLinePack:dn,LinePack:gn,PointPack:yn,NativePointPack:xn,LineExtrusionPack:mn,CirclePack:vn,RoundTubePack:wn,SquareTubePack:Mn,FilterUtil:bn,PackUtil:Pn,StyleUtil:_n,TextUtil:In,DEFAULT_TEX_WIDTH:An,GlyphRequestor:Sn}=ne(),Fn="__original_properties",Tn="__fn-type_properties";class kn{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=I(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=T(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=>{n.canceled?e(null,{canceled:!0}):(n.data.styleCounter=t.styleCounter,o&&I(n.data,o),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={},delete this._cache,this.requests={}}fetchIconGlyphs(t,e,n){if(this.options.workerGlyph&&cn){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 Sn),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++)Xn(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,M=-1;const b=[];let P=!1;for(let t=0;t<s.length;t++){M++;const r=s[t];r.type!==w&&(M=0,w=r.type);const a=0===r.type?p:d;if(r.symbol&&!1===r.symbol.visible){a[M]=null;continue}jn(r.symbol,b,t),P=P||b[t]&&b[t].size>0;const{tileFeatures:l,tileFeaIndexes:u}=this._filterFeatures(c,r.type,r.filter,e,m,t);if(!l.length){a[M]=null;continue}const y=u[u.length-1],_=Pn.getIndexArrayType(y);a[M]={styledFeatures:new _(u)},g.push({idx:t,typeIdx:M}),x.push(a[M].styledFeatures.buffer);const A=I({},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){A.debugIndex=t[e].index;break}}}let S=this._createTileGeometry(l,r,A);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=Cn(t.properties)),t&&(y.features||P&&m[r]))if("id"===y.features)o[r]=t.id;else{y.pickingGeometry||delete t.geometry,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=I({},t.originalFeature);delete e[Fn],n.customProps=I({},e),t=n}const i=I({},t);if(P&&m[r]&&(!y.features||"transient"===y.features)){const i=m[r];for(let r=0;r<i.length;r++){const i=b[r];i&&i.forEach((r=>{const i=e?e.properties:t.properties;i[Tn]||(i[Tn]=new Set),i[Tn].add(r),n=!0}))}}o[r]=i}if(n)for(const t in o){const e=o[t],n=e.properties[Tn];if(n){delete e.properties[Tn],"transient"===y.features&&(e.fnTypeProps=I({},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=I({},i,{EXTENT:a,zoom:h,debugIndex:y,features:this.options.features});if("3d-extrusion"===g){Yn(o)&&(i.uv=1);const t=this.options.projectionCode,e=o.material&&o.material.textureWidth||An;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(Ke(r,a,o,i))]);if("point"===g){x=I(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=>{const e=fn.genFnTypes(t);let n=r;return yn.needMerge(t,e,h)&&(n=yn.mergeLineFeatures(r,t,e,h)),new yn(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,xn,d)}if("line"===g)return x=I(x,{requestor:this.fetchIconGlyphs.bind(this),tileRatio:d}),Vn(r,o,x,gn,1,!0);if("native-line"===g)return Vn(r,o,x,dn,1,!0);if("fill"===g)return x=I(x,{requestor:this.fetchIconGlyphs.bind(this)}),Vn(r,o,x,pn);if("line-extrusion"===g){delete o.lineGradientProperty,o.lineJoin="miter",o.lineCap="butt";const t=Yn(o);if(t&&(i.uv=1),x=I(x,{tileSize:s,zScale:u,glScale:l}),o.mergeOnProperty){const t=fn.genFnTypes(o);r=gn.mergeLineFeatures(r,o,t,x.zoom)}if(t){const t=[];if(!1!==i.top){const e=I({},x);e.side=!1,t.push(new mn(r,o,e))}return!1!==i.side&&(x.side=!0,x.top=!1,t.push(new mn(r,o,x))),Promise.all(t.map((t=>t.load())))}return Promise.all([new mn(r,o,x).load()])}if("circle"===g)return Vn(r,o,x,vn);if("round-tube"===g||"square-tube"===g){const t="round-tube"===g?wn:Mn;return x=I(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=(te+"").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=bn.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=bn.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 ${R}tn(i)}\`)),renderPlugin:Bn(a),symbol:Ln(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 Ln(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 Cn(t){if(Array.isArray(t)||!T(t))return{};const e={};for(const n in t){const r=t[n];A(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(T(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]=On(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=fn.genFnTypes(a[e]);h=gn.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 On(t){if(!t)return 0;for(const e in t)if(B(t[e]))return 1;return 0}function Xn(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=bn.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 Nn={get:(t,e)=>e in t?t[e]:t.originalFeature[e],has:(t,e)=>e in t||e in t.originalFeature},En={get:function(t,e){return e in t?t[e]:t[Fn][e]},has:(t,e)=>e in t||e in t[Fn]},zn={};function $n(t){const e={};e.originalFeature=t;const n=new Proxy(e,Nn);return n.properties=new Proxy({},En),n.properties[Fn]=t.properties||zn,n}function qn(t,e,n){t[e]||(t[e]=new Set),t[e].add(n)}const Dn=[];function jn(t,e,n){if(!t)return Dn;for(const r in t){if(!t[r]||!_n.checkIfZoomFnTypeSymbol(r))continue;if(B(t[r]))qn(e,n,t[r].property);else{if("lineGradientProperty"===r){qn(e,n,t[r]);continue}if("textName"===r)if(A(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(bn.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++)B(i[t][1])&&qn(e,t,i[t][1].property)}return e[n]}function Zn(t,e){Gn(t.geometry,e)}function Gn(t,e){if(t)switch(t.type){case"Point":Un(t.coordinates,e);break;case"MultiPoint":case"LineString":Rn(t.coordinates,e);break;case"MultiLineString":!function(t,e){for(let n=0,r=t.length;n<r;n++)Rn(t[n],e)}(t.coordinates,e);break;case"Polygon":Jn(t.coordinates,e);break;case"MultiPolygon":!function(t,e){for(let n=0,r=t.length;n<r;n++)Jn(t[n],e)}(t.coordinates,e);break;case"GeometryCollection":const n=t.geometries.length;for(let r=0;r<n;r++)Gn(t.geometries[r],e)}}function Un(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 Rn(t,e){for(let n=0,r=t.length;n<r;n++)Un(t[n],e)}function Jn(t,e){t.length&&Rn(t[0],e)}function Hn(t,e,n,r,i){Wn(t,e,n||0,r||t.length-1,i||Qn)}function Wn(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);Wn(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(Kn(t,n,e),i(t[r],h)>0&&Kn(t,n,r);c<f;){for(Kn(t,c,f),c++,f--;i(t[c],h)<0;)c++;for(;i(t[f],h)>0;)f--}0===i(t[n],h)?Kn(t,n,f):Kn(t,++f,r),f<=e&&(n=f+1),e<=f&&(r=f-1)}}function Kn(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Qn(t,e){return t<e?-1:t>e?1:0}class tr{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(!cr(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;cr(t,a)&&(e.leaf?n.push(s):hr(t,a)?this._all(s,n):i.push(s))}e=i.pop()}return n}collides(t){let e=this.data;if(!cr(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(cr(t,o)){if(e.leaf||hr(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=fr([]),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=er(t,n.children,e);if(-1!==r)return n.children.splice(r,1),i.push(n),this._condense(i),this}l||n.leaf||!hr(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=fr(t.slice(e,n+1)),nr(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(s)),s=Math.ceil(i/Math.pow(s,r-1))),o=fr([]),o.leaf=!1,o.height=r;const a=Math.ceil(i/s),l=a*Math.ceil(Math.sqrt(s));pr(t,e,n,l,this.compareMinX);for(let i=e;i<=n;i+=l){const e=Math.min(i+l-1,n);pr(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 nr(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=ar(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),ir(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=fr(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,nr(n,this.toBBox),nr(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)}_splitRoot(t,e){this.data=fr([t,e]),this.data.height=t.height+1,this.data.leaf=!1,nr(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=rr(t,0,s,this.toBBox),a=rr(t,s,n,this.toBBox),l=ur(e,a),u=ar(e)+ar(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:or,i=t.leaf?this.compareMinY:sr;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=rr(t,0,e,i),s=rr(t,n-e,n,i);let a=lr(o)+lr(s);for(let r=e;r<n-e;r++){const e=t.children[r];ir(o,t.leaf?i(e):e),a+=lr(o)}for(let r=n-e-1;r>=e;r--){const e=t.children[r];ir(s,t.leaf?i(e):e),a+=lr(s)}return a}_adjustParentBBoxes(t,e,n){for(let r=n;r>=0;r--)ir(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():nr(t[n],this.toBBox)}}function er(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 nr(t,e){rr(t,0,t.children.length,e,t)}function rr(t,e,n,r,i){i||(i=fr(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];ir(i,t.leaf?r(e):e)}return i}function ir(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 or(t,e){return t.minX-e.minX}function sr(t,e){return t.minY-e.minY}function ar(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function lr(t){return t.maxX-t.minX+(t.maxY-t.minY)}function ur(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 hr(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function cr(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function fr(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function pr(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;Hn(t,s,e,n,i),o.push(e,s,s,n)}}class dr{constructor(t=[],e=gr){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 gr(t,e){return t<e?-1:t>e?1:0}function yr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xr={exports:{}},mr=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},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,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};xr.exports=function(t,e,n,r){return e.length>0&&Array.isArray(e[0])?vr(t,e,n,r):mr(t,e,n,r)};var wr=xr.exports.nested=vr;xr.exports.flat=mr;const Mr=11102230246251565e-32,br=134217729,Pr=(3+8*Mr)*Mr;function _r(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 Ar=33306690738754716e-32,Sr=22204460492503146e-32,Fr=11093356479670487e-47,Tr=Ir(4),kr=Ir(8),Br=Ir(12),Lr=Ir(16),Cr=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)>=Ar*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,M,b,P,_;const I=t-i,A=n-i,S=e-o,F=r-o;w=I*F,f=br*I,p=f-(f-I),d=I-p,f=br*F,g=f-(f-F),y=F-g,M=d*y-(w-p*g-d*g-p*y),b=S*A,f=br*S,p=f-(f-S),d=S-p,f=br*A,g=f-(f-A),y=A-g,P=d*y-(b-p*g-d*g-p*y),x=M-P,c=M-x,Tr[0]=M-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-b,c=v-x,Tr[1]=v-(x+c)+(c-b),_=m+x,c=_-m,Tr[2]=m-(_-c)+(x-c),Tr[3]=_;let T=function(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}(4,Tr),k=Sr*s;if(T>=k||-T>=k)return T;if(c=t-I,a=t-(I+c)+(c-i),c=n-A,u=n-(A+c)+(c-i),c=e-S,l=e-(S+c)+(c-o),c=r-F,h=r-(F+c)+(c-o),0===a&&0===l&&0===u&&0===h)return T;if(k=Fr*s+Pr*Math.abs(T),T+=I*h+F*a-(S*u+A*l),T>=k||-T>=k)return T;w=a*F,f=br*a,p=f-(f-a),d=a-p,f=br*F,g=f-(f-F),y=F-g,M=d*y-(w-p*g-d*g-p*y),b=l*A,f=br*l,p=f-(f-l),d=l-p,f=br*A,g=f-(f-A),y=A-g,P=d*y-(b-p*g-d*g-p*y),x=M-P,c=M-x,Cr[0]=M-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-b,c=v-x,Cr[1]=v-(x+c)+(c-b),_=m+x,c=_-m,Cr[2]=m-(_-c)+(x-c),Cr[3]=_;const B=_r(4,Tr,4,Cr,kr);w=I*h,f=br*I,p=f-(f-I),d=I-p,f=br*h,g=f-(f-h),y=h-g,M=d*y-(w-p*g-d*g-p*y),b=S*u,f=br*S,p=f-(f-S),d=S-p,f=br*u,g=f-(f-u),y=u-g,P=d*y-(b-p*g-d*g-p*y),x=M-P,c=M-x,Cr[0]=M-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-b,c=v-x,Cr[1]=v-(x+c)+(c-b),_=m+x,c=_-m,Cr[2]=m-(_-c)+(x-c),Cr[3]=_;const L=_r(B,kr,4,Cr,Br);w=a*h,f=br*a,p=f-(f-a),d=a-p,f=br*h,g=f-(f-h),y=h-g,M=d*y-(w-p*g-d*g-p*y),b=l*u,f=br*l,p=f-(f-l),d=l-p,f=br*u,g=f-(f-u),y=u-g,P=d*y-(b-p*g-d*g-p*y),x=M-P,c=M-x,Cr[0]=M-(x+c)+(c-P),m=w+x,c=m-w,v=w-(m-c)+(x-c),x=v-b,c=v-x,Cr[1]=v-(x+c)+(c-b),_=m+x,c=_-m,Cr[2]=m-(_-c)+(x-c),Cr[3]=_;const C=_r(L,Br,4,Cr,Lr);return Lr[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++)wr(t[o],a)||l.push(t[o]);return function(t){t.sort(Ur);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 tr(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=Dr(l,o),s.push(o)}var u=new tr(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=Or(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(Dr(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 Or(t,e,n,r,i,o,s){for(var a=new dr([],Xr),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):Nr(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&&zr(n,p,s)&&zr(r,p,s))return p}(l=a.pop())&&(l=l.node)}return null}function Xr(t,e){return t.dist-e.dist}function Nr(t,e,n){if(Er(t,n)||Er(e,n))return 0;var r=Gr(t[0],t[1],e[0],e[1],n.minX,n.minY,n.maxX,n.minY);if(0===r)return 0;var i=Gr(t[0],t[1],e[0],e[1],n.minX,n.minY,n.minX,n.maxY);if(0===i)return 0;var o=Gr(t[0],t[1],e[0],e[1],n.maxX,n.minY,n.maxX,n.maxY);if(0===o)return 0;var s=Gr(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 Er(t,e){return t[0]>=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function zr(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 Dr(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 Gr(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,M=f*y+p*x,b=d*y+g*x,P=m*w-v*v,_=P,I=P;0===P?(u=0,_=1,c=b,I=w):(c=m*b-v*M,(u=v*b-w*M)<0?(u=0,c=b,I=w):u>_&&(u=_,c=b+v,I=w)),c<0?(c=0,-M<0?u=0:-M>m?u=_:(u=-M,_=m)):c>I&&(c=I,-M+v<0?u=0:-M+v>m?u=_:(u=-M+v,_=m));var A=(1-(h=0===c?0:c/I))*i+h*s-((1-(l=0===u?0:u/_))*t+l*n),S=(1-h)*o+h*a-((1-l)*e+l*r);return A*A+S*S}function Ur(t,e){return t[0]===e[0]?t[1]-e[1]:t[0]-e[0]}const{PackUtil:Rr}=ne();class Jr{constructor(t,e){this.x=t,this.y=e}clone(){return new Jr(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 Jr(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 Jr(this.y,-this.x)}}function Hr(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 Jr(t.x+a*e.x,t.y+a*e.y)}const Wr=[],Kr=[];function Qr(t){if(S(t[0]&&t[0].x)){const e=[];let n=0;for(let r=0;r<t.length;r++)Kr[n]?(Kr[n][0]=t[r].x,Kr[n][1]=t[r].y):Kr[n]=[t[r].x,t[r].y],e.push(Kr[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]||(Pt(i,e[t],"EPSG:3857"),Wr[s]?(Wr[s].x=i[0],Wr[s].y=i[1]):Wr[s]=new Jr(i[0],i[1]),o.push(Wr[s]),s++);Rr.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=Hr(t,r,s,a),c=Hr(i,o,s,a),f=Hr(l,u,t,r),p=Hr(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 Jr(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),h=new Jr(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 Jr(0,-1),p=new Jr(0,1),d=new Jr(-1,0),g=new Jr(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 ti=[];function ei(t,e){const n=Array.isArray(t&&t[0]&&t[0][0]);for(let r=0;r<t.length;r++)n?t[r]=ei(t[r]):(Pt(ti,t[r],e),t[r][0]=ti[0],t[r][1]=ti[1]);return t}const{PackUtil:ni}=ne();class ri extends kn{constructor(t,e,n,r,i,o){super(t,e,n,r,i),(e=e||{}).extent||(e.extent=8192),this.setData(e.data,o)}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")),A(t)&&"{"!=t.substring(0,1)||t.url){const r=t.url?t.url:t;C.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:{}});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,i=r&&r.length;this._genOMBB(r);let o=r;if(r&&i>1e3){o=[];for(let t=0;t<i;t++)ii(r[t],o,t,i)}this._generate(o,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=Qr(t,t.length);n.properties=n.properties||{},n.properties[ee]=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=Qr(r,r.length);n.properties=n.properties||{},n.properties[ee]=n.properties[ee]||[],n.properties[ee][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:Gn(t,e)}return e}({type:"FeatureCollection",features:t}):null;this.index=function(t,e){return new ut(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={};let r=0;const i=this.options.featureIdProperty;if(t){const o=t.length;t.forEach(((t,s)=>{!function(t,o,s){if(t&&("Feature"!==t.type||t.geometry)){if(S(t.id)||(t.id=r++),i){let e=i;T(i)&&(e=i[t.layer||"0"]),t.id=t.properties[e]}n[t.id]=I({},t),t.geometry?(n[t.id].geometry=I({},t.geometry),n[t.id].geometry.coordinates=null):t.coordinates&&(n[t.id].coordinates=null),ii(t,e,o,s)}}(t,s,o)}))}return{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||(ni.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}}function ii(t,e,n,r){const i=Math.floor(r/998);(0===n||n===r-1||(0===i||n%i==0)&&e.length<999)&&e.push(t)}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 Mi(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function bi(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 Ii(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function Ai(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=Ai(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)+Ai(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),Ii(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Ii(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Ii(this.buf,-1&t,this.pos),Ii(this.buf,Math.floor(t*hi),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Ii(this.buf,-1&t,this.pos),Ii(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,Mi,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,bi,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=yr(si),Fi=Ti;function Ti(t,e){this.x=t,this.y=e}Ti.prototype={clone:function(){return new Ti(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}},Ti.convert=function(t){return t instanceof Ti?t:Array.isArray(t)?new Ti(t[0],t[1]):t};var ki=Fi,Bi=Li;function Li(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 Yi(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}Li.types=["Unknown","Point","LineString","Polygon"],Li.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},Li.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]},Li.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=Li.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=Yi(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 Vi=Bi,Oi=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 Vi(this._pbf,e,this.extent,this._keys,this._values)};var Ei=Oi,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 qi=zi;const Di=2;class ji extends kn{constructor(t,e,n,r,i,o){super(t,e,n,r,i),e=e||{},o()}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;return a?setTimeout((()=>{this._readTile(n,i,o,null,a,e)}),1):(r.referrer=t.referrer,C.getArrayBuffer(n,r,((r,s)=>{this._cache&&(r?r.loading||this._cache.add(n,{err:r,data:s&&s.data,cacheIndex:t.workerCacheIndex}):s&&s.data&&this._cache.add(n,{err:null,data:s.data,cacheIndex:t.workerCacheIndex}),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 qi(new Si(i))}catch(r){return 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[ee];l&&(A(l)&&(l=JSON.parse(l)),r.properties[ee]=ei(l,"EPSG:3857"));const h=e&&r.properties[e];if(h){const t=Zi(h),e=[];Gi(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();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 Gi(t,e,n,r){r||(r={index:0});for(let i=0;i<t.length;i++)if(Array.isArray(t[i]))Gi(t[i],e,n,r);else{const o=r.index;k(e[o])?n.push(Di):t[i].z=100*e[o],r.index++}}const{LRUCache:Ui}=ne();let Ri=0;const Ji=new Ui(128);class Hi{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 ri(n,a,l,Ji,{},i):new ji(n,a,l,Ji,{},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)}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?\`${R}t}-${R}Ri++}\`: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\`${R}t}-${R}e}\`}_getLayerById(t,e){const n=this._genKey(t,e);return this._layers[n]}_resetCache(){Ji.reset()}}t.initialize=function(){},t.onmessage=function(t,e){const n=t.data;if(this.dispatcher||(this.dispatcher=new Hi(t.workerId)),"<response>"===t.type)this.dispatcher.workerId===t.workerId&&this.dispatcher.receive(t);else{const r=n.command;this.dispatcher[r]({actorId:t.actorId,mapId:n.mapId,layerId:n.layerId,params:n.params},((t,n,i)=>{t&&404!==t.status&&204!==t.status&&!t.loading&&console.error(r,t),e(t,n,i)}))}}}`;
|
|
35
35
|
|
|
@@ -448,7 +448,7 @@ function D(e) {
|
|
|
448
448
|
return [ (this.paddedRect.w - 2 * this.padding) / this.pixelRatio, (this.paddedRect.h - 2 * this.padding) / this.pixelRatio ];
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
-
class
|
|
451
|
+
class F {
|
|
452
452
|
constructor(e) {
|
|
453
453
|
this.glyphMap = e, this.build();
|
|
454
454
|
}
|
|
@@ -468,7 +468,7 @@ function D(e) {
|
|
|
468
468
|
if (i.pack(r, {
|
|
469
469
|
inPlace: !0
|
|
470
470
|
}), !C(i.w) || !C(i.h)) {
|
|
471
|
-
const e =
|
|
471
|
+
const e = O(i.w), t = O(i.h);
|
|
472
472
|
i.resize(e, t);
|
|
473
473
|
}
|
|
474
474
|
const o = new v({
|
|
@@ -488,7 +488,7 @@ function D(e) {
|
|
|
488
488
|
this.image = o, this.positions = n;
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function O(e) {
|
|
492
492
|
return Math.pow(2, Math.ceil(Math.log(e) / Math.LN2));
|
|
493
493
|
}
|
|
494
494
|
/*!
|
|
@@ -1293,11 +1293,11 @@ function D(e) {
|
|
|
1293
1293
|
if (!("channels" in Ie[Ce])) throw new Error("missing channels property: " + Ce);
|
|
1294
1294
|
if (!("labels" in Ie[Ce])) throw new Error("missing channel labels property: " + Ce);
|
|
1295
1295
|
if (Ie[Ce].labels.length !== Ie[Ce].channels) throw new Error("channel and label counts mismatch: " + Ce);
|
|
1296
|
-
var ke = Ie[Ce].channels,
|
|
1296
|
+
var ke = Ie[Ce].channels, Fe = Ie[Ce].labels;
|
|
1297
1297
|
delete Ie[Ce].channels, delete Ie[Ce].labels, Object.defineProperty(Ie[Ce], "channels", {
|
|
1298
1298
|
value: ke
|
|
1299
1299
|
}), Object.defineProperty(Ie[Ce], "labels", {
|
|
1300
|
-
value:
|
|
1300
|
+
value: Fe
|
|
1301
1301
|
});
|
|
1302
1302
|
}
|
|
1303
1303
|
Ie.rgb.hsl = function(e) {
|
|
@@ -1531,7 +1531,7 @@ function D(e) {
|
|
|
1531
1531
|
}, Ie.rgb.gray = function(e) {
|
|
1532
1532
|
return [ (e[0] + e[1] + e[2]) / 3 / 255 * 100 ];
|
|
1533
1533
|
};
|
|
1534
|
-
var
|
|
1534
|
+
var Oe = Se.exports, Re = Oe;
|
|
1535
1535
|
function Ee(e, t) {
|
|
1536
1536
|
return function(n) {
|
|
1537
1537
|
return t(e(n));
|
|
@@ -1542,7 +1542,7 @@ function D(e) {
|
|
|
1542
1542
|
i = Ee(Re[t[r].parent][r], i), r = t[r].parent;
|
|
1543
1543
|
return i.conversion = n, i;
|
|
1544
1544
|
}
|
|
1545
|
-
var Le =
|
|
1545
|
+
var Le = Oe, He = function(e) {
|
|
1546
1546
|
for (var t = function(e) {
|
|
1547
1547
|
var t = function() {
|
|
1548
1548
|
for (var e = {}, t = Object.keys(Re), n = t.length, i = 0; i < n; i++) e[t[i]] = {
|
|
@@ -2146,12 +2146,12 @@ function D(e) {
|
|
|
2146
2146
|
}, i && r) if (e.exports == i) r.exports = o; else for (a in o) o.hasOwnProperty(a) && (i[a] = o[a]); else n.punycode = o;
|
|
2147
2147
|
}(It);
|
|
2148
2148
|
}(Ct, Ct.exports);
|
|
2149
|
-
class
|
|
2149
|
+
class Ft extends Error {
|
|
2150
2150
|
constructor(e, t) {
|
|
2151
2151
|
super(t), this.message = t, this.key = e;
|
|
2152
2152
|
}
|
|
2153
2153
|
}
|
|
2154
|
-
var
|
|
2154
|
+
var Ot = Ft;
|
|
2155
2155
|
class Rt {
|
|
2156
2156
|
constructor(e, t = []) {
|
|
2157
2157
|
this.parent = e, this.bindings = {};
|
|
@@ -2944,8 +2944,8 @@ function D(e) {
|
|
|
2944
2944
|
this.locale && (e.locale = this.locale.serialize()), [ "collator", e ];
|
|
2945
2945
|
}
|
|
2946
2946
|
}
|
|
2947
|
-
const
|
|
2948
|
-
function
|
|
2947
|
+
const Fn = 8192;
|
|
2948
|
+
function On(e, t) {
|
|
2949
2949
|
e[0] = Math.min(e[0], t[0]), e[1] = Math.min(e[1], t[1]), e[2] = Math.max(e[2], t[0]),
|
|
2950
2950
|
e[3] = Math.max(e[3], t[1]);
|
|
2951
2951
|
}
|
|
@@ -2956,7 +2956,7 @@ function D(e) {
|
|
|
2956
2956
|
const n = (180 + e[0]) / 360, i = (r = e[1], (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + r * Math.PI / 360))) / 360);
|
|
2957
2957
|
var r;
|
|
2958
2958
|
const s = Math.pow(2, t.z);
|
|
2959
|
-
return [ Math.round(n * s *
|
|
2959
|
+
return [ Math.round(n * s * Fn), Math.round(i * s * Fn) ];
|
|
2960
2960
|
}
|
|
2961
2961
|
function Dn(e, t, n) {
|
|
2962
2962
|
const i = e[0] - t[0], r = e[1] - t[1], s = e[0] - n[0], o = e[1] - n[1];
|
|
@@ -3006,7 +3006,7 @@ function D(e) {
|
|
|
3006
3006
|
const s = [];
|
|
3007
3007
|
for (let i = 0; i < e[r].length; i++) {
|
|
3008
3008
|
const o = En(e[r][i], n);
|
|
3009
|
-
|
|
3009
|
+
On(t, o), s.push(o);
|
|
3010
3010
|
}
|
|
3011
3011
|
i.push(s);
|
|
3012
3012
|
}
|
|
@@ -3026,10 +3026,10 @@ function D(e) {
|
|
|
3026
3026
|
let r = e[0] - n[0] > t ? -i : n[0] - e[0] > t ? i : 0;
|
|
3027
3027
|
0 === r && (r = e[0] - n[2] > t ? -i : n[2] - e[0] > t ? i : 0), e[0] += r;
|
|
3028
3028
|
}
|
|
3029
|
-
|
|
3029
|
+
On(t, e);
|
|
3030
3030
|
}
|
|
3031
3031
|
function Xn(e, t, n, i) {
|
|
3032
|
-
const r = Math.pow(2, i.z) *
|
|
3032
|
+
const r = Math.pow(2, i.z) * Fn, s = [ i.x * Fn, i.y * Fn ], o = [];
|
|
3033
3033
|
if (!e) return o;
|
|
3034
3034
|
for (const i of e) for (const e of i) {
|
|
3035
3035
|
const i = [ e.x + s[0], e.y + s[1] ];
|
|
@@ -3038,13 +3038,13 @@ function D(e) {
|
|
|
3038
3038
|
return o;
|
|
3039
3039
|
}
|
|
3040
3040
|
function Yn(e, t, n, i) {
|
|
3041
|
-
const r = Math.pow(2, i.z) *
|
|
3041
|
+
const r = Math.pow(2, i.z) * Fn, s = [ i.x * Fn, i.y * Fn ], o = [];
|
|
3042
3042
|
if (!e) return o;
|
|
3043
3043
|
for (const n of e) {
|
|
3044
3044
|
const e = [];
|
|
3045
3045
|
for (const i of n) {
|
|
3046
3046
|
const n = [ i.x + s[0], i.y + s[1] ];
|
|
3047
|
-
|
|
3047
|
+
On(t, n), e.push(n);
|
|
3048
3048
|
}
|
|
3049
3049
|
o.push(e);
|
|
3050
3050
|
}
|
|
@@ -3214,7 +3214,7 @@ function D(e) {
|
|
|
3214
3214
|
}
|
|
3215
3215
|
error(e, ...t) {
|
|
3216
3216
|
const n = `${this.key}${t.map((e => `[${e}]`)).join("")}`;
|
|
3217
|
-
this.errors.push(new
|
|
3217
|
+
this.errors.push(new Ot(n, e));
|
|
3218
3218
|
}
|
|
3219
3219
|
checkSubtype(e, t) {
|
|
3220
3220
|
const n = Zt(e, t);
|
|
@@ -3493,8 +3493,8 @@ function D(e) {
|
|
|
3493
3493
|
const r = i - n, s = e - n;
|
|
3494
3494
|
return 0 === r ? 0 : 1 === t ? s / r : (Math.pow(t, s) - 1) / (Math.pow(t, r) - 1);
|
|
3495
3495
|
}
|
|
3496
|
-
var
|
|
3497
|
-
class
|
|
3496
|
+
var Fi = Ci;
|
|
3497
|
+
class Oi {
|
|
3498
3498
|
constructor(e, t) {
|
|
3499
3499
|
this.type = e, this.args = t;
|
|
3500
3500
|
}
|
|
@@ -3512,7 +3512,7 @@ function D(e) {
|
|
|
3512
3512
|
n = n || e.type, r.push(e);
|
|
3513
3513
|
}
|
|
3514
3514
|
const s = i && r.some((e => Zt(i, e.type)));
|
|
3515
|
-
return new
|
|
3515
|
+
return new Oi(s ? Ut : n, r);
|
|
3516
3516
|
}
|
|
3517
3517
|
evaluate(e) {
|
|
3518
3518
|
let t, n = null, i = 0;
|
|
@@ -3536,7 +3536,7 @@ function D(e) {
|
|
|
3536
3536
|
})), e;
|
|
3537
3537
|
}
|
|
3538
3538
|
}
|
|
3539
|
-
var Ri =
|
|
3539
|
+
var Ri = Oi;
|
|
3540
3540
|
class Ei {
|
|
3541
3541
|
constructor(e, t) {
|
|
3542
3542
|
this.type = t.type, this.bindings = [].concat(e), this.result = t;
|
|
@@ -3976,9 +3976,9 @@ function D(e) {
|
|
|
3976
3976
|
image: An,
|
|
3977
3977
|
in: zi,
|
|
3978
3978
|
"index-of": Ui,
|
|
3979
|
-
interpolate:
|
|
3980
|
-
"interpolate-hcl":
|
|
3981
|
-
"interpolate-lab":
|
|
3979
|
+
interpolate: Fi,
|
|
3980
|
+
"interpolate-hcl": Fi,
|
|
3981
|
+
"interpolate-lab": Fi,
|
|
3982
3982
|
length: rr,
|
|
3983
3983
|
let: Di,
|
|
3984
3984
|
literal: mn,
|
|
@@ -4213,7 +4213,7 @@ function D(e) {
|
|
|
4213
4213
|
return {
|
|
4214
4214
|
kind: "composite",
|
|
4215
4215
|
interpolationType: s,
|
|
4216
|
-
interpolationFactor:
|
|
4216
|
+
interpolationFactor: Fi.interpolationFactor.bind(void 0, s),
|
|
4217
4217
|
zoomStops: r.map((e => e[0])),
|
|
4218
4218
|
evaluate: ({zoom: n}, i) => br({
|
|
4219
4219
|
stops: r,
|
|
@@ -4229,7 +4229,7 @@ function D(e) {
|
|
|
4229
4229
|
return {
|
|
4230
4230
|
kind: "camera",
|
|
4231
4231
|
interpolationType: n,
|
|
4232
|
-
interpolationFactor:
|
|
4232
|
+
interpolationFactor: Fi.interpolationFactor.bind(void 0, n),
|
|
4233
4233
|
zoomStops: e.stops.map((e => e[0])),
|
|
4234
4234
|
evaluate: ({zoom: n}) => a(e, t, n, l, h)
|
|
4235
4235
|
};
|
|
@@ -4355,7 +4355,7 @@ function D(e) {
|
|
|
4355
4355
|
return this._styleExpression.evaluate(e, t, n, i, r, s);
|
|
4356
4356
|
}
|
|
4357
4357
|
interpolationFactor(e, t, n) {
|
|
4358
|
-
return this.interpolationType ?
|
|
4358
|
+
return this.interpolationType ? Fi.interpolationFactor(this.interpolationType, e, t, n) : 0;
|
|
4359
4359
|
}
|
|
4360
4360
|
}
|
|
4361
4361
|
function Ir(e, t) {
|
|
@@ -4363,17 +4363,17 @@ function D(e) {
|
|
|
4363
4363
|
const n = e.value.expression, i = $n(n);
|
|
4364
4364
|
if (!i && !function(e) {
|
|
4365
4365
|
return "data-driven" === e["property-type"];
|
|
4366
|
-
}(t)) return fr([ new
|
|
4366
|
+
}(t)) return fr([ new Ot("", "data expressions not supported") ]);
|
|
4367
4367
|
const r = Kn(n, [ "zoom", "pitch", "distance-from-center" ]);
|
|
4368
4368
|
if (!r && !function(e) {
|
|
4369
4369
|
return !!e.expression && e.expression.parameters.indexOf("zoom") > -1;
|
|
4370
|
-
}(t)) return fr([ new
|
|
4370
|
+
}(t)) return fr([ new Ot("", "zoom expressions not supported") ]);
|
|
4371
4371
|
const s = kr(n);
|
|
4372
|
-
if (!s && !r) return fr([ new
|
|
4373
|
-
if (s instanceof
|
|
4374
|
-
if (s instanceof
|
|
4372
|
+
if (!s && !r) return fr([ new Ot("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.') ]);
|
|
4373
|
+
if (s instanceof Ot) return fr([ s ]);
|
|
4374
|
+
if (s instanceof Fi && !dr(t)) return fr([ new Ot("", '"interpolate" expressions cannot be used with this property') ]);
|
|
4375
4375
|
if (!s) return ur(new Mr(i ? "constant" : "source", e.value));
|
|
4376
|
-
const o = s instanceof
|
|
4376
|
+
const o = s instanceof Fi ? s.interpolation : void 0;
|
|
4377
4377
|
return ur(new Pr(i ? "camera" : "composite", e.value, s.labels, o));
|
|
4378
4378
|
}
|
|
4379
4379
|
class Cr {
|
|
@@ -4394,24 +4394,24 @@ function D(e) {
|
|
|
4394
4394
|
let t = null;
|
|
4395
4395
|
if (e instanceof Di) t = kr(e.result); else if (e instanceof Ri) {
|
|
4396
4396
|
for (const n of e.args) if (t = kr(n), t) break;
|
|
4397
|
-
} else (e instanceof oi || e instanceof
|
|
4398
|
-
return t instanceof
|
|
4397
|
+
} else (e instanceof oi || e instanceof Fi) && e.input instanceof Cn && "zoom" === e.input.name && (t = e);
|
|
4398
|
+
return t instanceof Ot || e.eachChild((e => {
|
|
4399
4399
|
const n = kr(e);
|
|
4400
|
-
n instanceof
|
|
4400
|
+
n instanceof Ot ? t = n : !t && n ? t = new Ot("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.') : t && n && t !== n && (t = new Ot("", 'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'));
|
|
4401
4401
|
})), t;
|
|
4402
4402
|
}
|
|
4403
|
-
function
|
|
4404
|
-
if (Array.isArray(e)) return e.map(
|
|
4403
|
+
function Fr(e) {
|
|
4404
|
+
if (Array.isArray(e)) return e.map(Fr);
|
|
4405
4405
|
if (e instanceof Object && !(e instanceof Number || e instanceof String || e instanceof Boolean)) {
|
|
4406
4406
|
const t = {};
|
|
4407
|
-
for (const n in e) t[n] =
|
|
4407
|
+
for (const n in e) t[n] = Fr(e[n]);
|
|
4408
4408
|
return t;
|
|
4409
4409
|
}
|
|
4410
4410
|
return function(e) {
|
|
4411
4411
|
return e instanceof Number || e instanceof String || e instanceof Boolean ? e.valueOf() : e;
|
|
4412
4412
|
}(e);
|
|
4413
4413
|
}
|
|
4414
|
-
function
|
|
4414
|
+
function Or(e, t = "fill") {
|
|
4415
4415
|
if (null == e) return {
|
|
4416
4416
|
filter: () => !0,
|
|
4417
4417
|
needGeometry: !1,
|
|
@@ -4422,7 +4422,7 @@ function D(e) {
|
|
|
4422
4422
|
try {
|
|
4423
4423
|
i = function(e) {
|
|
4424
4424
|
if (!Dr(e)) return e;
|
|
4425
|
-
let t =
|
|
4425
|
+
let t = Fr(e);
|
|
4426
4426
|
return Er(t), t = Rr(t), t;
|
|
4427
4427
|
}(n);
|
|
4428
4428
|
} catch (e) {
|
|
@@ -4574,7 +4574,7 @@ function D(e) {
|
|
|
4574
4574
|
}
|
|
4575
4575
|
if (xt(e)) return new Function("f", `var p = (f && f.properties || {}); return ${_t(e)}`);
|
|
4576
4576
|
{
|
|
4577
|
-
let t =
|
|
4577
|
+
let t = Or(e);
|
|
4578
4578
|
t = t && t.filter;
|
|
4579
4579
|
const n = (e, n) => (Ur.zoom = n, t && t(Ur, e));
|
|
4580
4580
|
return n;
|
|
@@ -4944,7 +4944,7 @@ function D(e) {
|
|
|
4944
4944
|
height: r
|
|
4945
4945
|
}, s);
|
|
4946
4946
|
}
|
|
4947
|
-
this.iconAtlas = new
|
|
4947
|
+
this.iconAtlas = new F(e);
|
|
4948
4948
|
}
|
|
4949
4949
|
if (n && Object.keys(n).length) {
|
|
4950
4950
|
for (const e in n) {
|
|
@@ -5103,7 +5103,7 @@ function D(e) {
|
|
|
5103
5103
|
}
|
|
5104
5104
|
function ms(e) {
|
|
5105
5105
|
let t = e.positions, n = e.image && e.image.format || "alpha";
|
|
5106
|
-
if (e instanceof
|
|
5106
|
+
if (e instanceof F) {
|
|
5107
5107
|
t = {};
|
|
5108
5108
|
for (const n in e.positions) {
|
|
5109
5109
|
const i = e.positions[n];
|
|
@@ -5298,14 +5298,14 @@ function D(e) {
|
|
|
5298
5298
|
function ks(e) {
|
|
5299
5299
|
return !(Cs.Arabic(e) || Cs["Arabic Supplement"](e) || Cs["Arabic Extended-A"](e) || Cs["Arabic Presentation Forms-A"](e) || Cs["Arabic Presentation Forms-B"](e));
|
|
5300
5300
|
}
|
|
5301
|
-
function
|
|
5301
|
+
function Fs(e) {
|
|
5302
5302
|
return !!(!(e < 11904) && (Cs["Bopomofo Extended"](e) || Cs.Bopomofo(e) || Cs["CJK Compatibility Forms"](e) || Cs["CJK Compatibility Ideographs"](e) || Cs["CJK Compatibility"](e) || Cs["CJK Radicals Supplement"](e) || Cs["CJK Strokes"](e) || Cs["CJK Symbols and Punctuation"](e) || Cs["CJK Unified Ideographs Extension A"](e) || Cs["CJK Unified Ideographs"](e) || Cs["Enclosed CJK Letters and Months"](e) || Cs["Halfwidth and Fullwidth Forms"](e) || Cs.Hiragana(e) || Cs["Ideographic Description Characters"](e) || Cs["Kangxi Radicals"](e) || Cs["Katakana Phonetic Extensions"](e) || Cs.Katakana(e) || Cs["Vertical Forms"](e) || Cs["Yi Radicals"](e) || Cs["Yi Syllables"](e)));
|
|
5303
5303
|
}
|
|
5304
|
-
function
|
|
5304
|
+
function Os(e) {
|
|
5305
5305
|
return !!(746 === e || 747 === e || !(e < 4352) && (Cs["Bopomofo Extended"](e) || Cs.Bopomofo(e) || Cs["CJK Compatibility Forms"](e) && !(e >= 65097 && e <= 65103) || Cs["CJK Compatibility Ideographs"](e) || Cs["CJK Compatibility"](e) || Cs["CJK Radicals Supplement"](e) || Cs["CJK Strokes"](e) || !(!Cs["CJK Symbols and Punctuation"](e) || e >= 12296 && e <= 12305 || e >= 12308 && e <= 12319 || 12336 === e) || Cs["CJK Unified Ideographs Extension A"](e) || Cs["CJK Unified Ideographs"](e) || Cs["Enclosed CJK Letters and Months"](e) || Cs["Hangul Compatibility Jamo"](e) || Cs["Hangul Jamo Extended-A"](e) || Cs["Hangul Jamo Extended-B"](e) || Cs["Hangul Jamo"](e) || Cs["Hangul Syllables"](e) || Cs.Hiragana(e) || Cs["Ideographic Description Characters"](e) || Cs.Kanbun(e) || Cs["Kangxi Radicals"](e) || Cs["Katakana Phonetic Extensions"](e) || Cs.Katakana(e) && 12540 !== e || !(!Cs["Halfwidth and Fullwidth Forms"](e) || 65288 === e || 65289 === e || 65293 === e || e >= 65306 && e <= 65310 || 65339 === e || 65341 === e || 65343 === e || e >= 65371 && e <= 65503 || 65507 === e || e >= 65512 && e <= 65519) || !(!Cs["Small Form Variants"](e) || e >= 65112 && e <= 65118 || e >= 65123 && e <= 65126) || Cs["Unified Canadian Aboriginal Syllabics"](e) || Cs["Unified Canadian Aboriginal Syllabics Extended"](e) || Cs["Vertical Forms"](e) || Cs["Yijing Hexagram Symbols"](e) || Cs["Yi Syllables"](e) || Cs["Yi Radicals"](e)));
|
|
5306
5306
|
}
|
|
5307
5307
|
function Rs(e) {
|
|
5308
|
-
return !(
|
|
5308
|
+
return !(Os(e) || function(e) {
|
|
5309
5309
|
return !!(Cs["Latin-1 Supplement"](e) && (167 === e || 169 === e || 174 === e || 177 === e || 188 === e || 189 === e || 190 === e || 215 === e || 247 === e) || Cs["General Punctuation"](e) && (8214 === e || 8224 === e || 8225 === e || 8240 === e || 8241 === e || 8251 === e || 8252 === e || 8258 === e || 8263 === e || 8264 === e || 8265 === e || 8273 === e) || Cs["Letterlike Symbols"](e) || Cs["Number Forms"](e) || Cs["Miscellaneous Technical"](e) && (e >= 8960 && e <= 8967 || e >= 8972 && e <= 8991 || e >= 8996 && e <= 9e3 || 9003 === e || e >= 9085 && e <= 9114 || e >= 9150 && e <= 9165 || 9167 === e || e >= 9169 && e <= 9179 || e >= 9186 && e <= 9215) || Cs["Control Pictures"](e) && 9251 !== e || Cs["Optical Character Recognition"](e) || Cs["Enclosed Alphanumerics"](e) || Cs["Geometric Shapes"](e) || Cs["Miscellaneous Symbols"](e) && !(e >= 9754 && e <= 9759) || Cs["Miscellaneous Symbols and Arrows"](e) && (e >= 11026 && e <= 11055 || e >= 11088 && e <= 11097 || e >= 11192 && e <= 11243) || Cs["CJK Symbols and Punctuation"](e) || Cs.Katakana(e) || Cs["Private Use Area"](e) || Cs["CJK Compatibility Forms"](e) || Cs["Small Form Variants"](e) || Cs["Halfwidth and Fullwidth Forms"](e) || 8734 === e || 8756 === e || 8757 === e || e >= 9984 && e <= 10087 || e >= 10102 && e <= 10131 || 65532 === e || 65533 === e);
|
|
5310
5310
|
}(e));
|
|
5311
5311
|
}
|
|
@@ -5445,7 +5445,7 @@ function D(e) {
|
|
|
5445
5445
|
let o = 0;
|
|
5446
5446
|
for (let n = 0; n < e.length; n++) {
|
|
5447
5447
|
const a = e.codePointAt(n), l = i[a];
|
|
5448
|
-
l && (l && !Us[a] && (o += l.metrics.advance + t), n < e.length - 1 && (Bs[a] ||
|
|
5448
|
+
l && (l && !Us[a] && (o += l.metrics.advance + t), n < e.length - 1 && (Bs[a] || Fs(a)) && r.push(Ws(n + 1, o, s, r, js(a, e.codePointAt(n + 1)), !1)));
|
|
5449
5449
|
}
|
|
5450
5450
|
return Xs(Ws(e.length, o, s, r, 0, !0));
|
|
5451
5451
|
}(c, o, n, t)), function(e, t, n, i, r, s, o, a, l, h) {
|
|
@@ -5460,7 +5460,7 @@ function D(e) {
|
|
|
5460
5460
|
const s = d.length;
|
|
5461
5461
|
for (let e = 0; e < r.length; e++) {
|
|
5462
5462
|
const n = r.codePointAt(e), i = t[n];
|
|
5463
|
-
i && (
|
|
5463
|
+
i && (Os(n) && o !== Ns ? (32 !== n && d.push({
|
|
5464
5464
|
glyph: n,
|
|
5465
5465
|
x: c,
|
|
5466
5466
|
y: 0,
|
|
@@ -6306,12 +6306,16 @@ function D(e) {
|
|
|
6306
6306
|
name: "aMarkerDy"
|
|
6307
6307
|
}), o;
|
|
6308
6308
|
}
|
|
6309
|
+
_prepareFnTypes() {
|
|
6310
|
+
this.iconAtlas || (this._fnTypes.markerWidthFn = this._fnTypes.markerHeightFn = this._fnTypes.markerDxFn = this._fnTypes.markerDyFn = this._fnTypes.markerPitchAlignmentFn = this._fnTypes.markerRotationAlignmentFn = this._fnTypes.markerRotationFn = this._fnTypes.markerAllowOverlapFn = this._fnTypes.markerIgnorePlacementFn = this._fnTypes.markerOpacityFn = null),
|
|
6311
|
+
this.glyphAtlas || (this._fnTypes.textFillFn = this._fnTypes.textSizeFn = this._fnTypes.textHaloFillFn = this._fnTypes.textHaloRadiusFn = this._fnTypes.textHaloOpacityFn = this._fnTypes.textDxFn = this._fnTypes.textDyFn = this._fnTypes.textPitchAlignmentFn = this._fnTypes.textRotationAlignmentFn = this._fnTypes.textRotationFn = this._fnTypes.textAllowOverlapFn = this._fnTypes.textIgnorePlacementFn = this._fnTypes.textOpacityFn = null);
|
|
6312
|
+
}
|
|
6309
6313
|
createDataPack() {
|
|
6310
6314
|
if (!this.iconAtlas && !this.glyphAtlas) {
|
|
6311
6315
|
if (!this.options.allowEmptyPack) return null;
|
|
6312
6316
|
this.empty = !0;
|
|
6313
6317
|
}
|
|
6314
|
-
this.countOutOfAngle = 0, this.lineVertex = [];
|
|
6318
|
+
this._prepareFnTypes(), this.countOutOfAngle = 0, this.lineVertex = [];
|
|
6315
6319
|
const e = super.createDataPack.apply(this, arguments);
|
|
6316
6320
|
return e ? (e.lineVertex = new Int16Array(this.lineVertex), e.buffers.push(e.lineVertex.buffer),
|
|
6317
6321
|
e) : null;
|
|
@@ -6327,10 +6331,10 @@ function D(e) {
|
|
|
6327
6331
|
let u = this.data.aPosition.getLength() / c;
|
|
6328
6332
|
const f = e.symbol, d = e.feature.properties, p = "line" === this._textPlacement && !f.isIconText, g = !a, m = !o, y = g && p && function(e) {
|
|
6329
6333
|
let t = 0;
|
|
6330
|
-
for (let n = 0; n < e.length; n++) if (
|
|
6334
|
+
for (let n = 0; n < e.length; n++) if (Os(e.charAt(n).charCodeAt(0))) t = 0; else if (t++,
|
|
6331
6335
|
t >= 1) return !1;
|
|
6332
6336
|
return !0;
|
|
6333
|
-
}(e.getIconAndGlyph().glyph.text) ? 1 : 0, {textFillFn: x, textSizeFn: _, textHaloFillFn: v, textHaloRadiusFn: b, textHaloOpacityFn: A, textDxFn: T, textDyFn: I, textPitchAlignmentFn: C, textRotationAlignmentFn: k, textRotationFn:
|
|
6337
|
+
}(e.getIconAndGlyph().glyph.text) ? 1 : 0, {textFillFn: x, textSizeFn: _, textHaloFillFn: v, textHaloRadiusFn: b, textHaloOpacityFn: A, textDxFn: T, textDyFn: I, textPitchAlignmentFn: C, textRotationAlignmentFn: k, textRotationFn: F, textAllowOverlapFn: O, textIgnorePlacementFn: R, textOpacityFn: E, markerWidthFn: D, markerHeightFn: L, markerDxFn: H, markerDyFn: N, markerPitchAlignmentFn: z, markerRotationAlignmentFn: V, markerRotationFn: U, markerAllowOverlapFn: B, markerIgnorePlacementFn: G, markerOpacityFn: j} = this._fnTypes;
|
|
6334
6338
|
let W, X, Y, Z, q, $ = [ 0, 0, 0, 0 ], J = 14, K = [ 0, 0, 0, 0 ], Q = 0, ee = 0, te = 0, ne = 0, re = 0, se = 0, oe = 0, ae = 0, le = 0, he = 0, ce = 0, ue = 0, fe = 0, de = 0;
|
|
6335
6339
|
if (g) {
|
|
6336
6340
|
const t = e.getIconAndGlyph().glyph.font;
|
|
@@ -6362,7 +6366,7 @@ function D(e) {
|
|
|
6362
6366
|
_ && (J = _(this.options.zoom, d), M(J) && (J = 14)), v && (K = v(null, d), ie(K) ? this.dynamicAttrs.aTextHaloFill = 1 : K = ht([], K)),
|
|
6363
6367
|
b && (Q = b(null, d)), A && (ee = 255 * A(null, d)), T && (te = T(null, d) || 0),
|
|
6364
6368
|
I && (ne = I(null, d) || 0), C && (he = +("map" === C(null, d))), k && (ue = +("map" === k(null, d))),
|
|
6365
|
-
|
|
6369
|
+
F && (de = P(F(null, d), 0, 360) * Math.PI / 180);
|
|
6366
6370
|
}
|
|
6367
6371
|
m && (Z = i ? function(e) {
|
|
6368
6372
|
const t = e.image, n = e.top - 1 / t.pixelRatio, i = e.left - 1 / t.pixelRatio, r = e.bottom + 1 / t.pixelRatio, o = e.right + 1 / t.pixelRatio;
|
|
@@ -6404,18 +6408,19 @@ function D(e) {
|
|
|
6404
6408
|
ie(re) && (this.dynamicAttrs.aMarkerWidth = 1), ie(se) && (this.dynamicAttrs.aMarkerHeight = 1),
|
|
6405
6409
|
(ie(oe) || ie(te)) && (this.dynamicAttrs.aDxDy = 1), (ie(ae) || ie(te)) && (this.dynamicAttrs.aDxDy = 1),
|
|
6406
6410
|
(ie(le) || ie(he)) && (this.dynamicAttrs.aPitchAlign = 1), (ie(ce) || ie(ue)) && (this.dynamicAttrs.aRotationAlign = 1),
|
|
6407
|
-
(ie(fe) || ie(de)) && (this.dynamicAttrs.aRotation = 1), (B ||
|
|
6408
|
-
!W &&
|
|
6411
|
+
(ie(fe) || ie(de)) && (this.dynamicAttrs.aRotation = 1), (B || O) && (B && (W = B(null, d) || 0),
|
|
6412
|
+
!W && O && (W = O(null, d) || 0)), (G || R) && (G && (X = G(null, d) || 0), !X && R && (X = R(null, d) || 0)),
|
|
6409
6413
|
j && (q = 255 * (j(this.options.zoom, d) || 0));
|
|
6410
6414
|
let pe = 0;
|
|
6411
6415
|
E && (pe = 255 * (E(this.options.zoom, d) || 0));
|
|
6412
6416
|
const ge = Y && Y.length || 0;
|
|
6413
6417
|
this.ensureDataCapacity(4 * (ge + (Z && Z.length || 0)), l.length);
|
|
6414
|
-
const me = this.options.EXTENT, {altitudeScale: ye, altitudeProperty: xe, defaultAltitude: _e} = this.options, {altitude: ve} = S(e.feature, ye, xe, _e), be = (e, t, n, i, r, s, o) => {
|
|
6418
|
+
const me = this.options.EXTENT, {altitudeScale: ye, altitudeProperty: xe, defaultAltitude: _e} = this.options, {altitude: ve} = S(e.feature, ye, xe, _e), be = this.needAltitudeAttribute(), Ae = (e, t, n, i, r, s, o) => {
|
|
6415
6419
|
if (!t) return;
|
|
6416
6420
|
const a = e ? ge : 1;
|
|
6417
6421
|
for (let l = 0; l < t.length; l++) {
|
|
6418
6422
|
const c = t[l], {tl: f, tr: d, bl: g, br: m, tex: x} = c;
|
|
6423
|
+
let _;
|
|
6419
6424
|
this._fillPos(h, n, i, r, 10 * f.x, 10 * f.y, x.x, x.y + x.h, e, o), this._fillTextData(h, p, a, c.glyphOffset, s, y, s.axis, s.angleR),
|
|
6420
6425
|
this._fillFnTypeData(h, $, J, K, Q, ee, te, ne, re, se, oe, ae, q, pe, le, he, ce, ue, fe, de, W, X),
|
|
6421
6426
|
this._fillPos(h, n, i, r, 10 * d.x, 10 * d.y, x.x + x.w, x.y + x.h, e, o), this._fillTextData(h, p, a, c.glyphOffset, s, y, s.axis, s.angleR),
|
|
@@ -6424,16 +6429,16 @@ function D(e) {
|
|
|
6424
6429
|
this._fillFnTypeData(h, $, J, K, Q, ee, te, ne, re, se, oe, ae, q, pe, le, he, ce, ue, fe, de, W, X),
|
|
6425
6430
|
this._fillPos(h, n, i, r, 10 * m.x, 10 * m.y, x.x + x.w, x.y, e, o), this._fillTextData(h, p, a, c.glyphOffset, s, y, s.axis, s.angleR),
|
|
6426
6431
|
this._fillFnTypeData(h, $, J, K, Q, ee, te, ne, re, se, oe, ae, q, pe, le, he, ce, ue, fe, de, W, X),
|
|
6427
|
-
this.addElements(u, u + 1, u + 2), this.addElements(u + 1, u + 2, u + 3), u += 4
|
|
6428
|
-
|
|
6432
|
+
this.addElements(u, u + 1, u + 2), this.addElements(u + 1, u + 2, u + 3), u += 4,
|
|
6433
|
+
_ = be ? Math.max(Math.abs(n), Math.abs(i)) : Math.max(Math.abs(n), Math.abs(i), Math.abs(r)),
|
|
6429
6434
|
_ > this.maxPos && (this.maxPos = _);
|
|
6430
6435
|
}
|
|
6431
|
-
},
|
|
6436
|
+
}, Te = "text" === this.options.pluginType;
|
|
6432
6437
|
for (let e = 0; e < l.length; e++) {
|
|
6433
6438
|
const t = l[e], n = t.z || ve || 0;
|
|
6434
6439
|
if (me !== 1 / 0 && w(t, me)) continue;
|
|
6435
6440
|
const i = t.x, r = t.y;
|
|
6436
|
-
m &&
|
|
6441
|
+
m && Ae(!1, Z, i, r, n, t), g && (Te || Ae(!0, Y, i, r, n, t, !0), Ae(!0, Y, i, r, n, t, !1));
|
|
6437
6442
|
}
|
|
6438
6443
|
}
|
|
6439
6444
|
_fillPos(e, t, n, i, r, s, o, a, l, h) {
|
|
@@ -6457,7 +6462,7 @@ function D(e) {
|
|
|
6457
6462
|
}
|
|
6458
6463
|
}
|
|
6459
6464
|
_fillFnTypeData(e, t, n, i, r, s, o, a, l, h, c, u, f, d, p, g, m, y, x, _, v, b) {
|
|
6460
|
-
const {textFillFn: A, textSizeFn: T, textHaloFillFn: S, textHaloRadiusFn: w, textDxFn: P, textDyFn: I, textPitchAlignmentFn: C, textRotationAlignmentFn: k, textRotationFn:
|
|
6465
|
+
const {textFillFn: A, textSizeFn: T, textHaloFillFn: S, textHaloRadiusFn: w, textDxFn: P, textDyFn: I, textPitchAlignmentFn: C, textRotationAlignmentFn: k, textRotationFn: F, textAllowOverlapFn: O, textIgnorePlacementFn: R, textOpacityFn: E, textHaloOpacityFn: D, markerWidthFn: L, markerHeightFn: H, markerDxFn: N, markerDyFn: z, markerPitchAlignmentFn: V, markerRotationAlignmentFn: U, markerRotationFn: B, markerAllowOverlapFn: G, markerIgnorePlacementFn: j, markerOpacityFn: W} = this._fnTypes;
|
|
6461
6466
|
if (A) {
|
|
6462
6467
|
let n = e.aTextFill.currentIndex;
|
|
6463
6468
|
e.aTextFill[n++] = t[0], e.aTextFill[n++] = t[1], e.aTextFill[n++] = t[2], e.aTextFill[n++] = t[3],
|
|
@@ -6528,7 +6533,7 @@ function D(e) {
|
|
|
6528
6533
|
e.aRotationAlign[t++] = m, e.aRotationAlign.currentIndex = t, t = e.aRotationAlign.currentIndex,
|
|
6529
6534
|
e.aRotationAlign[t++] = y, e.aRotationAlign.currentIndex = t;
|
|
6530
6535
|
}
|
|
6531
|
-
if (B ||
|
|
6536
|
+
if (B || F) if (X) {
|
|
6532
6537
|
let t = e.aRotation.currentIndex;
|
|
6533
6538
|
e.aRotation[t++] = 9362 * _, e.aRotation.currentIndex = t;
|
|
6534
6539
|
} else {
|
|
@@ -6536,7 +6541,7 @@ function D(e) {
|
|
|
6536
6541
|
e.aRotation[t++] = 9362 * x, e.aRotation.currentIndex = t, t = e.aRotation.currentIndex,
|
|
6537
6542
|
e.aRotation[t++] = 9362 * _, e.aRotation.currentIndex = t;
|
|
6538
6543
|
}
|
|
6539
|
-
const Y = G ||
|
|
6544
|
+
const Y = G || O, Z = j || R;
|
|
6540
6545
|
if (Y || Z) {
|
|
6541
6546
|
const t = (Y ? 8 : 0) + 4 * v, n = (Z ? 2 : 0) + b;
|
|
6542
6547
|
let i = e.aOverlap.currentIndex;
|
|
@@ -6692,7 +6697,7 @@ function D(e) {
|
|
|
6692
6697
|
function ko(e, t, n) {
|
|
6693
6698
|
return e[0] = t[0] * n, e[1] = t[1] * n, e[2] = t[2] * n, e[3] = t[3] * n, e;
|
|
6694
6699
|
}
|
|
6695
|
-
function
|
|
6700
|
+
function Fo(e, t, n) {
|
|
6696
6701
|
return e[0] = t, e[1] = n, e;
|
|
6697
6702
|
}
|
|
6698
6703
|
Math.hypot || (Math.hypot = function() {
|
|
@@ -6706,7 +6711,7 @@ function D(e) {
|
|
|
6706
6711
|
var e = new wo(2);
|
|
6707
6712
|
wo != Float32Array && (e[0] = 0, e[1] = 0);
|
|
6708
6713
|
}();
|
|
6709
|
-
const
|
|
6714
|
+
const Oo = 63, Ro = Math.cos(Math.PI / 180 * 37.5), Eo = Math.pow(2, 16) / 1, Do = new s, Lo = new s, Ho = new s;
|
|
6710
6715
|
class No extends gs {
|
|
6711
6716
|
static mergeLineFeatures(e, t, n, i) {
|
|
6712
6717
|
return bo(e, t, n, i);
|
|
@@ -6983,12 +6988,12 @@ function D(e) {
|
|
|
6983
6988
|
fillData(e, t, n, i, r, s, o, a, l, h) {
|
|
6984
6989
|
const {lineWidthFn: c, lineStrokeWidthFn: u, lineStrokeColorFn: f, lineColorFn: d, lineOpacityFn: p, lineDxFn: g, lineDyFn: m, linePatternAnimSpeedFn: y, linePatternGapFn: x} = this._fnTypes;
|
|
6985
6990
|
this.fillPosition(e, t, n, i);
|
|
6986
|
-
let _ =
|
|
6991
|
+
let _ = Oo * r;
|
|
6987
6992
|
_ = (Math.sign(_) || 1) * ((Math.floor(Math.abs(_)) >> 1 << 1) + +o);
|
|
6988
|
-
let v =
|
|
6993
|
+
let v = Oo * s;
|
|
6989
6994
|
v = (Math.sign(v) || 1) * ((Math.floor(Math.abs(v)) >> 1 << 1) + +a);
|
|
6990
6995
|
let b = e.aExtrude.currentIndex;
|
|
6991
|
-
e.aExtrude[b++] = _, e.aExtrude[b++] = v, (this.iconAtlas || this.hasDasharray) && (e.aExtrude[b++] =
|
|
6996
|
+
e.aExtrude[b++] = _, e.aExtrude[b++] = v, (this.iconAtlas || this.hasDasharray) && (e.aExtrude[b++] = Oo * h),
|
|
6992
6997
|
e.aExtrude.currentIndex = b, b = e.aLinesofar.currentIndex, e.aLinesofar[b++] = l,
|
|
6993
6998
|
e.aLinesofar.currentIndex = b, c && (b = e.aLineWidth.currentIndex, e.aLineWidth[b++] = Math.round(2 * this.feaLineWidth),
|
|
6994
6999
|
e.aLineWidth.currentIndex = b), u && (b = e.aLineStrokeWidth.currentIndex, e.aLineStrokeWidth[b++] = Math.round(2 * this.feaLineStrokeWidth),
|
|
@@ -7058,7 +7063,7 @@ function D(e) {
|
|
|
7058
7063
|
const Bo = [], Go = [];
|
|
7059
7064
|
function jo(e, t, n) {
|
|
7060
7065
|
const i = e.mag(), r = t.mag();
|
|
7061
|
-
|
|
7066
|
+
Fo(Bo, n.x, n.y), Fo(Go, t.x, t.y);
|
|
7062
7067
|
const s = (a = Go, (o = Bo)[0] * a[0] + o[1] * a[1]);
|
|
7063
7068
|
var o, a;
|
|
7064
7069
|
return -Math.sign(s) * Math.sqrt(r * r - i * i);
|
|
@@ -7334,12 +7339,12 @@ function D(e) {
|
|
|
7334
7339
|
return Aa(e.prev, e, e.next) < 0 ? Aa(e, t, e.next) >= 0 && Aa(e, e.prev, t) >= 0 : Aa(e, t, e.prev) < 0 || Aa(e, e.next, t) < 0;
|
|
7335
7340
|
}
|
|
7336
7341
|
function Ia(e, t) {
|
|
7337
|
-
const n =
|
|
7342
|
+
const n = Fa(e.i, e.x, e.y), i = Fa(t.i, t.x, t.y), r = e.next, s = t.prev;
|
|
7338
7343
|
return e.next = t, t.prev = e, n.next = r, r.prev = n, i.next = n, n.prev = i, s.next = i,
|
|
7339
7344
|
i.prev = s, i;
|
|
7340
7345
|
}
|
|
7341
7346
|
function Ca(e, t, n, i) {
|
|
7342
|
-
const r =
|
|
7347
|
+
const r = Fa(e, t, n);
|
|
7343
7348
|
return i ? (r.next = i.next, r.prev = i, i.next.prev = r, i.next = r) : (r.prev = r,
|
|
7344
7349
|
r.next = r), r;
|
|
7345
7350
|
}
|
|
@@ -7347,7 +7352,7 @@ function D(e) {
|
|
|
7347
7352
|
e.next.prev = e.prev, e.prev.next = e.next, e.prevZ && (e.prevZ.nextZ = e.nextZ),
|
|
7348
7353
|
e.nextZ && (e.nextZ.prevZ = e.prevZ);
|
|
7349
7354
|
}
|
|
7350
|
-
function
|
|
7355
|
+
function Fa(e, t, n) {
|
|
7351
7356
|
return {
|
|
7352
7357
|
i: e,
|
|
7353
7358
|
x: t,
|
|
@@ -7360,7 +7365,7 @@ function D(e) {
|
|
|
7360
7365
|
steiner: !1
|
|
7361
7366
|
};
|
|
7362
7367
|
}
|
|
7363
|
-
const
|
|
7368
|
+
const Oa = [], Ra = [];
|
|
7364
7369
|
function Ea(e, t) {
|
|
7365
7370
|
var n, i, r, o, a, l, h;
|
|
7366
7371
|
for (i = 1; i <= 8; i *= 2) {
|
|
@@ -7376,14 +7381,14 @@ function D(e) {
|
|
|
7376
7381
|
return n;
|
|
7377
7382
|
}
|
|
7378
7383
|
function Da(e, t, n, i) {
|
|
7379
|
-
return
|
|
7380
|
-
e =
|
|
7384
|
+
return Oa[0] = void 0 === e.x ? e[0] : e.x, Oa[1] = void 0 === e.y ? e[1] : e.y,
|
|
7385
|
+
e = Oa, Ra[0] = void 0 === t.x ? t[0] : t.x, Ra[1] = void 0 === t.y ? t[1] : t.y,
|
|
7381
7386
|
t = Ra, 8 & n ? [ e[0] + (t[0] - e[0]) * (i[3] - e[1]) / (t[1] - e[1]), i[3] ] : 4 & n ? [ e[0] + (t[0] - e[0]) * (i[1] - e[1]) / (t[1] - e[1]), i[1] ] : 2 & n ? [ i[2], e[1] + (t[1] - e[1]) * (i[2] - e[0]) / (t[0] - e[0]) ] : 1 & n ? [ i[0], e[1] + (t[1] - e[1]) * (i[0] - e[0]) / (t[0] - e[0]) ] : null;
|
|
7382
7387
|
}
|
|
7383
7388
|
function La(e, t) {
|
|
7384
|
-
|
|
7389
|
+
Oa[0] = void 0 === e.x ? e[0] : e.x, Oa[1] = void 0 === e.y ? e[1] : e.y;
|
|
7385
7390
|
var n = 0;
|
|
7386
|
-
return (e =
|
|
7391
|
+
return (e = Oa)[0] < t[0] ? n |= 1 : e[0] > t[2] && (n |= 2), e[1] < t[1] ? n |= 4 : e[1] > t[3] && (n |= 8),
|
|
7387
7392
|
n;
|
|
7388
7393
|
}
|
|
7389
7394
|
const Ha = [ 0, 0, 0, 0 ], Na = -9999999, za = [ {
|
|
@@ -7469,12 +7474,12 @@ function D(e) {
|
|
|
7469
7474
|
fillData(e, t, n, i, r, s, o, a) {
|
|
7470
7475
|
const {lineWidthFn: l, lineColorFn: h, lineOpacityFn: c, linePatternAnimSpeedFn: u, linePatternGapFn: f} = this._fnTypes, d = r.length;
|
|
7471
7476
|
for (let s = 0; s < d; s++) {
|
|
7472
|
-
this.fillPosition(e, t, n, i), ko(r[s], r[s],
|
|
7477
|
+
this.fillPosition(e, t, n, i), ko(r[s], r[s], Oo);
|
|
7473
7478
|
let d = e.aTubeNormal.currentIndex;
|
|
7474
7479
|
for (let t = 0; t < r[s].length; t++) e.aTubeNormal[d++] = r[s][t];
|
|
7475
7480
|
if (e.aTubeNormal.currentIndex = d, d = e.aLinesofar.currentIndex, e.aLinesofar[d++] = o,
|
|
7476
7481
|
e.aLinesofar.currentIndex = d, this.iconAtlas && (d = e.aNormalDistance.currentIndex,
|
|
7477
|
-
e.aNormalDistance[d++] =
|
|
7482
|
+
e.aNormalDistance[d++] = Oo * a, e.aNormalDistance.currentIndex = d, d = e.aTexInfo.currentIndex,
|
|
7478
7483
|
e.aTexInfo[d++] = this.feaTexInfo[0], e.aTexInfo[d++] = this.feaTexInfo[1], e.aTexInfo[d++] = this.feaTexInfo[2],
|
|
7479
7484
|
e.aTexInfo[d++] = this.feaTexInfo[3], e.aTexInfo.currentIndex = d), l) {
|
|
7480
7485
|
const t = at(this.options.metric);
|
|
@@ -7503,7 +7508,7 @@ function D(e) {
|
|
|
7503
7508
|
}
|
|
7504
7509
|
const Xa = [], Ya = [], Za = [], qa = [], $a = [];
|
|
7505
7510
|
function Ja(e, t, n, i, r, s, o, a) {
|
|
7506
|
-
Mo(Ya, n, i, r), Mo(Za, s, o, 0), Io(qa, Ya, Za), Po(Za, Za), Po(qa, qa),
|
|
7511
|
+
Mo(Ya, n, i, r), Mo(Za, s, o, 0), Io(qa, Ya, Za), Po(Za, Za), Po(qa, qa), Fo(Xa, e, t);
|
|
7507
7512
|
const l = function(e) {
|
|
7508
7513
|
var t = e[0], n = e[1];
|
|
7509
7514
|
return Math.hypot(t, n);
|
|
@@ -7758,7 +7763,7 @@ function D(e) {
|
|
|
7758
7763
|
n[t] = n[t] || {}, s[t] = s[t] || {};
|
|
7759
7764
|
for (const c in e[t]) {
|
|
7760
7765
|
if (h++, h <= i) continue;
|
|
7761
|
-
const e = r && !
|
|
7766
|
+
const e = r && !Os(+c), u = t + ":" + c + ":" + e;
|
|
7762
7767
|
let f;
|
|
7763
7768
|
if (this._cache.has(u) ? f = this._cache.get(u) : (f = this._tinySDF(n[t], t, c, e),
|
|
7764
7769
|
this._cache.add(u, f), l++), f = rl(f), s[t][c] = f, a.push(f.bitmap.data.buffer),
|
|
@@ -7922,7 +7927,7 @@ function D(e) {
|
|
|
7922
7927
|
}
|
|
7923
7928
|
}
|
|
7924
7929
|
fillData(e, t, n, i, r, s, o, a, l) {
|
|
7925
|
-
const h = !1 !== this.options.top, c = !1 !== this.options.side, u = this.options.EXTENT / this.options.tileSize, f = this.feaLineWidth || this.symbol.lineWidth / 2 * u, d =
|
|
7930
|
+
const h = !1 !== this.options.top, c = !1 !== this.options.side, u = this.options.EXTENT / this.options.tileSize, f = this.feaLineWidth || this.symbol.lineWidth / 2 * u, d = Oo * r, p = Oo * s, g = f * r + t, m = f * s + n;
|
|
7926
7931
|
this._fillTop(e, t, n, r, s, o, a, l, g, m, d, p), c && (h && this._fillTop(e, t, n, r, s, o, a, l, g, m, d, p),
|
|
7927
7932
|
this._fillTop(e, t, n, r, s, o, a, l, g, m, d, p), this._fillBottom(e, t, n, r, s, o, a, l, g, m, d, p),
|
|
7928
7933
|
this._fillBottom(e, t, n, r, s, o, a, l, g, m, d, p)), this.maxPos = Math.max(this.maxPos, Math.abs(t), Math.abs(n));
|
|
@@ -8081,7 +8086,7 @@ function D(e) {
|
|
|
8081
8086
|
let i;
|
|
8082
8087
|
n && (i = n(this.options.zoom, t) || [ 255, 255, 255, 255 ], ie(i) ? (this.dynamicAttrs.aColor = 1,
|
|
8083
8088
|
i = [ 0, 0, 0, 0 ]) : i = ht([], i));
|
|
8084
|
-
const r = this.data, s = this.symbol.markerSpacing || 250, o = this.symbol.markerPlacement || "point", a = "line" === this.symbol.markerRotationAlignment, l = this._getAnchors(e, s, o, a);
|
|
8089
|
+
const r = this.data, s = this.symbol.markerSpacing || 250, o = this.symbol.markerPlacement || "point", a = "line" === this.symbol.markerRotationAlignment, l = this._getAnchors(e, s, o, a), h = this.needAltitudeAttribute();
|
|
8085
8090
|
for (let e = 0; e < l.length; e++) {
|
|
8086
8091
|
const t = l[e];
|
|
8087
8092
|
if (this.fillPosition(this.data, t.x, t.y, t.z), a) {
|
|
@@ -8094,7 +8099,8 @@ function D(e) {
|
|
|
8094
8099
|
r.aColor[e++] = i[0], r.aColor[e++] = i[1], r.aColor[e++] = i[2], r.aColor[e++] = i[3],
|
|
8095
8100
|
r.aColor.currentIndex = e;
|
|
8096
8101
|
}
|
|
8097
|
-
|
|
8102
|
+
let n;
|
|
8103
|
+
n = h ? Math.max(Math.abs(t.x), Math.abs(t.y)) : Math.max(Math.abs(t.x), Math.abs(t.y), Math.abs(t.z || 0)),
|
|
8098
8104
|
n > this.maxPos && (this.maxPos = n);
|
|
8099
8105
|
}
|
|
8100
8106
|
}
|
|
@@ -9028,12 +9034,12 @@ function Ce(e, t, n, i, r, s) {
|
|
|
9028
9034
|
|
|
9029
9035
|
const ke = [];
|
|
9030
9036
|
|
|
9031
|
-
function
|
|
9037
|
+
function Fe(e) {
|
|
9032
9038
|
for (let t = 0; t < e.length; t++) ke[t] = e[t], ke[t] *= 255;
|
|
9033
9039
|
return 3 === e.length && (ke[3] = 255), ke;
|
|
9034
9040
|
}
|
|
9035
9041
|
|
|
9036
|
-
function
|
|
9042
|
+
function Oe(e, t = 4) {
|
|
9037
9043
|
return Re.bind(this, e, t);
|
|
9038
9044
|
}
|
|
9039
9045
|
|
|
@@ -11327,11 +11333,15 @@ function wt(e, t, n, i) {
|
|
|
11327
11333
|
for (let n = 0; n < e.length; n++) if (Dt(t[e[n]])) return !0;
|
|
11328
11334
|
return !1;
|
|
11329
11335
|
}(a, t) ? (Dt(t[o]) && Mt(e, t, n), l) : (void 0 === n.index && (e.deleteData(s),
|
|
11330
|
-
Pt(e, s)), null) : Dt(t[o])
|
|
11336
|
+
Pt(e, s)), null) : Dt(t[o]) && function(e, t) {
|
|
11337
|
+
if (e.startsWith("marker") && !t.properties.iconAtlas) return !1;
|
|
11338
|
+
if (e.startsWith("text") && !t.properties.glyphAtlas) return !1;
|
|
11339
|
+
return !0;
|
|
11340
|
+
}(o, e) ? (l = e.data[s] = new n.type(n.width * r.length), function(e, t, n, i, r) {
|
|
11331
11341
|
const {attrName: s} = i, o = (At + s + "Index").trim();
|
|
11332
11342
|
Mt(t, n, i);
|
|
11333
11343
|
const a = t.properties[o];
|
|
11334
|
-
|
|
11344
|
+
Ot(t, a, i, r);
|
|
11335
11345
|
}(l, e, t, n, i), l) : null;
|
|
11336
11346
|
}
|
|
11337
11347
|
|
|
@@ -11339,7 +11349,7 @@ function Mt(e, t, n) {
|
|
|
11339
11349
|
const {attrName: i, symbolName: r} = n, s = e.properties, o = (At + i + "Index").trim(), a = (At + i).trim();
|
|
11340
11350
|
if (s[o] && s[a]) return;
|
|
11341
11351
|
const l = function(e) {
|
|
11342
|
-
if (!e) return
|
|
11352
|
+
if (!e) return Ft;
|
|
11343
11353
|
const t = [];
|
|
11344
11354
|
for (let n = 0; n < e.length; n++) x(e[n][1]) && !_(e[n][1]).isZoomConstant && t.push(e[n][0]);
|
|
11345
11355
|
return t;
|
|
@@ -11375,13 +11385,13 @@ function It(e, t, n, i, r, s) {
|
|
|
11375
11385
|
if (!e || o._fnDataZoom === s) continue;
|
|
11376
11386
|
const n = (At + h + "Index").trim(), i = o.properties[n];
|
|
11377
11387
|
if (!i) continue;
|
|
11378
|
-
|
|
11388
|
+
Ot(o, i, l, t);
|
|
11379
11389
|
continue;
|
|
11380
11390
|
}
|
|
11381
|
-
const c = wt(o, n, l), u = l.define;
|
|
11391
|
+
const c = wt(o, n, l, t), u = l.define;
|
|
11382
11392
|
if (c) {
|
|
11383
11393
|
const n = (At + h + "Index").trim();
|
|
11384
|
-
if (
|
|
11394
|
+
if (Ot(o, o.properties[n], l, t), t._getFeatureStateStamp && (o._featureTimestamp = t._getFeatureStateStamp()),
|
|
11385
11395
|
u) {
|
|
11386
11396
|
const e = r.defines;
|
|
11387
11397
|
e[u] = 1, r.setDefines(e);
|
|
@@ -11406,9 +11416,9 @@ function kt(e, t, n) {
|
|
|
11406
11416
|
return !1;
|
|
11407
11417
|
}
|
|
11408
11418
|
|
|
11409
|
-
const
|
|
11419
|
+
const Ft = [];
|
|
11410
11420
|
|
|
11411
|
-
function
|
|
11421
|
+
function Ot(e, t, n, i) {
|
|
11412
11422
|
const {attrName: r, evaluate: s, index: o, width: a} = n, {aPickingId: l, features: h} = e.properties;
|
|
11413
11423
|
let c;
|
|
11414
11424
|
if (t) {
|
|
@@ -12434,7 +12444,7 @@ class In extends pn {
|
|
|
12434
12444
|
}, y = this.getSymbol(l), _ = this.getSymbolDef(l);
|
|
12435
12445
|
if (x(_.polygonPatternFileOrigin) && this._preparePatternOrigin(_, t, c ? [ 0, 0 ] : o, p),
|
|
12436
12446
|
(x(_.polygonPatternFileWidth) || x(_.polygonPatternFileWidth)) && this._preparePatternWidth(_, t, c ? d : 1, g, p),
|
|
12437
|
-
_.uvOffsetInMeter && x(_.uvOffset) && this._preparePatternOffset(_, t, g, p), Ce(m, "polygonFill", y, "polygonFill", An.polygonFill,
|
|
12447
|
+
_.uvOffsetInMeter && x(_.uvOffset) && this._preparePatternOffset(_, t, g, p), Ce(m, "polygonFill", y, "polygonFill", An.polygonFill, Oe(this.colorCache)),
|
|
12438
12448
|
Ce(m, "polygonOpacity", y, "polygonOpacity", An.polygonOpacity), Ce(m, "uvScale", y, "uvScale", An.uvScale),
|
|
12439
12449
|
void 0 === h) {
|
|
12440
12450
|
const e = this.getFnTypeConfig(l);
|
|
@@ -12584,7 +12594,7 @@ class In extends pn {
|
|
|
12584
12594
|
evaluate: (t, i) => {
|
|
12585
12595
|
let r = n(e.getZoom(), t);
|
|
12586
12596
|
return x(r) && (r = this.evaluateInFnTypeConfig(r, i, e, t, !0)), Array.isArray(r) || (r = this.colorCache[r] = this.colorCache[r] || m(r).unitArray()),
|
|
12587
|
-
r =
|
|
12597
|
+
r = Fe(r), r;
|
|
12588
12598
|
}
|
|
12589
12599
|
}, {
|
|
12590
12600
|
attrName: "aOpacity",
|
|
@@ -12729,9 +12739,9 @@ class In extends pn {
|
|
|
12729
12739
|
|
|
12730
12740
|
var Cn = "#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}";
|
|
12731
12741
|
|
|
12732
|
-
const kn = o.identity([]),
|
|
12742
|
+
const kn = o.identity([]), Fn = [];
|
|
12733
12743
|
|
|
12734
|
-
class
|
|
12744
|
+
class On extends pn {
|
|
12735
12745
|
static getBloomSymbol() {
|
|
12736
12746
|
return [ "lineBloom" ];
|
|
12737
12747
|
}
|
|
@@ -12757,7 +12767,7 @@ class Fn extends pn {
|
|
|
12757
12767
|
return !!super.needToRedraw() || !!this.isAnimating();
|
|
12758
12768
|
}
|
|
12759
12769
|
isBloom(e) {
|
|
12760
|
-
return !!this.getSymbol(e.properties.symbolIndex)[
|
|
12770
|
+
return !!this.getSymbol(e.properties.symbolIndex)[On.getBloomSymbol()[0]];
|
|
12761
12771
|
}
|
|
12762
12772
|
needPolygonOffset() {
|
|
12763
12773
|
return !0;
|
|
@@ -12774,9 +12784,9 @@ class Fn extends pn {
|
|
|
12774
12784
|
tileExtent: i.properties.tileExtent,
|
|
12775
12785
|
fogFactor: this.layer.options.fogFactor || 0
|
|
12776
12786
|
};
|
|
12777
|
-
this.setLineUniforms(l, h), Ce(h, "lineColor", l, "lineColor", "#fff",
|
|
12778
|
-
Ce(h, "linePatterGapColor", l, "linePatterGapColor", [ 0, 0, 0, 0 ],
|
|
12779
|
-
Ce(h, "lineStrokeColor", l, "lineStrokeColor", [ 0, 0, 0, 0 ],
|
|
12787
|
+
this.setLineUniforms(l, h), Ce(h, "lineColor", l, "lineColor", "#fff", Oe(this.colorCache)),
|
|
12788
|
+
Ce(h, "linePatterGapColor", l, "linePatterGapColor", [ 0, 0, 0, 0 ], Oe(this.colorCache)),
|
|
12789
|
+
Ce(h, "lineStrokeColor", l, "lineStrokeColor", [ 0, 0, 0, 0 ], Oe(this.colorCache)),
|
|
12780
12790
|
Ce(h, "lineDasharray", l, "lineDasharray", [ 0, 0, 0, 0 ], (e => {
|
|
12781
12791
|
let t;
|
|
12782
12792
|
if (e && e.length) {
|
|
@@ -12784,7 +12794,7 @@ class Fn extends pn {
|
|
|
12784
12794
|
1 === e.length ? t = [ n[0], n[0], n[0], n[0] ] : 2 === e.length ? t = [ n[0], n[1], n[0], n[1] ] : 3 === e.length ? t = [ n[0], n[1], n[2], n[2] ] : 4 === e.length ? t = e : e.length > 4 && (t = e.slice(0, 4));
|
|
12785
12795
|
}
|
|
12786
12796
|
return t || [ 0, 0, 0, 0 ];
|
|
12787
|
-
})), Ce(h, "lineDashColor", l, "lineDashColor", [ 0, 0, 0, 0 ],
|
|
12797
|
+
})), Ce(h, "lineDashColor", l, "lineDashColor", [ 0, 0, 0, 0 ], Oe(this.colorCache));
|
|
12788
12798
|
const c = i.properties.iconAtlas, u = this.layer instanceof e.TileLayer;
|
|
12789
12799
|
c && (h.linePatternFile = mn(this.regl, c, !1, !1), h.atlasSize = c ? [ c.width, c.height ] : [ 0, 0 ],
|
|
12790
12800
|
h.flipY = u ? -1 : 1, this.drawDebugAtlas(c)), void 0 === o && i.generateBuffers(this.regl);
|
|
@@ -12843,7 +12853,7 @@ class Fn extends pn {
|
|
|
12843
12853
|
evaluate: (t, i) => {
|
|
12844
12854
|
let r = n(e.getZoom(), t);
|
|
12845
12855
|
return x(r) && (r = this.evaluateInFnTypeConfig(r, i, e, t, !0)), Array.isArray(r) || (r = this.colorCache[r] = this.colorCache[r] || m(r).unitArray()),
|
|
12846
|
-
r =
|
|
12856
|
+
r = Fe(r), r;
|
|
12847
12857
|
}
|
|
12848
12858
|
}, {
|
|
12849
12859
|
attrName: "aLinePattern",
|
|
@@ -13005,7 +13015,7 @@ class Fn extends pn {
|
|
|
13005
13015
|
};
|
|
13006
13016
|
}
|
|
13007
13017
|
getUniformValues(e, t) {
|
|
13008
|
-
const n = t && t.isRenderingTerrainSkin, i = this.layer.getTileSize().width, r = n ? kn : e.projViewMatrix, s = e.viewMatrix, o = e.cameraToCenterDistance, a = e.getResolution(), l = u.set(
|
|
13018
|
+
const n = t && t.isRenderingTerrainSkin, i = this.layer.getTileSize().width, r = n ? kn : e.projViewMatrix, s = e.viewMatrix, o = e.cameraToCenterDistance, a = e.getResolution(), l = u.set(Fn, e.width, e.height);
|
|
13009
13019
|
n && u.set(l, i, i);
|
|
13010
13020
|
const h = this.getBlendFunc().src(), c = this.sceneConfig.trailAnimation || {}, f = {
|
|
13011
13021
|
layerScale: this.layer.options.styleScale || 1,
|
|
@@ -13440,7 +13450,7 @@ function Bn(e, t) {
|
|
|
13440
13450
|
n;
|
|
13441
13451
|
}
|
|
13442
13452
|
|
|
13443
|
-
class Gn extends
|
|
13453
|
+
class Gn extends On {
|
|
13444
13454
|
postCreateGeometry(e) {
|
|
13445
13455
|
this.generateGradProperties(e);
|
|
13446
13456
|
}
|
|
@@ -14140,8 +14150,8 @@ function ki(e, t, n, i, r) {
|
|
|
14140
14150
|
y = we(.5 + .5 * (1 - (1 - a / m) * o.markerPerspectiveRatio), 0, 4);
|
|
14141
14151
|
}
|
|
14142
14152
|
const {aShape: x, aMarkerDx: _, aMarkerDy: v, aMarkerWidth: b, aMarkerHeight: A, aPitchAlign: T, aRotationAlign: S, aRotation: w} = l, M = _ ? _[n] : h.markerDx, P = v ? v[n] : h.markerDy, I = T ? T[2 * n] : o.markerPitchWithMap, C = S ? S[2 * n] : o.markerRotateWithMap, k = u.set(Pi, M || 0, -(P || 0));
|
|
14143
|
-
let
|
|
14144
|
-
0 === o.flipY && 1 === I && (u.multiply(
|
|
14153
|
+
let F = u.set(Ti, x[2 * n] / 10, x[2 * n + 1] / 10), O = u.set(Si, x[2 * n + 2] / 10, x[2 * n + 3] / 10), R = u.set(wi, x[2 * n + 4] / 10, x[2 * n + 5] / 10), E = u.set(Mi, x[2 * n + 6] / 10, x[2 * n + 7] / 10);
|
|
14154
|
+
0 === o.flipY && 1 === I && (u.multiply(F, F, Ii), u.multiply(O, O, Ii), u.multiply(R, R, Ii),
|
|
14145
14155
|
u.multiply(E, E, Ii));
|
|
14146
14156
|
const [D, L] = _n(t.geometry);
|
|
14147
14157
|
let H = b ? b[n] : h.markerWidth;
|
|
@@ -14150,20 +14160,20 @@ function ki(e, t, n, i, r) {
|
|
|
14150
14160
|
Pe(N) && (N = L || mi);
|
|
14151
14161
|
const z = u.set(Ci, H / yi, N / yi);
|
|
14152
14162
|
let V;
|
|
14153
|
-
u.mul(
|
|
14163
|
+
u.mul(F, F, z), u.mul(O, O, z), u.mul(R, R, z), u.mul(E, E, z), V = w ? w[2 * n] / 9362 : -(h.markerRotation || 0) * Math.PI / 180;
|
|
14154
14164
|
const U = -V, B = r.getBearing() * Math.PI / 180;
|
|
14155
14165
|
if (B * C || U) {
|
|
14156
14166
|
const e = pi(Ai, U, B, C, I);
|
|
14157
|
-
|
|
14167
|
+
F = u.transformMat2(F, F, e), O = u.transformMat2(O, O, e), R = u.transformMat2(R, R, e),
|
|
14158
14168
|
E = u.transformMat2(E, E, e);
|
|
14159
14169
|
}
|
|
14160
|
-
1 === I ? fi(e, d,
|
|
14161
|
-
u.multiply(R, R, Ii), u.multiply(E, E, Ii), di(e, g,
|
|
14170
|
+
1 === I ? fi(e, d, F, O, R, E, i, k, o, r, m, y) : (u.multiply(F, F, Ii), u.multiply(O, O, Ii),
|
|
14171
|
+
u.multiply(R, R, Ii), u.multiply(E, E, Ii), di(e, g, F, O, R, E, k, y));
|
|
14162
14172
|
const G = this.getMap().getDevicePixelRatio();
|
|
14163
14173
|
return 1 !== G && (e[0] *= G, e[1] *= G, e[2] *= G, e[3] *= G), e;
|
|
14164
14174
|
}
|
|
14165
14175
|
|
|
14166
|
-
const {PackUtil:
|
|
14176
|
+
const {PackUtil: Fi} = L(), Oi = 1, Ri = [], Ei = [], Di = [], Li = [], Hi = [], Ni = [], zi = [ 1, -1 ];
|
|
14167
14177
|
|
|
14168
14178
|
function Vi(e, t, n, i, r, o, a, l, h) {
|
|
14169
14179
|
const c = i.material.uniforms, f = h.cameraToCenterDistance, d = i.geometry.properties, p = this.getSymbol(d.symbolIndex), g = "line" === p.textPlacement && !Le(p), m = xi, y = n[2];
|
|
@@ -14178,7 +14188,7 @@ function Vi(e, t, n, i, r, o, a, l, h) {
|
|
|
14178
14188
|
const C = b ? I : c.textPitchWithMap;
|
|
14179
14189
|
let k;
|
|
14180
14190
|
A && (k = S ? A[2 * a + 1] : A[a]);
|
|
14181
|
-
const
|
|
14191
|
+
const F = A ? k : c.textRotateWithMap, O = u.set(Ni, M || 0, -(P || 0));
|
|
14182
14192
|
if (g) {
|
|
14183
14193
|
const {aOffset: i, aShape: r} = d, o = i.length !== r.length;
|
|
14184
14194
|
let f, p, g, m;
|
|
@@ -14187,9 +14197,9 @@ function Vi(e, t, n, i, r, o, a, l, h) {
|
|
|
14187
14197
|
p = u.set(Di, i[2 * a + 2] / 10, i[2 * a + 3] / 10), g = u.set(Li, i[2 * a + 4] / 10, i[2 * a + 5] / 10),
|
|
14188
14198
|
m = u.set(Hi, i[2 * a + 6] / 10, i[2 * a + 7] / 10)), 1 === C) {
|
|
14189
14199
|
const n = q(h.getResolution(), h);
|
|
14190
|
-
fi(e, t, f, p, g, m, l,
|
|
14200
|
+
fi(e, t, f, p, g, m, l, O, c, h, y, x, o, n);
|
|
14191
14201
|
} else u.multiply(f, f, zi), u.multiply(p, p, zi), u.multiply(g, g, zi), u.multiply(m, m, zi),
|
|
14192
|
-
di(e, n, f, p, g, m,
|
|
14202
|
+
di(e, n, f, p, g, m, O, x);
|
|
14193
14203
|
} else {
|
|
14194
14204
|
const {aShape: i} = d;
|
|
14195
14205
|
let s, o = u.set(Ei, i[2 * a] / 10, -i[2 * a + 1] / 10), f = u.set(Di, i[2 * a + 2] / 10, -i[2 * a + 3] / 10), _ = u.set(Li, i[2 * a + 4] / 10, -i[2 * a + 5] / 10), v = u.set(Hi, i[2 * a + 6] / 10, -i[2 * a + 7] / 10);
|
|
@@ -14197,21 +14207,21 @@ function Vi(e, t, n, i, r, o, a, l, h) {
|
|
|
14197
14207
|
u.multiply(v, v, zi)), s = T ? S && T.length > S.length ? T[2 * a + 1] / 9362 : T[a] / 9362 : (p.textRotation || 0) * Math.PI / 180;
|
|
14198
14208
|
const b = g ? 0 : h.getBearing() * Math.PI / 180;
|
|
14199
14209
|
if (s || b) {
|
|
14200
|
-
const e = pi(Ri, s, b,
|
|
14210
|
+
const e = pi(Ri, s, b, F, C);
|
|
14201
14211
|
o = u.transformMat2(o, o, e), f = u.transformMat2(f, f, e), _ = u.transformMat2(_, _, e),
|
|
14202
14212
|
v = u.transformMat2(v, v, e);
|
|
14203
14213
|
}
|
|
14204
14214
|
const A = r / m;
|
|
14205
|
-
u.scale(o, o, A), u.scale(f, f, A), u.scale(_, _, A), u.scale(v, v, A), 1 === C ? fi(e, t, o, f, _, v, l,
|
|
14215
|
+
u.scale(o, o, A), u.scale(f, f, A), u.scale(_, _, A), u.scale(v, v, A), 1 === C ? fi(e, t, o, f, _, v, l, O, c, h, y, x) : di(e, n, o, f, _, v, O, x);
|
|
14206
14216
|
}
|
|
14207
|
-
o = o || 0, e[0] -= o +
|
|
14217
|
+
o = o || 0, e[0] -= o + Oi, e[1] -= o + Oi, e[2] += o + Oi, e[3] += o + Oi;
|
|
14208
14218
|
const R = this.getMap().getDevicePixelRatio();
|
|
14209
14219
|
return 1 !== R && (e[0] *= R, e[1] *= R, e[2] *= R, e[3] *= R), e;
|
|
14210
14220
|
}
|
|
14211
14221
|
|
|
14212
14222
|
function Ui(e, t, n) {
|
|
14213
14223
|
const i = t.geometry.desc.positionSize, {aAnchor: r, aAltitude: o, aTerrainAltitude: a} = t.geometry.properties, l = n * i;
|
|
14214
|
-
if (o ? s.set(e, r[l], r[l + 1], o[n]) : 3 === i ?
|
|
14224
|
+
if (o ? s.set(e, r[l], r[l + 1], o[n]) : 3 === i ? Fi.unpackPosition(e, r[l], r[l + 1], r[l + 2]) : s.set(e, r[l], r[l + 1], 0),
|
|
14215
14225
|
a) {
|
|
14216
14226
|
const t = 100 * a[2 * n];
|
|
14217
14227
|
t && (e[2] += t);
|
|
@@ -14389,7 +14399,7 @@ function Zi(e, t, n) {
|
|
|
14389
14399
|
|
|
14390
14400
|
function qi(e, t, n) {
|
|
14391
14401
|
void 0 === t.isHalo && (t.isHalo = 1), Ce(t, "textOpacity", n, "textOpacity", Bi.textOpacity),
|
|
14392
|
-
Ce(t, "textFill", n, "textFill", Bi.textFill,
|
|
14402
|
+
Ce(t, "textFill", n, "textFill", Bi.textFill, Oe()), Ce(t, "textHaloFill", n, "textHaloFill", Bi.textHaloFill, Oe()),
|
|
14393
14403
|
Ce(t, "textHaloBlur", n, "textHaloBlur", Bi.textHaloBlur), Ce(t, "textHaloRadius", n, "textHaloRadius", Bi.textHaloRadius),
|
|
14394
14404
|
Ce(t, "textHaloOpacity", n, "textHaloOpacity", Bi.textHaloOpacity), Ce(t, "textPerspectiveRatio", n, "textPerspectiveRatio", Bi.textPerspectiveRatio, (t => "line" === e.properties.textPlacement ? 1 : t)),
|
|
14395
14405
|
Ce(t, "textRotateWithMap", n, "textRotationAlignment", Bi.textRotationAlignment, (e => +("map" === e))),
|
|
@@ -14465,7 +14475,7 @@ function Ji(e, t) {
|
|
|
14465
14475
|
evaluate: (t, i) => {
|
|
14466
14476
|
let r = n(e.getZoom(), t);
|
|
14467
14477
|
return x(r) && (r = this.evaluateInFnTypeConfig(r, i, e, t, !0)), Array.isArray(r) || (r = g[r] = g[r] || m(r).unitArray()),
|
|
14468
|
-
r =
|
|
14478
|
+
r = Fe(r), r;
|
|
14469
14479
|
}
|
|
14470
14480
|
}, {
|
|
14471
14481
|
attrName: "aTextSize",
|
|
@@ -14485,7 +14495,7 @@ function Ji(e, t) {
|
|
|
14485
14495
|
width: 4,
|
|
14486
14496
|
evaluate: t => {
|
|
14487
14497
|
let n = r(e.getZoom(), t);
|
|
14488
|
-
return Array.isArray(n) || (n = g[n] = g[n] || m(n).unitArray()), n =
|
|
14498
|
+
return Array.isArray(n) || (n = g[n] = g[n] || m(n).unitArray()), n = Fe(n), n;
|
|
14489
14499
|
}
|
|
14490
14500
|
}, {
|
|
14491
14501
|
attrName: "aTextHalo",
|
|
@@ -15547,28 +15557,28 @@ function Pr(e, t) {
|
|
|
15547
15557
|
|
|
15548
15558
|
const Ir = [], Cr = [], kr = [];
|
|
15549
15559
|
|
|
15550
|
-
function
|
|
15560
|
+
function Fr(e, t, n, i, r, o, a, l, h, c, f, d, p) {
|
|
15551
15561
|
const {aGlyphOffset: g, aSegment: m, aTextDx: y, aTextDy: x, symbolIndex: _} = t.geometry.properties, v = this.getSymbol(_), b = y ? y[r] : v.textDx, A = x ? x[r] : v.textDy, T = u.set(kr, b || 0, A || 0), S = u.set(Ir, g[2 * r], g[2 * r + 1]), w = s.set(Cr, m[3 * r], m[3 * r + 1], m[3 * r + 2]), M = function(e, t, n, i, r, s, o, a, l, h, c, u, f, d, p, g, m, y) {
|
|
15552
15562
|
p || (p = i);
|
|
15553
15563
|
const x = t.geometry.properties.line, _ = s[0] * u, v = f ? _ - o : _ + o;
|
|
15554
15564
|
let b = v > 0 ? 1 : -1, A = 0;
|
|
15555
15565
|
f && (b *= -1, A = Math.PI), b < 0 && (A += Math.PI);
|
|
15556
15566
|
const T = h + c, S = Math.abs(v);
|
|
15557
|
-
let w = b > 0 ? l : l + 1, M = zt.convert(i), P = zt.convert(i), I = zt.convert(r), C = zt.convert(r), k = 0,
|
|
15558
|
-
for (;k +
|
|
15567
|
+
let w = b > 0 ? l : l + 1, M = zt.convert(i), P = zt.convert(i), I = zt.convert(r), C = zt.convert(r), k = 0, F = 0;
|
|
15568
|
+
for (;k + F <= S; ) {
|
|
15559
15569
|
if (w += b, w < h || w >= T) return null;
|
|
15560
15570
|
P.x = M.x, P.y = M.y, C.x = I.x, C.y = I.y, M.x = n[3 * w], M.y = n[3 * w + 1],
|
|
15561
|
-
I.x = x[3 * w], I.y = x[3 * w + 1], k +=
|
|
15571
|
+
I.x = x[3 * w], I.y = x[3 * w + 1], k += F, F = P.dist(M) / d;
|
|
15562
15572
|
}
|
|
15563
|
-
const
|
|
15573
|
+
const O = (S - k) / F, R = g && g.getRenderer(), E = R && R.getTerrainHelper(), D = t.properties.tile.terrainTileInfos;
|
|
15564
15574
|
if (!y && E) {
|
|
15565
15575
|
const {extent: n} = t.properties.tile, i = g.getTileSize().width / n, r = g.getMap();
|
|
15566
|
-
let s = I.sub(C).mult(
|
|
15576
|
+
let s = I.sub(C).mult(O)._add(C);
|
|
15567
15577
|
M = Zt(Bt, r, t, I, i, g, m, D), P = Zt(Gt, r, t, C, i, g, m, D), s = Zt(jt, r, t, s, i, g, m, D);
|
|
15568
15578
|
const o = A + Math.atan2(M[1] - P[1], M[0] - P[0]);
|
|
15569
15579
|
return e[0] = (s[0] - p[0]) / d, e[1] = (s[1] - p[1]) / d, e[2] = o, e;
|
|
15570
15580
|
}
|
|
15571
|
-
const L = M.sub(P), H = L.mult(
|
|
15581
|
+
const L = M.sub(P), H = L.mult(O)._add(P);
|
|
15572
15582
|
H._add(L._unit()._perp()._mult(a * b));
|
|
15573
15583
|
const N = A + Math.atan2(M.y - P.y, M.x - P.x);
|
|
15574
15584
|
return e[0] = (H.x - i[0]) / d, e[1] = (H.y - i[1]) / d, e[2] = N, e;
|
|
@@ -15576,19 +15586,19 @@ function Or(e, t, n, i, r, o, a, l, h, c, f, d, p) {
|
|
|
15576
15586
|
return M;
|
|
15577
15587
|
}
|
|
15578
15588
|
|
|
15579
|
-
const
|
|
15589
|
+
const Or = [], Rr = [];
|
|
15580
15590
|
|
|
15581
15591
|
function Er(e, t, n, i, r, o, a, l, h, c, f, d, p) {
|
|
15582
15592
|
const {aVertical: g} = n.geometry.properties, m = g[o];
|
|
15583
|
-
let y, x, _ =
|
|
15593
|
+
let y, x, _ = Fr.call(this, Or, n, i, r, o, l, h, c, !1);
|
|
15584
15594
|
if (!_) return null;
|
|
15585
|
-
if (s.copy(e, _), _ =
|
|
15595
|
+
if (s.copy(e, _), _ = Fr.call(this, Rr, n, i, r, a, l, h, c, !1), p = Math.PI * p / 180,
|
|
15586
15596
|
!_ || Math.abs(_[2]) > p) return null;
|
|
15587
|
-
if (s.copy(t, _), d && (u.transformMat2(
|
|
15597
|
+
if (s.copy(t, _), d && (u.transformMat2(Or, Or, d), u.transformMat2(Rr, Rr, d)),
|
|
15588
15598
|
m) {
|
|
15589
|
-
const e = Math.abs(Rr[1] -
|
|
15590
|
-
x =
|
|
15591
|
-
} else y = 0, x =
|
|
15599
|
+
const e = Math.abs(Rr[1] - Or[1]), t = Math.abs(Rr[0] - Or[0]) * f;
|
|
15600
|
+
x = Or[0] > Rr[0] ? 1 : 0, e > t ? (y = 1, x = Or[1] < Rr[1] ? 0 : 1) : y = 0;
|
|
15601
|
+
} else y = 0, x = Or[0] > Rr[0] ? 1 : 0;
|
|
15592
15602
|
return 2 * x + y;
|
|
15593
15603
|
}
|
|
15594
15604
|
|
|
@@ -15832,17 +15842,17 @@ class ys extends ei {
|
|
|
15832
15842
|
const M = x.properties.aTextSize, P = !l, I = t[n], C = I * _;
|
|
15833
15843
|
let k;
|
|
15834
15844
|
k = x.data.aAltitude ? s.set($r, A[C], A[C + 1], T[I]) : zr.unpackPosition($r, A[C], A[C + 1], A[C + 2]);
|
|
15835
|
-
const
|
|
15845
|
+
const F = Ut(Jr, k, a, y.width, y.height), O = x.properties.aTerrainAltitude;
|
|
15836
15846
|
let R;
|
|
15837
|
-
if (
|
|
15838
|
-
const e =
|
|
15847
|
+
if (O) {
|
|
15848
|
+
const e = O[I];
|
|
15839
15849
|
if (e === ge) return w[3 * I] = pe, w[3 * I + 1] = pe, w[3 * I + 2] = pe, !1;
|
|
15840
|
-
e ? (R = s.set(ps, ...k), R[2] = 100 * e, R = Ut(R, R, a, y.width, y.height)) : R =
|
|
15841
|
-
} else R =
|
|
15850
|
+
e ? (R = s.set(ps, ...k), R[2] = 100 * e, R = Ut(R, R, a, y.width, y.height)) : R = F;
|
|
15851
|
+
} else R = F;
|
|
15842
15852
|
const E = y.getDevicePixelRatio();
|
|
15843
15853
|
if (h.scale(ms, R, 1 / E), y.isOffscreen(ms)) return m || xs(b, t, n, i), w[3 * I] = pe,
|
|
15844
15854
|
w[3 * I + 1] = pe, w[3 * I + 2] = pe, !1;
|
|
15845
|
-
P && (k =
|
|
15855
|
+
P && (k = F), w[3 * I] = R[0], w[3 * I + 1] = R[1], w[3 * I + 2] = R[2];
|
|
15846
15856
|
const D = P ? 1 : x.properties.tileExtent / this.layer.getTileSize().width;
|
|
15847
15857
|
let L = !0;
|
|
15848
15858
|
const H = t[n], N = t[i - 1], z = M ? M[H] : e.properties.textSize, V = this._updateNormal(e, z, r, H, N, k, $r, D, l);
|
|
@@ -15851,7 +15861,7 @@ class ys extends ei {
|
|
|
15851
15861
|
for (let l = n; l < i; l += 6) {
|
|
15852
15862
|
const h = t[l];
|
|
15853
15863
|
let c;
|
|
15854
|
-
if (c = B || l !== n || U || g ? B || l !== i - 6 || U || g ?
|
|
15864
|
+
if (c = B || l !== n || U || g ? B || l !== i - 6 || U || g ? Fr.call(this, Zr, e, z, r, h, k, $r, D, B, R, this.layer, a, p) : hs : ls,
|
|
15855
15865
|
!c) {
|
|
15856
15866
|
L = !1, m || xs(b, t, n, i);
|
|
15857
15867
|
break;
|
|
@@ -16013,7 +16023,7 @@ class As extends pn {
|
|
|
16013
16023
|
}
|
|
16014
16024
|
const a = {};
|
|
16015
16025
|
Ce(a, "markerOpacity", o, "markerOpacity", 1), Ce(a, "markerSize", o, "markerSize", 10),
|
|
16016
|
-
Ce(a, "markerFill", o, "markerFill", "#000",
|
|
16026
|
+
Ce(a, "markerFill", o, "markerFill", "#000", Oe(this.colorCache, 3));
|
|
16017
16027
|
const l = new r.Material(a, bs);
|
|
16018
16028
|
l.createDefines = () => "square" !== o.markerType ? {
|
|
16019
16029
|
USE_CIRCLE: 1
|
|
@@ -16038,7 +16048,7 @@ class As extends pn {
|
|
|
16038
16048
|
evaluate: (t, i) => {
|
|
16039
16049
|
let r = n(e.getZoom(), t);
|
|
16040
16050
|
return x(r) && (r = this.evaluateInFnTypeConfig(r, i, e, t, !0)), Array.isArray(r) || (r = this.colorCache[r] = this.colorCache[r] || m(r).unitArray()),
|
|
16041
|
-
r =
|
|
16051
|
+
r = Fe(r), r;
|
|
16042
16052
|
}
|
|
16043
16053
|
} ];
|
|
16044
16054
|
}
|
|
@@ -16127,7 +16137,7 @@ class ws extends pn {
|
|
|
16127
16137
|
}
|
|
16128
16138
|
getMeshUniforms(e, t) {
|
|
16129
16139
|
const n = {};
|
|
16130
|
-
return Ce(n, "lineColor", t, "lineColor", "#000",
|
|
16140
|
+
return Ce(n, "lineColor", t, "lineColor", "#000", Oe(this.colorCache)), Ce(n, "lineOpacity", t, "lineOpacity", 1),
|
|
16131
16141
|
n;
|
|
16132
16142
|
}
|
|
16133
16143
|
isEnableTileStencil(e) {
|
|
@@ -16205,7 +16215,7 @@ class ws extends pn {
|
|
|
16205
16215
|
}
|
|
16206
16216
|
}
|
|
16207
16217
|
|
|
16208
|
-
const {DEFAULT_TEX_WIDTH: Ms} = L(), Ps = [ 1, 1, 1 ], Is = [ 1, 1, 1, 1 ], Cs = [ 0, 0 ], ks = [ 1, 1 ],
|
|
16218
|
+
const {DEFAULT_TEX_WIDTH: Ms} = L(), Ps = [ 1, 1, 1 ], Is = [ 1, 1, 1, 1 ], Cs = [ 0, 0 ], ks = [ 1, 1 ], Fs = [], Os = new e.Coordinate(0, 0), Rs = new e.Coordinate(0, 0), Es = [], Ds = [];
|
|
16209
16219
|
|
|
16210
16220
|
class Ls extends un {
|
|
16211
16221
|
isEnableTileStencil() {
|
|
@@ -16233,7 +16243,7 @@ class Ls extends un {
|
|
|
16233
16243
|
}
|
|
16234
16244
|
const c = this.getSymbolDef(a), u = this.getFnTypeConfig(a);
|
|
16235
16245
|
St(s, c, u, this.layer);
|
|
16236
|
-
const f = this.getShader(), d = f.getGeometryDefines ? f.getGeometryDefines(s) : {}, p = this.getSymbol(a), g =
|
|
16246
|
+
const f = this.getShader(), d = f.getGeometryDefines ? f.getGeometryDefines(s) : {}, p = this.getSymbol(a), g = Oe(this.colorCache);
|
|
16237
16247
|
if (s.data.aExtrude) {
|
|
16238
16248
|
d.IS_LINE_EXTRUSION = 1;
|
|
16239
16249
|
const {tileResolution: e, tileRatio: t} = s.properties, n = this.getMap();
|
|
@@ -16313,8 +16323,8 @@ class Ls extends un {
|
|
|
16313
16323
|
if (1 === this.dataConfig.topUVMode) return e[0] = 0, e[1] = 0, e;
|
|
16314
16324
|
const o = this.getMap(), a = this.getSymbol(t).material;
|
|
16315
16325
|
let l = n;
|
|
16316
|
-
!this.dataConfig.side && a && a.textureOrigin && (
|
|
16317
|
-
o.coordToPointAtRes(
|
|
16326
|
+
!this.dataConfig.side && a && a.textureOrigin && (Os.set(a.textureOrigin[0], a.textureOrigin[1]),
|
|
16327
|
+
o.coordToPointAtRes(Os, i, Rs), l = u.set(Es, n[0] - Rs.x, n[1] - Rs.y));
|
|
16318
16328
|
const h = !!a && a.uvOffsetInMeter;
|
|
16319
16329
|
let c = a && a.uvOffset || Cs;
|
|
16320
16330
|
const f = this.getUVOffsetAnim();
|
|
@@ -16332,7 +16342,7 @@ class Ls extends un {
|
|
|
16332
16342
|
super.callShader(e, t);
|
|
16333
16343
|
}
|
|
16334
16344
|
getShadowMeshes() {
|
|
16335
|
-
if (!this.isVisible()) return
|
|
16345
|
+
if (!this.isVisible()) return Fs;
|
|
16336
16346
|
this.shadowCount = this.scene.getMeshes().length;
|
|
16337
16347
|
const e = this.scene.getMeshes().filter((e => 0 === e.properties.level));
|
|
16338
16348
|
for (let t = 0; t < e.length; t++) {
|
|
@@ -16391,7 +16401,7 @@ class Ls extends un {
|
|
|
16391
16401
|
evaluate: (t, i) => {
|
|
16392
16402
|
let r = n(e.getZoom(), t);
|
|
16393
16403
|
return x(r) && (r = this.evaluateInFnTypeConfig(r, i, e, t, !0)), Array.isArray(r) || (r = this.colorCache[r] = this.colorCache[r] || m(r).unitArray()),
|
|
16394
|
-
r =
|
|
16404
|
+
r = Fe(r), r;
|
|
16395
16405
|
}
|
|
16396
16406
|
}, {
|
|
16397
16407
|
attrName: "aOpacity",
|
|
@@ -16882,7 +16892,7 @@ class Ys extends pn {
|
|
|
16882
16892
|
tileResolution: c,
|
|
16883
16893
|
tileRatio: u
|
|
16884
16894
|
};
|
|
16885
|
-
Ce(f, "lineColor", h, "lineColor", "#fff",
|
|
16895
|
+
Ce(f, "lineColor", h, "lineColor", "#fff", Oe(this.colorCache)), Ce(f, "linePatternGapColor", h, "linePatternGapColor", [ 1, 1, 1, 1 ], Oe(this.colorCache)),
|
|
16886
16896
|
Ce(f, "lineWidth", h, "lineWidth", 2, (e => Ws.getTubeSizeScale(this.dataConfig.metric) * e)),
|
|
16887
16897
|
Ce(f, "lineOpacity", h, "lineOpacity", 1), Ce(f, "linePatternAnimSpeed", h, "linePatternAnimSpeed", 0),
|
|
16888
16898
|
Ce(f, "linePatternGap", h, "linePatternGap", 0), Ce(f, "metallicFactor", h, "metallicFactor", 0),
|
|
@@ -17014,7 +17024,7 @@ class Ys extends pn {
|
|
|
17014
17024
|
evaluate: (t, i) => {
|
|
17015
17025
|
let r = n(e.getZoom(), t);
|
|
17016
17026
|
return x(r) && (r = this.evaluateInFnTypeConfig(r, i, e, t, !0)), Array.isArray(r) || (r = this.colorCache[r] = this.colorCache[r] || m(r).unitArray()),
|
|
17017
|
-
r =
|
|
17027
|
+
r = Fe(r), r;
|
|
17018
17028
|
}
|
|
17019
17029
|
}, {
|
|
17020
17030
|
attrName: "aLinePattern",
|
|
@@ -17176,22 +17186,22 @@ const {PackUtil: Zs} = L(), qs = [], $s = [], Js = [], Ks = [], Qs = [], eo = [
|
|
|
17176
17186
|
k.properties.startTime = a, C.HAS_SKIN = 1;
|
|
17177
17187
|
}
|
|
17178
17188
|
S && (k.setUniform("morphWeights", S), C.HAS_MORPH = 1), k.setUniform("hasAlpha", M.alphaMode && "BLEND" === M.alphaMode.toUpperCase()),
|
|
17179
|
-
Ce(k.uniforms, "polygonFill", t, "markerFill", ro,
|
|
17180
|
-
const
|
|
17189
|
+
Ce(k.uniforms, "polygonFill", t, "markerFill", ro, Oe(this.colorCache)), Ce(k.uniforms, "polygonOpacity", t, "markerOpacity", 1);
|
|
17190
|
+
const F = [];
|
|
17181
17191
|
k.setPositionMatrix((() => {
|
|
17182
17192
|
const t = this._getMeshNodeMatrix(e, g, P);
|
|
17183
|
-
o.multiply(
|
|
17193
|
+
o.multiply(F, oo, t), o.multiply(F, f, F), o.multiply(F, w, F);
|
|
17184
17194
|
const n = o.identity(so);
|
|
17185
|
-
if (0 !== d && (o.fromTranslation(n, p), o.multiply(
|
|
17195
|
+
if (0 !== d && (o.fromTranslation(n, p), o.multiply(F, n, F)), De(u)) {
|
|
17186
17196
|
const e = l.getGLScale() / l.getGLScale(u);
|
|
17187
|
-
return s.set(qs, e, e, e), o.fromScaling(n, qs), o.multiply(n, n,
|
|
17197
|
+
return s.set(qs, e, e, e), o.fromScaling(n, qs), o.multiply(n, n, F);
|
|
17188
17198
|
}
|
|
17189
|
-
return
|
|
17199
|
+
return F;
|
|
17190
17200
|
}));
|
|
17191
|
-
const
|
|
17201
|
+
const O = this.layer.getRenderer().getZScale(), R = [], E = [];
|
|
17192
17202
|
return k.setLocalTransform((() => {
|
|
17193
17203
|
const e = this.layer.options.altitude || 0;
|
|
17194
|
-
return s.copy(E, _), E[2] += 100 * e *
|
|
17204
|
+
return s.copy(E, _), E[2] += 100 * e * O, o.translate(R, n, E), R;
|
|
17195
17205
|
})), m.generateBuffers(this.regl, {
|
|
17196
17206
|
excludeElementsInVAO: !0
|
|
17197
17207
|
}), x.instance_color && (C.HAS_INSTANCE_COLOR = 1), x.aTerrainAltitude && (C.HAS_INSTANCE_TERRAIN_ALTITUDE = 1,
|
|
@@ -17279,13 +17289,13 @@ const {PackUtil: Zs} = L(), qs = [], $s = [], Js = [], Ks = [], Qs = [], eo = [
|
|
|
17279
17289
|
t[0] < x && (x = t[0]), t[0] > b && (b = t[0]), t[1] < _ && (_ = t[1]), t[1] > A && (A = t[1]),
|
|
17280
17290
|
t[2] < v && (v = t[2]), t[2] > T && (T = t[2]);
|
|
17281
17291
|
}
|
|
17282
|
-
const M = (x + b) / 2, P = (_ + A) / 2, I = (v + T) / 2, C = [], k = this._hasFuncType(),
|
|
17292
|
+
const M = (x + b) / 2, P = (_ + A) / 2, I = (v + T) / 2, C = [], k = this._hasFuncType(), F = [ 0, 0, 1 ];
|
|
17283
17293
|
for (let t = 0; t < p; t++) {
|
|
17284
17294
|
a ? s.set(w, r[t * c], r[t * c + 1], a[t]) : Zs.unpackPosition(w, r[t * c], r[t * c + 1], r[t * c + 2]);
|
|
17285
17295
|
const n = w[0], i = w[1], p = s.set(S, n * g - M, -i * g - P, (w[2] + y) * m - I), x = l && l[t] || 0, _ = h && h[t] || 0;
|
|
17286
17296
|
if (x || _) {
|
|
17287
|
-
o.fromRotation(C, _,
|
|
17288
|
-
const e = s.set(qs, n, i, 0), t = s.normalize(e, s.cross(e, e,
|
|
17297
|
+
o.fromRotation(C, _, F);
|
|
17298
|
+
const e = s.set(qs, n, i, 0), t = s.normalize(e, s.cross(e, e, F));
|
|
17289
17299
|
o.rotate(C, C, x, t);
|
|
17290
17300
|
const r = o.fromTranslation(so, p);
|
|
17291
17301
|
o.multiply(C, r, C);
|
|
@@ -17698,7 +17708,7 @@ const _o = _t("fill", In);
|
|
|
17698
17708
|
|
|
17699
17709
|
_o.registerAt(lt);
|
|
17700
17710
|
|
|
17701
|
-
const vo = _t("line",
|
|
17711
|
+
const vo = _t("line", On);
|
|
17702
17712
|
|
|
17703
17713
|
vo.registerAt(lt);
|
|
17704
17714
|
|
|
@@ -17744,7 +17754,7 @@ const ko = _t("gltf-lit", ho);
|
|
|
17744
17754
|
|
|
17745
17755
|
ko.registerAt(lt);
|
|
17746
17756
|
|
|
17747
|
-
const
|
|
17757
|
+
const Fo = _t("heatmap", class extends pn {
|
|
17748
17758
|
createFnTypeConfig(e, t) {
|
|
17749
17759
|
const n = _(t.heatmapWeight), i = new Int16Array(1);
|
|
17750
17760
|
return [ {
|
|
@@ -17808,12 +17818,12 @@ const Oo = _t("heatmap", class extends pn {
|
|
|
17808
17818
|
}
|
|
17809
17819
|
});
|
|
17810
17820
|
|
|
17811
|
-
|
|
17821
|
+
Fo.registerAt(lt);
|
|
17812
17822
|
|
|
17813
|
-
const
|
|
17823
|
+
const Oo = _t("water", yo);
|
|
17814
17824
|
|
|
17815
|
-
|
|
17816
|
-
gt.registerPainter("fill", In), gt.registerPainter("line",
|
|
17825
|
+
Oo.registerAt(lt), gt.registerPainter("lit", Gs), gt.registerPainter("icon", Mr),
|
|
17826
|
+
gt.registerPainter("fill", In), gt.registerPainter("line", On), gt.registerPainter("line-gradient", Gn),
|
|
17817
17827
|
gt.registerPainter("water", yo), gt.registerPainter("tube", Ys);
|
|
17818
17828
|
|
|
17819
17829
|
class Ro extends lt {
|
|
@@ -19105,14 +19115,14 @@ function Ca(e) {
|
|
|
19105
19115
|
return t;
|
|
19106
19116
|
}
|
|
19107
19117
|
|
|
19108
|
-
const {StyleUtil: ka, PackUtil:
|
|
19118
|
+
const {StyleUtil: ka, PackUtil: Fa, ArrayPool: Oa} = L(), Ra = Oa.getInstance();
|
|
19109
19119
|
|
|
19110
19120
|
function Ea(e, t, n, i, r, s, o, a, l, h, c, u, f, d, p, g) {
|
|
19111
19121
|
void 0 === t.top && (t.top = !0), void 0 === t.side && (t.side = !0), Ra.reset();
|
|
19112
|
-
const {altitudeScale: m, altitudeProperty: y, defaultAltitude: b, heightProperty: A, minHeightProperty: T, defaultHeight: S, tangent: w, uv:
|
|
19122
|
+
const {altitudeScale: m, altitudeProperty: y, defaultAltitude: b, heightProperty: A, minHeightProperty: T, defaultHeight: S, tangent: w, uv: O, topUVMode: R, sideUVMode: E, sideVerticalUVMode: D, top: L, side: H, textureYOrigin: N, topThickness: z} = t, V = !!g, U = function(e, t, {altitudeScale: n, altitudeProperty: i, defaultAltitude: r, heightProperty: s, minHeightProperty: o, 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: b, positionType: A, res: T, glScale: S, projectionCode: w}, M, P) {
|
|
19113
19123
|
let C = t / e[0].extent;
|
|
19114
19124
|
t === 1 / 0 && (C = 1);
|
|
19115
|
-
const k = t === 1 / 0,
|
|
19125
|
+
const k = t === 1 / 0, F = P.get(), O = P.get(), R = P.get(), E = P.getProxy(), D = P.get(), L = P.get(), H = P.get(), N = !!d, z = !!c, V = !!h, U = N ? P.get() : null;
|
|
19116
19126
|
function G(e, n, i, r, s, o) {
|
|
19117
19127
|
let a = n;
|
|
19118
19128
|
if (z) {
|
|
@@ -19179,20 +19189,20 @@ function Ea(e, t, n, i, r, s, o, a, l, h, c, u, f, d, p, g) {
|
|
|
19179
19189
|
}
|
|
19180
19190
|
const _ = D.getLength() - g, v = (de + "").trim();
|
|
19181
19191
|
for (let e = 0; e < _ / 3; e++) {
|
|
19182
|
-
let e =
|
|
19183
|
-
|
|
19184
|
-
|
|
19192
|
+
let e = O.currentIndex;
|
|
19193
|
+
O[e++] = void 0 === l[v] ? Z : l[v], O.currentIndex = e, e = F.currentIndex, F[e++] = Z,
|
|
19194
|
+
F.currentIndex = e, B(h) && (e = R.currentIndex, R[e++] = h, R.currentIndex = e);
|
|
19185
19195
|
}
|
|
19186
19196
|
}
|
|
19187
|
-
const ee = wa.getUnsignedArrayType(
|
|
19197
|
+
const ee = wa.getUnsignedArrayType(O.getLength() ? O[O.getLength() - 1] : 0), te = {
|
|
19188
19198
|
hasNegativeHeight: Q,
|
|
19189
19199
|
maxAltitude: j === -1 / 0 ? 0 : j,
|
|
19190
19200
|
minAltitude: W === 1 / 0 ? 0 : W,
|
|
19191
19201
|
vertices: D,
|
|
19192
19202
|
verticeTypes: H,
|
|
19193
19203
|
indices: L,
|
|
19194
|
-
pickingIds: Ma.createTypedArray(
|
|
19195
|
-
featureIndexes:
|
|
19204
|
+
pickingIds: Ma.createTypedArray(O, ee),
|
|
19205
|
+
featureIndexes: F
|
|
19196
19206
|
};
|
|
19197
19207
|
if (R.getLength()) {
|
|
19198
19208
|
const e = J ? wa.getPosArrayType($) : wa.getUnsignedArrayType($);
|
|
@@ -19211,7 +19221,7 @@ function Ea(e, t, n, i, r, s, o, a, l, h, c, u, f, d, p, g) {
|
|
|
19211
19221
|
top: L,
|
|
19212
19222
|
side: H,
|
|
19213
19223
|
topThickness: 10 * z || 0,
|
|
19214
|
-
uv:
|
|
19224
|
+
uv: O || w,
|
|
19215
19225
|
uvSize: [ r, r ],
|
|
19216
19226
|
uvOrigin: i,
|
|
19217
19227
|
topUVMode: R,
|
|
@@ -19225,10 +19235,10 @@ function Ea(e, t, n, i, r, s, o, a, l, h, c, u, f, d, p, g) {
|
|
|
19225
19235
|
res: s,
|
|
19226
19236
|
glScale: o,
|
|
19227
19237
|
projectionCode: f
|
|
19228
|
-
}, d, Ra), G = [], j = U.vertices.getLength() / 3, W =
|
|
19238
|
+
}, d, Ra), G = [], j = U.vertices.getLength() / 3, W = Fa.getIndexArrayType(j), X = Oa.createTypedArray(U.indices, W);
|
|
19229
19239
|
delete U.indices, G.push(X.buffer, U.pickingIds.buffer);
|
|
19230
|
-
const Z = Math.max(Math.abs(U.maxAltitude), Math.abs(U.minAltitude)), q = p ||
|
|
19231
|
-
U.vertices =
|
|
19240
|
+
const Z = Math.max(Math.abs(U.maxAltitude), Math.abs(U.minAltitude)), q = p || Fa.getPosArrayType(Math.max(512, Z));
|
|
19241
|
+
U.vertices = Oa.createTypedArray(U.vertices, q);
|
|
19232
19242
|
const $ = w ? Ra.getProxy() : new Float32Array(3 * j);
|
|
19233
19243
|
$.setLength && $.setLength(3 * j);
|
|
19234
19244
|
const J = C(U.vertices, X, $);
|
|
@@ -19246,15 +19256,15 @@ function Ea(e, t, n, i, r, s, o, a, l, h, c, u, f, d, p, g) {
|
|
|
19246
19256
|
for (let a = 0; a < n; a += 4) {
|
|
19247
19257
|
const n = a / 4 * 3;
|
|
19248
19258
|
M.set(s, e[n] || 0, e[n + 1] || 0, e[n + 2] || 0), P.set(r, t[a] || 0, t[a + 1] || 0, t[a + 2] || 0, t[a + 3] || 0),
|
|
19249
|
-
|
|
19259
|
+
F(o, s, r), P.copy(i.subarray(a, a + 4), o);
|
|
19250
19260
|
}
|
|
19251
19261
|
return i;
|
|
19252
19262
|
}(U.normals, e), U.tangents = e, G.push(e.buffer), delete U.normals;
|
|
19253
19263
|
}
|
|
19254
|
-
if (U.normals && (K && (U.normals =
|
|
19264
|
+
if (U.normals && (K && (U.normals = Oa.createTypedArray(U.normals, Int8Array)),
|
|
19255
19265
|
G.push(U.normals.buffer)), U.uvs) {
|
|
19256
19266
|
const e = U.uvs;
|
|
19257
|
-
U.uvs =
|
|
19267
|
+
U.uvs = Oa.createTypedArray(e, Float32Array), G.push(U.uvs.buffer);
|
|
19258
19268
|
}
|
|
19259
19269
|
if (g) {
|
|
19260
19270
|
const e = U.vertices, t = e.length;
|
|
@@ -19319,7 +19329,7 @@ function Ea(e, t, n, i, r, s, o, a, l, h, c, u, f, d, p, g) {
|
|
|
19319
19329
|
}(U.verticeTypes, U.featureIndexes, e, c, u), ne = {
|
|
19320
19330
|
data: {
|
|
19321
19331
|
data: {
|
|
19322
|
-
aVertexColorType: te.length <= 252 ?
|
|
19332
|
+
aVertexColorType: te.length <= 252 ? Oa.createTypedArray(U.verticeTypes, Uint8Array) : Oa.createTypedArray(U.verticeTypes, Uint16Array),
|
|
19323
19333
|
aPosition: U.vertices,
|
|
19324
19334
|
aNormal: U.normals,
|
|
19325
19335
|
aTexCoord0: U.uvs,
|
|
@@ -19340,7 +19350,7 @@ function Ea(e, t, n, i, r, s, o, a, l, h, c, u, f, d, p, g) {
|
|
|
19340
19350
|
return U.featureIds.length ? (ne.data.featureIds = U.featureIds, G.push(ne.data.featureIds.buffer)) : ne.data.featureIds = [],
|
|
19341
19351
|
ee.aColor && (ne.data.data.aColor = ee.aColor, ne.buffers.push(ee.aColor.buffer)),
|
|
19342
19352
|
ee.aOpacity && (ne.data.data.aOpacity = ee.aOpacity, ne.buffers.push(ee.aOpacity.buffer)),
|
|
19343
|
-
ne.buffers.push(ne.data.data.aPosition.buffer), ne.data.pickingIdIndiceMap =
|
|
19353
|
+
ne.buffers.push(ne.data.data.aPosition.buffer), ne.data.pickingIdIndiceMap = Fa.generatePickingIndiceIndex(ne.data.data.aPickingId, ne.data.indices),
|
|
19344
19354
|
ne;
|
|
19345
19355
|
}
|
|
19346
19356
|
|
|
@@ -19472,21 +19482,21 @@ function nl(e, t, n, i, r, s) {
|
|
|
19472
19482
|
y = b - T, u = b - y, tl[0] = b - (y + u) + (u - T), x = v + y, u = x - v, _ = v - (x - u) + (y - u),
|
|
19473
19483
|
y = _ - A, u = _ - y, tl[1] = _ - (y + u) + (u - A), S = x + y, u = S - x, tl[2] = x - (S - u) + (y - u),
|
|
19474
19484
|
tl[3] = S;
|
|
19475
|
-
const
|
|
19485
|
+
const F = Xa(4, Ja, 4, tl, Ka);
|
|
19476
19486
|
v = w * c, f = ja * w, d = f - (f - w), p = w - d, f = ja * c, g = f - (f - c),
|
|
19477
19487
|
m = c - g, b = p * m - (v - d * g - p * g - d * m), A = P * h, f = ja * P, d = f - (f - P),
|
|
19478
19488
|
p = P - d, f = ja * h, g = f - (f - h), m = h - g, T = p * m - (A - d * g - p * g - d * m),
|
|
19479
19489
|
y = b - T, u = b - y, tl[0] = b - (y + u) + (u - T), x = v + y, u = x - v, _ = v - (x - u) + (y - u),
|
|
19480
19490
|
y = _ - A, u = _ - y, tl[1] = _ - (y + u) + (u - A), S = x + y, u = S - x, tl[2] = x - (S - u) + (y - u),
|
|
19481
19491
|
tl[3] = S;
|
|
19482
|
-
const
|
|
19492
|
+
const O = Xa(F, Ka, 4, tl, Qa);
|
|
19483
19493
|
v = a * c, f = ja * a, d = f - (f - a), p = a - d, f = ja * c, g = f - (f - c),
|
|
19484
19494
|
m = c - g, b = p * m - (v - d * g - p * g - d * m), A = l * h, f = ja * l, d = f - (f - l),
|
|
19485
19495
|
p = l - d, f = ja * h, g = f - (f - h), m = h - g, T = p * m - (A - d * g - p * g - d * m),
|
|
19486
19496
|
y = b - T, u = b - y, tl[0] = b - (y + u) + (u - T), x = v + y, u = x - v, _ = v - (x - u) + (y - u),
|
|
19487
19497
|
y = _ - A, u = _ - y, tl[1] = _ - (y + u) + (u - A), S = x + y, u = S - x, tl[2] = x - (S - u) + (y - u),
|
|
19488
19498
|
tl[3] = S;
|
|
19489
|
-
const R = Xa(
|
|
19499
|
+
const R = Xa(O, Qa, 4, tl, el);
|
|
19490
19500
|
return el[R - 1];
|
|
19491
19501
|
}(e, t, n, i, r, s, h);
|
|
19492
19502
|
}
|
|
@@ -19512,7 +19522,7 @@ function il(e, t, n) {
|
|
|
19512
19522
|
}
|
|
19513
19523
|
return i.pop(), t.pop(), t.concat(i);
|
|
19514
19524
|
}(l);
|
|
19515
|
-
}(e), r = new
|
|
19525
|
+
}(e), r = new O(16);
|
|
19516
19526
|
r.toBBox = function(e) {
|
|
19517
19527
|
return {
|
|
19518
19528
|
minX: e[0],
|
|
@@ -19529,7 +19539,7 @@ function il(e, t, n) {
|
|
|
19529
19539
|
var l = i[a];
|
|
19530
19540
|
r.remove(l), s = ul(l, s), o.push(s);
|
|
19531
19541
|
}
|
|
19532
|
-
var h = new
|
|
19542
|
+
var h = new O(16);
|
|
19533
19543
|
for (a = 0; a < o.length; a++) h.insert(cl(o[a]));
|
|
19534
19544
|
for (var c = t * t, u = n * n; o.length; ) {
|
|
19535
19545
|
var f = o.shift(), d = f.p, p = f.next.p, g = fl(d, p);
|
|
@@ -19971,7 +19981,7 @@ r.ShaderLib.register("vt_position_vert", "#ifdef HAS_TERRAIN_ALTITUDE\n attri
|
|
|
19971
19981
|
|
|
19972
19982
|
i.mat4.create();
|
|
19973
19983
|
|
|
19974
|
-
const
|
|
19984
|
+
const Fl = function(e, t) {
|
|
19975
19985
|
const n = e.toString(), i = n.indexOf("{") + 1, r = n.substring(0, i);
|
|
19976
19986
|
let s = `${r}\n (` + t.toString() + ")({});\n";
|
|
19977
19987
|
return s += "\n" + n.substring(r.length), s;
|
|
@@ -19980,14 +19990,14 @@ const Ol = function(e, t) {
|
|
|
19980
19990
|
if (i.transcoders) {
|
|
19981
19991
|
const t = e.Map.VERSION;
|
|
19982
19992
|
if (t.indexOf("1.0.0-beta") >= 0 || t.indexOf("1.0.0-alpha") >= 0) {
|
|
19983
|
-
const t = i.transcoders.inject(
|
|
19993
|
+
const t = i.transcoders.inject(Fl);
|
|
19984
19994
|
e.registerWorkerAdapter("@maptalks/vt", t);
|
|
19985
19995
|
} else e.registerWorkerAdapter("@maptalks/vt", (function() {
|
|
19986
|
-
return i.transcoders.inject(
|
|
19996
|
+
return i.transcoders.inject(Fl);
|
|
19987
19997
|
}));
|
|
19988
|
-
} else e.registerWorkerAdapter("@maptalks/vt",
|
|
19998
|
+
} else e.registerWorkerAdapter("@maptalks/vt", Fl);
|
|
19989
19999
|
|
|
19990
|
-
export { Tl as ExtrudePolygonLayer, In as FillPainter, _o as FillPlugin, Il as FilterUtil, Co as GLTFPhongPlugin, ko as GLTFStandardPlugin, Do as GeoJSONVectorTileLayer,
|
|
20000
|
+
export { Tl as ExtrudePolygonLayer, In as FillPainter, _o as FillPlugin, Il as FilterUtil, Co as GLTFPhongPlugin, ko as GLTFStandardPlugin, Do as GeoJSONVectorTileLayer, Fo as HeatmapPlugin, Mr as IconPainter, Ao as IconPlugin, bo as LineGradientPlugin, On as LinePainter, vo as LinePlugin, ca as LineStringLayer, Po as LitPlugin, Ro as MapboxVectorTileLayer, ws as NativeLinePainter, So as NativeLinePlugin, As as NativePointPainter, Pl as PackUtil, zs as PhongPainter, wo as PhongPlugin, la as PointLayer, da as PolygonLayer, kl as SYMBOLS_NEED_REBUILD_IN_VECTOR, Cl as SYMBOLS_NEED_REBUILD_IN_VT, ys as TextPainter, To as TextPlugin, Io as TubePlugin, gt as Vector3DLayer, lt as VectorTileLayer, qe as VectorTileLayerRenderer, Oo as WaterPlugin, Us as WireframePainter, Mo as WireframePlugin };
|
|
19991
20001
|
|
|
19992
|
-
"undefined" != typeof console && console.log("@maptalks/vt v0.105.
|
|
20002
|
+
"undefined" != typeof console && console.log("@maptalks/vt v0.105.3");
|
|
19993
20003
|
//# sourceMappingURL=maptalks.vt.es.js.map
|