@deck.gl/extensions 8.9.1 → 8.9.2
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/dist.dev.js +744 -103
- package/dist.min.js +33 -33
- package/package.json +2 -2
package/dist.min.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
else if (typeof define === 'function' && define.amd) define([], factory);
|
|
5
5
|
else if (typeof exports === 'object') exports['deck'] = factory();
|
|
6
6
|
else root['deck'] = factory();})(globalThis, function () {
|
|
7
|
-
"use strict";var __exports__=(()=>{var
|
|
7
|
+
"use strict";var __exports__=(()=>{var Ti=Object.create;var oe=Object.defineProperty;var wi=Object.getOwnPropertyDescriptor;var Mi=Object.getOwnPropertyNames;var Ai=Object.getPrototypeOf,Ri=Object.prototype.hasOwnProperty;var O=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),Si=(t,r)=>{for(var e in r)oe(t,e,{get:r[e],enumerable:!0})},ie=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Mi(r))!Ri.call(t,i)&&i!==e&&oe(t,i,{get:()=>r[i],enumerable:!(n=wi(r,i))||n.enumerable});return t},j=(t,r,e)=>(ie(t,r,"default"),e&&ie(e,r,"default")),u=(t,r,e)=>(e=t!=null?Ti(Ai(t)):{},ie(r||!t||!t.__esModule?oe(e,"default",{value:t,enumerable:!0}):e,t)),Fi=t=>ie(oe({},"__esModule",{value:!0}),t);var y=O((Ma,ht)=>{ht.exports=globalThis.deck});var x=O((Ra,gt)=>{function ki(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}gt.exports=ki});var b=O((Sa,xt)=>{function Pt(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ci(t,r,e){return r&&Pt(t.prototype,r),e&&Pt(t,e),t}xt.exports=Ci});var bt=O((Fa,Ne)=>{function Le(t,r){return Ne.exports=Le=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Le(t,r)}Ne.exports=Le});var w=O((ka,Ot)=>{var Ii=bt();function Li(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&Ii(t,r)}Ot.exports=Li});var Et=O((Ca,se)=>{function ae(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?se.exports=ae=function(e){return typeof e}:se.exports=ae=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ae(t)}se.exports=ae});var fe=O((Ia,Tt)=>{function Ni(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}Tt.exports=Ni});var M=O((La,wt)=>{var Bi=Et(),Di=fe();function ji(t,r){return r&&(Bi(r)==="object"||typeof r=="function")?r:Di(t)}wt.exports=ji});var T=O((Na,De)=>{function Be(t){return De.exports=Be=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Be(t)}De.exports=Be});var P=O((Ba,Mt)=>{function Vi(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}Mt.exports=Vi});var R=O((Ua,Gt)=>{Gt.exports=globalThis.luma});var ir=O((Wa,nr)=>{function ro(t){if(Array.isArray(t))return t}nr.exports=ro});var ar=O((Ha,or)=>{function no(t,r){if(Symbol.iterator in Object(t)||Object.prototype.toString.call(t)==="[object Arguments]"){var e=[],n=!0,i=!1,o=void 0;try{for(var a=t[Symbol.iterator](),s;!(n=(s=a.next()).done)&&(e.push(s.value),!(r&&e.length===r));n=!0);}catch(f){i=!0,o=f}finally{try{!n&&a.return!=null&&a.return()}finally{if(i)throw o}}return e}}or.exports=no});var fr=O((Ka,sr)=>{function io(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}sr.exports=io});var qe=O((Ya,lr)=>{var oo=ir(),ao=ar(),so=fr();function fo(t,r){return oo(t)||ao(t,r)||so()}lr.exports=fo});var Jr=O((Zs,Xr)=>{var Go=T();function Wo(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&(t=Go(t),t!==null););return t}Xr.exports=Wo});var rt=O((Xs,be)=>{var Ho=Jr();function xe(t,r,e){return typeof Reflect<"u"&&Reflect.get?be.exports=xe=Reflect.get:be.exports=xe=function(i,o,a){var s=Ho(i,o);if(s){var f=Object.getOwnPropertyDescriptor(s,o);return f.get?f.get.call(a):f.value}},xe(t,r,e||t)}be.exports=xe});var re={};Si(re,{BrushingExtension:()=>le,ClipExtension:()=>Pe,CollisionFilterExtension:()=>we,DataFilterExtension:()=>ve,FillStyleExtension:()=>ge,Fp64Extension:()=>$e,MaskExtension:()=>Me,PathStyleExtension:()=>he,_TerrainExtension:()=>Ce,project64:()=>me});var C={},yt=u(y());j(C,u(y()));if(!yt.Layer)throw new Error("@deck.gl/core is not found");j(re,C);var St=u(x()),Ft=u(b()),kt=u(w()),Ct=u(M()),je=u(T()),Ve=u(P()),It=u(y());var At=u(y()),zi=`
|
|
8
8
|
uniform bool brushing_enabled;
|
|
9
9
|
uniform int brushing_target;
|
|
10
10
|
uniform vec2 brushing_mousePos;
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
void brushing_setVisible(bool visible) {
|
|
37
37
|
brushing_isVisible = float(visible);
|
|
38
38
|
}
|
|
39
|
-
`,
|
|
39
|
+
`,Ui=`
|
|
40
40
|
uniform bool brushing_enabled;
|
|
41
41
|
varying float brushing_isVisible;
|
|
42
|
-
`,
|
|
42
|
+
`,qi={source:0,target:1,custom:2,source_target:3},Gi={"vs:DECKGL_FILTER_GL_POSITION":`
|
|
43
43
|
vec2 brushingTarget;
|
|
44
44
|
vec2 brushingSource;
|
|
45
45
|
if (brushing_target == 3) {
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
if (brushing_enabled && brushing_isVisible < 0.5) {
|
|
68
68
|
discard;
|
|
69
69
|
}
|
|
70
|
-
`},
|
|
70
|
+
`},Rt={name:"brushing",dependencies:[At.project],vs:zi,fs:Ui,inject:Gi,getUniforms:function(r){if(!r||!("viewport"in r))return{};var e=r.brushingEnabled,n=e===void 0?!0:e,i=r.brushingRadius,o=i===void 0?1e4:i,a=r.brushingTarget,s=a===void 0?"source":a,f=r.mousePosition,l=r.viewport;return{brushing_enabled:Boolean(n&&f&&l.containsPixel(f)),brushing_radius:o,brushing_target:qi[s]||0,brushing_mousePos:f?l.unproject([f.x-l.x,f.y-l.y]):[0,0]}}};function Wi(t){var r=Hi();return function(){var n=(0,je.default)(t),i;if(r){var o=(0,je.default)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,Ct.default)(this,i)}}function Hi(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Ki={getBrushingTarget:{type:"accessor",value:[0,0]},brushingTarget:"source",brushingEnabled:!0,brushingRadius:1e4},le=function(t){(0,kt.default)(e,t);var r=Wi(e);function e(){return(0,St.default)(this,e),r.apply(this,arguments)}return(0,Ft.default)(e,[{key:"getShaders",value:function(){return{modules:[Rt]}}},{key:"initializeState",value:function(i,o){var a=this,s=this.getAttributeManager();s&&s.add({brushingTargets:{size:2,accessor:"getBrushingTarget",shaderAttributes:{brushingTargets:{divisor:0},instanceBrushingTargets:{divisor:1}}}}),this.state.onMouseMove=function(){var f;(f=a.getCurrentLayer())===null||f===void 0||f.setNeedsRedraw()},i.deck&&i.deck.eventManager.on({pointermove:this.state.onMouseMove,pointerleave:this.state.onMouseMove})}},{key:"finalizeState",value:function(i,o){i.deck&&i.deck.eventManager.off({pointermove:this.state.onMouseMove,pointerleave:this.state.onMouseMove})}}]),e}(It.LayerExtension);(0,Ve.default)(le,"defaultProps",Ki);(0,Ve.default)(le,"extensionName","BrushingExtension");var Jt=u(x()),Qt=u(b()),er=u(w()),tr=u(M()),Ue=u(T()),ce=u(P()),rr=u(y());var Bt=u(P());function Lt(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Nt(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Lt(Object(e),!0).forEach(function(n){(0,Bt.default)(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Lt(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var Dt=`
|
|
71
71
|
uniform DATAFILTER_TYPE filter_min;
|
|
72
72
|
uniform DATAFILTER_TYPE filter_softMin;
|
|
73
73
|
uniform DATAFILTER_TYPE filter_softMax;
|
|
@@ -122,10 +122,10 @@ void dataFilter_setValue(DATAFILTER_TYPE valueFromMin, DATAFILTER_TYPE valueFrom
|
|
|
122
122
|
dataFilter_value = 1.0;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
`,
|
|
125
|
+
`,jt=`
|
|
126
126
|
uniform bool filter_transformColor;
|
|
127
127
|
varying float dataFilter_value;
|
|
128
|
-
`;function
|
|
128
|
+
`;function Vt(t){if(!t||!("extensions"in t))return{};var r=t.filterRange,e=r===void 0?[-1,1]:r,n=t.filterEnabled,i=n===void 0?!0:n,o=t.filterTransformSize,a=o===void 0?!0:o,s=t.filterTransformColor,f=s===void 0?!0:s,l=t.filterSoftRange||e;return Nt(Nt({},Number.isFinite(e[0])?{filter_min:e[0],filter_softMin:l[0],filter_softMax:l[1],filter_max:e[1]}:{filter_min:e.map(function(c){return c[0]}),filter_softMin:l.map(function(c){return c[0]}),filter_softMax:l.map(function(c){return c[1]}),filter_max:e.map(function(c){return c[1]})}),{},{filter_enabled:i,filter_useSoftMargin:Boolean(t.filterSoftRange),filter_transformSize:i&&a,filter_transformColor:i&&f})}function Yi(t){if(!t||!("extensions"in t))return{};var r=Vt(t);if(Number.isFinite(r.filter_min)){var e=Math.fround(r.filter_min);r.filter_min-=e,r.filter_softMin-=e,r.filter_min64High=e;var n=Math.fround(r.filter_max);r.filter_max-=n,r.filter_softMax-=n,r.filter_max64High=n}else{var i=r.filter_min.map(Math.fround);r.filter_min=r.filter_min.map(function(a,s){return a-i[s]}),r.filter_softMin=r.filter_softMin.map(function(a,s){return a-i[s]}),r.filter_min64High=i;var o=r.filter_max.map(Math.fround);r.filter_max=r.filter_max.map(function(a,s){return a-o[s]}),r.filter_softMax=r.filter_softMax.map(function(a,s){return a-o[s]}),r.filter_max64High=o}return r}var zt={"vs:#main-start":`
|
|
129
129
|
#ifdef DATAFILTER_DOUBLE
|
|
130
130
|
dataFilter_setValue(
|
|
131
131
|
DATAFILTER_ATTRIB - filter_min64High + DATAFILTER_ATTRIB_64LOW,
|
|
@@ -147,7 +147,7 @@ varying float dataFilter_value;
|
|
|
147
147
|
if (filter_transformColor) {
|
|
148
148
|
color.a *= dataFilter_value;
|
|
149
149
|
}
|
|
150
|
-
`},
|
|
150
|
+
`},Ut={name:"data-filter",vs:Dt,fs:jt,inject:zt,getUniforms:Vt},qt={name:"data-filter-fp64",vs:Dt,fs:jt,inject:zt,getUniforms:Yi};var ze=u(P()),L=u(R());function Wt(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function $i(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Wt(Object(e),!0).forEach(function(n){(0,ze.default)(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Wt(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var Zi=`#define SHADER_NAME data-filter-vertex-shader
|
|
151
151
|
|
|
152
152
|
#ifdef FLOAT_TARGET
|
|
153
153
|
attribute float filterIndices;
|
|
@@ -177,7 +177,7 @@ void main() {
|
|
|
177
177
|
#endif
|
|
178
178
|
gl_PointSize = 1.0;
|
|
179
179
|
}
|
|
180
|
-
`,
|
|
180
|
+
`,Xi=`#define SHADER_NAME data-filter-fragment-shader
|
|
181
181
|
precision highp float;
|
|
182
182
|
|
|
183
183
|
varying vec4 vColor;
|
|
@@ -188,7 +188,7 @@ void main() {
|
|
|
188
188
|
}
|
|
189
189
|
gl_FragColor = vColor;
|
|
190
190
|
}
|
|
191
|
-
`;function
|
|
191
|
+
`;function Ht(t){return Boolean(t.getExtension("EXT_float_blend")&&(t.getExtension("EXT_color_buffer_float")||t.getExtension("WEBGL_color_buffer_float")))}function Kt(t,r){return r?new L.Framebuffer(t,{width:1,height:1,attachments:(0,ze.default)({},36064,new L.Texture2D(t,{format:(0,L.isWebGL2)(t)?34836:6408,type:5126,mipmaps:!1}))}):new L.Framebuffer(t,{width:256,height:64,depth:!1})}function Yt(t,r,e){return r.defines.NON_INSTANCED_MODEL=1,e&&(r.defines.FLOAT_TARGET=1),new L.Model(t,$i({id:"data-filter-aggregation-model",vertexCount:1,isInstanced:!1,drawMode:0,vs:Zi,fs:Xi},r))}var $t={blend:!0,blendFunc:[1,1,1,1],blendEquation:[32774,32774],depthTest:!1};var pe=u(R());function Zt(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function ue(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Zt(Object(e),!0).forEach(function(n){(0,ce.default)(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Zt(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Qi(t){var r=eo();return function(){var n=(0,Ue.default)(t),i;if(r){var o=(0,Ue.default)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,tr.default)(this,i)}}function eo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var to={getFilterValue:{type:"accessor",value:0},onFilteredItemsChange:{type:"function",value:null,optional:!0},filterEnabled:!0,filterRange:[-1,1],filterSoftRange:null,filterTransformSize:!0,filterTransformColor:!0},Xt={1:"float",2:"vec2",3:"vec3",4:"vec4"},ve=function(t){(0,er.default)(e,t);var r=Qi(e);function e(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.filterSize,o=i===void 0?1:i,a=n.fp64,s=a===void 0?!1:a,f=n.countItems,l=f===void 0?!1:f;if((0,Jt.default)(this,e),!Xt[o])throw new Error("filterSize out of range");return r.call(this,{filterSize:o,fp64:s,countItems:l})}return(0,Qt.default)(e,[{key:"getShaders",value:function(i){var o=i.opts,a=o.filterSize,s=o.fp64;return{modules:[s?qt:Ut],defines:{DATAFILTER_TYPE:Xt[a],DATAFILTER_DOUBLE:Boolean(s)}}}},{key:"initializeState",value:function(i,o){var a=this.getAttributeManager();a&&a.add({filterValues:{size:o.opts.filterSize,type:o.opts.fp64?5130:5126,accessor:"getFilterValue",shaderAttributes:{filterValues:{divisor:0},instanceFilterValues:{divisor:1}}}});var s=this.context.gl;if(a&&o.opts.countItems){var f=Ht(s);a.add({filterIndices:{size:f?1:2,vertexOffset:1,type:5121,normalized:!0,accessor:function(v,_){var m=_.index,d=v&&v.__source?v.__source.index:m;return f?(d+1)%255:[(d+1)%255,Math.floor(d/255)%255]},shaderAttributes:{filterPrevIndices:{vertexOffset:0},filterIndices:{vertexOffset:1}}}});var l=Kt(s,f),c=Yt(s,o.getShaders.call(this,o),f);this.setState({filterFBO:l,filterModel:c})}}},{key:"updateState",value:function(i){var o=i.props,a=i.oldProps;if(this.state.filterModel){var s=this.getAttributeManager(),f=s.attributes.filterValues.needsUpdate()||o.filterEnabled!==a.filterEnabled||o.filterRange!==a.filterRange||o.filterSoftRange!==a.filterSoftRange;f&&this.setState({filterNeedsUpdate:f})}}},{key:"draw",value:function(i,o){var a=this.state,s=a.filterFBO,f=a.filterModel,l=a.filterNeedsUpdate,c=this.props.onFilteredItemsChange;if(l&&c&&f){var p=this.getAttributeManager(),v=p.attributes,_=v.filterValues,m=v.filterIndices;f.setVertexCount(this.getNumInstances());var d=this.context.gl;(0,pe.clear)(d,{framebuffer:s,color:[0,0,0,0]}),f.updateModuleSettings(i.moduleParameters).setAttributes(ue(ue({},_.getShaderAttributes()),m&&m.getShaderAttributes())).draw({framebuffer:s,parameters:ue(ue({},$t),{},{viewport:[0,0,s.width,s.height]})});for(var h=(0,pe.readPixelsToArray)(s),g=0,A=0;A<h.length;A++)g+=h[A];c({id:this.id,count:g}),this.state.filterNeedsUpdate=!1}}},{key:"finalizeState",value:function(){var i=this.state,o=i.filterFBO,a=i.filterModel;o&&(o.color.delete(),o.delete(),a.delete())}}]),e}(rr.LayerExtension);(0,ce.default)(ve,"defaultProps",to);(0,ce.default)(ve,"extensionName","DataFilterExtension");var dr=u(x()),mr=u(b()),hr=u(w()),yr=u(M()),Ye=u(T()),gr=u(P()),J=u(y());function _e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=Math.fround(t),i=t-n;return r[e]=n,r[e+1]=i,r}function Ge(t){return t-Math.fround(t)}function We(t){for(var r=new Float32Array(32),e=0;e<4;++e)for(var n=0;n<4;++n){var i=e*4+n;_e(t[n*4+e],r,i*2)}return r}var ur=`uniform float ONE;
|
|
192
192
|
vec2 split(float a) {
|
|
193
193
|
const float SPLIT = 4097.0;
|
|
194
194
|
float t = a * SPLIT;
|
|
@@ -329,7 +329,7 @@ vec2 sqrt_fp64(vec2 a) {
|
|
|
329
329
|
return sum_fp64(vec2(yn, 0.0), prod);
|
|
330
330
|
#endif
|
|
331
331
|
}
|
|
332
|
-
`;var
|
|
332
|
+
`;var cr=`const vec2 E_FP64 = vec2(2.7182817459106445e+00, 8.254840366817007e-08);
|
|
333
333
|
const vec2 LOG2_FP64 = vec2(0.6931471824645996e+00, -1.9046542121259336e-09);
|
|
334
334
|
const vec2 PI_FP64 = vec2(3.1415927410125732, -8.742278012618954e-8);
|
|
335
335
|
const vec2 TWO_PI_FP64 = vec2(6.2831854820251465, -1.7484556025237907e-7);
|
|
@@ -957,7 +957,7 @@ void mat4_vec4_mul_fp64(vec2 b[16], vec2 a[4], out vec2 out_val[4]) {
|
|
|
957
957
|
vec4_dot_fp64(a, tmp, out_val[i]);
|
|
958
958
|
}
|
|
959
959
|
}
|
|
960
|
-
`;var
|
|
960
|
+
`;var lo={ONE:1};function uo(){return lo}var pr={name:"fp64-arithmetic",vs:ur,fs:null,getUniforms:uo,fp64ify:_e,fp64LowPart:Ge,fp64ifyMatrix4:We},Z={name:"fp64",vs:cr,fs:null,dependencies:[pr],fp64ify:_e,fp64LowPart:Ge,fp64ifyMatrix4:We};var os=1/Math.PI*180,as=1/180*Math.PI,X={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function He(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function U(t,r,e){var n=X.EPSILON;e&&(X.EPSILON=e);try{if(t===r)return!0;if(He(t)&&He(r)){if(t.length!==r.length)return!1;for(var i=0;i<t.length;++i)if(!U(t[i],r[i]))return!1;return!0}return t&&t.equals?t.equals(r):r&&r.equals?r.equals(t):typeof t=="number"&&typeof r=="number"?Math.abs(t-r)<=X.EPSILON*Math.max(1,Math.abs(t),Math.abs(r)):!1}finally{X.EPSILON=n}}var Ke=typeof Float32Array<"u"?Float32Array:Array;var fs=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var t=0,r=arguments.length;r--;)t+=arguments[r]*arguments[r];return Math.sqrt(t)});function po(){var t=new Ke(3);return Ke!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function vo(t,r){var e=r[0]-t[0],n=r[1]-t[1],i=r[2]-t[2];return Math.hypot(e,n,i)}var vr=vo;var cs=function(){var t=po();return function(r,e,n,i,o,a){var s,f;for(e||(e=3),n||(n=0),i?f=Math.min(i*e+n,r.length):f=r.length,s=n;s<f;s+=e)t[0]=r[s],t[1]=r[s+1],t[2]=r[s+2],o(t,t,a),r[s]=t[0],r[s+1]=t[1],r[s+2]=t[2];return r}}();var de=u(y());var _r=`
|
|
961
961
|
const vec2 WORLD_SCALE_FP64 = vec2(81.4873275756836, 0.0000032873668232014097);
|
|
962
962
|
|
|
963
963
|
uniform vec2 project_uViewProjectionMatrixFP64[16];
|
|
@@ -1031,7 +1031,7 @@ vec4 project_position_to_clipspace(
|
|
|
1031
1031
|
position, position64xyLow, offset, commonPosition
|
|
1032
1032
|
);
|
|
1033
1033
|
}
|
|
1034
|
-
`;var
|
|
1034
|
+
`;var _o=Z.fp64ify,mo=Z.fp64ifyMatrix4,me={name:"project64",dependencies:[de.project,Z],vs:_r,getUniforms:yo},ho=(0,de._memoize)(go);function yo(t){if(t&&"viewport"in t){var r=t.viewport,e=r.viewProjectionMatrix,n=r.scale;return ho({viewProjectionMatrix:e,scale:n})}return{}}function go(t){var r=t.viewProjectionMatrix,e=t.scale,n=mo(r),i=_o(e);return{project_uViewProjectionMatrixFP64:n,project64_uViewProjectionMatrix:n,project64_uScale:i}}function Po(t){var r=xo();return function(){var n=(0,Ye.default)(t),i;if(r){var o=(0,Ye.default)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,yr.default)(this,i)}}function xo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var $e=function(t){(0,hr.default)(e,t);var r=Po(e);function e(){return(0,dr.default)(this,e),r.apply(this,arguments)}return(0,mr.default)(e,[{key:"getShaders",value:function(){var i=this.props.coordinateSystem;if(i!==J.COORDINATE_SYSTEM.LNGLAT&&i!==J.COORDINATE_SYSTEM.DEFAULT)throw new Error("fp64: coordinateSystem must be LNGLAT");return{modules:[me]}}}]),e}(J.LayerExtension);(0,gr.default)($e,"extensionName","Fp64Extension");var br=u(x()),Or=u(b()),Er=u(w()),Tr=u(M()),Ze=u(T()),Xe=u(P()),Q=u(y());var Pr={inject:{"vs:#decl":`
|
|
1035
1035
|
attribute vec2 instanceDashArrays;
|
|
1036
1036
|
attribute float instanceDashOffsets;
|
|
1037
1037
|
varying vec2 vDashArray;
|
|
@@ -1084,7 +1084,7 @@ float round(float x) {
|
|
|
1084
1084
|
}
|
|
1085
1085
|
}
|
|
1086
1086
|
}
|
|
1087
|
-
`}},
|
|
1087
|
+
`}},xr={inject:{"vs:#decl":`
|
|
1088
1088
|
attribute float instanceOffsets;
|
|
1089
1089
|
`,"vs:DECKGL_FILTER_SIZE":`
|
|
1090
1090
|
float offsetWidth = abs(instanceOffsets * 2.0) + 1.0;
|
|
@@ -1099,7 +1099,7 @@ attribute float instanceOffsets;
|
|
|
1099
1099
|
if (isInside == 0.0) {
|
|
1100
1100
|
discard;
|
|
1101
1101
|
}
|
|
1102
|
-
`}};
|
|
1102
|
+
`}};function bo(t){var r=Oo();return function(){var n=(0,Ze.default)(t),i;if(r){var o=(0,Ze.default)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,Tr.default)(this,i)}}function Oo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Eo={getDashArray:{type:"accessor",value:[0,0]},getOffset:{type:"accessor",value:0},dashJustified:!1,dashGapPickable:!1},he=function(t){(0,Er.default)(e,t);var r=bo(e);function e(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.dash,o=i===void 0?!1:i,a=n.offset,s=a===void 0?!1:a,f=n.highPrecisionDash,l=f===void 0?!1:f;return(0,br.default)(this,e),r.call(this,{dash:o||l,offset:s,highPrecisionDash:l})}return(0,Or.default)(e,[{key:"isEnabled",value:function(i){return"pathTesselator"in i.state}},{key:"getShaders",value:function(i){if(!i.isEnabled(this))return null;var o={};return i.opts.dash&&(o=(0,Q._mergeShaders)(o,Pr)),i.opts.offset&&(o=(0,Q._mergeShaders)(o,xr)),o}},{key:"initializeState",value:function(i,o){var a=this.getAttributeManager();!a||!o.isEnabled(this)||(o.opts.dash&&a.addInstanced({instanceDashArrays:{size:2,accessor:"getDashArray"}}),o.opts.highPrecisionDash&&a.addInstanced({instanceDashOffsets:{size:1,accessor:"getPath",transform:o.getDashOffsets.bind(this)}}),o.opts.offset&&a.addInstanced({instanceOffsets:{size:1,accessor:"getOffset"}}))}},{key:"updateState",value:function(i,o){if(o.isEnabled(this)){var a={};o.opts.dash&&(a.dashAlignMode=this.props.dashJustified?1:0,a.dashGapPickable=Boolean(this.props.dashGapPickable)),this.state.model.setUniforms(a)}}},{key:"getDashOffsets",value:function(i){for(var o=[0],a=this.props.positionFormat==="XY"?2:3,s=Array.isArray(i[0]),f=s?i.length:i.length/a,l,c,p=0;p<f-1;p++)l=s?i[p]:i.slice(p*a,p*a+a),l=this.projectPosition(l),p>0&&(o[p]=o[p-1]+vr(c,l)),c=l;return o}}]),e}(Q.LayerExtension);(0,Xe.default)(he,"defaultProps",Eo);(0,Xe.default)(he,"extensionName","PathStyleExtension");var Mr=u(x()),Ar=u(b()),Rr=u(w()),Sr=u(M()),Je=u(T()),ye=u(P()),Fr=u(y()),kr=u(R());var ee=u(y()),To=`
|
|
1103
1103
|
#ifdef NON_INSTANCED_MODEL
|
|
1104
1104
|
#define FILL_PATTERN_FRAME_ATTRIB fillPatternFrames
|
|
1105
1105
|
#define FILL_PATTERN_SCALE_ATTRIB fillPatternScales
|
|
@@ -1120,7 +1120,7 @@ uniform vec2 fill_patternTextureSize;
|
|
|
1120
1120
|
varying vec2 fill_uv;
|
|
1121
1121
|
varying vec4 fill_patternBounds;
|
|
1122
1122
|
varying vec4 fill_patternPlacement;
|
|
1123
|
-
`,
|
|
1123
|
+
`,wo=`
|
|
1124
1124
|
uniform bool fill_patternEnabled;
|
|
1125
1125
|
uniform bool fill_patternMask;
|
|
1126
1126
|
uniform sampler2D fill_patternTexture;
|
|
@@ -1154,13 +1154,13 @@ const float FILL_UV_SCALE = 512.0 / 40000000.0;
|
|
|
1154
1154
|
color.rgb = patternColor.rgb;
|
|
1155
1155
|
}
|
|
1156
1156
|
}
|
|
1157
|
-
`};function
|
|
1157
|
+
`};function Ao(t,r){if(!t)return{};if("fillPatternTexture"in t){var e=t.fillPatternTexture;return{fill_patternTexture:e,fill_patternTextureSize:[e.width,e.height]}}if("viewport"in t){var n=t.fillPatternMask,i=n===void 0?!0:n,o=t.fillPatternEnabled,a=o===void 0?!0:o,s=r,f=s.project_uCommonOrigin,l=[(0,ee.fp64LowPart)(f[0]),(0,ee.fp64LowPart)(f[1])];return{fill_uvCoordinateOrigin:f.slice(0,2),fill_uvCoordinateOrigin64Low:l,fill_patternMask:i,fill_patternEnabled:a}}return{}}var wr={name:"fill-pattern",vs:To,fs:wo,inject:Mo,dependencies:[ee.project],getUniforms:Ao};function Ro(t){var r=So();return function(){var n=(0,Je.default)(t),i;if(r){var o=(0,Je.default)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,Sr.default)(this,i)}}function So(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Fo={fillPatternEnabled:!0,fillPatternAtlas:{type:"image",value:null,async:!0,parameters:(0,ye.default)({},10241,9729)},fillPatternMapping:{type:"object",value:{},async:!0},fillPatternMask:!0,getFillPattern:{type:"accessor",value:function(r){return r.pattern}},getFillPatternScale:{type:"accessor",value:1},getFillPatternOffset:{type:"accessor",value:[0,0]}},ge=function(t){(0,Rr.default)(e,t);var r=Ro(e);function e(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.pattern,o=i===void 0?!1:i;return(0,Mr.default)(this,e),r.call(this,{pattern:o})}return(0,Ar.default)(e,[{key:"isEnabled",value:function(i){return i.getAttributeManager()!==null&&!("pathTesselator"in i.state)}},{key:"getShaders",value:function(i){return i.isEnabled(this)?{modules:[i.opts.pattern&&wr].filter(Boolean)}:null}},{key:"initializeState",value:function(i,o){if(o.isEnabled(this)){var a=this.getAttributeManager();o.opts.pattern&&a.add({fillPatternFrames:{size:4,accessor:"getFillPattern",transform:o.getPatternFrame.bind(this),shaderAttributes:{fillPatternFrames:{divisor:0},instanceFillPatternFrames:{divisor:1}}},fillPatternScales:{size:1,accessor:"getFillPatternScale",defaultValue:1,shaderAttributes:{fillPatternScales:{divisor:0},instanceFillPatternScales:{divisor:1}}},fillPatternOffsets:{size:2,accessor:"getFillPatternOffset",shaderAttributes:{fillPatternOffsets:{divisor:0},instanceFillPatternOffsets:{divisor:1}}}}),this.setState({emptyTexture:new kr.Texture2D(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}}},{key:"updateState",value:function(i,o){var a=i.props,s=i.oldProps;o.isEnabled(this)&&a.fillPatternMapping&&a.fillPatternMapping!==s.fillPatternMapping&&this.getAttributeManager().invalidate("getFillPattern")}},{key:"draw",value:function(i,o){if(o.isEnabled(this)){var a=this.props.fillPatternAtlas;this.setModuleParameters({fillPatternTexture:a||this.state.emptyTexture})}}},{key:"finalizeState",value:function(){var i=this.state,o=i.patternTexture,a=i.emptyTexture;o?.delete(),a?.delete()}},{key:"getPatternFrame",value:function(i){var o=this.getCurrentLayer().props.fillPatternMapping,a=o&&o[i];return a?[a.x,a.y,a.width,a.height]:[0,0,0,0]}}]),e}(Fr.LayerExtension);(0,ye.default)(ge,"defaultProps",Fo);(0,ye.default)(ge,"extensionName","FillStyleExtension");var Cr=u(x()),Ir=u(b()),Lr=u(w()),Nr=u(M()),Qe=u(T()),et=u(P()),Br=u(y());function ko(t){var r=Co();return function(){var n=(0,Qe.default)(t),i;if(r){var o=(0,Qe.default)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,Nr.default)(this,i)}}function Co(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Io={clipBounds:[0,0,1,1],clipByInstance:void 0},Dr=`
|
|
1158
1158
|
uniform vec4 clip_bounds;
|
|
1159
1159
|
|
|
1160
1160
|
bool clip_isInBounds(vec2 position) {
|
|
1161
1161
|
return position.x >= clip_bounds[0] && position.y >= clip_bounds[1] && position.x < clip_bounds[2] && position.y < clip_bounds[3];
|
|
1162
1162
|
}
|
|
1163
|
-
`,
|
|
1163
|
+
`,Lo={name:"clip-vs",vs:Dr},No={"vs:#decl":`
|
|
1164
1164
|
varying float clip_isVisible;
|
|
1165
1165
|
`,"vs:DECKGL_FILTER_GL_POSITION":`
|
|
1166
1166
|
clip_isVisible = float(clip_isInBounds(geometry.worldPosition.xy));
|
|
@@ -1168,7 +1168,7 @@ varying float clip_isVisible;
|
|
|
1168
1168
|
varying float clip_isVisible;
|
|
1169
1169
|
`,"fs:DECKGL_FILTER_COLOR":`
|
|
1170
1170
|
if (clip_isVisible < 0.5) discard;
|
|
1171
|
-
`},
|
|
1171
|
+
`},Bo={name:"clip-fs",fs:Dr},Do={"vs:#decl":`
|
|
1172
1172
|
varying vec2 clip_commonPosition;
|
|
1173
1173
|
`,"vs:DECKGL_FILTER_GL_POSITION":`
|
|
1174
1174
|
clip_commonPosition = geometry.position.xy;
|
|
@@ -1176,7 +1176,7 @@ varying vec2 clip_commonPosition;
|
|
|
1176
1176
|
varying vec2 clip_commonPosition;
|
|
1177
1177
|
`,"fs:DECKGL_FILTER_COLOR":`
|
|
1178
1178
|
if (!clip_isInBounds(clip_commonPosition)) discard;
|
|
1179
|
-
`},Pe=function(t){(0,Lr.default)(e,t);var r=
|
|
1179
|
+
`},Pe=function(t){(0,Lr.default)(e,t);var r=ko(e);function e(){return(0,Cr.default)(this,e),r.apply(this,arguments)}return(0,Ir.default)(e,[{key:"getShaders",value:function(){var i="instancePositions"in this.getAttributeManager().attributes;return this.props.clipByInstance!==void 0&&(i=Boolean(this.props.clipByInstance)),this.state.clipByInstance=i,i?{modules:[Lo],inject:No}:{modules:[Bo],inject:Do}}},{key:"draw",value:function(i){var o=i.uniforms,a=this.props.clipBounds;if(this.state.clipByInstance)o.clip_bounds=a;else{var s=this.projectPosition([a[0],a[1],0]),f=this.projectPosition([a[2],a[3],0]);o.clip_bounds=[Math.min(s[0],f[0]),Math.min(s[1],f[1]),Math.max(s[0],f[0]),Math.max(s[1],f[1])]}}}]),e}(Br.LayerExtension);(0,et.default)(Pe,"defaultProps",Io);(0,et.default)(Pe,"extensionName","ClipExtension");var Pn=u(x()),xn=u(b()),bn=u(w()),On=u(M()),at=u(T()),st=u(P()),En=u(y());var jr=u(y()),jo=`
|
|
1180
1180
|
#ifdef NON_INSTANCED_MODEL
|
|
1181
1181
|
attribute float collisionPriorities;
|
|
1182
1182
|
#else
|
|
@@ -1225,7 +1225,7 @@ float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
|
|
|
1225
1225
|
float W = 2.0 * floatN + 1.0;
|
|
1226
1226
|
return pow(accumulator / (W * W), 2.2);
|
|
1227
1227
|
}
|
|
1228
|
-
`,
|
|
1228
|
+
`,Vo={"vs:#decl":`
|
|
1229
1229
|
float collision_fade = 1.0;
|
|
1230
1230
|
`,"vs:DECKGL_FILTER_GL_POSITION":`
|
|
1231
1231
|
if (collision_sort) {
|
|
@@ -1247,16 +1247,16 @@ float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
|
|
|
1247
1247
|
}
|
|
1248
1248
|
`,"vs:DECKGL_FILTER_COLOR":`
|
|
1249
1249
|
color.a *= collision_fade;
|
|
1250
|
-
`},
|
|
1251
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return o=l.done,l},e:function(l){a=!0,s=l},f:function(){try{!o&&e.return!=null&&e.return()}finally{if(a)throw s}}}}function
|
|
1252
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return o=l.done,l},e:function(l){a=!0,s=l},f:function(){try{!o&&e.return!=null&&e.return()}finally{if(a)throw s}}}}function
|
|
1253
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return o=l.done,l},e:function(l){a=!0,s=l},f:function(){try{!o&&e.return!=null&&e.return()}finally{if(a)throw s}}}}function
|
|
1250
|
+
`},zo=function(r,e){if(!r||!("dummyCollisionMap"in r))return{};var n=r.collisionFBO,i=r.drawToCollisionMap,o=r.dummyCollisionMap;return{collision_sort:Boolean(i),collision_texture:!i&&n?n:o}},Vr={name:"collision",dependencies:[jr.project],vs:jo,inject:Vo,getUniforms:zo};var mn=u(x()),hn=u(b()),E=u(P()),B=u(R());var yn=u(y());var qr=u(P()),Gr=u(x()),Wr=u(b()),Hr=u(w()),Kr=u(M()),tt=u(T()),Yr=u(R()),$r=u(y());function zr(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Ur(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?zr(Object(e),!0).forEach(function(n){(0,qr.default)(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):zr(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Uo(t){var r=qo();return function(){var n=(0,tt.default)(t),i;if(r){var o=(0,tt.default)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,Kr.default)(this,i)}}function qo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Zr=function(t){(0,Hr.default)(e,t);var r=Uo(e);function e(){return(0,Gr.default)(this,e),r.apply(this,arguments)}return(0,Wr.default)(e,[{key:"renderCollisionMap",value:function(i,o){var a=this,s=this.gl,f=1;return(0,Yr.withParameters)(s,{scissorTest:!0,scissor:[f,f,i.width-2*f,i.height-2*f],clearColor:[0,0,0,0],blend:!1,depthTest:!0,depthRange:[0,1]},function(){return a.render(Ur(Ur({},o),{},{target:i,pass:"collision"}))})}},{key:"getModuleParameters",value:function(){return{drawToCollisionMap:!0,pickingActive:1,pickingAttribute:!1,lightSources:{}}}}]),e}($r._LayersPass);var pn=u(x()),vn=u(b()),F=u(P()),it=u(y()),_n=u(R());var tn=u(x()),rn=u(b()),nt=u(fe()),nn=u(rt()),on=u(w()),an=u(M()),Oe=u(T()),N=u(P()),q=u(R()),sn=u(y());function Qr(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function en(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Qr(Object(e),!0).forEach(function(n){(0,N.default)(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Qr(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Ko(t){var r=Yo();return function(){var n=(0,Oe.default)(t),i;if(r){var o=(0,Oe.default)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,an.default)(this,i)}}function Yo(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var fn=function(t){(0,on.default)(e,t);var r=Ko(e);function e(n,i){var o,a;(0,tn.default)(this,e),a=r.call(this,n,i),(0,N.default)((0,nt.default)(a),"maskMap",void 0),(0,N.default)((0,nt.default)(a),"fbo",void 0);var s=i.mapSize,f=s===void 0?2048:s;return a.maskMap=new q.Texture2D(n,{width:f,height:f,parameters:(o={},(0,N.default)(o,10241,9729),(0,N.default)(o,10240,9729),(0,N.default)(o,10242,33071),(0,N.default)(o,10243,33071),o)}),a.fbo=new q.Framebuffer(n,{id:"maskmap",width:f,height:f,attachments:(0,N.default)({},36064,a.maskMap)}),a}return(0,rn.default)(e,[{key:"render",value:function(i){var o=this,a=this.gl,s=[!1,!1,!1,!1];return s[i.channel]=!0,(0,q.withParameters)(a,{clearColor:[255,255,255,255],blend:!0,blendFunc:[0,1],blendEquation:32778,colorMask:s,depthTest:!1},function(){return(0,nn.default)((0,Oe.default)(e.prototype),"render",o).call(o,en(en({},i),{},{target:o.fbo,pass:"mask"}))})}},{key:"shouldDrawLayer",value:function(i){return i.props.operation.includes("mask")}},{key:"delete",value:function(){this.fbo.delete(),this.maskMap.delete()}}]),e}(sn._LayersPass);var un=u(qe()),Ee=u(y());function $o(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Zo(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
1251
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return o=l.done,l},e:function(l){a=!0,s=l},f:function(){try{!o&&e.return!=null&&e.return()}finally{if(a)throw s}}}}function Zo(t,r){if(t){if(typeof t=="string")return ln(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ln(t,r)}}function ln(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function G(t,r){var e=[1/0,1/0,-1/0,-1/0],n=$o(t),i;try{for(n.s();!(i=n.n()).done;){var o=i.value,a=o.getBounds();if(a){var s=o.projectPosition(a[0],{viewport:r,autoOffset:!1}),f=o.projectPosition(a[1],{viewport:r,autoOffset:!1});e[0]=Math.min(e[0],s[0]),e[1]=Math.min(e[1],s[1]),e[2]=Math.max(e[2],f[0]),e[3]=Math.max(e[3],f[1])}}}catch(l){n.e(l)}finally{n.f()}return Number.isFinite(e[0])?e:null}var Xo=2048;function W(t){var r=t.bounds,e=t.viewport,n=t.border,i=n===void 0?0:n,o=e.isGeospatial;if(r[2]<=r[0]||r[3]<=r[1])return null;var a=e.unprojectPosition([(r[0]+r[2])/2,(r[1]+r[3])/2,0]),s=t.width,f=t.height,l=t.zoom;if(l===void 0){s=s-i*2,f=f-i*2;var c=Math.min(s/(r[2]-r[0]),f/(r[3]-r[1]));l=Math.min(Math.log2(c),20)}else if(!s||!f){var p=Math.pow(2,l);s=Math.round(Math.abs(r[2]-r[0])*p),f=Math.round(Math.abs(r[3]-r[1])*p);var v=Xo-i*2;if(s>v||f>v){var _=v/Math.max(s,f);s=Math.round(s*_),f=Math.round(f*_),l+=Math.log2(_)}}return o?new Ee.WebMercatorViewport({x:i,y:i,width:s,height:f,longitude:a[0],latitude:a[1],zoom:l,orthographic:!0}):new Ee.OrthographicViewport({x:i,y:i,width:s,height:f,target:a,zoom:l,flipY:!1})}function Jo(t,r){var e;if(r&&r.length===2){var n=(0,un.default)(r,2),i=n[0],o=n[1],a=t.getBounds({z:i}),s=t.getBounds({z:o});e=[Math.min(a[0],s[0]),Math.min(a[1],s[1]),Math.max(a[2],s[2]),Math.max(a[3],s[3])]}else e=t.getBounds();var f=t.projectPosition(e.slice(0,2)),l=t.projectPosition(e.slice(2,4));return[f[0],f[1],l[0],l[1]]}function H(t,r,e){if(!t)return[0,0,1,1];var n=Jo(r,e),i=Qo(n);return t[2]-t[0]<=i[2]-i[0]&&t[3]-t[1]<=i[3]-i[1]?t:[Math.max(t[0],i[0]),Math.max(t[1],i[1]),Math.min(t[2],i[2]),Math.min(t[3],i[3])]}function Qo(t){var r=t[2]-t[0],e=t[3]-t[1],n=(t[0]+t[2])/2,i=(t[1]+t[3])/2;return[n-r,i-e,n+r,i+e]}function ea(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=ta(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
1252
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return o=l.done,l},e:function(l){a=!0,s=l},f:function(){try{!o&&e.return!=null&&e.return()}finally{if(a)throw s}}}}function ta(t,r){if(t){if(typeof t=="string")return cn(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return cn(t,r)}}function cn(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var Te=function(){function t(){(0,pn.default)(this,t),(0,F.default)(this,"id","mask-effect"),(0,F.default)(this,"props",null),(0,F.default)(this,"useInPicking",!0),(0,F.default)(this,"order",0),(0,F.default)(this,"dummyMaskMap",void 0),(0,F.default)(this,"channels",[]),(0,F.default)(this,"masks",null),(0,F.default)(this,"maskPass",void 0),(0,F.default)(this,"maskMap",void 0),(0,F.default)(this,"lastViewport",void 0)}return(0,vn.default)(t,[{key:"preRender",value:function(e,n){var i=n.layers,o=n.layerFilter,a=n.viewports,s=n.onViewportActive,f=n.views,l=n.isPicking,c=!1;if(this.dummyMaskMap||(this.dummyMaskMap=new _n.Texture2D(e,{width:1,height:1})),l)return{didRender:c};var p=i.filter(function(g){return g.props.visible&&g.props.operation.includes("mask")});if(p.length===0)return this.masks=null,this.channels.length=0,{didRender:c};this.masks={},this.maskPass||(this.maskPass=new fn(e,{id:"default-mask"}),this.maskMap=this.maskPass.maskMap);var v=this._sortMaskChannels(p),_=a[0],m=!this.lastViewport||!this.lastViewport.equals(_);if(_.resolution!==void 0)return it.log.warn("MaskExtension is not supported in GlobeView")(),{didRender:c};for(var d in v){var h=this._renderChannel(v[d],{layerFilter:o,onViewportActive:s,views:f,viewport:_,viewportChanged:m});c||(c=h)}return{didRender:c}}},{key:"_renderChannel",value:function(e,n){var i=n.layerFilter,o=n.onViewportActive,a=n.views,s=n.viewport,f=n.viewportChanged,l=!1,c=this.channels[e.index];if(!c)return l;var p=e===c||e.layers.length!==c.layers.length||e.layers.some(function(h,g){return h!==c.layers[g]||h.props.transitions})||e.layerBounds.some(function(h,g){return h!==c.layerBounds[g]});if(e.bounds=c.bounds,e.maskBounds=c.maskBounds,this.channels[e.index]=e,p||f){this.lastViewport=s;var v=G(e.layers,s);if(e.bounds=v&&H(v,s),p||!U(e.bounds,c.bounds)){var _=this.maskPass,m=this.maskMap,d=v&&W({bounds:e.bounds,viewport:s,width:m.width,height:m.height,border:1});e.maskBounds=d?d.getBounds():[0,0,1,1],_.render({pass:"mask",channel:e.index,layers:e.layers,layerFilter:i,viewports:d?[d]:[],onViewportActive:o,views:a,moduleParameters:{devicePixelRatio:1}}),l=!0}}return this.masks[e.id]={index:e.index,bounds:e.maskBounds,coordinateOrigin:e.coordinateOrigin,coordinateSystem:e.coordinateSystem},l}},{key:"_sortMaskChannels",value:function(e){var n=this,i={},o=0,a=ea(e),s;try{var f=function(){var d=s.value,h=d.root.id,g=i[h];if(!g){if(++o>4)return it.log.warn("Too many mask layers. The max supported is 4")(),"continue";g={id:h,index:n.channels.findIndex(function(A){return A?.id===h}),layers:[],layerBounds:[],coordinateOrigin:d.root.props.coordinateOrigin,coordinateSystem:d.root.props.coordinateSystem},i[h]=g}g.layers.push(d),g.layerBounds.push(d.getBounds())};for(a.s();!(s=a.n()).done;)var l=f()}catch(m){a.e(m)}finally{a.f()}for(var c=0;c<4;c++){var p=this.channels[c];(!p||!(p.id in i))&&(this.channels[c]=null)}for(var v in i){var _=i[v];_.index<0&&(_.index=this.channels.findIndex(function(m){return!m}),this.channels[_.index]=_)}return i}},{key:"getModuleParameters",value:function(){return{maskMap:this.masks?this.maskMap:this.dummyMaskMap,maskChannels:this.masks}}},{key:"cleanup",value:function(){this.dummyMaskMap&&(this.dummyMaskMap.delete(),this.dummyMaskMap=void 0),this.maskPass&&(this.maskPass.delete(),this.maskPass=void 0,this.maskMap=void 0),this.lastViewport=void 0,this.masks=null,this.channels.length=0}}]),t}();function ra(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=na(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
1253
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return o=l.done,l},e:function(l){a=!0,s=l},f:function(){try{!o&&e.return!=null&&e.return()}finally{if(a)throw s}}}}function na(t,r){if(t){if(typeof t=="string")return dn(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return dn(t,r)}}function dn(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var ot=2,gn=function(){function t(){(0,mn.default)(this,t),(0,E.default)(this,"id","collision-filter-effect"),(0,E.default)(this,"props",null),(0,E.default)(this,"useInPicking",!0),(0,E.default)(this,"order",1),(0,E.default)(this,"channels",{}),(0,E.default)(this,"collisionFilterPass",void 0),(0,E.default)(this,"collisionFBOs",{}),(0,E.default)(this,"dummyCollisionMap",void 0),(0,E.default)(this,"lastViewport",void 0)}return(0,hn.default)(t,[{key:"preRender",value:function(e,n){var i,o=n.effects,a=n.layers,s=n.layerFilter,f=n.viewports,l=n.onViewportActive,c=n.views,p=n.isPicking,v=n.preRenderStats,_=v===void 0?{}:v;if(this.dummyCollisionMap||(this.dummyCollisionMap=new B.Texture2D(e,{width:1,height:1})),!p){var m=a.filter(function(Ie){var mt=Ie.props,Oi=mt.visible,Ei=mt.collisionEnabled;return Oi&&Ei});if(m.length===0){this.channels={};return}this.collisionFilterPass||(this.collisionFilterPass=new Zr(e,{id:"default-collision-filter"}));var d=o?.filter(function(Ie){return Ie.constructor===Te}),h=(i=_["mask-effect"])===null||i===void 0?void 0:i.didRender,g=this._groupByCollisionGroup(e,m),A=f[0],ne=!this.lastViewport||!this.lastViewport.equals(A)||h;for(var $ in g){var xi=this.collisionFBOs[$],bi=g[$];xi.resize({width:e.canvas.width/ot,height:e.canvas.height/ot}),this._render(bi,{effects:d,layerFilter:s,onViewportActive:l,views:c,viewport:A,viewportChanged:ne})}}}},{key:"_render",value:function(e,n){var i=n.effects,o=n.layerFilter,a=n.onViewportActive,s=n.views,f=n.viewport,l=n.viewportChanged,c=e.collisionGroup,p=this.channels[c];if(p){var v=l||e===p||!(0,yn._deepEqual)(p.layers,e.layers,1)||e.layerBounds.some(function(m,d){return!U(m,p.layerBounds[d])})||e.allLayersLoaded!==p.allLayersLoaded||e.layers.some(function(m){return m.props.transitions});if(this.channels[c]=e,v){this.lastViewport=f;var _=this.collisionFBOs[c];this.collisionFilterPass.renderCollisionMap(_,{pass:"collision-filter",isPicking:!0,layers:e.layers,effects:i,layerFilter:o,viewports:f?[f]:[],onViewportActive:a,views:s,moduleParameters:{dummyCollisionMap:this.dummyCollisionMap,devicePixelRatio:(0,B.cssToDeviceRatio)(_.gl)/ot}})}}}},{key:"_groupByCollisionGroup",value:function(e,n){var i={},o=ra(n),a;try{for(o.s();!(a=o.n()).done;){var s=a.value,f=s.props.collisionGroup,l=i[f];l||(l={collisionGroup:f,layers:[],layerBounds:[],allLayersLoaded:!0},i[f]=l),l.layers.push(s),l.layerBounds.push(s.getBounds()),s.isLoaded||(l.allLayersLoaded=!1)}}catch(h){o.e(h)}finally{o.f()}for(var c=0,p=Object.keys(i);c<p.length;c++){var v=p[c];this.collisionFBOs[v]||this.createFBO(e,v),this.channels[v]||(this.channels[v]=i[v])}for(var _=0,m=Object.keys(this.collisionFBOs);_<m.length;_++){var d=m[_];i[d]||this.destroyFBO(d)}return i}},{key:"getModuleParameters",value:function(e){var n=e.props.collisionGroup,i=this.collisionFBOs,o=this.dummyCollisionMap;return{collisionFBO:i[n],dummyCollisionMap:o}}},{key:"cleanup",value:function(){this.dummyCollisionMap&&(this.dummyCollisionMap.delete(),this.dummyCollisionMap=void 0),this.channels={};for(var e=0,n=Object.keys(this.collisionFBOs);e<n.length;e++){var i=n[e];this.destroyFBO(i)}this.collisionFBOs={},this.lastViewport=void 0}},{key:"createFBO",value:function(e,n){var i,o,a=e.canvas,s=a.width,f=a.height,l=new B.Texture2D(e,{width:s,height:f,parameters:(i={},(0,E.default)(i,10241,9728),(0,E.default)(i,10240,9728),(0,E.default)(i,10242,33071),(0,E.default)(i,10243,33071),i)}),c=new B.Renderbuffer(e,{format:33189,width:s,height:f});this.collisionFBOs[n]=new B.Framebuffer(e,{id:"Collision-".concat(n),width:s,height:f,attachments:(o={},(0,E.default)(o,36064,l),(0,E.default)(o,36096,c),o)})}},{key:"destroyFBO",value:function(e){for(var n=this.collisionFBOs[e],i=0,o=Object.values(n.attachments);i<o.length;i++){var a=o[i];a.delete()}n.delete(),delete this.collisionFBOs[e]}}]),t}();function ia(t){var r=oa();return function(){var n=(0,at.default)(t),i;if(r){var o=(0,at.default)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,On.default)(this,i)}}function oa(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var aa={getCollisionPriority:{type:"accessor",value:0},collisionEnabled:!0,collisionGroup:{type:"string",value:"default"},collisionTestProps:{}},we=function(t){(0,bn.default)(e,t);var r=ia(e);function e(){return(0,Pn.default)(this,e),r.apply(this,arguments)}return(0,xn.default)(e,[{key:"getShaders",value:function(){return{modules:[Vr]}}},{key:"draw",value:function(i){var o=i.uniforms,a=i.context,s=i.moduleParameters,f=this.props.collisionEnabled,l=s.collisionFBO,c=s.drawToCollisionMap,p=f&&Boolean(l);o.collision_enabled=p,c&&(this.props=this.clone(this.props.collisionTestProps).props)}},{key:"initializeState",value:function(i,o){var a;if(this.getAttributeManager()!==null){(a=this.context.deck)===null||a===void 0||a._addDefaultEffect(new gn);var s=this.getAttributeManager();s.add({collisionPriorities:{size:1,accessor:"getCollisionPriority",shaderAttributes:{collisionPriorities:{divisor:0},instanceCollisionPriorities:{divisor:1}}}})}}},{key:"getNeedsPickingBuffer",value:function(){return this.props.collisionEnabled}}]),e}(En.LayerExtension);(0,st.default)(we,"defaultProps",aa);(0,st.default)(we,"extensionName","CollisionFilterExtension");var Mn=u(x()),An=u(b()),Rn=u(w()),Sn=u(M()),ft=u(T()),lt=u(P()),V=u(y());var Tn=u(y()),sa=`
|
|
1254
1254
|
uniform vec4 mask_bounds;
|
|
1255
1255
|
uniform bool mask_maskByInstance;
|
|
1256
1256
|
vec2 mask_getCoords(vec4 position) {
|
|
1257
1257
|
return (position.xy - mask_bounds.xy) / (mask_bounds.zw - mask_bounds.xy);
|
|
1258
1258
|
}
|
|
1259
|
-
`,
|
|
1259
|
+
`,fa=`
|
|
1260
1260
|
uniform sampler2D mask_texture;
|
|
1261
1261
|
uniform int mask_channel;
|
|
1262
1262
|
uniform bool mask_enabled;
|
|
@@ -1283,7 +1283,7 @@ bool mask_isInBounds(vec2 texCoords) {
|
|
|
1283
1283
|
return maskValue < 0.5;
|
|
1284
1284
|
}
|
|
1285
1285
|
}
|
|
1286
|
-
`,
|
|
1286
|
+
`,la={"vs:#decl":`
|
|
1287
1287
|
varying vec2 mask_texCoords;
|
|
1288
1288
|
`,"vs:#main-end":`
|
|
1289
1289
|
vec4 mask_common_position;
|
|
@@ -1305,13 +1305,13 @@ varying vec2 mask_texCoords;
|
|
|
1305
1305
|
|
|
1306
1306
|
if (!mask) discard;
|
|
1307
1307
|
}
|
|
1308
|
-
`},
|
|
1309
|
-
`),Ae={name:"terrain",dependencies:[
|
|
1308
|
+
`},ua=function(r){return r&&"maskMap"in r?{mask_texture:r.maskMap}:{}},wn={name:"mask",dependencies:[Tn.project],vs:sa,fs:fa,inject:la,getUniforms:ua};function ca(t){var r=pa();return function(){var n=(0,ft.default)(t),i;if(r){var o=(0,ft.default)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,Sn.default)(this,i)}}function pa(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var va={maskId:"",maskByInstance:void 0,maskInverted:!1},Me=function(t){(0,Rn.default)(e,t);var r=ca(e);function e(){return(0,Mn.default)(this,e),r.apply(this,arguments)}return(0,An.default)(e,[{key:"initializeState",value:function(){var i;(i=this.context.deck)===null||i===void 0||i._addDefaultEffect(new Te)}},{key:"getShaders",value:function(){var i="instancePositions"in this.getAttributeManager().attributes;return this.props.maskByInstance!==void 0&&(i=Boolean(this.props.maskByInstance)),this.state.maskByInstance=i,{modules:[wn]}}},{key:"draw",value:function(i){var o=i.uniforms,a=i.context,s=i.moduleParameters;o.mask_maskByInstance=this.state.maskByInstance;var f=this.props,l=f.maskId,c=f.maskInverted,p=s.maskChannels,v=a.viewport;if(p&&p[l]){var _=p[l],m=_.index,d=_.bounds,h=_.coordinateOrigin,g=p[l].coordinateSystem;o.mask_enabled=!0,o.mask_channel=m,o.mask_inverted=c,g===V.COORDINATE_SYSTEM.DEFAULT&&(g=v.isGeospatial?V.COORDINATE_SYSTEM.LNGLAT:V.COORDINATE_SYSTEM.CARTESIAN);var A={modelMatrix:null,fromCoordinateOrigin:h,fromCoordinateSystem:g},ne=this.projectPosition([d[0],d[1],0],A),$=this.projectPosition([d[2],d[3],0],A);o.mask_bounds=[ne[0],ne[1],$[0],$[1]]}else l&&V.log.warn("Could not find a mask layer with id: ".concat(l))(),o.mask_enabled=!1}}]),e}(V.LayerExtension);(0,lt.default)(Me,"defaultProps",va);(0,lt.default)(Me,"extensionName","MaskExtension");var mi=u(x()),hi=u(b()),yi=u(w()),gi=u(M()),_t=u(T()),dt=u(P()),Pi=u(y());var ci=u(qe()),pi=u(x()),vi=u(b()),S=u(P()),ke=u(R()),_i=u(y());var kn=u(y()),I={NONE:0,WRITE_HEIGHT_MAP:1,USE_HEIGHT_MAP:2,USE_COVER:3,USE_COVER_ONLY:4,SKIP:5},Fn=Object.keys(I).map(function(t){return"const float TERRAIN_MODE_".concat(t," = ").concat(I[t],".0;")}).join(`
|
|
1309
|
+
`),Ae={name:"terrain",dependencies:[kn.project],inject:{"vs:#decl":`
|
|
1310
1310
|
uniform float terrain_mode;
|
|
1311
1311
|
uniform sampler2D terrain_map;
|
|
1312
1312
|
uniform vec4 terrain_bounds;
|
|
1313
1313
|
varying vec3 commonPos;
|
|
1314
|
-
`.concat(
|
|
1314
|
+
`.concat(Fn,`
|
|
1315
1315
|
`),"vs:#main-start":`
|
|
1316
1316
|
if (terrain_mode == TERRAIN_MODE_SKIP) {
|
|
1317
1317
|
gl_Position = vec4(0.0);
|
|
@@ -1339,7 +1339,7 @@ uniform float terrain_mode;
|
|
|
1339
1339
|
uniform sampler2D terrain_map;
|
|
1340
1340
|
uniform vec4 terrain_bounds;
|
|
1341
1341
|
varying vec3 commonPos;
|
|
1342
|
-
`.concat(
|
|
1342
|
+
`.concat(Fn,`
|
|
1343
1343
|
`),"fs:#main-start":`
|
|
1344
1344
|
if (terrain_mode == TERRAIN_MODE_WRITE_HEIGHT_MAP) {
|
|
1345
1345
|
gl_FragColor = vec4(commonPos.z, 0.0, 0.0, 1.0);
|
|
@@ -1357,8 +1357,8 @@ if ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_US
|
|
|
1357
1357
|
}
|
|
1358
1358
|
return;
|
|
1359
1359
|
}
|
|
1360
|
-
`},getUniforms:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;if("dummyHeightMap"in r){var n=r.drawToTerrainHeightMap,i=r.heightMap,o=r.heightMapBounds,a=r.dummyHeightMap,s=r.terrainCover,f=r.useTerrainHeightMap,l=r.terrainSkipRender,c=e.project_uCommonOrigin,p=l?I.SKIP:I.NONE,v=a,_=null;if(n)p=I.WRITE_HEIGHT_MAP,_=o;else if(f&&i)p=I.USE_HEIGHT_MAP,v=i,_=o;else if(s){var m=r.pickingActive;v=m?s.getPickingFramebuffer():s.getRenderFramebuffer(),m&&(p=I.SKIP),v?(p=p===I.SKIP?I.USE_COVER_ONLY:I.USE_COVER,_=s.bounds):v=a}return{terrain_mode:p,terrain_map:v,terrain_bounds:_?[_[0]-c[0],_[1]-c[1],_[2]-_[0],_[3]-_[1]]:[0,0,0,0]}}return null}};var
|
|
1361
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return o=l.done,l},e:function(l){a=!0,s=l},f:function(){try{!o&&e.return!=null&&e.return()}finally{if(a)throw s}}}}function ha(t,r){if(t){if(typeof t=="string")return Bn(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Bn(t,r)}}function Bn(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var Vn=function(){function t(r){(0,Dn.default)(this,t),(0,k.default)(this,"isDirty",!0),(0,k.default)(this,"targetLayer",void 0),(0,k.default)(this,"renderViewport",null),(0,k.default)(this,"bounds",null),(0,k.default)(this,"fbo",void 0),(0,k.default)(this,"pickingFbo",void 0),(0,k.default)(this,"layers",[]),(0,k.default)(this,"tile",void 0),(0,k.default)(this,"targetBounds",null),(0,k.default)(this,"targetBoundsCommon",null),this.targetLayer=r,this.tile=zn(r)}return(0,jn.default)(t,[{key:"id",get:function(){return this.targetLayer.id}},{key:"isActive",get:function(){return Boolean(this.targetLayer.getCurrentLayer())}},{key:"shouldUpdate",value:function(e){var n=e.targetLayer,i=e.viewport,o=e.layers,a=e.layerNeedsRedraw;n&&(this.targetLayer=n);var s=i?this._updateViewport(i):!1,f=o?this._updateLayers(o):!1;if(a){var l=ma(this.layers),c;try{for(l.s();!(c=l.n()).done;){var p=c.value;if(a[p]){f=!0;break}}}catch(v){l.e(v)}finally{l.f()}}return f||s}},{key:"_updateLayers",value:function(e){var n=!1;if(e=this.tile?ya(this.tile,e):e,e.length!==this.layers.length)n=!0;else for(var i=0;i<e.length;i++){var o=e[i].id;if(o!==this.layers[i]){n=!0;break}}return n&&(this.layers=e.map(function(a){return a.id})),n}},{key:"_updateViewport",value:function(e){var n=this.targetLayer,i=!1;if(this.targetBounds!==n.getBounds()&&(i=!0,this.targetBounds=n.getBounds(),this.targetBoundsCommon=G([n],e)),!this.targetBoundsCommon)return!1;var o=Math.ceil(e.zoom+.5);if(this.tile)this.bounds=this.targetBoundsCommon;else{var a,s=(a=this.renderViewport)===null||a===void 0?void 0:a.zoom;i=i||o!==s;var f=H(this.targetBoundsCommon,e),l=this.bounds;i=i||!l||f.some(function(c,p){return c!==l[p]}),this.bounds=f}return i&&(this.renderViewport=W({bounds:this.bounds,zoom:o,viewport:e})),i}},{key:"getRenderFramebuffer",value:function(){return!this.renderViewport||this.layers.length===0?null:(this.fbo||(this.fbo=ee(this.targetLayer.context.gl,{id:this.id})),this.fbo)}},{key:"getPickingFramebuffer",value:function(){return!this.renderViewport||this.layers.length===0&&!this.targetLayer.props.pickable?null:(this.pickingFbo||(this.pickingFbo=ee(this.targetLayer.context.gl,{id:"".concat(this.id,"-picking")})),this.pickingFbo)}},{key:"filterLayers",value:function(e){var n=this;return e.filter(function(i){var o=i.id;return n.layers.includes(o)})}},{key:"delete",value:function(){var e=this.fbo,n=this.pickingFbo;e&&(e.texture.delete(),e.delete()),n&&(n.texture.delete(),n.delete())}}]),t}();function ya(t,r){return r.filter(function(e){var n=zn(e);return n?ga(t.bbox,n.bbox):!0})}function zn(t){for(;t;){var r=t.props.tile;if(r)return r;t=t.parent}return null}function ga(t,r){return"west"in t&&"west"in r?t.west<r.east&&r.west<t.east&&t.south<r.north&&r.south<t.north:"left"in t&&"left"in r?t.left<r.right&&r.left<t.right&&t.top<r.bottom&&r.top<t.bottom:!1}var qn=u(P()),Gn=u(x()),Wn=u(b()),Hn=u(w()),Kn=u(R()),lt=u(T()),ut=u(A()),Yn=u(h());function Un(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Me(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Un(Object(e),!0).forEach(function(n){(0,qn.default)(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Un(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Pa(t){var r=xa();return function(){var n=(0,lt.default)(t),i;if(r){var o=(0,lt.default)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,Kn.default)(this,i)}}function xa(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var $n=function(t){(0,Hn.default)(e,t);var r=Pa(e);function e(){return(0,Gn.default)(this,e),r.apply(this,arguments)}return(0,Wn.default)(e,[{key:"getRenderableLayers",value:function(i,o){for(var a=o.layers,s=[],f=this._getDrawLayerParams(i,o,!0),l=0;l<a.length;l++){var c=a[l];!c.isComposite&&f[l].shouldDrawLayer&&s.push(c)}return s}},{key:"renderHeightMap",value:function(i,o){var a=this,s=i.getRenderFramebuffer(),f=i.renderViewport;!s||!f||(s.resize(f),(0,ut.withParameters)(this.gl,{clearColor:[0,0,0,0],blend:!0,blendFunc:[1,1],blendEquation:32776,depthTest:!1},function(){return a.render(Me(Me({},o),{},{target:s,pass:"terrain-height-map",layers:o.layers,viewports:[f],effects:[]}))}))}},{key:"renderTerrainCover",value:function(i,o){var a=this,s=i.getRenderFramebuffer(),f=i.renderViewport;if(!(!s||!f)){var l=i.filterLayers(o.layers);s.resize(f),(0,ut.withParameters)(this.gl,{depthTest:!1},function(){return a.render(Me(Me({},o),{},{target:s,pass:"terrain-cover-".concat(i.id),layers:l,effects:[],viewports:[f]}))})}}}]),e}(Yn._LayersPass);var Jn=u(x()),Qn=u(b()),ei=u(se()),ti=u(tt()),ri=u(w()),ni=u(R()),Fe=u(T()),ct=u(P()),ii=u(h()),oi=u(A());function Zn(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Xn(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Zn(Object(e),!0).forEach(function(n){(0,ct.default)(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Zn(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function ba(t){var r=Oa();return function(){var n=(0,Fe.default)(t),i;if(r){var o=(0,Fe.default)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,ni.default)(this,i)}}function Oa(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var ai=function(t){(0,ri.default)(e,t);var r=ba(e);function e(){var n;(0,Jn.default)(this,e);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=r.call.apply(r,[this].concat(o)),(0,ct.default)((0,ei.default)(n),"drawParameters",{}),n}return(0,Qn.default)(e,[{key:"getRenderableLayers",value:function(i,o){var a=o.layers,s=[];this.drawParameters={},this._resetColorEncoder(o.pickZ);for(var f=this._getDrawLayerParams(i,o),l=0;l<a.length;l++){var c=a[l];!c.isComposite&&f[l].shouldDrawLayer&&(s.push(c),this.drawParameters[c.id]=f[l].layerParameters)}return s}},{key:"renderTerrainCover",value:function(i,o){var a=this,s=i.getPickingFramebuffer(),f=i.renderViewport;if(!(!s||!f)){var l=i.filterLayers(o.layers),c=i.targetLayer;c.props.pickable&&l.unshift(c),s.resize(f),(0,oi.withParameters)(this.gl,{depthTest:!1},function(){return a.render(Xn(Xn({},o),{},{pickingFBO:s,pass:"terrain-cover-picking-".concat(i.id),layers:l,effects:[],viewports:[f],cullRect:void 0,deviceRect:f,pickZ:!1}))})}}},{key:"getLayerParameters",value:function(i,o,a){if(this.drawParameters[i.id])return this.drawParameters[i.id];var s=(0,ti.default)((0,Fe.default)(e.prototype),"getLayerParameters",this).call(this,i,o,a);return s.blend=!0,s}}]),e}(ii._PickLayersPass);var fi=u(x()),li=u(b()),D=u(P()),ui=u(A());var si=2048,pt=function(){function t(r){(0,fi.default)(this,t),(0,D.default)(this,"renderViewport",null),(0,D.default)(this,"bounds",null),(0,D.default)(this,"fbo",void 0),(0,D.default)(this,"gl",void 0),(0,D.default)(this,"layers",[]),(0,D.default)(this,"layersBounds",[]),(0,D.default)(this,"layersBoundsCommon",null),(0,D.default)(this,"lastViewport",null),this.gl=r}return(0,li.default)(t,[{key:"getRenderFramebuffer",value:function(){return this.renderViewport?(this.fbo||(this.fbo=ee(this.gl,{id:"height-map",float:!0})),this.fbo):null}},{key:"shouldUpdate",value:function(e){var n=this,i=e.layers,o=e.viewport,a=i.length!==this.layers.length||i.some(function(v,_){return v!==n.layers[_]||v.props.transitions||v.getBounds()!==n.layersBounds[_]});a&&(this.layers=i,this.layersBounds=i.map(function(v){return v.getBounds()}),this.layersBoundsCommon=G(i,o));var s=!this.lastViewport||!o.equals(this.lastViewport);if(!this.layersBoundsCommon)this.renderViewport=null;else if(a||s){var f=H(this.layersBoundsCommon,o);this.bounds=f,this.lastViewport=o;var l=o.scale,c=(f[2]-f[0])*l,p=(f[3]-f[1])*l;return this.renderViewport=c>0||p>0?W({bounds:[o.center[0]-1,o.center[1]-1,o.center[0]+1,o.center[1]+1],zoom:o.zoom,width:Math.min(c,si),height:Math.min(p,si),viewport:o}):null,!0}return!1}},{key:"delete",value:function(){this.fbo&&(this.fbo.color.delete(),this.fbo.delete())}}],[{key:"isSupported",value:function(e){return ui.Framebuffer.isSupported(e,{colorBufferFloat:!0})}}]),t}();function ci(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Se(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?ci(Object(e),!0).forEach(function(n){(0,F.default)(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ci(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Y(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Ea(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
1362
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return o=l.done,l},e:function(l){a=!0,s=l},f:function(){try{!o&&e.return!=null&&e.return()}finally{if(a)throw s}}}}function
|
|
1360
|
+
`},getUniforms:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;if("dummyHeightMap"in r){var n=r.drawToTerrainHeightMap,i=r.heightMap,o=r.heightMapBounds,a=r.dummyHeightMap,s=r.terrainCover,f=r.useTerrainHeightMap,l=r.terrainSkipRender,c=e.project_uCommonOrigin,p=l?I.SKIP:I.NONE,v=a,_=null;if(n)p=I.WRITE_HEIGHT_MAP,_=o;else if(f&&i)p=I.USE_HEIGHT_MAP,v=i,_=o;else if(s){var m=r.pickingActive;v=m?s.getPickingFramebuffer():s.getRenderFramebuffer(),m&&(p=I.SKIP),v?(p=p===I.SKIP?I.USE_COVER_ONLY:I.USE_COVER,_=s.bounds):v=a}return{terrain_mode:p,terrain_map:v,terrain_bounds:_?[_[0]-c[0],_[1]-c[1],_[2]-_[0],_[3]-_[1]]:[0,0,0,0]}}return null}};var Nn=u(x()),Bn=u(b()),k=u(P());var z=u(P()),K=u(R());function Cn(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function In(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Cn(Object(e),!0).forEach(function(n){(0,z.default)(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Cn(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function te(t,r){var e;return new K.Framebuffer(t,{id:r.id,attachments:(0,z.default)({},36064,new K.Texture2D(t,In(In({},r.float&&{format:(0,K.isWebGL2)(t)?34836:6408,type:5126}),{},{mipmaps:!1,parameters:(e={},(0,z.default)(e,10241,9729),(0,z.default)(e,10240,9729),(0,z.default)(e,10242,33071),(0,z.default)(e,10243,33071),e)})))})}function _a(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=da(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
1361
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return o=l.done,l},e:function(l){a=!0,s=l},f:function(){try{!o&&e.return!=null&&e.return()}finally{if(a)throw s}}}}function da(t,r){if(t){if(typeof t=="string")return Ln(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Ln(t,r)}}function Ln(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var Dn=function(){function t(r){(0,Nn.default)(this,t),(0,k.default)(this,"isDirty",!0),(0,k.default)(this,"targetLayer",void 0),(0,k.default)(this,"renderViewport",null),(0,k.default)(this,"bounds",null),(0,k.default)(this,"fbo",void 0),(0,k.default)(this,"pickingFbo",void 0),(0,k.default)(this,"layers",[]),(0,k.default)(this,"tile",void 0),(0,k.default)(this,"targetBounds",null),(0,k.default)(this,"targetBoundsCommon",null),this.targetLayer=r,this.tile=jn(r)}return(0,Bn.default)(t,[{key:"id",get:function(){return this.targetLayer.id}},{key:"isActive",get:function(){return Boolean(this.targetLayer.getCurrentLayer())}},{key:"shouldUpdate",value:function(e){var n=e.targetLayer,i=e.viewport,o=e.layers,a=e.layerNeedsRedraw;n&&(this.targetLayer=n);var s=i?this._updateViewport(i):!1,f=o?this._updateLayers(o):!1;if(a){var l=_a(this.layers),c;try{for(l.s();!(c=l.n()).done;){var p=c.value;if(a[p]){f=!0;break}}}catch(v){l.e(v)}finally{l.f()}}return f||s}},{key:"_updateLayers",value:function(e){var n=!1;if(e=this.tile?ma(this.tile,e):e,e.length!==this.layers.length)n=!0;else for(var i=0;i<e.length;i++){var o=e[i].id;if(o!==this.layers[i]){n=!0;break}}return n&&(this.layers=e.map(function(a){return a.id})),n}},{key:"_updateViewport",value:function(e){var n=this.targetLayer,i=!1;if(this.targetBounds!==n.getBounds()&&(i=!0,this.targetBounds=n.getBounds(),this.targetBoundsCommon=G([n],e)),!this.targetBoundsCommon)return!1;var o=Math.ceil(e.zoom+.5);if(this.tile)this.bounds=this.targetBoundsCommon;else{var a,s=(a=this.renderViewport)===null||a===void 0?void 0:a.zoom;i=i||o!==s;var f=H(this.targetBoundsCommon,e),l=this.bounds;i=i||!l||f.some(function(c,p){return c!==l[p]}),this.bounds=f}return i&&(this.renderViewport=W({bounds:this.bounds,zoom:o,viewport:e})),i}},{key:"getRenderFramebuffer",value:function(){return!this.renderViewport||this.layers.length===0?null:(this.fbo||(this.fbo=te(this.targetLayer.context.gl,{id:this.id})),this.fbo)}},{key:"getPickingFramebuffer",value:function(){return!this.renderViewport||this.layers.length===0&&!this.targetLayer.props.pickable?null:(this.pickingFbo||(this.pickingFbo=te(this.targetLayer.context.gl,{id:"".concat(this.id,"-picking")})),this.pickingFbo)}},{key:"filterLayers",value:function(e){var n=this;return e.filter(function(i){var o=i.id;return n.layers.includes(o)})}},{key:"delete",value:function(){var e=this.fbo,n=this.pickingFbo;e&&(e.texture.delete(),e.delete()),n&&(n.texture.delete(),n.delete())}}]),t}();function ma(t,r){return r.filter(function(e){var n=jn(e);return n?ha(t.bbox,n.bbox):!0})}function jn(t){for(;t;){var r=t.props.tile;if(r)return r;t=t.parent}return null}function ha(t,r){return"west"in t&&"west"in r?t.west<r.east&&r.west<t.east&&t.south<r.north&&r.south<t.north:"left"in t&&"left"in r?t.left<r.right&&r.left<t.right&&t.top<r.bottom&&r.top<t.bottom:!1}var zn=u(P()),Un=u(x()),qn=u(b()),Gn=u(w()),Wn=u(M()),ut=u(T()),ct=u(R()),Hn=u(y());function Vn(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Re(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Vn(Object(e),!0).forEach(function(n){(0,zn.default)(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Vn(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function ya(t){var r=ga();return function(){var n=(0,ut.default)(t),i;if(r){var o=(0,ut.default)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,Wn.default)(this,i)}}function ga(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Kn=function(t){(0,Gn.default)(e,t);var r=ya(e);function e(){return(0,Un.default)(this,e),r.apply(this,arguments)}return(0,qn.default)(e,[{key:"getRenderableLayers",value:function(i,o){for(var a=o.layers,s=[],f=this._getDrawLayerParams(i,o,!0),l=0;l<a.length;l++){var c=a[l];!c.isComposite&&f[l].shouldDrawLayer&&s.push(c)}return s}},{key:"renderHeightMap",value:function(i,o){var a=this,s=i.getRenderFramebuffer(),f=i.renderViewport;!s||!f||(s.resize(f),(0,ct.withParameters)(this.gl,{clearColor:[0,0,0,0],blend:!0,blendFunc:[1,1],blendEquation:32776,depthTest:!1},function(){return a.render(Re(Re({},o),{},{target:s,pass:"terrain-height-map",layers:o.layers,viewports:[f],effects:[]}))}))}},{key:"renderTerrainCover",value:function(i,o){var a=this,s=i.getRenderFramebuffer(),f=i.renderViewport;if(!(!s||!f)){var l=i.filterLayers(o.layers);s.resize(f),(0,ct.withParameters)(this.gl,{depthTest:!1},function(){return a.render(Re(Re({},o),{},{target:s,pass:"terrain-cover-".concat(i.id),layers:l,effects:[],viewports:[f]}))})}}}]),e}(Hn._LayersPass);var Zn=u(x()),Xn=u(b()),Jn=u(fe()),Qn=u(rt()),ei=u(w()),ti=u(M()),Se=u(T()),pt=u(P()),ri=u(y()),ni=u(R());function Yn(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function $n(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Yn(Object(e),!0).forEach(function(n){(0,pt.default)(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Yn(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Pa(t){var r=xa();return function(){var n=(0,Se.default)(t),i;if(r){var o=(0,Se.default)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,ti.default)(this,i)}}function xa(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var ii=function(t){(0,ei.default)(e,t);var r=Pa(e);function e(){var n;(0,Zn.default)(this,e);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=r.call.apply(r,[this].concat(o)),(0,pt.default)((0,Jn.default)(n),"drawParameters",{}),n}return(0,Xn.default)(e,[{key:"getRenderableLayers",value:function(i,o){var a=o.layers,s=[];this.drawParameters={},this._resetColorEncoder(o.pickZ);for(var f=this._getDrawLayerParams(i,o),l=0;l<a.length;l++){var c=a[l];!c.isComposite&&f[l].shouldDrawLayer&&(s.push(c),this.drawParameters[c.id]=f[l].layerParameters)}return s}},{key:"renderTerrainCover",value:function(i,o){var a=this,s=i.getPickingFramebuffer(),f=i.renderViewport;if(!(!s||!f)){var l=i.filterLayers(o.layers),c=i.targetLayer;c.props.pickable&&l.unshift(c),s.resize(f),(0,ni.withParameters)(this.gl,{depthTest:!1},function(){return a.render($n($n({},o),{},{pickingFBO:s,pass:"terrain-cover-picking-".concat(i.id),layers:l,effects:[],viewports:[f],cullRect:void 0,deviceRect:f,pickZ:!1}))})}}},{key:"getLayerParameters",value:function(i,o,a){if(this.drawParameters[i.id])return this.drawParameters[i.id];var s=(0,Qn.default)((0,Se.default)(e.prototype),"getLayerParameters",this).call(this,i,o,a);return s.blend=!0,s}}]),e}(ri._PickLayersPass);var ai=u(x()),si=u(b()),D=u(P()),fi=u(R());var oi=2048,vt=function(){function t(r){(0,ai.default)(this,t),(0,D.default)(this,"renderViewport",null),(0,D.default)(this,"bounds",null),(0,D.default)(this,"fbo",void 0),(0,D.default)(this,"gl",void 0),(0,D.default)(this,"layers",[]),(0,D.default)(this,"layersBounds",[]),(0,D.default)(this,"layersBoundsCommon",null),(0,D.default)(this,"lastViewport",null),this.gl=r}return(0,si.default)(t,[{key:"getRenderFramebuffer",value:function(){return this.renderViewport?(this.fbo||(this.fbo=te(this.gl,{id:"height-map",float:!0})),this.fbo):null}},{key:"shouldUpdate",value:function(e){var n=this,i=e.layers,o=e.viewport,a=i.length!==this.layers.length||i.some(function(v,_){return v!==n.layers[_]||v.props.transitions||v.getBounds()!==n.layersBounds[_]});a&&(this.layers=i,this.layersBounds=i.map(function(v){return v.getBounds()}),this.layersBoundsCommon=G(i,o));var s=!this.lastViewport||!o.equals(this.lastViewport);if(!this.layersBoundsCommon)this.renderViewport=null;else if(a||s){var f=H(this.layersBoundsCommon,o);this.bounds=f,this.lastViewport=o;var l=o.scale,c=(f[2]-f[0])*l,p=(f[3]-f[1])*l;return this.renderViewport=c>0||p>0?W({bounds:[o.center[0]-1,o.center[1]-1,o.center[0]+1,o.center[1]+1],zoom:o.zoom,width:Math.min(c,oi),height:Math.min(p,oi),viewport:o}):null,!0}return!1}},{key:"delete",value:function(){this.fbo&&(this.fbo.color.delete(),this.fbo.delete())}}],[{key:"isSupported",value:function(e){return fi.Framebuffer.isSupported(e,{colorBufferFloat:!0})}}]),t}();function li(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Fe(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?li(Object(e),!0).forEach(function(n){(0,S.default)(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):li(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Y(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=ba(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
1362
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return o=l.done,l},e:function(l){a=!0,s=l},f:function(){try{!o&&e.return!=null&&e.return()}finally{if(a)throw s}}}}function ba(t,r){if(t){if(typeof t=="string")return ui(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ui(t,r)}}function ui(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var di=function(){function t(){(0,pi.default)(this,t),(0,S.default)(this,"id","terrain-effect"),(0,S.default)(this,"props",null),(0,S.default)(this,"useInPicking",!0),(0,S.default)(this,"isPicking",!1),(0,S.default)(this,"isDrapingEnabled",!1),(0,S.default)(this,"dummyHeightMap",void 0),(0,S.default)(this,"heightMap",void 0),(0,S.default)(this,"terrainPass",void 0),(0,S.default)(this,"terrainPickingPass",void 0),(0,S.default)(this,"terrainCovers",new Map)}return(0,vi.default)(t,[{key:"initialize",value:function(e){this.dummyHeightMap=new ke.Texture2D(e,{width:1,height:1,data:new Uint8Array([0,0,0,0])}),this.terrainPass=new Kn(e,{id:"terrain"}),this.terrainPickingPass=new ii(e,{id:"terrain-picking"}),vt.isSupported(e)?this.heightMap=new vt(e):_i.log.warn("Terrain offset mode is not supported by this browser")(),ke.ProgramManager.getDefaultProgramManager(e).addDefaultModule(Ae)}},{key:"preRender",value:function(e,n){if(!this.dummyHeightMap){this.initialize(e);var i=Y(n.layers),o;try{for(i.s();!(o=i.n()).done;){var a=o.value;a.props.operation.includes("terrain")&&a.setChangeFlags({extensionsChanged:!0})}}catch(d){i.e(d)}finally{i.f()}}if(n.pickZ){this.isDrapingEnabled=!1;return}var s=n.viewports,f=n.isPicking,l=f===void 0?!1:f;this.isPicking=l,this.isDrapingEnabled=!0;var c=s[0],p=(l?this.terrainPickingPass:this.terrainPass).getRenderableLayers(c,n),v=p.filter(function(d){return d.props.operation.includes("terrain")});if(v.length!==0){if(!l){var _=p.filter(function(d){return d.state.terrainDrawMode==="offset"});_.length>0&&this._updateHeightMap(v,c,n)}var m=p.filter(function(d){return d.state.terrainDrawMode==="drape"});this._updateTerrainCovers(v,m,c,n)}}},{key:"getModuleParameters",value:function(e){var n,i,o=e.state.terrainDrawMode;return{heightMap:(n=this.heightMap)===null||n===void 0?void 0:n.getRenderFramebuffer(),heightMapBounds:(i=this.heightMap)===null||i===void 0?void 0:i.bounds,dummyHeightMap:this.dummyHeightMap,terrainCover:this.isDrapingEnabled?this.terrainCovers.get(e.id):null,useTerrainHeightMap:o==="offset",terrainSkipRender:o==="drape"||!e.props.operation.includes("draw")}}},{key:"cleanup",value:function(){this.dummyHeightMap&&(this.dummyHeightMap.delete(),this.dummyHeightMap=void 0),this.heightMap&&(this.heightMap.delete(),this.heightMap=void 0);var e=Y(this.terrainCovers.values()),n;try{for(e.s();!(n=e.n()).done;){var i=n.value;i.delete()}}catch(o){e.e(o)}finally{e.f()}this.terrainCovers.clear()}},{key:"_updateHeightMap",value:function(e,n,i){if(this.heightMap){var o=this.heightMap.shouldUpdate({layers:e,viewport:n});o&&this.terrainPass.renderHeightMap(this.heightMap,Fe(Fe({},i),{},{layers:e,moduleParameters:{heightMapBounds:this.heightMap.bounds,dummyHeightMap:this.dummyHeightMap,devicePixelRatio:1,drawToTerrainHeightMap:!0}}))}}},{key:"_updateTerrainCovers",value:function(e,n,i,o){var a={},s=Y(n),f;try{for(s.s();!(f=s.n()).done;){var l=f.value;l.state.terrainCoverNeedsRedraw&&(a[l.id]=!0,l.state.terrainCoverNeedsRedraw=!1)}}catch(h){s.e(h)}finally{s.f()}var c=Y(this.terrainCovers.values()),p;try{for(c.s();!(p=c.n()).done;){var v=p.value;v.isDirty=v.isDirty||v.shouldUpdate({layerNeedsRedraw:a})}}catch(h){c.e(h)}finally{c.f()}var _=Y(e),m;try{for(_.s();!(m=_.n()).done;){var d=m.value;this._updateTerrainCover(d,n,i,o)}}catch(h){_.e(h)}finally{_.f()}this.isPicking||this._pruneTerrainCovers()}},{key:"_updateTerrainCover",value:function(e,n,i,o){var a=this.isPicking?this.terrainPickingPass:this.terrainPass,s=this.terrainCovers.get(e.id);s||(s=new Dn(e),this.terrainCovers.set(e.id,s));try{var f=s.shouldUpdate({targetLayer:e,viewport:i,layers:n});(this.isPicking||s.isDirty||f)&&(a.renderTerrainCover(s,Fe(Fe({},o),{},{layers:n,moduleParameters:{dummyHeightMap:this.dummyHeightMap,terrainSkipRender:!1,devicePixelRatio:1}})),s.isDirty=!1)}catch(l){e.raiseError(l,"Error rendering terrain cover ".concat(s.id))}}},{key:"_pruneTerrainCovers",value:function(){var e=[],n=Y(this.terrainCovers),i;try{for(n.s();!(i=n.n()).done;){var o=(0,ci.default)(i.value,2),a=o[0],s=o[1];s.isActive||e.push(a)}}catch(p){n.e(p)}finally{n.f()}for(var f=0,l=e;f<l.length;f++){var c=l[f];this.terrainCovers.delete(c)}}}]),t}();function Oa(t){var r=Ea();return function(){var n=(0,_t.default)(t),i;if(r){var o=(0,_t.default)(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return(0,gi.default)(this,i)}}function Ea(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Ta={terrainDrawMode:void 0},Ce=function(t){(0,yi.default)(e,t);var r=Oa(e);function e(){return(0,mi.default)(this,e),r.apply(this,arguments)}return(0,hi.default)(e,[{key:"getShaders",value:function(){return{modules:[Ae]}}},{key:"initializeState",value:function(){var i;(i=this.context.deck)===null||i===void 0||i._addDefaultEffect(new di)}},{key:"updateState",value:function(i){var o=i.props,a=i.oldProps;if(!(this.state.terrainDrawMode&&o.terrainDrawMode===a.terrainDrawMode&&o.extruded===a.extruded)){var s=o.terrainDrawMode;if(!s){var f,l=this.props.extruded,c=(f=this.getAttributeManager())===null||f===void 0?void 0:f.attributes,p=c&&"instancePositions"in c;s=l||p?"offset":"drape"}this.setState({terrainDrawMode:s})}}},{key:"onNeedsRedraw",value:function(){var i=this.state;i.terrainDrawMode==="drape"&&(i.terrainCoverNeedsRedraw=!0)}}]),e}(Pi.LayerExtension);(0,dt.default)(Ce,"defaultProps",Ta);(0,dt.default)(Ce,"extensionName","TerrainExtension");return Fi(re);})();
|
|
1363
1363
|
return __exports__;
|
|
1364
1364
|
});
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@deck.gl/extensions",
|
|
3
3
|
"description": "Plug-and-play functionalities for deck.gl layers",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "8.9.
|
|
5
|
+
"version": "8.9.2",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"@math.gl/web-mercator": "^3.6.2",
|
|
41
41
|
"gl-matrix": "^3.0.0"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "b43c2515c1fdac0a41fe653c98d6a315939ef0e1"
|
|
44
44
|
}
|