@deck.gl/geo-layers 8.9.17 → 8.9.18

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.
Files changed (34) hide show
  1. package/dist.min.js +1 -1
  2. package/package.json +2 -2
  3. package/typed/geo-cell-layer/GeoCellLayer.js +49 -0
  4. package/typed/great-circle-layer/great-circle-layer.js +29 -0
  5. package/typed/h3-layers/h3-cluster-layer.js +33 -0
  6. package/typed/h3-layers/h3-hexagon-layer.js +251 -0
  7. package/typed/imagery-layer/imagery-layer.d.ts +53 -0
  8. package/typed/imagery-layer/imagery-layer.d.ts.map +1 -0
  9. package/typed/index.js +33 -0
  10. package/typed/mesh-layer/mesh-layer-fragment.glsl.js +55 -0
  11. package/typed/mesh-layer/mesh-layer-vertex.glsl.js +80 -0
  12. package/typed/mesh-layer/mesh-layer.js +110 -0
  13. package/typed/mvt-layer/coordinate-transform.js +41 -0
  14. package/typed/mvt-layer/find-index-binary.js +96 -0
  15. package/typed/mvt-layer/mvt-layer.js +297 -0
  16. package/typed/quadkey-layer/quadkey-layer.js +18 -0
  17. package/typed/quadkey-layer/quadkey-utils.js +26 -0
  18. package/typed/s2-layer/s2-geometry.js +123 -0
  19. package/typed/s2-layer/s2-layer.js +37 -0
  20. package/typed/s2-layer/s2-utils.js +88 -0
  21. package/typed/terrain-layer/terrain-layer.js +226 -0
  22. package/typed/tile-3d-layer/tile-3d-layer.js +294 -0
  23. package/typed/tile-layer/tile-2d-header.js +113 -0
  24. package/typed/tile-layer/tile-2d-traversal.js +181 -0
  25. package/typed/tile-layer/tile-layer.js +192 -0
  26. package/typed/tile-layer/tileset-2d.d.ts.map +1 -1
  27. package/typed/tile-layer/tileset-2d.js +399 -0
  28. package/typed/tile-layer/types.js +1 -0
  29. package/typed/tile-layer/utils.d.ts +1 -1
  30. package/typed/tile-layer/utils.d.ts.map +1 -1
  31. package/typed/tile-layer/utils.js +197 -0
  32. package/typed/trips-layer/trips-layer.js +92 -0
  33. package/typed/tile-3d-layer/utils.d.ts +0 -3
  34. package/typed/tile-3d-layer/utils.d.ts.map +0 -1
package/dist.min.js CHANGED
@@ -38,7 +38,7 @@ varying float vTime;
38
38
  }
39
39
  `},a}},{key:"initializeState",value:function(){(0,Hs.default)((0,Sa.default)(t.prototype),"initializeState",this).call(this);var a=this.getAttributeManager();a.addInstanced({timestamps:{size:1,accessor:"getTimestamps",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})}},{key:"draw",value:function(a){var i=this.props,o=i.fadeTrail,s=i.trailLength,u=i.currentTime;a.uniforms=u_(u_({},a.uniforms),{},{fadeTrail:o,trailLength:s,currentTime:u}),(0,Hs.default)((0,Sa.default)(t.prototype),"draw",this).call(this,a)}}]),t}(d_.PathLayer);(0,Vs.default)(zs,"layerName","TripsLayer");(0,Vs.default)(zs,"defaultProps",nF);var C_=m(H()),B_=m(z()),M_=m(Te()),O_=m(xe()),mh=m(be()),vh=m(W()),P_=m(hh()),I_=m(Ut());var y_=m(H()),A_=m(z()),__=m(wt()),b_=m(Te()),T_=m(xe()),dh=m(be()),wa=m(W()),x_=m(Ge()),Vi=m(ie()),nt=m(hh());var qs=m(Ut()),zi=m(Nt());function aF(e){var r=iF();return function(){var n=(0,dh.default)(e),a;if(r){var i=(0,dh.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,T_.default)(this,a)}}function iF(){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}}function m_(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,n)}return t}function Ws(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?m_(Object(t),!0).forEach(function(n){(0,wa.default)(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):m_(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function ph(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=oF(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
40
40
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function oF(e,r){if(e){if(typeof e=="string")return v_(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return v_(e,r)}}function v_(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var sF=10;function E_(e,r){r=r===void 0?e[0][0]:r;var t=ph(e),n;try{for(t.s();!(n=t.n()).done;){var a=n.value,i=a[0]-r;i>180?a[0]-=360:i<-180&&(a[0]+=360)}}catch(o){t.e(o)}finally{t.f()}}function uF(e,r,t){var n=(0,nt.h3ToGeo)(e),a=(0,Vi.default)(n,2),i=a[0],o=a[1],s=r.length;E_(r,o);for(var u=r[0]===r[s-1]?s-1:s,f=0;f<u;f++)r[f][0]=Ur(o,r[f][0],t),r[f][1]=Ur(i,r[f][1],t)}function fF(e,r,t){var n=e(r,t),a=(0,nt.h3ToGeo)(n),i=(0,Vi.default)(a,2),o=i[0],s=i[1];return[s,o]}function g_(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,t=(0,nt.h3ToGeoBoundary)(e,!0);return r!==1?uF(e,t,r):E_(t),t}function lF(e){var r=new Float64Array(e.length*2),t=0,n=ph(e),a;try{for(n.s();!(a=n.n()).done;){var i=a.value;r[t++]=i[0],r[t++]=i[1]}}catch(o){n.e(o)}finally{n.f()}return r}function cF(e,r){var t;return e==null?t=r:(0,x_.default)(e)==="object"?t=Ws(Ws({},e),{},{coverage:r}):t={getHexagon:e,coverage:r},t}var hF=Ws(Ws({},zi.PolygonLayer.defaultProps),{},{highPrecision:"auto",coverage:{type:"number",min:0,max:1,value:1},centerHexagon:null,getHexagon:{type:"accessor",value:function(r){return r.hexagon}},extruded:!0}),Pn=function(e){(0,b_.default)(t,e);var r=aF(t);function t(){var n;(0,y_.default)(this,t);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return n=r.call.apply(r,[this].concat(i)),(0,wa.default)((0,__.default)(n),"state",void 0),n}return(0,A_.default)(t,[{key:"initializeState",value:function(){t._checkH3Lib(),this.state={edgeLengthKM:0,resolution:-1}}},{key:"shouldUpdateState",value:function(a){var i=a.changeFlags;return this._shouldUseHighPrecision()?i.propsOrDataChanged:i.somethingChanged}},{key:"updateState",value:function(a){var i=a.props,o=a.changeFlags;if(i.highPrecision!==!0&&(o.dataChanged||o.updateTriggersChanged&&o.updateTriggersChanged.getHexagon)){var s=this._calculateH3DataProps();this.setState(s)}this._updateVertices(this.context.viewport)}},{key:"_calculateH3DataProps",value:function(){var a=-1,i=!1,o=!1,s=(0,qs.createIterable)(this.props.data),u=s.iterable,f=s.objectInfo,l=ph(u),c;try{for(l.s();!(c=l.n()).done;){var h=c.value;f.index++;var d=this.props.getHexagon(h,f),p=(0,nt.h3GetResolution)(d);if(a<0){if(a=p,!this.props.highPrecision)break}else if(a!==p){o=!0;break}if((0,nt.h3IsPentagon)(d)){i=!0;break}}}catch(v){l.e(v)}finally{l.f()}return{resolution:a,edgeLengthKM:a>=0?(0,nt.edgeLength)(a,"km"):0,hasMultipleRes:o,hasPentagon:i}}},{key:"_shouldUseHighPrecision",value:function(){if(this.props.highPrecision==="auto"){var a=this.state,i=a.resolution,o=a.hasPentagon,s=a.hasMultipleRes,u=this.context.viewport;return Boolean(u?.resolution)||s||o||i>=0&&i<=5}return this.props.highPrecision}},{key:"_updateVertices",value:function(a){if(!this._shouldUseHighPrecision()){var i=this.state,o=i.resolution,s=i.edgeLengthKM,u=i.centerHex;if(!(o<0)){var f=this.props.centerHexagon||(0,nt.geoToH3)(a.latitude,a.longitude,o);if(u!==f){if(u){var l=(0,nt.h3Distance)(u,f);if(l>=0&&l*s<sF)return}var c=a.distanceScales.unitsPerMeter,h=g_(f),d=(0,nt.h3ToGeo)(f),p=(0,Vi.default)(d,2),v=p[0],y=p[1],A=a.projectFlat([y,v]),_=(0,Vi.default)(A,2),E=_[0],x=_[1];h=h.map(function(C){var B=a.projectFlat(C);return[(B[0]-E)/c[0],(B[1]-x)/c[1]]}),this.setState({centerHex:f,vertices:h})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var a=this.props,i=a.elevationScale,o=a.material,s=a.coverage,u=a.extruded,f=a.wireframe,l=a.stroked,c=a.filled,h=a.lineWidthUnits,d=a.lineWidthScale,p=a.lineWidthMinPixels,v=a.lineWidthMaxPixels,y=a.getFillColor,A=a.getElevation,_=a.getLineColor,E=a.getLineWidth,x=a.transitions,C=a.updateTriggers;return{elevationScale:i,extruded:u,coverage:s,wireframe:f,stroked:l,filled:c,lineWidthUnits:h,lineWidthScale:d,lineWidthMinPixels:p,lineWidthMaxPixels:v,material:o,getElevation:A,getFillColor:y,getLineColor:_,getLineWidth:E,transitions:x,updateTriggers:{getFillColor:C.getFillColor,getElevation:C.getElevation,getLineColor:C.getLineColor,getLineWidth:C.getLineWidth}}}},{key:"_renderPolygonLayer",value:function(){var a=this.props,i=a.data,o=a.getHexagon,s=a.updateTriggers,u=a.coverage,f=this.getSubLayerClass("hexagon-cell-hifi",zi.PolygonLayer),l=this._getForwardProps();return l.updateTriggers.getPolygon=cF(s.getHexagon,u),new f(l,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:l.updateTriggers}),{data:i,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:function(h,d){var p=o(h,d);return lF(g_(p,u))}})}},{key:"_renderColumnLayer",value:function(){var a=this.props,i=a.data,o=a.getHexagon,s=a.updateTriggers,u=this.getSubLayerClass("hexagon-cell",zi.ColumnLayer),f=this._getForwardProps();return f.updateTriggers.getPosition=s.getHexagon,new u(f,this.getSubLayerProps({id:"hexagon-cell",flatShading:!0,updateTriggers:f.updateTriggers}),{data:i,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:fF.bind(null,o)})}}]),t}(qs.CompositeLayer);(0,wa.default)(Pn,"defaultProps",hF);(0,wa.default)(Pn,"layerName","H3HexagonLayer");(0,wa.default)(Pn,"_checkH3Lib",function(){});function S_(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=dF(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
41
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function dF(e,r){if(e){if(typeof e=="string")return w_(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return w_(e,r)}}function w_(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function pF(e){var r=mF();return function(){var n=(0,mh.default)(e),a;if(r){var i=(0,mh.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,O_.default)(this,a)}}function mF(){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 vF={getHexagons:{type:"accessor",value:function(r){return r.hexagons}}},Js=function(e){(0,M_.default)(t,e);var r=pF(t);function t(){return(0,C_.default)(this,t),r.apply(this,arguments)}return(0,B_.default)(t,[{key:"initializeState",value:function(){Pn._checkH3Lib()}},{key:"updateState",value:function(a){var i=a.props,o=a.changeFlags;if(o.dataChanged||o.updateTriggersChanged&&o.updateTriggersChanged.getHexagons){var s=i.data,u=i.getHexagons,f=[],l=(0,I_.createIterable)(s),c=l.iterable,h=l.objectInfo,d=S_(c),p;try{for(d.s();!(p=d.n()).done;){var v=p.value;h.index++;var y=u(v,h),A=(0,P_.h3SetToMultiPolygon)(y,!0),_=S_(A),E;try{for(_.s();!(E=_.n()).done;){var x=E.value;f.push(this.getSubLayerRow({polygon:x},v,h.index))}}catch(C){_.e(C)}finally{_.f()}}}catch(C){d.e(C)}finally{d.f()}this.setState({polygons:f})}}},{key:"indexToBounds",value:function(){var a=this.props,i=a.getElevation,o=a.getFillColor,s=a.getLineColor,u=a.getLineWidth;return{data:this.state.polygons,getPolygon:function(l){return l.polygon},getElevation:this.getSubLayerAccessor(i),getFillColor:this.getSubLayerAccessor(o),getLineColor:this.getSubLayerAccessor(s),getLineWidth:this.getSubLayerAccessor(u)}}}]),t}(Pt);(0,vh.default)(Js,"layerName","H3ClusterLayer");(0,vh.default)(Js,"defaultProps",vF);var u2=m(K()),f2=m(H()),l2=m(z()),c2=m(wt()),h2=m(Te()),d2=m(xe()),jm=m(be()),xo=m(W()),Hm=m(Y()),p2=m(gh()),un=m(Ut()),m2=m(Nt()),v2=m(Xs());var kT=m(H()),DT=m(z()),Fa=m(dn()),GT=m(Te()),NT=m(xe()),Qr=m(be()),vu=m(W());var Qs=m(Ge()),Wi=m(st()),K_=m(W()),Y_=m(H()),Z_=m(z());var L_=m(Ge());var Ks=m(Ge());function yh(e){if(typeof window<"u"&&(0,Ks.default)(window.process)==="object"&&window.process.type==="renderer"||typeof process<"u"&&(0,Ks.default)(process.versions)==="object"&&Boolean(process.versions.electron))return!0;var r=(typeof navigator>"u"?"undefined":(0,Ks.default)(navigator))==="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,t=e||r;return!!(t&&t.indexOf("Electron")>=0)}function ht(){var e=(typeof process>"u"?"undefined":(0,L_.default)(process))==="object"&&String(process)==="[object process]"&&!process.browser;return!e||yh()}var k_=m(Ge()),Jr={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document,process:(typeof process>"u"?"undefined":(0,k_.default)(process))==="object"&&process};var gF=Jr.self||Jr.window||Jr.global,Ca=Jr.window||Jr.self||Jr.global,yF=Jr.document||{},In=Jr.process||{};var Ys="8.9.17",bJ=ht();var D_=m(H()),G_=m(z());function AF(e){try{var r=window[e],t="__storage_test__";return r.setItem(t,t),r.removeItem(t),r}catch{return null}}var N_=function(){function e(r){(0,D_.default)(this,e);var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";g(this,"storage",void 0),g(this,"id",void 0),g(this,"config",{}),this.storage=AF(n),this.id=r,this.config={},Object.assign(this.config,t),this._loadConfiguration()}return(0,G_.default)(e,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(t){return this.config={},this.updateConfiguration(t)}},{key:"updateConfiguration",value:function(t){if(Object.assign(this.config,t),this.storage){var n=JSON.stringify(this.config);this.storage.setItem(this.id,n)}return this}},{key:"_loadConfiguration",value:function(){var t={};if(this.storage){var n=this.storage.getItem(this.id);t=n?JSON.parse(n):{}}return Object.assign(this.config,t),this}}]),e}();function U_(e){var r;return e<10?r="".concat(e.toFixed(2),"ms"):e<100?r="".concat(e.toFixed(1),"ms"):e<1e3?r="".concat(e.toFixed(0),"ms"):r="".concat((e/1e3).toFixed(2),"s"),r}function j_(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,t=Math.max(r-e.length,0);return"".concat(" ".repeat(t)).concat(e)}function Zs(e,r,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,a=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(t=Math.min(t,n/e.width));var i=e.width*t,o=e.height*t,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(i/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(a,");"),"background-size:".concat(i,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(r," %c+"),s]}var $s;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})($s||($s={}));function H_(e){return typeof e=="string"?$s[e.toUpperCase()]||$s.WHITE:e}function V_(e,r,t){return!ht&&typeof e=="string"&&(r&&(r=H_(r),e="\x1B[".concat(r,"m").concat(e,"\x1B[39m")),t&&(r=H_(t),e="\x1B[".concat(t+10,"m").concat(e,"\x1B[49m"))),e}function _F(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=bF(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
41
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function dF(e,r){if(e){if(typeof e=="string")return w_(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return w_(e,r)}}function w_(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function pF(e){var r=mF();return function(){var n=(0,mh.default)(e),a;if(r){var i=(0,mh.default)(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return(0,O_.default)(this,a)}}function mF(){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 vF={getHexagons:{type:"accessor",value:function(r){return r.hexagons}}},Js=function(e){(0,M_.default)(t,e);var r=pF(t);function t(){return(0,C_.default)(this,t),r.apply(this,arguments)}return(0,B_.default)(t,[{key:"initializeState",value:function(){Pn._checkH3Lib()}},{key:"updateState",value:function(a){var i=a.props,o=a.changeFlags;if(o.dataChanged||o.updateTriggersChanged&&o.updateTriggersChanged.getHexagons){var s=i.data,u=i.getHexagons,f=[],l=(0,I_.createIterable)(s),c=l.iterable,h=l.objectInfo,d=S_(c),p;try{for(d.s();!(p=d.n()).done;){var v=p.value;h.index++;var y=u(v,h),A=(0,P_.h3SetToMultiPolygon)(y,!0),_=S_(A),E;try{for(_.s();!(E=_.n()).done;){var x=E.value;f.push(this.getSubLayerRow({polygon:x},v,h.index))}}catch(C){_.e(C)}finally{_.f()}}}catch(C){d.e(C)}finally{d.f()}this.setState({polygons:f})}}},{key:"indexToBounds",value:function(){var a=this.props,i=a.getElevation,o=a.getFillColor,s=a.getLineColor,u=a.getLineWidth;return{data:this.state.polygons,getPolygon:function(l){return l.polygon},getElevation:this.getSubLayerAccessor(i),getFillColor:this.getSubLayerAccessor(o),getLineColor:this.getSubLayerAccessor(s),getLineWidth:this.getSubLayerAccessor(u)}}}]),t}(Pt);(0,vh.default)(Js,"layerName","H3ClusterLayer");(0,vh.default)(Js,"defaultProps",vF);var u2=m(K()),f2=m(H()),l2=m(z()),c2=m(wt()),h2=m(Te()),d2=m(xe()),jm=m(be()),xo=m(W()),Hm=m(Y()),p2=m(gh()),un=m(Ut()),m2=m(Nt()),v2=m(Xs());var kT=m(H()),DT=m(z()),Fa=m(dn()),GT=m(Te()),NT=m(xe()),Qr=m(be()),vu=m(W());var Qs=m(Ge()),Wi=m(st()),K_=m(W()),Y_=m(H()),Z_=m(z());var L_=m(Ge());var Ks=m(Ge());function yh(e){if(typeof window<"u"&&(0,Ks.default)(window.process)==="object"&&window.process.type==="renderer"||typeof process<"u"&&(0,Ks.default)(process.versions)==="object"&&Boolean(process.versions.electron))return!0;var r=(typeof navigator>"u"?"undefined":(0,Ks.default)(navigator))==="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,t=e||r;return!!(t&&t.indexOf("Electron")>=0)}function ht(){var e=(typeof process>"u"?"undefined":(0,L_.default)(process))==="object"&&String(process)==="[object process]"&&!process.browser;return!e||yh()}var k_=m(Ge()),Jr={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document,process:(typeof process>"u"?"undefined":(0,k_.default)(process))==="object"&&process};var gF=Jr.self||Jr.window||Jr.global,Ca=Jr.window||Jr.self||Jr.global,yF=Jr.document||{},In=Jr.process||{};var Ys="8.9.18",bJ=ht();var D_=m(H()),G_=m(z());function AF(e){try{var r=window[e],t="__storage_test__";return r.setItem(t,t),r.removeItem(t),r}catch{return null}}var N_=function(){function e(r){(0,D_.default)(this,e);var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";g(this,"storage",void 0),g(this,"id",void 0),g(this,"config",{}),this.storage=AF(n),this.id=r,this.config={},Object.assign(this.config,t),this._loadConfiguration()}return(0,G_.default)(e,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(t){return this.config={},this.updateConfiguration(t)}},{key:"updateConfiguration",value:function(t){if(Object.assign(this.config,t),this.storage){var n=JSON.stringify(this.config);this.storage.setItem(this.id,n)}return this}},{key:"_loadConfiguration",value:function(){var t={};if(this.storage){var n=this.storage.getItem(this.id);t=n?JSON.parse(n):{}}return Object.assign(this.config,t),this}}]),e}();function U_(e){var r;return e<10?r="".concat(e.toFixed(2),"ms"):e<100?r="".concat(e.toFixed(1),"ms"):e<1e3?r="".concat(e.toFixed(0),"ms"):r="".concat((e/1e3).toFixed(2),"s"),r}function j_(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,t=Math.max(r-e.length,0);return"".concat(" ".repeat(t)).concat(e)}function Zs(e,r,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,a=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(t=Math.min(t,n/e.width));var i=e.width*t,o=e.height*t,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(i/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(a,");"),"background-size:".concat(i,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(r," %c+"),s]}var $s;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})($s||($s={}));function H_(e){return typeof e=="string"?$s[e.toUpperCase()]||$s.WHITE:e}function V_(e,r,t){return!ht&&typeof e=="string"&&(r&&(r=H_(r),e="\x1B[".concat(r,"m").concat(e,"\x1B[39m")),t&&(r=H_(t),e="\x1B[".concat(t+10,"m").concat(e,"\x1B[49m"))),e}function _F(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=bF(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
42
42
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function bF(e,r){if(e){if(typeof e=="string")return z_(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return z_(e,r)}}function z_(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function W_(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],t=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(t),a=_F(n),i;try{var o=function(){var u=i.value;typeof e[u]=="function"&&(r.find(function(f){return u===f})||(e[u]=e[u].bind(e)))};for(a.s();!(i=a.n()).done;)o()}catch(s){a.e(s)}finally{a.f()}}function Ba(e,r){if(!e)throw new Error(r||"Assertion failed")}function Rn(){var e;if(ht&&"performance"in Ca){var r,t;e=Ca===null||Ca===void 0||(r=Ca.performance)===null||r===void 0||(t=r.now)===null||t===void 0?void 0:t.call(r)}else if("hrtime"in In){var n,a=In===null||In===void 0||(n=In.hrtime)===null||n===void 0?void 0:n.call(In);e=a[0]*1e3+a[1]/1e6}else e=Date.now();return e}var Ma={debug:ht&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},TF={enabled:!0,level:0};function It(){}var q_={},J_={once:!0},Oa=function(){function e(){(0,Y_.default)(this,e);var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""},t=r.id;g(this,"id",void 0),g(this,"VERSION",Ys),g(this,"_startTs",Rn()),g(this,"_deltaTs",Rn()),g(this,"_storage",void 0),g(this,"userData",{}),g(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this._storage=new N_("__probe-".concat(this.id,"__"),TF),this.userData={},this.timeStamp("".concat(this.id," started")),W_(this),Object.seal(this)}return(0,Z_.default)(e,[{key:"level",get:function(){return this.getLevel()},set:function(t){this.setLevel(t)}},{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((Rn()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((Rn()-this._deltaTs).toPrecision(10))}},{key:"priority",get:function(){return this.level},set:function(t){this.level=t}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.updateConfiguration({enabled:t}),this}},{key:"setLevel",value:function(t){return this._storage.updateConfiguration({level:t}),this}},{key:"get",value:function(t){return this._storage.config[t]}},{key:"set",value:function(t,n){this._storage.updateConfiguration((0,K_.default)({},t,n))}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"assert",value:function(t,n){Ba(t,n)}},{key:"warn",value:function(t){return this._getLogFunction(0,t,Ma.warn,arguments,J_)}},{key:"error",value:function(t){return this._getLogFunction(0,t,Ma.error,arguments)}},{key:"deprecated",value:function(t,n){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(n,"` instead"))}},{key:"removed",value:function(t,n){return this.error("`".concat(t,"` has been removed. Use `").concat(n,"` instead"))}},{key:"probe",value:function(t,n){return this._getLogFunction(t,n,Ma.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(t,n){return this._getLogFunction(t,n,Ma.debug,arguments)}},{key:"info",value:function(t,n){return this._getLogFunction(t,n,console.info,arguments)}},{key:"once",value:function(t,n){for(var a=arguments.length,i=new Array(a>2?a-2:0),o=2;o<a;o++)i[o-2]=arguments[o];return this._getLogFunction(t,n,Ma.debug||Ma.info,arguments,J_)}},{key:"table",value:function(t,n,a){return n?this._getLogFunction(t,n,console.table||It,a&&[a],{tag:wF(n)}):It}},{key:"image",value:function(t){var n=t.logLevel,a=t.priority,i=t.image,o=t.message,s=o===void 0?"":o,u=t.scale,f=u===void 0?1:u;return this._shouldLog(n||a)?ht?SF({image:i,message:s,scale:f}):EF({image:i,message:s,scale:f}):It}},{key:"time",value:function(t,n){return this._getLogFunction(t,n,console.time?console.time:console.info)}},{key:"timeEnd",value:function(t,n){return this._getLogFunction(t,n,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(t,n){return this._getLogFunction(t,n,console.timeStamp||It)}},{key:"group",value:function(t,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=X_({logLevel:t,message:n,opts:a}),o=a.collapsed;return i.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}},{key:"groupCollapsed",value:function(t,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,n,Object.assign({},a,{collapsed:!0}))}},{key:"groupEnd",value:function(t){return this._getLogFunction(t,"",console.groupEnd||It)}},{key:"withGroup",value:function(t,n,a){this.group(t,n)();try{a()}finally{this.groupEnd(t)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(t){return this.isEnabled()&&this.getLevel()>=$_(t)}},{key:"_getLogFunction",value:function(t,n,a,i,o){if(this._shouldLog(t)){var s;o=X_({logLevel:t,message:n,args:i,opts:o}),a=a||o.method,Ba(a),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=Rn();var u=o.tag||o.message;if(o.once)if(!q_[u])q_[u]=Rn();else return It;return n=xF(this.id,o.message,o),(s=a).bind.apply(s,[console,n].concat((0,Wi.default)(o.args)))}return It}}]),e}();g(Oa,"VERSION",Ys);function $_(e){if(!e)return 0;var r;switch((0,Qs.default)(e)){case"number":r=e;break;case"object":r=e.logLevel||e.priority||0;break;default:return 0}return Ba(Number.isFinite(r)&&r>=0),r}function X_(e){var r=e.logLevel,t=e.message;e.logLevel=$_(r);for(var n=e.args?Array.from(e.args):[];n.length&&n.shift()!==t;);switch((0,Qs.default)(r)){case"string":case"function":t!==void 0&&n.unshift(t),e.message=r;break;case"object":Object.assign(e,r);break;default:}typeof e.message=="function"&&(e.message=e.message());var a=(0,Qs.default)(e.message);return Ba(a==="string"||a==="object"),Object.assign(e,{args:n},e.opts)}function xF(e,r,t){if(typeof r=="string"){var n=t.time?j_(U_(t.total)):"";r=t.time?"".concat(e,": ").concat(n," ").concat(r):"".concat(e,": ").concat(r),r=V_(r,t.color,t.background)}return r}function EF(e){var r=e.image,t=e.message,n=t===void 0?"":t,a=e.scale,i=a===void 0?1:a,o=null;try{o=module.require("asciify-image")}catch{}return o?function(){return o(r,{fit:"box",width:"".concat(Math.round(80*i),"%")}).then(function(s){return console.log(s)})}:It}function SF(e){var r=e.image,t=e.message,n=t===void 0?"":t,a=e.scale,i=a===void 0?1:a;if(typeof r=="string"){var o=new Image;return o.onload=function(){var l,c=Zs(o,n,i);(l=console).log.apply(l,(0,Wi.default)(c))},o.src=r,It}var s=r.nodeName||"";if(s.toLowerCase()==="img"){var u;return(u=console).log.apply(u,(0,Wi.default)(Zs(r,n,i))),It}if(s.toLowerCase()==="canvas"){var f=new Image;return f.onload=function(){var l;return(l=console).log.apply(l,(0,Wi.default)(Zs(f,n,i)))},f.src=r.toDataURL(),It}return It}function wF(e){for(var r in e)for(var t in e[r])return t||"untitled";return"empty"}var KJ=new Oa({id:"@probe.gl/log"});var ue=new Oa({id:"luma.gl"});function We(e,r){if(!e)throw new Error(r||"luma.gl: assertion failed.")}var CF="Invalid WebGLRenderingContext";var BF="Requires WebGL2";function eu(e){return typeof WebGLRenderingContext<"u"&&e instanceof WebGLRenderingContext||typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&Number.isFinite(e._version))}function he(e){return typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:Boolean(e&&e._version===2)}function Ah(e){return he(e)?e:null}function qi(e){return We(eu(e),CF),e}function et(e){return We(he(e),BF),e}var Ji={};function MF(e){globalThis.console&&globalThis.console.error&&globalThis.console.error(e)}function OF(e){globalThis.console&&globalThis.console.log&&globalThis.console.log(e)}function PF(e,r){Ji[e]=!0,r!==void 0&&MF(r)}function IF(e){var r=e.getError;e.getError=function(){var n;do n=r.apply(e),n!==0&&(Ji[n]=!0);while(n!==0);for(n in Ji)if(Ji[n])return delete Ji[n],parseInt(n,10);return 0}}var Xi=function e(r){var t=r.gl;this.ext=r,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(r.maxVertexAttribs);for(var n=0;n<this.attribs.length;n++){var a=new e.VertexAttrib(t);this.attribs[n]=a}this.maxAttrib=0};Xi.VertexAttrib=function(r){this.enabled=!1,this.buffer=null,this.size=4,this.type=5126,this.normalized=!1,this.stride=16,this.offset=0,this.cached="",this.recache()};Xi.VertexAttrib.prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};var Fn=function(r){var t=this;this.gl=r,IF(r);var n=this.original={getParameter:r.getParameter,enableVertexAttribArray:r.enableVertexAttribArray,disableVertexAttribArray:r.disableVertexAttribArray,bindBuffer:r.bindBuffer,getVertexAttrib:r.getVertexAttrib,vertexAttribPointer:r.vertexAttribPointer};r.getParameter=function(i){return i===t.VERTEX_ARRAY_BINDING_OES?t.currentVertexArrayObject===t.defaultVertexArrayObject?null:t.currentVertexArrayObject:n.getParameter.apply(this,arguments)},r.enableVertexAttribArray=function(i){var o=t.currentVertexArrayObject;o.maxAttrib=Math.max(o.maxAttrib,i);var s=o.attribs[i];return s.enabled=!0,n.enableVertexAttribArray.apply(this,arguments)},r.disableVertexAttribArray=function(i){var o=t.currentVertexArrayObject;o.maxAttrib=Math.max(o.maxAttrib,i);var s=o.attribs[i];return s.enabled=!1,n.disableVertexAttribArray.apply(this,arguments)},r.bindBuffer=function(i,o){switch(i){case 34962:t.currentArrayBuffer=o;break;case 34963:t.currentVertexArrayObject.elementArrayBuffer=o;break;default:}return n.bindBuffer.apply(this,arguments)},r.getVertexAttrib=function(i,o){var s=t.currentVertexArrayObject,u=s.attribs[i];switch(o){case 34975:return u.buffer;case 34338:return u.enabled;case 34339:return u.size;case 34340:return u.stride;case 34341:return u.type;case 34922:return u.normalized;default:return n.getVertexAttrib.apply(this,arguments)}},r.vertexAttribPointer=function(i,o,s,u,f,l){var c=t.currentVertexArrayObject;c.maxAttrib=Math.max(c.maxAttrib,i);var h=c.attribs[i];return h.buffer=t.currentArrayBuffer,h.size=o,h.type=s,h.normalized=u,h.stride=f,h.offset=l,h.recache(),n.vertexAttribPointer.apply(this,arguments)},r.instrumentExtension&&r.instrumentExtension(this,"OES_vertex_array_object"),r.canvas&&r.canvas.addEventListener("webglcontextrestored",function(){OF("OESVertexArrayObject emulation library context restored"),t.reset_()},!0),this.reset_()};Fn.prototype.VERTEX_ARRAY_BINDING_OES=34229;Fn.prototype.reset_=function(){var r=this.vertexArrayObjects!==void 0;if(r)for(var t=0;t<this.vertexArrayObjects.length;++t)this.vertexArrayObjects.isAlive=!1;var n=this.gl;this.maxVertexAttribs=n.getParameter(34921),this.defaultVertexArrayObject=new Xi(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)};Fn.prototype.createVertexArrayOES=function(){var r=new Xi(this);return this.vertexArrayObjects.push(r),r};Fn.prototype.deleteVertexArrayOES=function(r){r.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(r),1),this.currentVertexArrayObject===r&&this.bindVertexArrayOES(null)};Fn.prototype.isVertexArrayOES=function(r){return!!(r&&r instanceof Xi&&r.hasBeenBound&&r.ext===this)};Fn.prototype.bindVertexArrayOES=function(r){var t=this.gl;if(r&&!r.isAlive){PF(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject");return}var n=this.original,a=this.currentVertexArrayObject;this.currentVertexArrayObject=r||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;var i=this.currentVertexArrayObject;if(a!==i){(!a||i.elementArrayBuffer!==a.elementArrayBuffer)&&n.bindBuffer.call(t,34963,i.elementArrayBuffer);for(var o=this.currentArrayBuffer,s=Math.max(a?a.maxAttrib:0,i.maxAttrib),u=0;u<=s;u++){var f=i.attribs[u],l=a?a.attribs[u]:null;if((!a||f.enabled!==l.enabled)&&(f.enabled?n.enableVertexAttribArray.call(t,u):n.disableVertexAttribArray.call(t,u)),f.enabled){var c=!1;(!a||f.buffer!==l.buffer)&&(o!==f.buffer&&(n.bindBuffer.call(t,34962,f.buffer),o=f.buffer),c=!0),(c||f.cached!==l.cached)&&n.vertexAttribPointer.call(t,u,f.size,f.type,f.normalized,f.stride,f.offset)}}this.currentArrayBuffer!==o&&n.bindBuffer.call(t,34962,this.currentArrayBuffer)}};function Q_(e){if(typeof e.createVertexArray!="function"){var r=e.getSupportedExtensions;e.getSupportedExtensions=function(){var a=r.call(this)||[];return a.indexOf("OES_vertex_array_object")<0&&a.push("OES_vertex_array_object"),a};var t=e.getExtension;e.getExtension=function(a){var i=t.call(this,a);return i||(a!=="OES_vertex_array_object"?null:(e.__OESVertexArrayObject||(this.__OESVertexArrayObject=new Fn(this)),this.__OESVertexArrayObject))}}}var Ki=m(W());var ae=m(W());var re,eb="OES_element_index",tb="WEBGL_draw_buffers",RF="EXT_disjoint_timer_query",FF="EXT_disjoint_timer_query_webgl2",LF="EXT_texture_filter_anisotropic",rb="WEBGL_debug_renderer_info",kF=35723,DF=4352,GF=36795,NF=34047,UF=37445,jF=37446,Ce=function(r){return he(r)?void 0:0},HF=(re={},(0,ae.default)(re,3074,function(r){return he(r)?void 0:36064}),(0,ae.default)(re,kF,function(e){return he(e)?void 0:DF}),(0,ae.default)(re,35977,Ce),(0,ae.default)(re,32937,Ce),(0,ae.default)(re,GF,function(e,r){var t=he(e)?e.getExtension(FF):e.getExtension(RF);return t&&t.GPU_DISJOINT_EXT?r(t.GPU_DISJOINT_EXT):0}),(0,ae.default)(re,UF,function(e,r){var t=e.getExtension(rb);return r(t&&t.UNMASKED_VENDOR_WEBGL||7936)}),(0,ae.default)(re,jF,function(e,r){var t=e.getExtension(rb);return r(t&&t.UNMASKED_RENDERER_WEBGL||7937)}),(0,ae.default)(re,NF,function(e,r){var t=e.luma.extensions[LF];return t?r(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),(0,ae.default)(re,32883,Ce),(0,ae.default)(re,35071,Ce),(0,ae.default)(re,37447,Ce),(0,ae.default)(re,36063,function(r,t){if(!he(r)){var n=r.getExtension(tb);return n?t(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),(0,ae.default)(re,35379,Ce),(0,ae.default)(re,35374,Ce),(0,ae.default)(re,35377,Ce),(0,ae.default)(re,34852,function(r){if(!he(r)){var t=r.getExtension(tb);return t?t.MAX_DRAW_BUFFERS_WEBGL:0}}),(0,ae.default)(re,36203,function(r){return r.getExtension(eb)?2147483647:65535}),(0,ae.default)(re,33001,function(r){return r.getExtension(eb)?16777216:65535}),(0,ae.default)(re,33e3,function(r){return 16777216}),(0,ae.default)(re,37157,Ce),(0,ae.default)(re,35373,Ce),(0,ae.default)(re,35657,Ce),(0,ae.default)(re,36183,Ce),(0,ae.default)(re,37137,Ce),(0,ae.default)(re,34045,Ce),(0,ae.default)(re,35978,Ce),(0,ae.default)(re,35979,Ce),(0,ae.default)(re,35968,Ce),(0,ae.default)(re,35376,Ce),(0,ae.default)(re,35375,Ce),(0,ae.default)(re,35659,Ce),(0,ae.default)(re,37154,Ce),(0,ae.default)(re,35371,Ce),(0,ae.default)(re,35658,Ce),(0,ae.default)(re,35076,Ce),(0,ae.default)(re,35077,Ce),(0,ae.default)(re,35380,Ce),re);function nb(e,r,t){var n=HF[t],a=typeof n=="function"?n(e,r,t):n,i=a!==void 0?a:r(t);return i}var Pa,VF="OES_vertex_array_object",ab="ANGLE_instanced_arrays",zF="WEBGL_draw_buffers",WF="EXT_disjoint_timer_query",qF="EXT_texture_filter_anisotropic",JF="VertexArray requires WebGL2 or OES_vertex_array_object extension";function XF(e,r){return{webgl2:he(e),ext:e.getExtension(r)}}var _h=(Pa={},(0,Ki.default)(Pa,VF,{meta:{suffix:"OES"},createVertexArray:function(){We(!1,JF)},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),(0,Ki.default)(Pa,ab,{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(r,t){We(t===0,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),(0,Ki.default)(Pa,zF,{meta:{suffix:"WEBGL"},drawBuffers:function(){We(!1)}}),(0,Ki.default)(Pa,WF,{meta:{suffix:"EXT"},createQuery:function(){We(!1)},deleteQuery:function(){We(!1)},beginQuery:function(){We(!1)},endQuery:function(){},getQuery:function(r,t){return this.getQueryObject(r,t)},getQueryParameter:function(r,t){return this.getQueryObject(r,t)},getQueryObject:function(){}}),Pa),tu={readBuffer:function(r,t,n){he(r)&&t(n)},getVertexAttrib:function(r,t,n,a){var i=XF(r,ab),o=i.webgl2,s=i.ext,u;switch(a){case 35069:u=o?void 0:!1;break;case 35070:u=!o&&!s?0:void 0;break;default:}return u!==void 0?u:t(n,a)},getProgramParameter:function(r,t,n,a){if(!he(r))switch(a){case 35967:return 35981;case 35971:return 0;case 35382:return 0;default:}return t(n,a)},getInternalformatParameter:function(r,t,n,a,i){if(!he(r))switch(i){case 32937:return new Int32Array([0]);default:}return r.getInternalformatParameter(n,a,i)},getTexParameter:function(r,t,n,a){switch(a){case 34046:var i=r.luma.extensions,o=i[qF];a=o&&o.TEXTURE_MAX_ANISOTROPY_EXT||34046;break;default:}return t(n,a)},getParameter:nb,hint:function(r,t,n,a){return t(n,a)}};function ob(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=KF(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
43
43
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function KF(e,r){if(e){if(typeof e=="string")return ib(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ib(e,r)}}function ib(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function sb(e){e.luma=e.luma||{};var r=e.luma;return r.polyfilled||(Q_(e),YF(e),$F(e,_h),ZF(e,{target:r,target2:e}),r.polyfilled=!0),e}globalThis.polyfillContext=sb;function YF(e){e.luma.extensions={};var r=e.getSupportedExtensions()||[],t=ob(r),n;try{for(t.s();!(n=t.n()).done;){var a=n.value;e.luma[a]=e.getExtension(a)}}catch(i){t.e(i)}finally{t.f()}}function ZF(e,r){var t=r.target,n=r.target2;Object.keys(tu).forEach(function(a){if(typeof tu[a]=="function"){var i=e[a]?e[a].bind(e):function(){},o=tu[a].bind(null,e,i);t[a]=o,n[a]=o}})}function $F(e,r){var t=ob(Object.getOwnPropertyNames(r)),n;try{for(t.s();!(n=t.n()).done;){var a=n.value;a!=="overrides"&&QF(e,{extension:a,target:e.luma,target2:e})}}catch(i){t.e(i)}finally{t.f()}}function QF(e,r){var t=r.extension,n=r.target,a=r.target2,i=_h[t];We(i);for(var o=i.meta,s=o===void 0?{}:o,u=s.suffix,f=u===void 0?"":u,l=e.getExtension(t),c=function(){var v=d[h],y="".concat(v).concat(f),A=null;v==="meta"||typeof e[v]=="function"||(l&&typeof l[y]=="function"?A=function(){return l[y].apply(l,arguments)}:typeof i[v]=="function"&&(A=i[v].bind(n))),A&&(n[v]=A,a[v]=A)},h=0,d=Object.keys(i);h<d.length;h++)c()}var ru=m(ie()),Fe=m(st()),T=m(W());var q,N,Rt,nu=(q={},(0,T.default)(q,3042,!1),(0,T.default)(q,32773,new Float32Array([0,0,0,0])),(0,T.default)(q,32777,32774),(0,T.default)(q,34877,32774),(0,T.default)(q,32969,1),(0,T.default)(q,32968,0),(0,T.default)(q,32971,1),(0,T.default)(q,32970,0),(0,T.default)(q,3106,new Float32Array([0,0,0,0])),(0,T.default)(q,3107,[!0,!0,!0,!0]),(0,T.default)(q,2884,!1),(0,T.default)(q,2885,1029),(0,T.default)(q,2929,!1),(0,T.default)(q,2931,1),(0,T.default)(q,2932,513),(0,T.default)(q,2928,new Float32Array([0,1])),(0,T.default)(q,2930,!0),(0,T.default)(q,3024,!0),(0,T.default)(q,36006,null),(0,T.default)(q,2886,2305),(0,T.default)(q,33170,4352),(0,T.default)(q,2849,1),(0,T.default)(q,32823,!1),(0,T.default)(q,32824,0),(0,T.default)(q,10752,0),(0,T.default)(q,32938,1),(0,T.default)(q,32939,!1),(0,T.default)(q,3089,!1),(0,T.default)(q,3088,new Int32Array([0,0,1024,1024])),(0,T.default)(q,2960,!1),(0,T.default)(q,2961,0),(0,T.default)(q,2968,4294967295),(0,T.default)(q,36005,4294967295),(0,T.default)(q,2962,519),(0,T.default)(q,2967,0),(0,T.default)(q,2963,4294967295),(0,T.default)(q,34816,519),(0,T.default)(q,36003,0),(0,T.default)(q,36004,4294967295),(0,T.default)(q,2964,7680),(0,T.default)(q,2965,7680),(0,T.default)(q,2966,7680),(0,T.default)(q,34817,7680),(0,T.default)(q,34818,7680),(0,T.default)(q,34819,7680),(0,T.default)(q,2978,[0,0,1024,1024]),(0,T.default)(q,3333,4),(0,T.default)(q,3317,4),(0,T.default)(q,37440,!1),(0,T.default)(q,37441,!1),(0,T.default)(q,37443,37444),(0,T.default)(q,35723,4352),(0,T.default)(q,36010,null),(0,T.default)(q,35977,!1),(0,T.default)(q,3330,0),(0,T.default)(q,3332,0),(0,T.default)(q,3331,0),(0,T.default)(q,3314,0),(0,T.default)(q,32878,0),(0,T.default)(q,3316,0),(0,T.default)(q,3315,0),(0,T.default)(q,32877,0),q),Xr=function(r,t,n){return t?r.enable(n):r.disable(n)},ub=function(r,t,n){return r.hint(n,t)},Ct=function(r,t,n){return r.pixelStorei(n,t)},eL=function(r,t){var n=he(r)?36009:36160;return r.bindFramebuffer(n,t)},tL=function(r,t){return r.bindFramebuffer(36008,t)};function Yi(e){return Array.isArray(e)||ArrayBuffer.isView(e)}var fb=(N={},(0,T.default)(N,3042,Xr),(0,T.default)(N,32773,function(r,t){return r.blendColor.apply(r,(0,Fe.default)(t))}),(0,T.default)(N,32777,"blendEquation"),(0,T.default)(N,34877,"blendEquation"),(0,T.default)(N,32969,"blendFunc"),(0,T.default)(N,32968,"blendFunc"),(0,T.default)(N,32971,"blendFunc"),(0,T.default)(N,32970,"blendFunc"),(0,T.default)(N,3106,function(r,t){return r.clearColor.apply(r,(0,Fe.default)(t))}),(0,T.default)(N,3107,function(r,t){return r.colorMask.apply(r,(0,Fe.default)(t))}),(0,T.default)(N,2884,Xr),(0,T.default)(N,2885,function(r,t){return r.cullFace(t)}),(0,T.default)(N,2929,Xr),(0,T.default)(N,2931,function(r,t){return r.clearDepth(t)}),(0,T.default)(N,2932,function(r,t){return r.depthFunc(t)}),(0,T.default)(N,2928,function(r,t){return r.depthRange.apply(r,(0,Fe.default)(t))}),(0,T.default)(N,2930,function(r,t){return r.depthMask(t)}),(0,T.default)(N,3024,Xr),(0,T.default)(N,35723,ub),(0,T.default)(N,36006,eL),(0,T.default)(N,2886,function(r,t){return r.frontFace(t)}),(0,T.default)(N,33170,ub),(0,T.default)(N,2849,function(r,t){return r.lineWidth(t)}),(0,T.default)(N,32823,Xr),(0,T.default)(N,32824,"polygonOffset"),(0,T.default)(N,10752,"polygonOffset"),(0,T.default)(N,35977,Xr),(0,T.default)(N,32938,"sampleCoverage"),(0,T.default)(N,32939,"sampleCoverage"),(0,T.default)(N,3089,Xr),(0,T.default)(N,3088,function(r,t){return r.scissor.apply(r,(0,Fe.default)(t))}),(0,T.default)(N,2960,Xr),(0,T.default)(N,2961,function(r,t){return r.clearStencil(t)}),(0,T.default)(N,2968,function(r,t){return r.stencilMaskSeparate(1028,t)}),(0,T.default)(N,36005,function(r,t){return r.stencilMaskSeparate(1029,t)}),(0,T.default)(N,2962,"stencilFuncFront"),(0,T.default)(N,2967,"stencilFuncFront"),(0,T.default)(N,2963,"stencilFuncFront"),(0,T.default)(N,34816,"stencilFuncBack"),(0,T.default)(N,36003,"stencilFuncBack"),(0,T.default)(N,36004,"stencilFuncBack"),(0,T.default)(N,2964,"stencilOpFront"),(0,T.default)(N,2965,"stencilOpFront"),(0,T.default)(N,2966,"stencilOpFront"),(0,T.default)(N,34817,"stencilOpBack"),(0,T.default)(N,34818,"stencilOpBack"),(0,T.default)(N,34819,"stencilOpBack"),(0,T.default)(N,2978,function(r,t){return r.viewport.apply(r,(0,Fe.default)(t))}),(0,T.default)(N,3333,Ct),(0,T.default)(N,3317,Ct),(0,T.default)(N,37440,Ct),(0,T.default)(N,37441,Ct),(0,T.default)(N,37443,Ct),(0,T.default)(N,3330,Ct),(0,T.default)(N,3332,Ct),(0,T.default)(N,3331,Ct),(0,T.default)(N,36010,tL),(0,T.default)(N,3314,Ct),(0,T.default)(N,32878,Ct),(0,T.default)(N,3316,Ct),(0,T.default)(N,3315,Ct),(0,T.default)(N,32877,Ct),(0,T.default)(N,"framebuffer",function(r,t){var n=t&&"handle"in t?t.handle:t;return r.bindFramebuffer(36160,n)}),(0,T.default)(N,"blend",function(r,t){return t?r.enable(3042):r.disable(3042)}),(0,T.default)(N,"blendColor",function(r,t){return r.blendColor.apply(r,(0,Fe.default)(t))}),(0,T.default)(N,"blendEquation",function(r,t){t=Yi(t)?t:[t,t],r.blendEquationSeparate.apply(r,(0,Fe.default)(t))}),(0,T.default)(N,"blendFunc",function(r,t){t=Yi(t)&&t.length===2?[].concat((0,Fe.default)(t),(0,Fe.default)(t)):t,r.blendFuncSeparate.apply(r,(0,Fe.default)(t))}),(0,T.default)(N,"clearColor",function(r,t){return r.clearColor.apply(r,(0,Fe.default)(t))}),(0,T.default)(N,"clearDepth",function(r,t){return r.clearDepth(t)}),(0,T.default)(N,"clearStencil",function(r,t){return r.clearStencil(t)}),(0,T.default)(N,"colorMask",function(r,t){return r.colorMask.apply(r,(0,Fe.default)(t))}),(0,T.default)(N,"cull",function(r,t){return t?r.enable(2884):r.disable(2884)}),(0,T.default)(N,"cullFace",function(r,t){return r.cullFace(t)}),(0,T.default)(N,"depthTest",function(r,t){return t?r.enable(2929):r.disable(2929)}),(0,T.default)(N,"depthFunc",function(r,t){return r.depthFunc(t)}),(0,T.default)(N,"depthMask",function(r,t){return r.depthMask(t)}),(0,T.default)(N,"depthRange",function(r,t){return r.depthRange.apply(r,(0,Fe.default)(t))}),(0,T.default)(N,"dither",function(r,t){return t?r.enable(3024):r.disable(3024)}),(0,T.default)(N,"derivativeHint",function(r,t){r.hint(35723,t)}),(0,T.default)(N,"frontFace",function(r,t){return r.frontFace(t)}),(0,T.default)(N,"mipmapHint",function(r,t){return r.hint(33170,t)}),(0,T.default)(N,"lineWidth",function(r,t){return r.lineWidth(t)}),(0,T.default)(N,"polygonOffsetFill",function(r,t){return t?r.enable(32823):r.disable(32823)}),(0,T.default)(N,"polygonOffset",function(r,t){return r.polygonOffset.apply(r,(0,Fe.default)(t))}),(0,T.default)(N,"sampleCoverage",function(r,t){return r.sampleCoverage.apply(r,(0,Fe.default)(t))}),(0,T.default)(N,"scissorTest",function(r,t){return t?r.enable(3089):r.disable(3089)}),(0,T.default)(N,"scissor",function(r,t){return r.scissor.apply(r,(0,Fe.default)(t))}),(0,T.default)(N,"stencilTest",function(r,t){return t?r.enable(2960):r.disable(2960)}),(0,T.default)(N,"stencilMask",function(r,t){t=Yi(t)?t:[t,t];var n=t,a=(0,ru.default)(n,2),i=a[0],o=a[1];r.stencilMaskSeparate(1028,i),r.stencilMaskSeparate(1029,o)}),(0,T.default)(N,"stencilFunc",function(r,t){t=Yi(t)&&t.length===3?[].concat((0,Fe.default)(t),(0,Fe.default)(t)):t;var n=t,a=(0,ru.default)(n,6),i=a[0],o=a[1],s=a[2],u=a[3],f=a[4],l=a[5];r.stencilFuncSeparate(1028,i,o,s),r.stencilFuncSeparate(1029,u,f,l)}),(0,T.default)(N,"stencilOp",function(r,t){t=Yi(t)&&t.length===3?[].concat((0,Fe.default)(t),(0,Fe.default)(t)):t;var n=t,a=(0,ru.default)(n,6),i=a[0],o=a[1],s=a[2],u=a[3],f=a[4],l=a[5];r.stencilOpSeparate(1028,i,o,s),r.stencilOpSeparate(1029,u,f,l)}),(0,T.default)(N,"viewport",function(r,t){return r.viewport.apply(r,(0,Fe.default)(t))}),N);function De(e,r,t){return r[e]!==void 0?r[e]:t[e]}var lb={blendEquation:function(r,t,n){return r.blendEquationSeparate(De(32777,t,n),De(34877,t,n))},blendFunc:function(r,t,n){return r.blendFuncSeparate(De(32969,t,n),De(32968,t,n),De(32971,t,n),De(32970,t,n))},polygonOffset:function(r,t,n){return r.polygonOffset(De(32824,t,n),De(10752,t,n))},sampleCoverage:function(r,t,n){return r.sampleCoverage(De(32938,t,n),De(32939,t,n))},stencilFuncFront:function(r,t,n){return r.stencilFuncSeparate(1028,De(2962,t,n),De(2967,t,n),De(2963,t,n))},stencilFuncBack:function(r,t,n){return r.stencilFuncSeparate(1029,De(34816,t,n),De(36003,t,n),De(36004,t,n))},stencilOpFront:function(r,t,n){return r.stencilOpSeparate(1028,De(2964,t,n),De(2965,t,n),De(2966,t,n))},stencilOpBack:function(r,t,n){return r.stencilOpSeparate(1029,De(34817,t,n),De(34818,t,n),De(34819,t,n))}},bh={enable:function(r,t){return r((0,T.default)({},t,!0))},disable:function(r,t){return r((0,T.default)({},t,!1))},pixelStorei:function(r,t,n){return r((0,T.default)({},t,n))},hint:function(r,t,n){return r((0,T.default)({},t,n))},bindFramebuffer:function(r,t,n){var a;switch(t){case 36160:return r((a={},(0,T.default)(a,36006,n),(0,T.default)(a,36010,n),a));case 36009:return r((0,T.default)({},36006,n));case 36008:return r((0,T.default)({},36010,n));default:return null}},blendColor:function(r,t,n,a,i){return r((0,T.default)({},32773,new Float32Array([t,n,a,i])))},blendEquation:function(r,t){var n;return r((n={},(0,T.default)(n,32777,t),(0,T.default)(n,34877,t),n))},blendEquationSeparate:function(r,t,n){var a;return r((a={},(0,T.default)(a,32777,t),(0,T.default)(a,34877,n),a))},blendFunc:function(r,t,n){var a;return r((a={},(0,T.default)(a,32969,t),(0,T.default)(a,32968,n),(0,T.default)(a,32971,t),(0,T.default)(a,32970,n),a))},blendFuncSeparate:function(r,t,n,a,i){var o;return r((o={},(0,T.default)(o,32969,t),(0,T.default)(o,32968,n),(0,T.default)(o,32971,a),(0,T.default)(o,32970,i),o))},clearColor:function(r,t,n,a,i){return r((0,T.default)({},3106,new Float32Array([t,n,a,i])))},clearDepth:function(r,t){return r((0,T.default)({},2931,t))},clearStencil:function(r,t){return r((0,T.default)({},2961,t))},colorMask:function(r,t,n,a,i){return r((0,T.default)({},3107,[t,n,a,i]))},cullFace:function(r,t){return r((0,T.default)({},2885,t))},depthFunc:function(r,t){return r((0,T.default)({},2932,t))},depthRange:function(r,t,n){return r((0,T.default)({},2928,new Float32Array([t,n])))},depthMask:function(r,t){return r((0,T.default)({},2930,t))},frontFace:function(r,t){return r((0,T.default)({},2886,t))},lineWidth:function(r,t){return r((0,T.default)({},2849,t))},polygonOffset:function(r,t,n){var a;return r((a={},(0,T.default)(a,32824,t),(0,T.default)(a,10752,n),a))},sampleCoverage:function(r,t,n){var a;return r((a={},(0,T.default)(a,32938,t),(0,T.default)(a,32939,n),a))},scissor:function(r,t,n,a,i){return r((0,T.default)({},3088,new Int32Array([t,n,a,i])))},stencilMask:function(r,t){var n;return r((n={},(0,T.default)(n,2968,t),(0,T.default)(n,36005,t),n))},stencilMaskSeparate:function(r,t,n){return r((0,T.default)({},t===1028?2968:36005,n))},stencilFunc:function(r,t,n,a){var i;return r((i={},(0,T.default)(i,2962,t),(0,T.default)(i,2967,n),(0,T.default)(i,2963,a),(0,T.default)(i,34816,t),(0,T.default)(i,36003,n),(0,T.default)(i,36004,a),i))},stencilFuncSeparate:function(r,t,n,a,i){var o;return r((o={},(0,T.default)(o,t===1028?2962:34816,n),(0,T.default)(o,t===1028?2967:36003,a),(0,T.default)(o,t===1028?2963:36004,i),o))},stencilOp:function(r,t,n,a){var i;return r((i={},(0,T.default)(i,2964,t),(0,T.default)(i,2965,n),(0,T.default)(i,2966,a),(0,T.default)(i,34817,t),(0,T.default)(i,34818,n),(0,T.default)(i,34819,a),i))},stencilOpSeparate:function(r,t,n,a,i){var o;return r((o={},(0,T.default)(o,t===1028?2964:34817,n),(0,T.default)(o,t===1028?2965:34818,a),(0,T.default)(o,t===1028?2966:34819,i),o))},viewport:function(r,t,n,a,i){return r((0,T.default)({},2978,[t,n,a,i]))}},ir=function(r,t){return r.isEnabled(t)},Th=(Rt={},(0,T.default)(Rt,3042,ir),(0,T.default)(Rt,2884,ir),(0,T.default)(Rt,2929,ir),(0,T.default)(Rt,3024,ir),(0,T.default)(Rt,32823,ir),(0,T.default)(Rt,32926,ir),(0,T.default)(Rt,32928,ir),(0,T.default)(Rt,3089,ir),(0,T.default)(Rt,2960,ir),(0,T.default)(Rt,35977,ir),Rt);var db=m(H()),pb=m(z());function xh(e){for(var r in e)return!1;return!0}function cb(e,r){if(e===r)return!0;var t=Array.isArray(e)||ArrayBuffer.isView(e),n=Array.isArray(r)||ArrayBuffer.isView(r);if(t&&n&&e.length===r.length){for(var a=0;a<e.length;++a)if(e[a]!==r[a])return!1;return!0}return!1}function hb(e,r){var t=e[r].bind(e);e[r]=function(){var a=arguments.length<=0?void 0:arguments[0];return a in e.state.cache&&e.state.enable?e.state.cache[a]:t.apply(void 0,arguments)},Object.defineProperty(e[r],"name",{value:"".concat(r,"-from-cache"),configurable:!1})}function rL(e,r,t){var n=e[r].bind(e);e[r]=function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];var u=t.apply(void 0,[e.state._updateCache].concat(o)),f=u.valueChanged,l=u.oldValue;return f&&n.apply(void 0,o),l},Object.defineProperty(e[r],"name",{value:"".concat(r,"-to-cache"),configurable:!1})}function nL(e){var r=e.useProgram.bind(e);e.useProgram=function(n){e.state.program!==n&&(r(n),e.state.program=n)}}var aL=function(){function e(r){(0,db.default)(this,e);var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.copyState,a=n===void 0?!1:n,i=t.log,o=i===void 0?function(){}:i;this.gl=r,this.program=null,this.stateStack=[],this.enable=!0,this.cache=a?wh(r):Object.assign({},nu),this.log=o,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return(0,pb.default)(e,[{key:"push",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.stateStack.push({})}},{key:"pop",value:function(){We(this.stateStack.length>0);var t=this.stateStack[this.stateStack.length-1];iu(this.gl,t),this.stateStack.pop()}},{key:"_updateCache",value:function(t){var n=!1,a,i=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var o in t){We(o!==void 0);var s=t[o],u=this.cache[o];cb(s,u)||(n=!0,a=u,i&&!(o in i)&&(i[o]=u),this.cache[o]=s)}return{valueChanged:n,oldValue:a}}}]),e}();function Eh(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.enable,n=t===void 0?!0:t,a=r.copyState;if(We(a!==void 0),!e.state){var i=globalThis.polyfillContext;i&&i(e),e.state=new aL(e,{copyState:a}),nL(e);for(var o in bh){var s=bh[o];rL(e,o,s)}hb(e,"getParameter"),hb(e,"isEnabled")}return e.state.enable=n,e}function Sh(e){e.state||Eh(e,{copyState:!1}),e.state.push()}function au(e){We(e.state),e.state.pop()}function iL(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=oL(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
44
44
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,o=!1,s;return{s:function(){t=t.call(e)},n:function(){var f=t.next();return i=f.done,f},e:function(f){o=!0,s=f},f:function(){try{!i&&t.return!=null&&t.return()}finally{if(o)throw s}}}}function oL(e,r){if(e){if(typeof e=="string")return mb(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(e);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return mb(e,r)}}function mb(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function iu(e,r){if(We(eu(e),"setParameters requires a WebGL context"),!xh(r)){var t={};for(var n in r){var a=Number(n),i=fb[n];i&&(typeof i=="string"?t[i]=!0:i(e,r[n],a))}var o=e.state&&e.state.cache;if(o)for(var s in t){var u=lb[s];u(e,r,o)}}}function wh(e,r){if(r=r||nu,typeof r=="number"){var t=r,n=Th[t];return n?n(e,t):e.getParameter(t)}var a=Array.isArray(r)?r:Object.keys(r),i={},o=iL(a),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,f=Th[u];i[u]=f?f(e,Number(u)):e.getParameter(Number(u))}}catch(l){o.e(l)}finally{o.f()}return i}function Ar(e,r,t){if(xh(r))return t(e);var n=r.nocatch,a=n===void 0?!0:n;Sh(e),iu(e,r);var i;if(a)i=t(e),au(e);else try{i=t(e)}finally{au(e)}return i}var kX=ht();var _b=m(H()),bb=m(z());var yb=m(H()),Ab=m(z());var vb=m(H()),gb=m(z());function Zi(){var e;if(typeof window<"u"&&window.performance)e=window.performance.now();else if(typeof process<"u"&&process.hrtime){var r=process.hrtime();e=r[0]*1e3+r[1]/1e6}else e=Date.now();return e}var ou=function(){function e(r,t){(0,vb.default)(this,e),g(this,"name",void 0),g(this,"type",void 0),g(this,"sampleSize",1),g(this,"time",void 0),g(this,"count",void 0),g(this,"samples",void 0),g(this,"lastTiming",void 0),g(this,"lastSampleTime",void 0),g(this,"lastSampleCount",void 0),g(this,"_count",0),g(this,"_time",0),g(this,"_samples",0),g(this,"_startTime",0),g(this,"_timerPending",!1),this.name=r,this.type=t,this.reset()}return(0,gb.default)(e,[{key:"setSampleSize",value:function(t){return this.sampleSize=t,this}},{key:"incrementCount",value:function(){return this.addCount(1),this}},{key:"decrementCount",value:function(){return this.subtractCount(1),this}},{key:"addCount",value:function(t){return this._count+=t,this._samples++,this._checkSampling(),this}},{key:"subtractCount",value:function(t){return this._count-=t,this._samples++,this._checkSampling(),this}},{key:"addTime",value:function(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}},{key:"timeStart",value:function(){return this._startTime=Zi(),this._timerPending=!0,this}},{key:"timeEnd",value:function(){return this._timerPending?(this.addTime(Zi()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}},{key:"getSampleAverageCount",value:function(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}},{key:"getSampleAverageTime",value:function(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}},{key:"getSampleHz",value:function(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}},{key:"getAverageCount",value:function(){return this.samples>0?this.count/this.samples:0}},{key:"getAverageTime",value:function(){return this.samples>0?this.time/this.samples:0}},{key:"getHz",value:function(){return this.time>0?this.samples/(this.time/1e3):0}},{key:"reset",value:function(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}},{key:"_checkSampling",value:function(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}]),e}();var Ch=function(){function e(r){(0,yb.default)(this,e),g(this,"id",void 0),g(this,"stats",{}),this.id=r.id,this.stats={},this._initializeStats(r.stats),Object.seal(this)}return(0,Ab.default)(e,[{key:"get",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:t,type:n})}},{key:"size",get:function(){return Object.keys(this.stats).length}},{key:"reset",value:function(){for(var t in this.stats)this.stats[t].reset();return this}},{key:"forEach",value:function(t){for(var n in this.stats)t(this.stats[n])}},{key:"getTable",value:function(){var t={};return this.forEach(function(n){t[n.name]={time:n.time||0,count:n.count||0,average:n.getAverageTime()||0,hz:n.getHz()||0}}),t}},{key:"_initializeStats",value:function(){var t=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];n.forEach(function(a){return t._getOrCreate(a)})}},{key:"_getOrCreate",value:function(t){if(!t||!t.name)return null;var n=t.name,a=t.type;return this.stats[n]||(t instanceof ou?this.stats[n]=t:this.stats[n]=new ou(n,a)),this.stats[n]}}]),e}();var $i="8.5.20",sL="set luma.log.level=1 (or higher) to trace rendering",uL=function(){function e(){(0,_b.default)(this,e),this.stats=new Map}return(0,bb.default)(e,[{key:"get",value:function(t){return this.stats.has(t)||this.stats.set(t,new Ch({id:t})),this.stats.get(t)}}]),e}(),Ia=new uL;if(globalThis.luma&&globalThis.luma.VERSION!==$i)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat($i));globalThis.luma||(ht()&&ue.log(1,"luma.gl ".concat($i," - ").concat(sL))(),globalThis.luma=globalThis.luma||{VERSION:$i,version:$i,log:ue,stats:Ia,globals:{modules:{},nodeIO:{}}});var d7=globalThis.luma;var MT=m(W());var Zb=m(H()),$b=m(z()),Qb=m(wt()),eT=m(Te()),tT=m(xe()),Fh=m(be());var Wb=m(ie()),qb=m(H()),Jb=m(z()),Xb=m(Te()),Kb=m(xe()),Ih=m(be());var Eb=m(H()),Sb=m(z());function $(e,r){if(!e)throw new Error(r||"luma.gl: assertion failed.")}function su(e,r){if(typeof r!="string")return r;var t=Number(r);if(!isNaN(t))return t;r=r.replace(/^.*\./,"");var n=e[r];return $(n!==void 0,"Accessing undefined constant GL.".concat(r)),n}function Ln(e,r){r=Number(r);for(var t in e)if(e[t]===r)return"GL.".concat(t);return String(r)}var Bh={};function uu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";Bh[e]=Bh[e]||1;var r=Bh[e]++;return"".concat(e,"-").concat(r)}function Mh(e){return $(typeof e=="number","Input must be a number"),e&&(e&e-1)===0}function Tb(e,r,t,n){var a="See luma.gl ".concat(t," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),i=Object.getPrototypeOf(e);n.forEach(function(o){i.methodName||(i[o]=function(){throw ue.removed("Calling removed method ".concat(r,".").concat(o,": "),a)(),new Error(o)})})}function fL(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=lL(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(f){throw f},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@deck.gl/geo-layers",
3
3
  "description": "deck.gl layers supporting geospatial use cases and GIS formats",
4
4
  "license": "MIT",
5
- "version": "8.9.17",
5
+ "version": "8.9.18",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
@@ -55,5 +55,5 @@
55
55
  "@loaders.gl/core": "^3.4.2",
56
56
  "@luma.gl/core": "^8.0.0"
57
57
  },
58
- "gitHead": "bb664e10c3fc830af98e68012b79cf0fbf2f2de9"
58
+ "gitHead": "e581cda7ad4df20fb3706023d64216e07ac78692"
59
59
  }
@@ -0,0 +1,49 @@
1
+ import { CompositeLayer } from '@deck.gl/core';
2
+ import { PolygonLayer } from '@deck.gl/layers';
3
+ const defaultProps = {
4
+ ...PolygonLayer.defaultProps
5
+ };
6
+ export default class GeoCellLayer extends CompositeLayer {
7
+ /** Implement to generate props to create geometry. */
8
+ indexToBounds() {
9
+ return null;
10
+ }
11
+ renderLayers() {
12
+ // Rendering props underlying layer
13
+ const { elevationScale, extruded, wireframe, filled, stroked, lineWidthUnits, lineWidthScale, lineWidthMinPixels, lineWidthMaxPixels, lineJointRounded, lineMiterLimit, lineDashJustified, getElevation, getFillColor, getLineColor, getLineWidth } = this.props;
14
+ // Accessor props for underlying layers
15
+ const { updateTriggers, material, transitions } = this.props;
16
+ // Filled Polygon Layer
17
+ const CellLayer = this.getSubLayerClass('cell', PolygonLayer);
18
+ return new CellLayer({
19
+ filled,
20
+ wireframe,
21
+ extruded,
22
+ elevationScale,
23
+ stroked,
24
+ lineWidthUnits,
25
+ lineWidthScale,
26
+ lineWidthMinPixels,
27
+ lineWidthMaxPixels,
28
+ lineJointRounded,
29
+ lineMiterLimit,
30
+ lineDashJustified,
31
+ material,
32
+ transitions,
33
+ getElevation,
34
+ getFillColor,
35
+ getLineColor,
36
+ getLineWidth
37
+ }, this.getSubLayerProps({
38
+ id: 'cell',
39
+ updateTriggers: updateTriggers && {
40
+ getElevation: updateTriggers.getElevation,
41
+ getFillColor: updateTriggers.getFillColor,
42
+ getLineColor: updateTriggers.getLineColor,
43
+ getLineWidth: updateTriggers.getLineWidth
44
+ }
45
+ }), this.indexToBounds());
46
+ }
47
+ }
48
+ GeoCellLayer.layerName = 'GeoCellLayer';
49
+ GeoCellLayer.defaultProps = defaultProps;
@@ -0,0 +1,29 @@
1
+ // Copyright (c) 2015 - 2017 Uber Technologies, Inc.
2
+ //
3
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ // of this software and associated documentation files (the "Software"), to deal
5
+ // in the Software without restriction, including without limitation the rights
6
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ // copies of the Software, and to permit persons to whom the Software is
8
+ // furnished to do so, subject to the following conditions:
9
+ //
10
+ // The above copyright notice and this permission notice shall be included in
11
+ // all copies or substantial portions of the Software.
12
+ //
13
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ // THE SOFTWARE.
20
+ import { ArcLayer } from '@deck.gl/layers';
21
+ // This layer has been merged into the core ArcLayer
22
+ // Keeping for backward-compatibility
23
+ export default class GreatCircleLayer extends ArcLayer {
24
+ }
25
+ GreatCircleLayer.layerName = 'GreatCircleLayer';
26
+ GreatCircleLayer.defaultProps = {
27
+ getHeight: { type: 'accessor', value: 0 },
28
+ greatCircle: true
29
+ };
@@ -0,0 +1,33 @@
1
+ import { h3SetToMultiPolygon } from 'h3-js';
2
+ import { createIterable } from '@deck.gl/core';
3
+ import GeoCellLayer from '../geo-cell-layer/GeoCellLayer';
4
+ const defaultProps = {
5
+ getHexagons: { type: 'accessor', value: d => d.hexagons }
6
+ };
7
+ export default class H3ClusterLayer extends GeoCellLayer {
8
+ updateState({ props, oldProps, changeFlags }) {
9
+ if (changeFlags.dataChanged ||
10
+ (changeFlags.updateTriggers && changeFlags.updateTriggers.getHexagons)) {
11
+ const { data, getHexagons } = props;
12
+ const polygons = [];
13
+ const { iterable, objectInfo } = createIterable(data);
14
+ for (const object of iterable) {
15
+ objectInfo.index++;
16
+ const hexagons = getHexagons(object, objectInfo);
17
+ const multiPolygon = h3SetToMultiPolygon(hexagons, true);
18
+ for (const polygon of multiPolygon) {
19
+ polygons.push(this.getSubLayerRow({ polygon }, object, objectInfo.index));
20
+ }
21
+ }
22
+ this.setState({ polygons });
23
+ }
24
+ }
25
+ indexToBounds() {
26
+ return {
27
+ data: this.state.polygons,
28
+ getPolygon: d => d.polygon
29
+ };
30
+ }
31
+ }
32
+ H3ClusterLayer.defaultProps = defaultProps;
33
+ H3ClusterLayer.layerName = 'H3ClusterLayer';
@@ -0,0 +1,251 @@
1
+ import { h3ToGeoBoundary, h3GetResolution, h3ToGeo, geoToH3, h3IsPentagon, h3Distance, edgeLength, UNITS } from 'h3-js';
2
+ import { lerp } from '@math.gl/core';
3
+ import { CompositeLayer, createIterable } from '@deck.gl/core';
4
+ import { ColumnLayer, PolygonLayer } from '@deck.gl/layers';
5
+ // There is a cost to updating the instanced geometries when using highPrecision: false
6
+ // This constant defines the distance between two hexagons that leads to "significant
7
+ // distortion." Smaller value makes the column layer more sensitive to viewport change.
8
+ const UPDATE_THRESHOLD_KM = 10;
9
+ // normalize longitudes w.r.t center (refLng), when not provided first vertex
10
+ export function normalizeLongitudes(vertices, refLng) {
11
+ refLng = refLng === undefined ? vertices[0][0] : refLng;
12
+ for (const pt of vertices) {
13
+ const deltaLng = pt[0] - refLng;
14
+ if (deltaLng > 180) {
15
+ pt[0] -= 360;
16
+ }
17
+ else if (deltaLng < -180) {
18
+ pt[0] += 360;
19
+ }
20
+ }
21
+ }
22
+ // scale polygon vertices w.r.t center (hexId)
23
+ export function scalePolygon(hexId, vertices, factor) {
24
+ const [lat, lng] = h3ToGeo(hexId);
25
+ const actualCount = vertices.length;
26
+ // normalize with respect to center
27
+ normalizeLongitudes(vertices, lng);
28
+ // `h3ToGeoBoundary` returns same array object for first and last vertex (closed polygon),
29
+ // if so skip scaling the last vertex
30
+ const vertexCount = vertices[0] === vertices[actualCount - 1] ? actualCount - 1 : actualCount;
31
+ for (let i = 0; i < vertexCount; i++) {
32
+ vertices[i][0] = lerp(lng, vertices[i][0], factor);
33
+ vertices[i][1] = lerp(lat, vertices[i][1], factor);
34
+ }
35
+ }
36
+ function getHexagonCentroid(getHexagon, object, objectInfo) {
37
+ const hexagonId = getHexagon(object, objectInfo);
38
+ const [lat, lng] = h3ToGeo(hexagonId);
39
+ return [lng, lat];
40
+ }
41
+ function h3ToPolygon(hexId, coverage = 1, flatten) {
42
+ const vertices = h3ToGeoBoundary(hexId, true);
43
+ if (coverage !== 1) {
44
+ // scale and normalize vertices w.r.t to center
45
+ scalePolygon(hexId, vertices, coverage);
46
+ }
47
+ else {
48
+ // normalize w.r.t to start vertex
49
+ normalizeLongitudes(vertices);
50
+ }
51
+ if (flatten) {
52
+ const positions = new Float64Array(vertices.length * 2);
53
+ let i = 0;
54
+ for (const pt of vertices) {
55
+ positions[i++] = pt[0];
56
+ positions[i++] = pt[1];
57
+ }
58
+ return positions;
59
+ }
60
+ return vertices;
61
+ }
62
+ function mergeTriggers(getHexagon, coverage) {
63
+ let trigger;
64
+ if (getHexagon === undefined || getHexagon === null) {
65
+ trigger = coverage;
66
+ }
67
+ else if (typeof getHexagon === 'object') {
68
+ trigger = { ...getHexagon, coverage };
69
+ }
70
+ else {
71
+ trigger = { getHexagon, coverage };
72
+ }
73
+ return trigger;
74
+ }
75
+ const defaultProps = {
76
+ ...PolygonLayer.defaultProps,
77
+ highPrecision: 'auto',
78
+ coverage: { type: 'number', min: 0, max: 1, value: 1 },
79
+ centerHexagon: null,
80
+ getHexagon: { type: 'accessor', value: x => x.hexagon },
81
+ extruded: true
82
+ };
83
+ // not supported
84
+ delete defaultProps.getLineDashArray;
85
+ /**
86
+ * A subclass of HexagonLayer that uses H3 hexagonIds in data objects
87
+ * rather than centroid lat/longs. The shape of each hexagon is determined
88
+ * based on a single "center" hexagon, which can be selected by passing in
89
+ * a center lat/lon pair. If not provided, the map center will be used.
90
+ *
91
+ * Also sets the `hexagonId` field in the onHover/onClick callback's info
92
+ * objects. Since this is calculated using math, hexagonId will be present
93
+ * even when no corresponding hexagon is in the data set. You can check
94
+ * index !== -1 to see if picking matches an actual object.
95
+ */
96
+ export default class H3HexagonLayer extends CompositeLayer {
97
+ shouldUpdateState({ changeFlags }) {
98
+ return this._shouldUseHighPrecision()
99
+ ? changeFlags.propsOrDataChanged
100
+ : changeFlags.somethingChanged;
101
+ }
102
+ updateState({ props, oldProps, changeFlags }) {
103
+ if (props.highPrecision !== true &&
104
+ (changeFlags.dataChanged ||
105
+ (changeFlags.updateTriggers && changeFlags.updateTriggers.getHexagon))) {
106
+ const dataProps = this._calculateH3DataProps(props);
107
+ this.setState(dataProps);
108
+ }
109
+ this._updateVertices(this.context.viewport);
110
+ }
111
+ _calculateH3DataProps(props) {
112
+ let resolution = -1;
113
+ let hasPentagon = false;
114
+ let hasMultipleRes = false;
115
+ const { iterable, objectInfo } = createIterable(props.data);
116
+ for (const object of iterable) {
117
+ objectInfo.index++;
118
+ const hexId = props.getHexagon(object, objectInfo);
119
+ // Take the resolution of the first hex
120
+ const hexResolution = h3GetResolution(hexId);
121
+ if (resolution < 0) {
122
+ resolution = hexResolution;
123
+ if (!props.highPrecision)
124
+ break;
125
+ }
126
+ else if (resolution !== hexResolution) {
127
+ hasMultipleRes = true;
128
+ break;
129
+ }
130
+ if (h3IsPentagon(hexId)) {
131
+ hasPentagon = true;
132
+ break;
133
+ }
134
+ }
135
+ return {
136
+ resolution,
137
+ edgeLengthKM: resolution >= 0 ? edgeLength(resolution, UNITS.km) : 0,
138
+ hasMultipleRes,
139
+ hasPentagon
140
+ };
141
+ }
142
+ _shouldUseHighPrecision() {
143
+ if (this.props.highPrecision === 'auto') {
144
+ const { resolution, hasPentagon, hasMultipleRes } = this.state;
145
+ const { viewport } = this.context;
146
+ return (viewport.resolution || hasMultipleRes || hasPentagon || (resolution >= 0 && resolution <= 5));
147
+ }
148
+ return this.props.highPrecision;
149
+ }
150
+ _updateVertices(viewport) {
151
+ if (this._shouldUseHighPrecision()) {
152
+ return;
153
+ }
154
+ const { resolution, edgeLengthKM, centerHex } = this.state;
155
+ if (resolution < 0) {
156
+ return;
157
+ }
158
+ const hex = this.props.centerHexagon || geoToH3(viewport.latitude, viewport.longitude, resolution);
159
+ if (centerHex === hex) {
160
+ return;
161
+ }
162
+ if (centerHex) {
163
+ const distance = h3Distance(centerHex, hex);
164
+ // h3Distance returns a negative number if the distance could not be computed
165
+ // due to the two indexes very far apart or on opposite sides of a pentagon.
166
+ if (distance >= 0 && distance * edgeLengthKM < UPDATE_THRESHOLD_KM) {
167
+ return;
168
+ }
169
+ }
170
+ const { unitsPerMeter } = viewport.distanceScales;
171
+ let vertices = h3ToPolygon(hex);
172
+ const [centerLat, centerLng] = h3ToGeo(hex);
173
+ const [centerX, centerY] = viewport.projectFlat([centerLng, centerLat]);
174
+ vertices = vertices.map(p => {
175
+ const worldPosition = viewport.projectFlat(p);
176
+ return [
177
+ (worldPosition[0] - centerX) / unitsPerMeter[0],
178
+ (worldPosition[1] - centerY) / unitsPerMeter[1]
179
+ ];
180
+ });
181
+ this.setState({ centerHex: hex, vertices });
182
+ }
183
+ renderLayers() {
184
+ return this._shouldUseHighPrecision() ? this._renderPolygonLayer() : this._renderColumnLayer();
185
+ }
186
+ _getForwardProps() {
187
+ const { elevationScale, material, coverage, extruded, wireframe, stroked, filled, lineWidthUnits, lineWidthScale, lineWidthMinPixels, lineWidthMaxPixels, getFillColor, getElevation, getLineColor, getLineWidth, transitions, updateTriggers } = this.props;
188
+ return {
189
+ elevationScale,
190
+ extruded,
191
+ coverage,
192
+ wireframe,
193
+ stroked,
194
+ filled,
195
+ lineWidthUnits,
196
+ lineWidthScale,
197
+ lineWidthMinPixels,
198
+ lineWidthMaxPixels,
199
+ material,
200
+ getElevation,
201
+ getFillColor,
202
+ getLineColor,
203
+ getLineWidth,
204
+ transitions,
205
+ updateTriggers: {
206
+ getFillColor: updateTriggers.getFillColor,
207
+ getElevation: updateTriggers.getElevation,
208
+ getLineColor: updateTriggers.getLineColor,
209
+ getLineWidth: updateTriggers.getLineWidth
210
+ }
211
+ };
212
+ }
213
+ _renderPolygonLayer() {
214
+ const { data, getHexagon, updateTriggers, coverage } = this.props;
215
+ const SubLayerClass = this.getSubLayerClass('hexagon-cell-hifi', PolygonLayer);
216
+ const forwardProps = this._getForwardProps();
217
+ forwardProps.updateTriggers.getPolygon = mergeTriggers(updateTriggers.getHexagon, coverage);
218
+ return new SubLayerClass(forwardProps, this.getSubLayerProps({
219
+ id: 'hexagon-cell-hifi',
220
+ updateTriggers: forwardProps.updateTriggers
221
+ }), {
222
+ data,
223
+ _normalize: false,
224
+ _windingOrder: 'CCW',
225
+ positionFormat: 'XY',
226
+ getPolygon: (object, objectInfo) => {
227
+ const hexagonId = getHexagon(object, objectInfo);
228
+ return h3ToPolygon(hexagonId, coverage, true);
229
+ }
230
+ });
231
+ }
232
+ _renderColumnLayer() {
233
+ const { data, getHexagon, updateTriggers } = this.props;
234
+ const SubLayerClass = this.getSubLayerClass('hexagon-cell', ColumnLayer);
235
+ const forwardProps = this._getForwardProps();
236
+ forwardProps.updateTriggers.getPosition = updateTriggers.getHexagon;
237
+ return new SubLayerClass(forwardProps, this.getSubLayerProps({
238
+ id: 'hexagon-cell',
239
+ flatShading: true,
240
+ updateTriggers: forwardProps.updateTriggers
241
+ }), {
242
+ data,
243
+ diskResolution: 6,
244
+ radius: 1,
245
+ vertices: this.state.vertices,
246
+ getPosition: getHexagonCentroid.bind(null, getHexagon)
247
+ });
248
+ }
249
+ }
250
+ H3HexagonLayer.defaultProps = defaultProps;
251
+ H3HexagonLayer.layerName = 'H3HexagonLayer';
@@ -0,0 +1,53 @@
1
+ import { Layer, CompositeLayer, CompositeLayerProps, UpdateParameters, DefaultProps, Viewport } from '@deck.gl/core/typed';
2
+ import type { ImageSourceMetadata, ImageType, ImageServiceType } from '@loaders.gl/wms';
3
+ import { ImageSource } from '@loaders.gl/wms';
4
+ /** All props supported by the TileLayer */
5
+ export declare type ImageryLayerProps = CompositeLayerProps<any> & _ImageryLayerProps;
6
+ /** Props added by the TileLayer */
7
+ declare type _ImageryLayerProps = {
8
+ serviceType?: ImageServiceType | 'auto';
9
+ layers?: string[];
10
+ srs?: 'EPSG:4326' | 'EPSG:3857' | 'auto';
11
+ onMetadataLoadStart?: () => void;
12
+ onMetadataLoadComplete?: (metadata: ImageSourceMetadata) => void;
13
+ onMetadataLoadError?: (error: Error) => void;
14
+ onImageLoadStart?: (requestId: unknown) => void;
15
+ onImageLoadComplete?: (requestId: unknown) => void;
16
+ onImageLoadError?: (requestId: unknown, error: Error) => void;
17
+ };
18
+ /**
19
+ * The layer is used in Hex Tile layer in order to properly discard invisible elements during animation
20
+ */
21
+ export declare class ImageryLayer<ExtraPropsT extends {} = {}> extends CompositeLayer<ExtraPropsT & Required<_ImageryLayerProps>> {
22
+ static layerName: string;
23
+ static defaultProps: DefaultProps;
24
+ state: {
25
+ imageSource: ImageSource;
26
+ image: ImageType;
27
+ srs: 'EPSG:4326' | 'EPSG:3857';
28
+ bounds: [number, number, number, number];
29
+ width: number;
30
+ height: number;
31
+ lastLoadedId: number;
32
+ _nextRequestId: number;
33
+ _timeoutId: any;
34
+ };
35
+ /** Lets deck.gl know that we want viewport change events */
36
+ shouldUpdateState(): boolean;
37
+ initializeState(): void;
38
+ updateState({ changeFlags, props, oldProps }: UpdateParameters<this>): void;
39
+ finalizeState(): void;
40
+ renderLayers(): Layer;
41
+ getFeatureInfoText(x: number, y: number): Promise<string | null>;
42
+ _createImageSource(props: ImageryLayerProps): ImageSource;
43
+ /** Run a getMetadata on the image service */
44
+ _loadMetadata(): Promise<void>;
45
+ /** Load an image */
46
+ loadImage(viewport: Viewport, reason: string): Promise<void>;
47
+ /** Global counter for issuing unique request ids */
48
+ private getRequestId;
49
+ /** Runs an action in the future, cancels it if the new action is issued before it executes */
50
+ private debounce;
51
+ }
52
+ export {};
53
+ //# sourceMappingURL=imagery-layer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"imagery-layer.d.ts","sourceRoot":"","sources":["../../src/imagery-layer/imagery-layer.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,EACL,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EAGT,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAC,mBAAmB,EAAE,SAAS,EAAE,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AACtF,OAAO,EAAC,WAAW,EAAoB,MAAM,iBAAiB,CAAC;AAG/D,2CAA2C;AAC3C,oBAAY,iBAAiB,GAAG,mBAAmB,CAAC,GAAG,CAAC,GAAG,kBAAkB,CAAC;AAE9E,mCAAmC;AACnC,aAAK,kBAAkB,GAAG;IACxB,WAAW,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAAC;IACxC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,GAAG,CAAC,EAAE,WAAW,GAAG,WAAW,GAAG,MAAM,CAAC;IACzC,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,sBAAsB,CAAC,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACjE,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAC7C,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,mBAAmB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACnD,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAC/D,CAAC;AAwBF;;GAEG;AACH,qBAAa,YAAY,CAAC,WAAW,SAAS,EAAE,GAAG,EAAE,CAAE,SAAQ,cAAc,CAC3E,WAAW,GAAG,QAAQ,CAAC,kBAAkB,CAAC,CAC3C;IACC,MAAM,CAAC,SAAS,SAAkB;IAClC,MAAM,CAAC,YAAY,EAAE,YAAY,CAAgB;IAEjD,KAAK,EAAG;QACN,WAAW,EAAE,WAAW,CAAC;QACzB,KAAK,EAAE,SAAS,CAAC;QACjB,GAAG,EAAE,WAAW,GAAG,WAAW,CAAC;QAC/B,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QACzC,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,EAAE,MAAM,CAAC;QAErB,cAAc,EAAE,MAAM,CAAC;QACvB,UAAU,EAAE,GAAG,CAAC;KACjB,CAAC;IAEF,4DAA4D;IACnD,iBAAiB,IAAI,OAAO;IAI5B,eAAe,IAAI,IAAI;IAMvB,WAAW,CAAC,EAAC,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IAgBzE,aAAa,IAAI,IAAI;IAIrB,YAAY,IAAI,KAAK;IAiBxB,kBAAkB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAsBtE,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,GAAG,WAAW;IAgBzD,6CAA6C;IACvC,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAepC,oBAAoB;IACd,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA+ClE,oDAAoD;IACpD,OAAO,CAAC,YAAY;IAIpB,8FAA8F;IAC9F,OAAO,CAAC,QAAQ;CAIjB"}
package/typed/index.js ADDED
@@ -0,0 +1,33 @@
1
+ // Copyright (c) 2015 - 2017 Uber Technologies, Inc.
2
+ //
3
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ // of this software and associated documentation files (the "Software"), to deal
5
+ // in the Software without restriction, including without limitation the rights
6
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ // copies of the Software, and to permit persons to whom the Software is
8
+ // furnished to do so, subject to the following conditions:
9
+ //
10
+ // The above copyright notice and this permission notice shall be included in
11
+ // all copies or substantial portions of the Software.
12
+ //
13
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ // THE SOFTWARE.
20
+ /* eslint-disable max-len */
21
+ export { default as GreatCircleLayer } from './great-circle-layer/great-circle-layer';
22
+ export { default as S2Layer } from './s2-layer/s2-layer';
23
+ export { default as QuadkeyLayer } from './quadkey-layer/quadkey-layer';
24
+ export { default as TileLayer } from './tile-layer/tile-layer';
25
+ export { default as TripsLayer } from './trips-layer/trips-layer';
26
+ export { default as H3ClusterLayer } from './h3-layers/h3-cluster-layer';
27
+ export { default as H3HexagonLayer } from './h3-layers/h3-hexagon-layer';
28
+ export { default as Tile3DLayer } from './tile-3d-layer/tile-3d-layer';
29
+ export { default as TerrainLayer } from './terrain-layer/terrain-layer';
30
+ export { default as MVTLayer } from './mvt-layer/mvt-layer';
31
+ export { getURLFromTemplate as _getURLFromTemplate } from './tile-layer/utils';
32
+ export { default as _Tileset2D } from './tile-layer/tileset-2d';
33
+ export { default as _Tile2DHeader } from './tile-layer/tile-2d-header';