m4-w-fast 1.0.13 → 1.0.14

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 (41) hide show
  1. package/README.md +54 -1
  2. package/dist/index.cjs +1 -6533
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.js +1 -1
  5. package/dist/index.mjs +1 -6531
  6. package/dist/intersect.worker.js +9 -9
  7. package/dist/isoBands.worker.js +1 -1
  8. package/dist/leaflet/leafletLayer.d.ts +8 -0
  9. package/dist/leaflet/leafletLayer.js +1 -0
  10. package/dist/leaflet/types.d.ts +42 -0
  11. package/dist/leaflet/types.js +1 -0
  12. package/dist/m4-w-fast.umd.js +1 -1
  13. package/dist/raster-overlay/color.d.ts +11 -0
  14. package/dist/raster-overlay/color.js +1 -0
  15. package/dist/raster-overlay/core.d.ts +31 -0
  16. package/dist/raster-overlay/core.js +1 -0
  17. package/dist/raster-overlay/index.cjs +2 -0
  18. package/dist/raster-overlay/index.d.ts +4 -0
  19. package/dist/raster-overlay/index.js +1 -0
  20. package/dist/raster-overlay/index.mjs +2 -0
  21. package/dist/raster-overlay/leaflet-renderers/cpuRenderer.d.ts +0 -0
  22. package/dist/raster-overlay/leaflet-renderers/cpuRenderer.js +1 -0
  23. package/dist/raster-overlay/leaflet-renderers/createRenderer.d.ts +3 -0
  24. package/dist/raster-overlay/leaflet-renderers/createRenderer.js +1 -0
  25. package/dist/raster-overlay/leaflet-renderers/renderer.d.ts +51 -0
  26. package/dist/raster-overlay/leaflet-renderers/renderer.js +1 -0
  27. package/dist/raster-overlay/leaflet-renderers/webgl2Renderer.d.ts +74 -0
  28. package/dist/raster-overlay/leaflet-renderers/webgl2Renderer.js +1 -0
  29. package/dist/raster-overlay/leaflet-renderers/webglRenderer.d.ts +0 -0
  30. package/dist/raster-overlay/leaflet-renderers/webglRenderer.js +1 -0
  31. package/dist/raster-overlay/leaflet-renderers/webgpuRenderer.d.ts +0 -0
  32. package/dist/raster-overlay/leaflet-renderers/webgpuRenderer.js +1 -0
  33. package/dist/raster-overlay/leafletLayer.d.ts +48 -0
  34. package/dist/raster-overlay/leafletLayer.js +1 -0
  35. package/dist/raster-overlay/m4-w-raster-overlay.umd.js +2 -0
  36. package/dist/raster-overlay/types.d.ts +114 -0
  37. package/dist/raster-overlay/types.js +1 -0
  38. package/dist/readFile.d.ts +7 -1
  39. package/dist/readFile.js +1 -1
  40. package/dist/types.d.ts +6 -0
  41. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ const _0x43bfd4=_0x5661;(function(_0x1b4cd,_0x283fd1){const _0x15b850=_0x5661,_0x45ea95=_0x1b4cd();while(!![]){try{const _0x7677ac=-parseInt(_0x15b850(0x1da))/0x1*(-parseInt(_0x15b850(0x1a6))/0x2)+parseInt(_0x15b850(0x1d6))/0x3*(-parseInt(_0x15b850(0x1a3))/0x4)+-parseInt(_0x15b850(0x1c7))/0x5+parseInt(_0x15b850(0x19b))/0x6+-parseInt(_0x15b850(0x1cf))/0x7+-parseInt(_0x15b850(0x1c2))/0x8*(-parseInt(_0x15b850(0x1ae))/0x9)+parseInt(_0x15b850(0x19f))/0xa*(parseInt(_0x15b850(0x1c5))/0xb);if(_0x7677ac===_0x283fd1)break;else _0x45ea95['push'](_0x45ea95['shift']());}catch(_0x38406c){_0x45ea95['push'](_0x45ea95['shift']());}}}(_0xdc56,0x2927b));const maxColorStops=0x20,defaultColorStops=[{'min':-Infinity,'max':Infinity,'color':[0x0,0x80,0xff]}],resolveLeaflet=_0xe66ef2=>{const _0x9a7260=_0x5661;if(_0xe66ef2)return _0xe66ef2;if(typeof window!=='undefined'){const _0x258408=window['L'];if(_0x258408)return _0x258408;}throw new Error(_0x9a7260(0x14c));},clampColor=_0x13e3c9=>Math[_0x43bfd4(0x15d)](0x0,Math['min'](0xff,Math[_0x43bfd4(0x189)](_0x13e3c9))),parseHexColor=_0x1b535f=>{const _0x3fd420=_0x43bfd4,_0x3d5adc=_0x1b535f['trim']();if(!_0x3d5adc['startsWith']('#'))return null;const _0x4571a5=_0x3d5adc['slice'](0x1),_0x430652=_0x4571a5[_0x3fd420(0x1cc)]===0x3?_0x4571a5[_0x3fd420(0x158)]('')[_0x3fd420(0x1ec)](_0x2f0284=>''+_0x2f0284+_0x2f0284)[_0x3fd420(0x13d)](''):_0x4571a5;if(_0x430652[_0x3fd420(0x1cc)]!==0x6)return null;const _0x2b0774=Number['parseInt'](_0x430652[_0x3fd420(0x152)](0x0,0x2),0x10),_0xe93dc3=Number[_0x3fd420(0x17b)](_0x430652[_0x3fd420(0x152)](0x2,0x4),0x10),_0x5cd0a1=Number[_0x3fd420(0x17b)](_0x430652['slice'](0x4,0x6),0x10);if([_0x2b0774,_0xe93dc3,_0x5cd0a1][_0x3fd420(0x197)](Number['isNaN']))return null;return[_0x2b0774,_0xe93dc3,_0x5cd0a1];},parseRgbColor=_0x209631=>{const _0x57d1eb=_0x43bfd4,_0x5a6129=_0x209631[_0x57d1eb(0x1b0)](/rgba?\(([^)]+)\)/i);if(!_0x5a6129?.[0x1])return null;const _0x977983=_0x5a6129[0x1][_0x57d1eb(0x158)](',')[_0x57d1eb(0x1ec)](_0x44a205=>Number(_0x44a205[_0x57d1eb(0x1e2)]())),_0x5d9bdc=_0x977983[0x0],_0x3dedb0=_0x977983[0x1],_0x2ed29a=_0x977983[0x2];if(_0x5d9bdc==null||_0x3dedb0==null||_0x2ed29a==null||[_0x5d9bdc,_0x3dedb0,_0x2ed29a][_0x57d1eb(0x197)](Number[_0x57d1eb(0x1c8)]))return null;return[clampColor(_0x5d9bdc),clampColor(_0x3dedb0),clampColor(_0x2ed29a)];},parseColor=_0x5f4b48=>{const _0x176924=_0x43bfd4;if(typeof _0x5f4b48===_0x176924(0x1d3))return parseHexColor(_0x5f4b48)??parseRgbColor(_0x5f4b48)??[0x0,0x0,0x0];return[clampColor(_0x5f4b48[0x0]),clampColor(_0x5f4b48[0x1]),clampColor(_0x5f4b48[0x2])];},normalizeColorStops=_0x2e27c7=>_0x2e27c7['slice'](0x0,maxColorStops)[_0x43bfd4(0x1ec)](_0x184274=>({'min':_0x184274[_0x43bfd4(0x198)],'max':_0x184274['max'],'color':parseColor(_0x184274[_0x43bfd4(0x167)])})),normalizeGrid=_0x42fc5f=>{const _0xfb061=_0x43bfd4,_0x12efdc=_0x42fc5f[_0xfb061(0x15a)]+_0x42fc5f['gjLng']*(_0x42fc5f['nx']-0x1),_0x272ea8=_0x42fc5f[_0xfb061(0x139)]+_0x42fc5f[_0xfb061(0x163)]*(_0x42fc5f['ny']-0x1),_0x29c6bf=Math['min'](_0x42fc5f['minLng'],_0x12efdc),_0x3e676e=Math['max'](_0x42fc5f[_0xfb061(0x15a)],_0x12efdc),_0x9c74a7=Math['min'](_0x42fc5f[_0xfb061(0x139)],_0x272ea8),_0xce5b42=Math[_0xfb061(0x15d)](_0x42fc5f['minLat'],_0x272ea8),_0xf85ba7=new Float32Array(_0x42fc5f['nx']*_0x42fc5f['ny']);for(let _0x148a64=0x0;_0x148a64<_0x42fc5f['ny'];_0x148a64++){const _0x410bb2=_0x42fc5f[_0xfb061(0x163)]>0x0?_0x42fc5f['ny']-0x1-_0x148a64:_0x148a64;for(let _0x1fbe64=0x0;_0x1fbe64<_0x42fc5f['nx'];_0x1fbe64++){const _0x5e41ee=Number(_0x42fc5f[_0xfb061(0x166)][_0x410bb2*_0x42fc5f['nx']+_0x1fbe64]);_0xf85ba7[_0x148a64*_0x42fc5f['nx']+_0x1fbe64]=Number[_0xfb061(0x164)](_0x5e41ee)?_0x5e41ee:Number['NaN'];}}return{'height':_0x42fc5f['ny'],'maxLat':_0xce5b42,'maxLng':_0x3e676e,'minLat':_0x9c74a7,'minLng':_0x29c6bf,'valueScale':0x1,'values':_0xf85ba7,'width':_0x42fc5f['nx']};};export const createM4LeafletColorStops=(_0x5cfd79,_0x414079)=>_0x5cfd79[_0x43bfd4(0x1ec)]((_0x412b6a,_0x5d1985)=>({'min':_0x412b6a,'max':_0x5cfd79[_0x5d1985+0x1]??Infinity,'color':_0x414079[_0x5d1985]??_0x414079[_0x414079[_0x43bfd4(0x1cc)]-0x1]??[0x0,0x80,0xff]}));function _0xdc56(){const _0x572fd2=['handleMapChanged','clearAnimationTransform','activeTexture','map','texture','minLat','point','off','getPixelOrigin','join','u_viewport','uniform3fv','colorStopCount','absolute','setPosition','setGrid','TEXTURE_WRAP_T','clear','createShader','positionBuffer','GPU\x20程序创建失败','TEXTURE_2D','GPU\x20uniform\x20不存在:\x20','NEAREST','请通过\x20options.leaflet\x20传入\x20Leaflet\x20实例,或先在浏览器全局挂载\x20window.L','u_gridBounds','renderedZoom','syncCanvasToMap','add','maxValue','slice','shaderSource','_latLngBoundsToNewLayerBounds','u_colorStopCount','getPane','getUniform','split','u_colorStopMaxs','minLng','colors','valueTexture','max','\x20超过\x20GPU\x20纹理上限\x20','renderedViewport','minValue','options','latLngBounds','gjLat','isFinite','colorStops','values','color','attachShader','handleMapMove','gridBounds','FRAGMENT_SHADER','u_range','opacity','redraw','GPU\x20程序链接失败','_map','moveFrame','bindBuffer','renderFrame','LINK_STATUS','uniform2f','deleteProgram','setColorRange','top','smooth','height','parseInt','pointerEvents','style','handleZoomAnimation','texParameteri','colorStopMins','render','bindTexture','range','zoomanim','getUniformLocation','gridData','appendChild','getZoom','round','getZoomScale','COMPILE_STATUS','drawArrays','getShaderInfoLog','texImage2D','enableVertexAttribArray','moveend\x20zoomend\x20resize\x20viewreset','uniforms','leaflet','vertexAttribPointer','devicePixelRatio','GPU\x20着色器创建失败','overlayPane','some','min','colorStopMaxs','useProgram','790818EfseFm','none','center','renderMode','1129670zEWVec','requestRender','u_mapMeta','uniform1fv','1065964TcrJIq','getProgramInfoLog','deleteBuffer','40046tZyMYY','layerPointToLatLng','STATIC_DRAW','当前浏览器不支持\x20WebGL2,无法启用\x20Leaflet\x20栅格图层','destroyGpu','TEXTURE_MIN_FILTER','getShaderParameter','maxLng','9ImjLiM','mapMeta','match','requestAnimationFrame','u_noData','setRenderMode','remove','noData','cancelAnimationFrame','deleteTexture','valueScale','containerPointToLayerPoint','TEXTURE_WRAP_S','onAdd','FLOAT','move','getPanes','CLAMP_TO_EDGE','getProgramParameter','forEach','888232wMqPdN','u_renderMode','webgl2','33wmjFeg','u_valueTexture','718855ZauACb','isNaN','COLOR_BUFFER_BIT','program','canvas','length','onRemove','create','1842393yQjmGl','pixelStorei','width','uniform4f','string','step','UNPACK_ALIGNMENT','3sSqNNM','breaks','pane','uploadGridTexture','13vCbgDS','latLngToLayerPoint','ARRAY_BUFFER','#version\x20300\x20es\x0ain\x20vec2\x20a_position;\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20gl_Position\x20=\x20vec4(a_position,\x200.0,\x201.0);\x0a}\x0a','createProgram','colorStopColors','getZoomedBoundsTopLeft','clearColor','trim','GPU\x20着色器编译失败','DomUtil','getContext','uniform1i','left','NaN'];_0xdc56=function(){return _0x572fd2;};return _0xdc56();}export const normalizeM4LeafletOptions=_0x23de59=>({..._0x23de59,'colorStops':_0x23de59[_0x43bfd4(0x165)]??createM4LeafletColorStops(_0x23de59[_0x43bfd4(0x1d7)]??[],_0x23de59[_0x43bfd4(0x15b)]??[])});export const createM4LeafletLayer=(_0x50bc5f,_0x4103cf)=>{const _0x3c1e55=_0x43bfd4,_0x1877d4=resolveLeaflet(_0x4103cf[_0x3c1e55(0x192)]),_0x3562c3=normalizeM4LeafletOptions(_0x4103cf),_0x698082=_0x3562c3[_0x3c1e55(0x165)][_0x3c1e55(0x1cc)]?_0x3562c3['colorStops']:defaultColorStops,_0x4e86d3=normalizeColorStops(_0x698082);class _0x55a5fb extends _0x1877d4['Layer']{[_0x3c1e55(0x1cb)]=null;['gl']=null;[_0x3c1e55(0x186)]=normalizeGrid(_0x50bc5f);[_0x3c1e55(0x151)]=_0x3562c3[_0x3c1e55(0x151)]??_0x4e86d3[_0x4e86d3[_0x3c1e55(0x1cc)]-0x1]?.[_0x3c1e55(0x15d)]??Infinity;[_0x3c1e55(0x160)]=_0x3562c3['minValue']??_0x4e86d3[0x0]?.[_0x3c1e55(0x198)]??-Infinity;[_0x3c1e55(0x16d)]=_0x3562c3[_0x3c1e55(0x16d)]??0.82;['program']=null;[_0x3c1e55(0x173)]=0x0;[_0x3c1e55(0x171)]=0x0;[_0x3c1e55(0x15f)]=null;[_0x3c1e55(0x14e)]=0x0;['renderMode']=_0x3562c3['renderMode']??_0x3c1e55(0x1d4);[_0x3c1e55(0x138)]=null;['handleMapChanged']=()=>{const _0x83aadc=_0x3c1e55;this[_0x83aadc(0x1ea)](),this[_0x83aadc(0x14f)](),this[_0x83aadc(0x1a0)]();};[_0x3c1e55(0x169)]=()=>{const _0x4439bd=_0x3c1e55;if(!this['_map']||this[_0x4439bd(0x170)][_0x4439bd(0x188)]()!==this[_0x4439bd(0x14e)])return;if(this[_0x4439bd(0x171)])return;this[_0x4439bd(0x171)]=window[_0x4439bd(0x1b1)](()=>{const _0x47c802=_0x4439bd;this['moveFrame']=0x0,this[_0x47c802(0x1ea)](),this['syncCanvasToMap'](),this[_0x47c802(0x1a0)]();});};[_0x3c1e55(0x17e)]=_0x156290=>{const _0xe49903=_0x3c1e55;if(!this[_0xe49903(0x170)]||!this[_0xe49903(0x1cb)]||!this['renderedViewport'])return;const _0x5ed9dc=this[_0xe49903(0x170)][_0xe49903(0x18a)](_0x156290['zoom'],this[_0xe49903(0x14e)]),_0x214782=_0x1877d4[_0xe49903(0x162)](this[_0xe49903(0x170)][_0xe49903(0x1a7)]([this[_0xe49903(0x15f)]['left'],this[_0xe49903(0x15f)]['top']+this[_0xe49903(0x15f)][_0xe49903(0x17a)]]),this[_0xe49903(0x170)][_0xe49903(0x1a7)]([this[_0xe49903(0x15f)][_0xe49903(0x1e7)]+this[_0xe49903(0x15f)][_0xe49903(0x1d1)],this[_0xe49903(0x15f)]['top']])),_0x35eb99=this[_0xe49903(0x1e0)](_0x214782,_0x156290['zoom'],_0x156290[_0xe49903(0x19d)]);_0x1877d4[_0xe49903(0x1e4)]['setTransform'](this[_0xe49903(0x1cb)],_0x35eb99,_0x5ed9dc);};[_0x3c1e55(0x1bb)](_0x55e6d1){const _0x499b8f=_0x3c1e55;this[_0x499b8f(0x1cb)]=_0x1877d4['DomUtil'][_0x499b8f(0x1ce)](_0x499b8f(0x1cb),'leaflet-layer\x20leaflet-zoom-animated\x20m4-leaflet-layer'),this[_0x499b8f(0x1cb)][_0x499b8f(0x17d)]['position']=_0x499b8f(0x141),this[_0x499b8f(0x1cb)][_0x499b8f(0x17d)][_0x499b8f(0x17c)]=_0x499b8f(0x19c),this[_0x499b8f(0x1cb)][_0x499b8f(0x17d)]['opacity']='1';const _0x1c7863=this[_0x499b8f(0x161)][_0x499b8f(0x1d8)]?_0x55e6d1[_0x499b8f(0x156)](this[_0x499b8f(0x161)]['pane']):_0x55e6d1[_0x499b8f(0x1be)]()[_0x499b8f(0x196)];_0x1c7863?.[_0x499b8f(0x187)](this[_0x499b8f(0x1cb)]),this['gl']=this[_0x499b8f(0x1cb)][_0x499b8f(0x1e5)](_0x499b8f(0x1c4),{'alpha':!![],'antialias':![],'depth':![],'premultipliedAlpha':![],'preserveDrawingBuffer':!![],'stencil':![]});if(!this['gl'])throw new Error(_0x499b8f(0x1a9));return this[_0x499b8f(0x1ca)]=this['createProgram'](this['gl']),this[_0x499b8f(0x1d9)](),this[_0x499b8f(0x14f)](),_0x55e6d1['on'](_0x499b8f(0x1bd),this[_0x499b8f(0x169)]),_0x55e6d1['on']('moveend\x20zoomend\x20resize\x20viewreset',this['handleMapChanged']),_0x55e6d1['on']('zoomanim',this[_0x499b8f(0x17e)]),this[_0x499b8f(0x1a0)](),this;}[_0x3c1e55(0x1cd)](_0x25e80b){const _0x4f30c4=_0x3c1e55;return _0x25e80b['off'](_0x4f30c4(0x1bd),this[_0x4f30c4(0x169)]),_0x25e80b['off'](_0x4f30c4(0x190),this[_0x4f30c4(0x1e9)]),_0x25e80b[_0x4f30c4(0x13b)](_0x4f30c4(0x184),this[_0x4f30c4(0x17e)]),this[_0x4f30c4(0x171)]&&(window[_0x4f30c4(0x1b6)](this[_0x4f30c4(0x171)]),this[_0x4f30c4(0x171)]=0x0),this[_0x4f30c4(0x173)]&&(window[_0x4f30c4(0x1b6)](this[_0x4f30c4(0x173)]),this[_0x4f30c4(0x173)]=0x0),this[_0x4f30c4(0x1aa)](),this[_0x4f30c4(0x1cb)]?.[_0x4f30c4(0x1b4)](),this[_0x4f30c4(0x1cb)]=null,this;}['getSnapshotCanvas'](){return this['canvas'];}[_0x3c1e55(0x16e)](){const _0x2bac1d=_0x3c1e55;return this[_0x2bac1d(0x1a0)](),this;}[_0x3c1e55(0x177)](_0xa28cce){const _0x3737bf=_0x3c1e55;this['minValue']=Math['min'](_0xa28cce[_0x3737bf(0x160)],_0xa28cce['maxValue']),this[_0x3737bf(0x151)]=Math['max'](_0xa28cce[_0x3737bf(0x160)],_0xa28cce['maxValue']),this[_0x3737bf(0x1a0)]();}[_0x3c1e55(0x143)](_0x3492f1){const _0xcbff25=_0x3c1e55;this[_0xcbff25(0x186)]=normalizeGrid(_0x3492f1),this[_0xcbff25(0x1d9)](),this[_0xcbff25(0x1a0)]();}[_0x3c1e55(0x1b3)](_0x116a3c){const _0x95c606=_0x3c1e55;this[_0x95c606(0x19e)]=_0x116a3c,this[_0x95c606(0x1a0)]();}[_0x3c1e55(0x1ea)](){const _0x53a271=_0x3c1e55;if(!this[_0x53a271(0x1cb)])return;this['canvas'][_0x53a271(0x17d)]['transform']='';}[_0x3c1e55(0x14f)](){const _0x5af252=_0x3c1e55;if(!this[_0x5af252(0x170)]||!this[_0x5af252(0x1cb)])return;const _0x1a2339=this[_0x5af252(0x170)]['getSize'](),_0x53e2f2=Math[_0x5af252(0x189)](_0x1a2339['x']*0.5),_0x5d6018=Math[_0x5af252(0x189)](_0x1a2339['y']*0.5),_0x16051a=this[_0x5af252(0x170)][_0x5af252(0x1b9)]([-_0x53e2f2,-_0x5d6018]),_0x53fb16=window[_0x5af252(0x194)]||0x1,_0x16c491=_0x1a2339['x']+_0x53e2f2*0x2,_0x3d7916=_0x1a2339['y']+_0x5d6018*0x2,_0x34abb5=Math[_0x5af252(0x15d)](0x1,Math[_0x5af252(0x189)](_0x16c491*_0x53fb16)),_0x4f8264=Math[_0x5af252(0x15d)](0x1,Math['round'](_0x3d7916*_0x53fb16));_0x1877d4[_0x5af252(0x1e4)][_0x5af252(0x142)](this[_0x5af252(0x1cb)],_0x16051a),this[_0x5af252(0x1cb)][_0x5af252(0x17d)][_0x5af252(0x1d1)]=_0x16c491+'px',this[_0x5af252(0x1cb)][_0x5af252(0x17d)][_0x5af252(0x17a)]=_0x3d7916+'px',this[_0x5af252(0x15f)]={'height':_0x3d7916,'left':_0x16051a['x'],'top':_0x16051a['y'],'width':_0x16c491},(this[_0x5af252(0x1cb)][_0x5af252(0x1d1)]!==_0x34abb5||this[_0x5af252(0x1cb)][_0x5af252(0x17a)]!==_0x4f8264)&&(this[_0x5af252(0x1cb)]['width']=_0x34abb5,this[_0x5af252(0x1cb)][_0x5af252(0x17a)]=_0x4f8264);}[_0x3c1e55(0x1a0)](){const _0x3b57f1=_0x3c1e55;if(this[_0x3b57f1(0x173)])return;this['renderFrame']=window[_0x3b57f1(0x1b1)](()=>{const _0x2c2651=_0x3b57f1;this[_0x2c2651(0x173)]=0x0,this[_0x2c2651(0x181)]();});}[_0x3c1e55(0x181)](){const _0x152b22=_0x3c1e55;if(!this['_map']||!this[_0x152b22(0x1cb)]||!this['gl']||!this[_0x152b22(0x1ca)]||!this[_0x152b22(0x138)])return;const _0x1370e7=this['gl'],_0x3e58b5=this[_0x152b22(0x1ca)],_0x463574=window[_0x152b22(0x194)]||0x1,_0xd5990f=this[_0x152b22(0x170)][_0x152b22(0x188)](),_0x3fa7a8=this['renderedViewport'],_0x4f9e78=_0x3fa7a8?this[_0x152b22(0x170)]['getPixelOrigin']()[_0x152b22(0x150)]([_0x3fa7a8[_0x152b22(0x1e7)],_0x3fa7a8[_0x152b22(0x178)]]):this[_0x152b22(0x170)][_0x152b22(0x13c)](),_0x1dfd01=new Float32Array(maxColorStops),_0x45afb7=new Float32Array(maxColorStops),_0x541039=new Float32Array(maxColorStops*0x3);_0x4e86d3[_0x152b22(0x1c1)]((_0x2581b6,_0x576650)=>{const _0x48f34c=_0x152b22;_0x1dfd01[_0x576650]=_0x2581b6[_0x48f34c(0x198)],_0x45afb7[_0x576650]=_0x2581b6['max'],_0x541039[_0x576650*0x3]=_0x2581b6[_0x48f34c(0x167)][0x0]/0xff,_0x541039[_0x576650*0x3+0x1]=_0x2581b6[_0x48f34c(0x167)][0x1]/0xff,_0x541039[_0x576650*0x3+0x2]=_0x2581b6[_0x48f34c(0x167)][0x2]/0xff;}),_0x1370e7['viewport'](0x0,0x0,this[_0x152b22(0x1cb)][_0x152b22(0x1d1)],this['canvas'][_0x152b22(0x17a)]),_0x1370e7[_0x152b22(0x1e1)](0x0,0x0,0x0,0x0),_0x1370e7[_0x152b22(0x145)](_0x1370e7[_0x152b22(0x1c9)]),_0x1370e7[_0x152b22(0x19a)](_0x3e58b5[_0x152b22(0x1ca)]),_0x1370e7[_0x152b22(0x172)](_0x1370e7[_0x152b22(0x1dc)],_0x3e58b5[_0x152b22(0x147)]),_0x1370e7[_0x152b22(0x18f)](0x0),_0x1370e7[_0x152b22(0x193)](0x0,0x2,_0x1370e7['FLOAT'],![],0x0,0x0),_0x1370e7[_0x152b22(0x1eb)](_0x1370e7['TEXTURE0']),_0x1370e7['bindTexture'](_0x1370e7[_0x152b22(0x149)],this['texture']),_0x1370e7[_0x152b22(0x1e6)](_0x3e58b5[_0x152b22(0x191)][_0x152b22(0x15c)],0x0),_0x1370e7[_0x152b22(0x175)](_0x3e58b5[_0x152b22(0x191)]['viewport'],this[_0x152b22(0x1cb)][_0x152b22(0x1d1)],this['canvas'][_0x152b22(0x17a)]),_0x1370e7[_0x152b22(0x1d2)](_0x3e58b5[_0x152b22(0x191)][_0x152b22(0x1af)],_0x4f9e78['x'],_0x4f9e78['y'],_0xd5990f,_0x463574),_0x1370e7[_0x152b22(0x1d2)](_0x3e58b5[_0x152b22(0x191)][_0x152b22(0x16a)],this[_0x152b22(0x186)]['minLng'],this[_0x152b22(0x186)][_0x152b22(0x1ad)],this[_0x152b22(0x186)]['minLat'],this[_0x152b22(0x186)]['maxLat']),_0x1370e7[_0x152b22(0x1d2)](_0x3e58b5['uniforms']['gridMeta'],this[_0x152b22(0x186)]['width'],this[_0x152b22(0x186)]['height'],this[_0x152b22(0x186)][_0x152b22(0x1b8)],this['canvas'][_0x152b22(0x1d1)]/_0x463574),_0x1370e7['uniform1f'](_0x3e58b5[_0x152b22(0x191)][_0x152b22(0x1b5)],Number[_0x152b22(0x1e8)]),_0x1370e7[_0x152b22(0x1d2)](_0x3e58b5[_0x152b22(0x191)][_0x152b22(0x183)],this[_0x152b22(0x160)],this['maxValue'],this[_0x152b22(0x16d)],_0x4e86d3[_0x4e86d3['length']-0x1]?.[_0x152b22(0x198)]??this['maxValue']),_0x1370e7[_0x152b22(0x1e6)](_0x3e58b5[_0x152b22(0x191)][_0x152b22(0x19e)],this[_0x152b22(0x19e)]===_0x152b22(0x179)?0x1:0x0),_0x1370e7[_0x152b22(0x1e6)](_0x3e58b5[_0x152b22(0x191)][_0x152b22(0x140)],_0x4e86d3['length']),_0x1370e7['uniform1fv'](_0x3e58b5[_0x152b22(0x191)][_0x152b22(0x180)],_0x1dfd01),_0x1370e7[_0x152b22(0x1a2)](_0x3e58b5[_0x152b22(0x191)][_0x152b22(0x199)],_0x45afb7),_0x1370e7[_0x152b22(0x13f)](_0x3e58b5[_0x152b22(0x191)][_0x152b22(0x1df)],_0x541039),_0x1370e7[_0x152b22(0x18c)](_0x1370e7['TRIANGLES'],0x0,0x6),this[_0x152b22(0x14e)]=_0xd5990f;}[_0x3c1e55(0x1e0)](_0x3b59d4,_0x15f6bc,_0x2da919){const _0x37faaa=_0x3c1e55;if(!this[_0x37faaa(0x170)])return _0x1877d4[_0x37faaa(0x13a)](0x0,0x0);const _0x405c88=this[_0x37faaa(0x170)];if(_0x405c88[_0x37faaa(0x154)])return _0x405c88[_0x37faaa(0x154)](_0x3b59d4,_0x15f6bc,_0x2da919)[_0x37faaa(0x198)]??_0x1877d4[_0x37faaa(0x13a)](0x0,0x0);return this[_0x37faaa(0x170)][_0x37faaa(0x1db)](_0x3b59d4['getNorthWest']());}[_0x3c1e55(0x1d9)](){const _0x3ae6d8=_0x3c1e55;if(!this['gl'])return;const _0xba6b65=this['gl'],_0x3808ee=_0xba6b65['getParameter'](_0xba6b65['MAX_TEXTURE_SIZE']);if(this[_0x3ae6d8(0x186)]['width']>_0x3808ee||this[_0x3ae6d8(0x186)][_0x3ae6d8(0x17a)]>_0x3808ee)throw new Error('当前\x20MICAPS4\x20尺寸\x20'+this[_0x3ae6d8(0x186)][_0x3ae6d8(0x1d1)]+'x'+this[_0x3ae6d8(0x186)][_0x3ae6d8(0x17a)]+_0x3ae6d8(0x15e)+_0x3808ee);this[_0x3ae6d8(0x138)]=this[_0x3ae6d8(0x138)]??_0xba6b65['createTexture']();if(!this[_0x3ae6d8(0x138)])throw new Error('GPU\x20纹理创建失败');_0xba6b65[_0x3ae6d8(0x182)](_0xba6b65[_0x3ae6d8(0x149)],this[_0x3ae6d8(0x138)]),_0xba6b65[_0x3ae6d8(0x1d0)](_0xba6b65[_0x3ae6d8(0x1d5)],0x1),_0xba6b65[_0x3ae6d8(0x17f)](_0xba6b65[_0x3ae6d8(0x149)],_0xba6b65[_0x3ae6d8(0x1ab)],_0xba6b65[_0x3ae6d8(0x14b)]),_0xba6b65[_0x3ae6d8(0x17f)](_0xba6b65[_0x3ae6d8(0x149)],_0xba6b65['TEXTURE_MAG_FILTER'],_0xba6b65[_0x3ae6d8(0x14b)]),_0xba6b65[_0x3ae6d8(0x17f)](_0xba6b65[_0x3ae6d8(0x149)],_0xba6b65[_0x3ae6d8(0x1ba)],_0xba6b65[_0x3ae6d8(0x1bf)]),_0xba6b65['texParameteri'](_0xba6b65[_0x3ae6d8(0x149)],_0xba6b65[_0x3ae6d8(0x144)],_0xba6b65[_0x3ae6d8(0x1bf)]),_0xba6b65[_0x3ae6d8(0x18e)](_0xba6b65['TEXTURE_2D'],0x0,_0xba6b65['R32F'],this[_0x3ae6d8(0x186)]['width'],this['gridData'][_0x3ae6d8(0x17a)],0x0,_0xba6b65['RED'],_0xba6b65[_0x3ae6d8(0x1bc)],this[_0x3ae6d8(0x186)]['values']);}[_0x3c1e55(0x1de)](_0x2a1842){const _0x1e20af=_0x3c1e55,_0xb6a6d6=this[_0x1e20af(0x146)](_0x2a1842,_0x2a1842['VERTEX_SHADER'],vertexSource),_0x557c8c=this[_0x1e20af(0x146)](_0x2a1842,_0x2a1842[_0x1e20af(0x16b)],fragmentSource),_0x1ebd9b=_0x2a1842[_0x1e20af(0x1de)](),_0x59da40=_0x2a1842['createBuffer']();if(!_0x1ebd9b||!_0x59da40)throw new Error(_0x1e20af(0x148));_0x2a1842[_0x1e20af(0x168)](_0x1ebd9b,_0xb6a6d6),_0x2a1842[_0x1e20af(0x168)](_0x1ebd9b,_0x557c8c),_0x2a1842['bindAttribLocation'](_0x1ebd9b,0x0,'a_position'),_0x2a1842['linkProgram'](_0x1ebd9b);if(!_0x2a1842[_0x1e20af(0x1c0)](_0x1ebd9b,_0x2a1842[_0x1e20af(0x174)]))throw new Error(_0x2a1842[_0x1e20af(0x1a4)](_0x1ebd9b)||_0x1e20af(0x16f));return _0x2a1842[_0x1e20af(0x172)](_0x2a1842[_0x1e20af(0x1dc)],_0x59da40),_0x2a1842['bufferData'](_0x2a1842['ARRAY_BUFFER'],new Float32Array([-0x1,-0x1,0x1,-0x1,-0x1,0x1,-0x1,0x1,0x1,-0x1,0x1,0x1]),_0x2a1842[_0x1e20af(0x1a8)]),{'program':_0x1ebd9b,'positionBuffer':_0x59da40,'uniforms':{'colorStopCount':this['getUniform'](_0x2a1842,_0x1ebd9b,_0x1e20af(0x155)),'colorStopMaxs':this[_0x1e20af(0x157)](_0x2a1842,_0x1ebd9b,_0x1e20af(0x159)),'colorStopMins':this[_0x1e20af(0x157)](_0x2a1842,_0x1ebd9b,'u_colorStopMins'),'colorStopColors':this['getUniform'](_0x2a1842,_0x1ebd9b,'u_colorStopColors'),'gridBounds':this[_0x1e20af(0x157)](_0x2a1842,_0x1ebd9b,_0x1e20af(0x14d)),'gridMeta':this['getUniform'](_0x2a1842,_0x1ebd9b,'u_gridMeta'),'mapMeta':this[_0x1e20af(0x157)](_0x2a1842,_0x1ebd9b,_0x1e20af(0x1a1)),'noData':this[_0x1e20af(0x157)](_0x2a1842,_0x1ebd9b,_0x1e20af(0x1b2)),'range':this[_0x1e20af(0x157)](_0x2a1842,_0x1ebd9b,_0x1e20af(0x16c)),'renderMode':this['getUniform'](_0x2a1842,_0x1ebd9b,_0x1e20af(0x1c3)),'valueTexture':this[_0x1e20af(0x157)](_0x2a1842,_0x1ebd9b,_0x1e20af(0x1c6)),'viewport':this[_0x1e20af(0x157)](_0x2a1842,_0x1ebd9b,_0x1e20af(0x13e))}};}[_0x3c1e55(0x146)](_0x3715b5,_0x1b29c0,_0x119818){const _0x472d0e=_0x3c1e55,_0x1651fe=_0x3715b5['createShader'](_0x1b29c0);if(!_0x1651fe)throw new Error(_0x472d0e(0x195));_0x3715b5[_0x472d0e(0x153)](_0x1651fe,_0x119818),_0x3715b5['compileShader'](_0x1651fe);if(!_0x3715b5[_0x472d0e(0x1ac)](_0x1651fe,_0x3715b5[_0x472d0e(0x18b)]))throw new Error(_0x3715b5[_0x472d0e(0x18d)](_0x1651fe)||_0x472d0e(0x1e3));return _0x1651fe;}[_0x3c1e55(0x157)](_0x5540d7,_0x4fff66,_0x27a8a7){const _0x2234a6=_0x3c1e55,_0x2ea9d5=_0x5540d7[_0x2234a6(0x185)](_0x4fff66,_0x27a8a7);if(!_0x2ea9d5)throw new Error(_0x2234a6(0x14a)+_0x27a8a7);return _0x2ea9d5;}[_0x3c1e55(0x1aa)](){const _0x4f7ffc=_0x3c1e55;if(!this['gl'])return;this['texture']&&(this['gl'][_0x4f7ffc(0x1b7)](this[_0x4f7ffc(0x138)]),this['texture']=null),this[_0x4f7ffc(0x1ca)]&&(this['gl'][_0x4f7ffc(0x1a5)](this['program'][_0x4f7ffc(0x147)]),this['gl'][_0x4f7ffc(0x176)](this[_0x4f7ffc(0x1ca)][_0x4f7ffc(0x1ca)]),this[_0x4f7ffc(0x1ca)]=null),this['gl']=null;}}return new _0x55a5fb(_0x3562c3);};function _0x5661(_0x36fc19,_0x3f4a20){const _0x56614c=_0xdc56();return _0x5661=function(_0x4d71fd,_0xdac197){_0x4d71fd=_0x4d71fd-0x138;let _0x26dbaa=_0x56614c[_0x4d71fd];return _0x26dbaa;},_0x5661(_0x36fc19,_0x3f4a20);}const vertexSource=_0x43bfd4(0x1dd),fragmentSource='#version\x20300\x20es\x0aprecision\x20highp\x20float;\x0aprecision\x20highp\x20sampler2D;\x0a\x0aconst\x20int\x20MAX_COLOR_STOPS\x20=\x2032;\x0aconst\x20float\x20PI\x20=\x203.141592653589793;\x0a\x0auniform\x20sampler2D\x20u_valueTexture;\x0auniform\x20vec2\x20u_viewport;\x0auniform\x20vec4\x20u_mapMeta;\x0auniform\x20vec4\x20u_gridBounds;\x0auniform\x20vec4\x20u_gridMeta;\x0auniform\x20float\x20u_noData;\x0auniform\x20vec4\x20u_range;\x0auniform\x20int\x20u_renderMode;\x0auniform\x20int\x20u_colorStopCount;\x0auniform\x20float\x20u_colorStopMins[MAX_COLOR_STOPS];\x0auniform\x20float\x20u_colorStopMaxs[MAX_COLOR_STOPS];\x0auniform\x20vec3\x20u_colorStopColors[MAX_COLOR_STOPS];\x0a\x0aout\x20vec4\x20outColor;\x0a\x0afloat\x20clampValue(float\x20value,\x20float\x20minValue,\x20float\x20maxValue)\x20{\x0a\x20\x20\x20\x20return\x20min(max(value,\x20minValue),\x20maxValue);\x0a}\x0a\x0afloat\x20getGridValue(int\x20x,\x20int\x20y)\x20{\x0a\x20\x20\x20\x20float\x20value\x20=\x20texelFetch(u_valueTexture,\x20ivec2(x,\x20y),\x200).r;\x0a\x0a\x20\x20\x20\x20if\x20(!isnan(u_noData)\x20&&\x20value\x20==\x20u_noData)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x20u_noData;\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20return\x20value\x20*\x20u_gridMeta.z;\x0a}\x0a\x0abool\x20isValidValue(float\x20value)\x20{\x0a\x20\x20\x20\x20return\x20!isnan(value)\x20&&\x20(isnan(u_noData)\x20||\x20value\x20!=\x20u_noData);\x0a}\x0a\x0afloat\x20sampleGrid(float\x20lng,\x20float\x20lat)\x20{\x0a\x20\x20\x20\x20if\x20(lng\x20<\x20u_gridBounds.x\x20||\x20lng\x20>\x20u_gridBounds.y\x20||\x20lat\x20<\x20u_gridBounds.z\x20||\x20lat\x20>\x20u_gridBounds.w)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x200.0\x20/\x200.0;\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20float\x20width\x20=\x20u_gridMeta.x;\x0a\x20\x20\x20\x20float\x20height\x20=\x20u_gridMeta.y;\x0a\x20\x20\x20\x20float\x20x\x20=\x20((lng\x20-\x20u_gridBounds.x)\x20/\x20(u_gridBounds.y\x20-\x20u_gridBounds.x))\x20*\x20(width\x20-\x201.0);\x0a\x20\x20\x20\x20float\x20y\x20=\x20((u_gridBounds.w\x20-\x20lat)\x20/\x20(u_gridBounds.w\x20-\x20u_gridBounds.z))\x20*\x20(height\x20-\x201.0);\x0a\x20\x20\x20\x20int\x20x0\x20=\x20int(floor(x));\x0a\x20\x20\x20\x20int\x20y0\x20=\x20int(floor(y));\x0a\x20\x20\x20\x20int\x20x1\x20=\x20min(x0\x20+\x201,\x20int(width)\x20-\x201);\x0a\x20\x20\x20\x20int\x20y1\x20=\x20min(y0\x20+\x201,\x20int(height)\x20-\x201);\x0a\x20\x20\x20\x20float\x20dx\x20=\x20x\x20-\x20float(x0);\x0a\x20\x20\x20\x20float\x20dy\x20=\x20y\x20-\x20float(y0);\x0a\x20\x20\x20\x20float\x20topLeft\x20=\x20getGridValue(x0,\x20y0);\x0a\x20\x20\x20\x20float\x20topRight\x20=\x20getGridValue(x1,\x20y0);\x0a\x20\x20\x20\x20float\x20bottomLeft\x20=\x20getGridValue(x0,\x20y1);\x0a\x20\x20\x20\x20float\x20bottomRight\x20=\x20getGridValue(x1,\x20y1);\x0a\x0a\x20\x20\x20\x20if\x20(!isValidValue(topLeft)\x20||\x20!isValidValue(topRight)\x20||\x20!isValidValue(bottomLeft)\x20||\x20!isValidValue(bottomRight))\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x200.0\x20/\x200.0;\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20float\x20top\x20=\x20mix(topLeft,\x20topRight,\x20dx);\x0a\x20\x20\x20\x20float\x20bottom\x20=\x20mix(bottomLeft,\x20bottomRight,\x20dx);\x0a\x0a\x20\x20\x20\x20return\x20mix(top,\x20bottom,\x20dy);\x0a}\x0a\x0avec4\x20getStepColor(float\x20value)\x20{\x0a\x20\x20\x20\x20for\x20(int\x20index\x20=\x200;\x20index\x20<\x20MAX_COLOR_STOPS;\x20index\x20+=\x201)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20(index\x20>=\x20u_colorStopCount)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20break;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20(value\x20>=\x20u_colorStopMins[index]\x20&&\x20value\x20<\x20u_colorStopMaxs[index])\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20vec4(u_colorStopColors[index],\x201.0);\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20return\x20vec4(0.0);\x0a}\x0a\x0avec4\x20getSmoothColor(float\x20value)\x20{\x0a\x20\x20\x20\x20if\x20(u_colorStopCount\x20<=\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x20vec4(0.0);\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20if\x20(value\x20<=\x20u_colorStopMins[0])\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x20vec4(u_colorStopColors[0],\x201.0);\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20int\x20lastIndex\x20=\x20u_colorStopCount\x20-\x201;\x0a\x0a\x20\x20\x20\x20if\x20(value\x20>=\x20u_colorStopMins[lastIndex])\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20return\x20vec4(u_colorStopColors[lastIndex],\x201.0);\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20for\x20(int\x20index\x20=\x200;\x20index\x20<\x20MAX_COLOR_STOPS\x20-\x201;\x20index\x20+=\x201)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20(index\x20>=\x20lastIndex)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20break;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20(value\x20>=\x20u_colorStopMins[index]\x20&&\x20value\x20<=\x20u_colorStopMins[index\x20+\x201])\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20float\x20ratio\x20=\x20(value\x20-\x20u_colorStopMins[index])\x20/\x20(u_colorStopMins[index\x20+\x201]\x20-\x20u_colorStopMins[index]);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20vec4(mix(u_colorStopColors[index],\x20u_colorStopColors[index\x20+\x201],\x20clampValue(ratio,\x200.0,\x201.0)),\x201.0);\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20return\x20vec4(0.0);\x0a}\x0a\x0avoid\x20main()\x20{\x0a\x20\x20\x20\x20vec2\x20cssPoint\x20=\x20vec2(gl_FragCoord.x\x20/\x20u_mapMeta.w,\x20(u_viewport.y\x20-\x20gl_FragCoord.y)\x20/\x20u_mapMeta.w);\x0a\x20\x20\x20\x20float\x20scale\x20=\x20256.0\x20*\x20exp2(u_mapMeta.z);\x0a\x20\x20\x20\x20float\x20worldX\x20=\x20u_mapMeta.x\x20+\x20cssPoint.x;\x0a\x20\x20\x20\x20float\x20worldY\x20=\x20u_mapMeta.y\x20+\x20cssPoint.y;\x0a\x20\x20\x20\x20float\x20lng\x20=\x20worldX\x20/\x20scale\x20*\x20360.0\x20-\x20180.0;\x0a\x20\x20\x20\x20float\x20n\x20=\x20PI\x20-\x202.0\x20*\x20PI\x20*\x20worldY\x20/\x20scale;\x0a\x20\x20\x20\x20float\x20lat\x20=\x20degrees(atan(sinh(n)));\x0a\x20\x20\x20\x20float\x20value\x20=\x20sampleGrid(lng,\x20lat);\x0a\x20\x20\x20\x20float\x20lastMin\x20=\x20u_range.w;\x0a\x0a\x20\x20\x20\x20if\x20(!isValidValue(value)\x20||\x20value\x20<\x20u_range.x\x20||\x20value\x20>\x20u_range.y)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20vec4\x20color\x20=\x20u_renderMode\x20==\x201\x20?\x20getSmoothColor(value)\x20:\x20getStepColor(value);\x0a\x0a\x20\x20\x20\x20if\x20(color.a\x20<=\x200.0)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20discard;\x0a\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20float\x20alpha\x20=\x20(value\x20>=\x20lastMin\x20?\x20230.0\x20:\x20215.0)\x20/\x20255.0\x20*\x20clampValue(u_range.z,\x200.0,\x201.0);\x0a\x0a\x20\x20\x20\x20outColor\x20=\x20vec4(color.rgb,\x20alpha);\x0a}\x0a';
@@ -0,0 +1,42 @@
1
+ import type * as L from 'leaflet';
2
+ export type M4LeafletRenderMode = 'step' | 'smooth';
3
+ export interface M4LeafletColorStop {
4
+ min: number;
5
+ max: number;
6
+ color: [number, number, number] | [number, number, number, number] | string;
7
+ }
8
+ export interface M4LeafletGrid {
9
+ gjLat: number;
10
+ gjLng: number;
11
+ maxLat: number;
12
+ maxLng: number;
13
+ minLat: number;
14
+ minLng: number;
15
+ nx: number;
16
+ ny: number;
17
+ values: number[];
18
+ }
19
+ export interface M4LeafletLayerOptions extends L.LayerOptions {
20
+ colorStops: M4LeafletColorStop[];
21
+ leaflet?: typeof L;
22
+ maxValue?: number;
23
+ minValue?: number;
24
+ opacity?: number;
25
+ renderMode?: M4LeafletRenderMode;
26
+ }
27
+ export interface M4LeafletLayerInputOptions extends Omit<M4LeafletLayerOptions, 'colorStops'> {
28
+ breaks?: number[];
29
+ colors?: M4LeafletColorStop['color'][];
30
+ colorStops?: M4LeafletColorStop[];
31
+ }
32
+ export interface M4LeafletColorRange {
33
+ maxValue: number;
34
+ minValue: number;
35
+ }
36
+ export interface M4LeafletLayer extends L.Layer {
37
+ getSnapshotCanvas: () => HTMLCanvasElement | null;
38
+ redraw: () => M4LeafletLayer;
39
+ setColorRange: (range: M4LeafletColorRange) => void;
40
+ setGrid: (grid: M4LeafletGrid) => void;
41
+ setRenderMode: (renderMode: M4LeafletRenderMode) => void;
42
+ }
@@ -0,0 +1 @@
1
+ export{};