@iweather-js/iweather-gl 0.0.3 → 0.0.6

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.
@@ -11,5 +11,5 @@ export declare const DEF_MAP_CONFIG: {
11
11
  huanan: Bounds;
12
12
  };
13
13
  };
14
- export declare function test(): string;
14
+ export declare function test2(): string;
15
15
  //# sourceMappingURL=map.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/config/map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,eAAO,MAAM,cAAc;;eAEqB,MAAM;gBACN,MAAM;eACL,MAAM;eACf,MAAM;eACN,MAAM;gBACJ,MAAM;iBACL,MAAM;gBACP,MAAM;;CAE/C,CAAC;AAEF,wBAAgB,IAAI,IAAI,MAAM,CAE7B"}
1
+ {"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/config/map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,eAAO,MAAM,cAAc;;eAEqB,MAAM;gBACN,MAAM;eACL,MAAM;eACf,MAAM;eACN,MAAM;gBACJ,MAAM;iBACL,MAAM;gBACP,MAAM;;CAE/C,CAAC;AAEF,wBAAgB,KAAK,IAAI,MAAM,CAE9B"}
package/dist/index.d.ts CHANGED
@@ -34,5 +34,4 @@ export * from './map/mapInitState';
34
34
  export * from './map/markerMgr';
35
35
  export * from './map/markerHover';
36
36
  export * from './map/mapAutoRotation';
37
- export declare function test22(): string;
38
37
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAE5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AAEtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAE3B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AAEzB,cAAc,cAAc,CAAC;AAE7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAE/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AAEtC,wBAAgB,MAAM,IAAI,MAAM,CAE/B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAE5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AAEtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAE3B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AAEzB,cAAc,cAAc,CAAC;AAE7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAE/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC"}
package/dist/index.js CHANGED
@@ -1981,6 +1981,6 @@ void main() {
1981
1981
  fColor = texture(u_image, v_uv);
1982
1982
  fColor.a *= 0.85;
1983
1983
  }
1984
- `}}class u5{fetchers;mock;constructor(e){this.fetchers=e.fetchers,this.mock=e.mock}}class c5{getDefOptions(){let e=this.getDataReqOptions({}),t=this.getDataResOptions({}),o=Object.keys(e).reduce((y,i)=>{return y[i]={enable:!1},y},{}),p=Object.keys(t).reduce((y,i)=>{return y[i]=void 0,y},{});return{...o,...p}}}class d5{params;layerMgrMap=void 0;constructor(e){this.params=e}getDefLayerOptions(){let e=this.layerMgrMap||this.params.createLayers();return Object.keys(e).reduce((t,o)=>{return t[o]={enable:!1},t},{})}}class M5{productMap={};products=[];groupConfig;constructor(e){e.products.reduce((t,o)=>{return t[o.type]=o,t},this.productMap),this.groupConfig=e.groupConfig,this.products=Object.values(this.productMap)}initCtx(e){Object.values(this.productMap).forEach((t)=>{t.initCtx(e)})}findProduct(e){return this.productMap[e]}get firstProduct(){return Object.values(this.productMap)[0]}}class P5{cityList;boundsPadding;isAddCityMask;customCityCoordinate={};constructor(e){this.cityList=e.cityListOptions,this.boundsPadding=e.boundsPadding||{top:0,bottom:0,left:0,right:0},this.isAddCityMask=e.isAddCityMask||!1}findCityInfo(e){let{china:t,province:o,city:p,county:y}=e,i=t?.gb||o?.gb||p?.gb||y?.gb,n=e.county?.geojson_boundary||e.city?.geojson_boundary||e.province?.geojson_boundary||e.china?.geojson_boundary;return{...this.cityList.find((s)=>s.adcode===i),maskGeoJson:n}}}import{SubscribeMgr as F5}from"@iweather-js/iweather-lib";import{debounce as b5,isEqual as a4,pick as f5}from"lodash-es";class _5{ctx;subscribeMgr=new F5;enabledLayerMgrs={};async mount(e){this.ctx=e;let{gisStore:t,configStore:o}=e,{map:p}=e.gisStore.getState();if(!p)return;t.getState().apply({type:"changeValue",value:{allLayerMgrs:o.getState().layerMgrConfig.params.createLayers()}});let{allLayerMgrs:y}=t.getState(),{dataReqOptionsConfig:i}=this.ctx.configStore.getState();this.subscribeMgr.add(this.ctx.gisStore.subscribe((a)=>{return{dataReqOptions:i.getDataReqOptions(a),allLayerOptopns:a.query.allLayerOptopns()}},async(a,s)=>{let l=a.allLayerOptopns,g=t.getState().query.enabledLayerOptopns(),u=f5(y,Object.keys(g));if(await Promise.all(Object.keys(y).map(async(m)=>{let c=y[m],P=l[m];if(c.initCtx(e,m),c.setEnable(P.enable),c.enable)await c.mount(P),c.setLayerOptions(P);else c.unmount()})),!a4(a.dataReqOptions,s.dataReqOptions))Object.values(u).forEach((m)=>m.loadData());else Object.values(u).forEach((m)=>{if(m.checkIsLoadData())m.loadData()});this.enabledLayerMgrs=u,console.info("[enabled layerMgrs]:",this.enabledLayerMgrs)},{equalityFn:a4,fireImmediately:!0}));let n=b5(()=>{Object.values(this.enabledLayerMgrs).forEach((a)=>a.boundsChange(p.getBounds()))},100);p.on("moveend",n),this.subscribeMgr.add(()=>{p.off("moveend",n)})}onUnmount(){this.subscribeMgr.dispose(),Object.values(this.ctx.gisStore.getState().allLayerMgrs).forEach((e)=>e.unmount())}}import{SubscribeMgr as v5}from"@iweather-js/iweather-lib";import{isEqual as h2}from"lodash-es";class h5{layerMgrHub;ctx;subscribeMgr=new v5;constructor(e){this.layerMgrHub=e}async mount(e){this.ctx=e,this.subscribeMgr.add(this.ctx.gisStore.subscribe((t)=>{let o=this.ctx.gisStore.getState();return{layersData:t.layersData,productType:t.productType,playMode:t.playMode,dataReqOptions:this.ctx.configStore.getState().dataReqOptionsConfig.getDataReqOptions(o)}},(t)=>{let{productType:o,playMode:p}=t,{productConfig:y}=this.ctx.configStore.getState(),n=y.findProduct(o).getTimeBarInfo(this.ctx.gisStore.getState());this.ctx.gisStore.getState().apply({type:"changeValue",value:{timeBarInfo:n,currTm:n?p==="timing"?n.timingTimeBar.initTime:n.frameTimeBar?.initTime:void 0}})},{equalityFn:h2,fireImmediately:!0})),this.subscribeMgr.add(this.ctx.gisStore.subscribe((t)=>t.currTm,(t)=>Object.values(this.layerMgrHub.enabledLayerMgrs).forEach((o)=>o.timeChange(t)),{equalityFn:h2})),this.subscribeMgr.add(this.ctx.gisStore.subscribe((t)=>t.devCustomGrayImageByMercator,(t)=>{Object.values(this.layerMgrHub.enabledLayerMgrs).forEach((o)=>o.loadData())},{equalityFn:h2}))}onUnmount(){this.subscribeMgr.dispose()}}import{clamp as x5}from"lodash-es";function C5(e,t){let o=t[0],p=t[1];return(x5(e,o,p)-o)/(p-o)}class x2{isDestroyed=!1;data=[];curr=void 0;setData(e){this.data=e.sort((t,o)=>t.beginTm-o.beginTm)}addData(e){this.data=[...this.data,...e].sort((t,o)=>t.beginTm-o.beginTm)}first(){return this.data[0]}find(e){let t=this.data.findLastIndex((o)=>e>=o.beginTm);if(t===-1)this.curr={data1:void 0,data2:void 0,p:0};else{let o=this.data[t],p=this.data[t+1],y=C5(e,[o.beginTm,o.endTm]);this.curr={data1:o,data2:p,p:y}}return this.curr}isEmpty(){return this.data.length===0}destroy(){this.isDestroyed=!0,this.data=[]}}import{AbortControllersMgr as L5}from"@iweather-js/iweather-lib";class T5{abortControllersMgr=new L5;setDataRes(e,t){e.gisStore.getState().apply({type:"changeValue",value:t})}onBeforeLoadData(e){return}async loadData(e){this.onBeforeLoadData(e);let t=await this.onLoadData(e),o=await this.onChangeDataRes(e,t);if(o)this.setDataRes(e,o);return t}abort(){this.abortControllersMgr.abort()}async onChangeDataRes(e,t){return}async loadMaxValue(e,t){return null}}import{AbortControllersMgr as I5,SubscribeMgr as D5}from"@iweather-js/iweather-lib";import{debounce as O5,isEqual as G5}from"lodash-es";class k5{props;enable=!0;isMounted=!1;data;layerOptions;prevLayerOptions;ctx;layerName;subscribeMgr=D5.create();isReload=!1;abortControllersMgr=new I5;dataFindMgrs=[];constructor(e){this.props=e}initCtx(e,t){return this.ctx=e,this.layerName=t,this}getLayerInfo(e){return""}get dataLoaderMgr(){return this.props.dataLoaderMgr}get map(){return this.ctx.gisStore.getState().map}getGisValue(){return this.ctx.gisStore.getState()}setLayerOptions(e){if(this.prevLayerOptions=this.layerOptions,this.layerOptions=e,!this.enable)return;if(!this.isMounted)return;if(!this.map)return;if(!this.ctx.gisStore.getState().mapIsLoaded)return;if(G5(e,this.prevLayerOptions))return;this.onLayerOptionsChange(e,this.prevLayerOptions)}checkIsLoadData(){if(!this.layerOptions)return!1;return this.onIsLoadData(this.layerOptions,this.prevLayerOptions)}async mount(e){if(!this.enable)return this;if(this.isMounted)return this;if(!this.map)return this;if(!this.ctx.gisStore.getState().mapIsLoaded)return this;return await this.onMount(e),this.isMounted=!0,this}static toLayerId(e){return`${e}-layer`}toLayerId(e,t=""){if(t)return`${e}-${t}-layer`;return`${e}-layer`}toSourceId(e){return`${e}-source`}setLayerVisible(e,t,o=!0){let p=o?this.toLayerId(e):e;if(this.map&&!!this.map.getLayer(p))this.map.setLayoutProperty(p,"visibility",t?"visible":"none")}isLayerVisible(e,t=!0){let o=t?this.toLayerId(e):e;return this.map?.getLayoutProperty(o,"visibility")==="visible"}getBeforeLayerId(e){return e&&!!this.map.getLayer(e)?e:void 0}removeLayerAndSource(e){this.removeMapLayer(this.toLayerId(e)),this.removeMapSource(this.toSourceId(e))}removeMapLayer(e){try{if(this.map.getLayer(e))this.map.removeLayer(e)}catch(t){console.error("[removeMapLayer]",t)}}removeMapSource(e){try{if(this.map.getSource(e))this.map.removeSource(e)}catch(t){console.error("[removeMapSource]",t)}}addMapLayer(e,t){return this.map.addLayer(e,this.getBeforeLayerId(t)),e}unmount(){if(!this.isMounted)return;this.isMounted=!1,this.clear(),this.onUnmount(),this.clearStoreData(),this.layerOptions=void 0,this.dataLoaderMgr?.abort(),this.abortControllersMgr.abort(),this.subscribeMgr.dispose()}timeChange(e){if(!this.enable)return;if(!this.map)return;if(!this.isMounted)return;let t=e??this.ctx.gisStore.getState().currTm;if(t)this.onTimeChange(t)}playStateChange(e){if(!this.enable)return;this.onPlayStateChange(e)}onPlayStateChange(e){}saveDataToStore(e){if(!this.layerName)return;let t=this.onTimingData(e);this.ctx.gisStore.getState().apply({type:"setLayersData",name:this.layerName,data:t})}clearStoreData(){if(!this.layerName)return;this.ctx.gisStore.getState().apply({type:"setLayersData",name:this.layerName,data:void 0})}async initData(e){if(!this.enable)return;if(!this.isMounted)return;if(!this.map)return;this.data=e,this.saveDataToStore(e),await this.onInitData(e),this.timeChange()}beforeReloadData(){}async loadData(){if(!this.enable)return;if(!this.isMounted)return;if(!this.dataLoaderMgr)return;if(this.beforeReloadData(),this.clear(),this.dataLoaderMgr.loadData(this.ctx).then((e)=>{this.initData(e)}),this.isReload)this.reloadMaxValue();if(this.isReload===!1)this.isReload=!0}boundsChange(e){this.reloadMaxValue()}reloadMaxValue=O5(async()=>{if(!this.enable)return;if(!this.isMounted)return;if(!this.map)return;if(!this.dataLoaderMgr)return;let e=await this.dataLoaderMgr.loadMaxValue(this.ctx,this.map.getBounds());if(e)this.onMaxValueChange(e)},300);onMaxValueChange(e){}clear(){this.onClear(),this.destroyDataFindMgrs(),this.timeChange()}onClear(){}createDataFindMgr(){let e=new x2;return this.dataFindMgrs.push(e),e}destroyDataFindMgrs(){this.dataFindMgrs.forEach((e)=>e.destroy())}setEnable(e){this.enable=e}}import{format as s4}from"date-fns";class E5{type;_ctx;constructor(e){this.type=e}getUpdateGisValueEffect(e,t){return}getDisplayLayerInfos(e){return[]}getSubGroupName(){return""}supportedForecastModels(){return[]}isSupportedMultiModelContrast(){return this.supportedForecastModels().length>1}getDefConfig(e){return J1(this.ctx,{layerOptions:{...e?.layerOptions},gisStyleOptions:{...e?.gisStyleOptions}})}initCtx(e){this._ctx=e}get ctx(){if(!this._ctx)throw Error("ctx is not initialized");return this._ctx}formatCurrTime(e){return s4(new Date(e),"yyyy/MM/dd HH:mm")}formatTimeBar(e){let t=new Date(e).getHours();return{value:s4(new Date(e),"M/d HH:mm"),highlight:t===8}}isNew(){return!1}}function $(e,t){if(!e)return;switch(t.type){case"setProjectionType":e.setProjection({type:t.projectionType});break;case"setShowSky":if(t.showSky)e.setSky({"atmosphere-blend":["interpolate",["linear"],["zoom"],0,1,2,0,7,0]}),e.setLight({anchor:"map",position:[1.5,90,80]});else e.setSky(void 0),e.setLight(void 0);break;case"disableZoom":if(t.isDisable)e.scrollZoom.disable();else e.scrollZoom.enable();break;case"disableMove":if(t.isDisable)e.dragPan.disable();else e.dragPan.enable();break;case"setBaseState":{t.center!==void 0&&e.setCenter(t.center),t.zoom!==void 0&&e.setZoom(t.zoom),t.maxZoom!==void 0&&e.setMaxZoom(t.maxZoom),t.minZoom!==void 0&&e.setMinZoom(t.minZoom),t.bearing!==void 0&&e.setBearing(t.bearing),t.pitch!==void 0&&e.setPitch(t.pitch);break}case"flyTo":if(t.zoom!==void 0&&t.center!==void 0&&t.pitch!==void 0&&t.bearing!==void 0)e.flyTo({zoom:t.zoom,center:t.center,pitch:t.pitch,bearing:t.bearing},{animate:!!t.duration,duration:t.duration??0});break;case"fitBounds":if(t.bounds)e.fitBounds(t.bounds,{animate:!!t.duration,duration:t.duration??0});break}}import A5 from"maplibre-gl";function Lr(e,t){let{center:o,zoom:p,pitch:y,bearing:i,bounds:n}=t.gisStore.getState();return new A5.Map({container:e,style:{version:8,glyphs:"/huishang/assets/map/glyphs/{fontstack}/{range}.pbf",sources:{},layers:[]},center:o,zoom:p,pitch:y,bearing:i,bounds:n,maxPitch:80,maplibreLogo:!1,canvasContextAttributes:{preserveDrawingBuffer:!0}})}import V5 from"mitt";var c1=V5();function C1(e){let t=e.getPitch(),o=e.getBearing(),p=e.getBounds(),y=e.getCenter().toArray(),i=e.getZoom();return{pitch:t,bearing:o,zoom:i,bounds:[Number(p.getWest().toFixed(6)),Number(p.getSouth().toFixed(6)),Number(p.getEast().toFixed(6)),Number(p.getNorth().toFixed(6))],center:y}}function Er(e){let{gisStore:t}=e,{map:o}=t.getState();if(!o)return;let p=()=>{if(!o)return;let{enableScreenshot:y,screenshot:i}=t.getState(),{bounds:n}=C1(o);if(!n)return;if(!y)return;let a=o.getCanvas().toDataURL("image/jpeg",0.5);if(i&&!i.startsWith("data:image")){console.info("检测截图:",i);try{let s=i.substring(i.lastIndexOf("/")+1).split("_")[1];if(s.substring(0,s.lastIndexOf("."))===n.map((g)=>g.toFixed(2)).join("|")){console.info("截图未变化,不进行截图修改:",i);return}}catch(s){console.error("截图解析错误:",i);return}}t.getState().apply({type:"changeValue",value:{screenshot:a}})};return o.on("idle",p),()=>{o.off("idle",p)}}function wr(e){let{gisStore:t}=e,{mapId:o,map:p,mapGroup:y}=t.getState();if(!p)return;let i=!1,n=()=>{if(!p)return;if(i)return;if(!t.getState().enableMapSync)return;c1.emit("syncMapMove",{fromMapGroup:y,fromMapId:o,state:C1(p)})},a=(s)=>{if(s.fromMapId===o)return;if(!s.fromMapGroup||s.fromMapGroup!==y)return;if(!t.getState().enableMapSync)return;i=!0,p.jumpTo({center:s.state.center,zoom:s.state.zoom,bearing:s.state.bearing,pitch:s.state.pitch}),i=!1};return p.on("move",n),c1.on("syncMapMove",a),()=>{p.off("move",n),c1.off("syncMapMove",a)}}import{isEqual as B5}from"lodash-es";function Zr(e){let{gisStore:t,configStore:o}=e,{mapId:p,map:y,mapGroup:i}=t.getState();if(!y)return;let n=!1,a=t.subscribe((l)=>l.currTm,(l)=>{if(n)return;if(!t.getState().enableMapSyncTime)return;if(!l)return;c1.emit("syncTime",{fromMapGroup:i,fromMapId:p,currTm:l})},{equalityFn:B5}),s=(l)=>{if(l.fromMapId===p)return;if(!l.fromMapGroup||l.fromMapGroup!==i)return;if(!t.getState().enableMapSyncTime)return;if(!o.getState().dataReqOptionsConfig.enableTimeSync(t.getState()))return;n=!0,t.getState().apply({type:"changeValue",value:{currTm:l.currTm}}),n=!1};return c1.on("syncTime",s),()=>{c1.off("syncTime",s),a()}}import{debounce as g4}from"lodash-es";function Qr(e){let{gisStore:t}=e,{map:o}=t.getState();if(!o)return;let p=!1,y=g4(()=>{p=!1},1000),i=g4(()=>{if(p)return;t.getState().apply({type:"changeValue",value:{mapStateToStoreSyncing:!0}}),t.getState().apply({type:"changeValue",value:C1(o)}),t.getState().apply({type:"changeValue",value:{mapStateToStoreSyncing:!1}})},500);o.on("zoomend",i),o.on("moveend",i),o.on("pitchend",i),o.on("resize",()=>{p=!0,$(o,{type:"fitBounds",bounds:t.getState().bounds}),y()})}import{isEqual as e2}from"lodash-es";function Rr(e){let{gisStore:t}=e,{map:o}=t.getState();t.subscribe((p)=>p.projectionType,(p)=>{if(t.getState().mapStateToStoreSyncing)return;$(o,{type:"setProjectionType",projectionType:p})},{equalityFn:e2}),t.subscribe((p)=>p.showSky,(p)=>{if(t.getState().mapStateToStoreSyncing)return;$(o,{type:"setShowSky",showSky:p})},{equalityFn:e2}),t.subscribe((p)=>p.disableZoom,(p)=>{if(t.getState().mapStateToStoreSyncing)return;$(o,{type:"disableZoom",isDisable:p})},{equalityFn:e2}),t.subscribe((p)=>p.bounds,(p)=>{if(t.getState().mapStateToStoreSyncing)return;$(o,{type:"fitBounds",bounds:p,duration:1000})},{equalityFn:e2})}function tp(e,t){let{gisStore:o}=t;setTimeout(()=>{e.resize()},1);let{showSky:p,projectionType:y,disableZoom:i,disableMove:n,boundsPadding:a,bounds:s,maxZoom:l,minZoom:g,mapBackgroundColor:u,renderWorldCopies:m,boundsLockMinZoom:c}=o.getState();if(e.setMaxZoom(l),e.setMinZoom(g),$(e,{type:"setShowSky",showSky:p}),$(e,{type:"disableZoom",isDisable:i}),$(e,{type:"disableMove",isDisable:n}),$(e,{type:"setProjectionType",projectionType:y}),e.setRenderWorldCopies(m),s)e.fitBounds(s,{animate:!1,duration:0,padding:a});if(c&&s)e.setMinZoom(e.cameraForBounds(s,{padding:a})?.zoom);e.setStyle({...e.getStyle(),layers:[{id:"background",type:"background",layout:{visibility:"visible"},paint:{"background-color":u||"transparent","background-opacity":1}}]})}import N5 from"maplibre-gl";class N1{infoMarker=null;infoMarkerEl=null;static map={};static getInstance(e){if(!N1.map[e])N1.map[e]=new N1;return N1.map[e]}constructor(){this.infoMarkerEl=document.createElement("div"),this.infoMarkerEl.className="hidden",this.infoMarker=new N5.Marker({element:this.infoMarkerEl})}hide(e){try{this.infoMarker?.removeClassName("visible"),this.infoMarker?.addClassName("invisible"),e.getCanvas().style.cursor="grab"}catch(t){console.info("MarkerMgr hide error")}}show(e,t){try{this.infoMarker.setLngLat(t.lngLat).addTo(e),this.infoMarker.removeClassName("invisible"),this.infoMarker.addClassName("visible"),this.infoMarkerEl.innerHTML=t.html,e.getCanvas().style.cursor="pointer"}catch(o){console.info("MarkerMgr show error")}}setEnable(e){if(e)this.infoMarker.removeClassName("hidden");else this.infoMarker.addClassName("hidden")}}import w5 from"maplibre-gl";class b1{static timer=null;static infoMarker;static infoMarkerEl;static hide(e){if(this.timer)clearTimeout(this.timer);this.timer=setTimeout(()=>{b1.infoMarker.removeClassName("marker_visible"),this.timer=null,e.getCanvas().style.cursor="grab"},300)}static show(e,t){if(this.timer)clearTimeout(this.timer);if(!b1.infoMarker)b1.infoMarkerEl=document.createElement("div"),b1.infoMarkerEl.className="marker font-[JinBuTi]",b1.infoMarker=new w5.Marker({element:b1.infoMarkerEl});let{lng:o,lat:p}=t;this.infoMarker.setLngLat({lat:p,lng:o}).addTo(e).addClassName("marker_visible"),this.infoMarkerEl.innerHTML=t.html,e.getCanvas().style.cursor="pointer"}}import{isEqual as W5}from"lodash-es";var w1=null,t2=!1,C2=!1,J5=0.1;function l4(e){let{gisStore:t}=e,{map:o}=t.getState();if(C2&&o){let p=o.getCenter();o.panTo([p.lng+J5,p.lat],{animate:!1})}requestAnimationFrame(()=>l4(e))}function gp(e){let{gisStore:t}=e,o=t.getState().map;if(!o)throw Error("map is not found");let p=()=>{let{autoRotation:n}=t.getState();if(!n)return;if(n.bounds)$(o,{type:"fitBounds",bounds:n.bounds,duration:500});else if(n.pos)$(o,{type:"flyTo",center:n.pos.center,zoom:n.pos.zoom,duration:500});setTimeout(()=>{if(t2)C2=!0},500)},y=()=>{if(w1)clearTimeout(w1);C2=!1},i=()=>{let n=t.getState().autoRotation?.speed;if(!n)return;if(w1)clearTimeout(w1);w1=setTimeout(()=>{if(t2)p()},n)};o.on("dragend",i),o.on("mouseup",i),o.on("zoomend",i),o.on("touchend",i),o.on("mousedown",y),o.on("dragstart",y),o.on("touchstart",y),o.on("wheel",y),t.subscribe((n)=>n.autoRotation?.enable&&n.projectionType==="globe",(n)=>{if(!n)t2=!1,y();else t2=!0,p()},{fireImmediately:!0,equalityFn:W5}),l4(e)}function mp(){return"test1133"}export{K2 as wrapLongitude,B4 as wrapBounds,A2 as toGisValue,a6 as toColorPaletteFns,q6 as toAdcodeInfoVo,mp as test22,$5 as test,Rr as syncStoreStateToMapHandler,Qr as syncMapStateToStoreHandler,m6 as scaleColorPaletteConfig,p6 as readImageWithWindExif,r6 as readImageWithCommonExif,X2 as parseExifDataRangeWithWind,Z2 as parseExifDataRange,u2 as parseExifBounds,H7 as parseExif3dSize,k7 as mapgl,Zr as mapSyncTimeHandler,wr as mapSyncMoveHandler,c1 as mapSyncEvent,Er as mapScreenshotHandler,gp as mapAutoRotation,$ as mapAction,tp as initMapState,q2 as getVisibleWraps,Q2 as getViewportBounds,W6 as getProvinceNames,e3 as getProvince,C1 as getMapState,V6 as getLand,E2 as getInitValue,J1 as getGisValue,d4 as getDefLayerOptions,c4 as getDefGisStyleOptions,r3 as getCounty,t3 as getCity,R2 as getChina,C7 as createMultiMapStatusStore,Lr as createMap,H2 as createGridMesh,d7 as createGisStore,f7 as createConfigStore,Q7 as createColorPalette,S4 as WindColorLayer,h5 as TimeMgrHub,T4 as StepRangeUnit,I2 as PlaySpeedByTiming,D2 as PlaySpeedByFrame,z5 as PROJECTION_TYPES,m5 as MaskedDataLayer,F2 as MaskLayer,N1 as MarkerMgr,i5 as Maplibre3DProfileLayerV3,r5 as Maplibre3DProfileLayerV0,e5 as Maplibre3DProfileLayer,f8 as MapLibreWindParticleLayer,_5 as LayerMgrHub,H5 as LEVEL_MAP_HIGHLIGHT_VALUE,Q5 as LEVELS,M5 as IProductConfig,E5 as IProduct,S as INFINITY_VALUE,d5 as ILayerMgrConfig,k5 as ILayerMgr,c5 as IDataReqOptionsConfig,u5 as IDataFetchConfig,P5 as ICityConfig,b1 as HoverMarker,l5 as GridWindValueLayer,F8 as GridWindLayer,g5 as GridValueLayer,y2 as GridRenderIconSize,W1 as GridDensity,e7 as GRID_ICON_SIZE_OPTIONS,R5 as GRID_DENSITY_TYPES,W as ExTimingLayer,o1 as ExCustomLayer,T5 as DataLoaderMgr,x2 as DataFindMgr,G2 as DEF_WIND_LARGE_VALUE_ICON_COLOR,k2 as DEF_WIND_LARGE_VALUE,O2 as DEF_WIND_ICON_COLOR,d1 as DEF_MAP_CONFIG,S5 as DEF_CHINA_LAYER_LINE_COLOR,l8 as ContourValueLayer,c8 as ContourLayerByValue,o8 as ContourLayer,R4 as CommonColorLayer,T2 as ColorRenderType,G1 as ColorLayer,I7 as COLOR_PALETTE_CONFIG,q5 as BASEMAP_TYPES};
1984
+ `}}class u5{fetchers;mock;constructor(e){this.fetchers=e.fetchers,this.mock=e.mock}}class c5{getDefOptions(){let e=this.getDataReqOptions({}),t=this.getDataResOptions({}),o=Object.keys(e).reduce((y,i)=>{return y[i]={enable:!1},y},{}),p=Object.keys(t).reduce((y,i)=>{return y[i]=void 0,y},{});return{...o,...p}}}class d5{params;layerMgrMap=void 0;constructor(e){this.params=e}getDefLayerOptions(){let e=this.layerMgrMap||this.params.createLayers();return Object.keys(e).reduce((t,o)=>{return t[o]={enable:!1},t},{})}}class M5{productMap={};products=[];groupConfig;constructor(e){e.products.reduce((t,o)=>{return t[o.type]=o,t},this.productMap),this.groupConfig=e.groupConfig,this.products=Object.values(this.productMap)}initCtx(e){Object.values(this.productMap).forEach((t)=>{t.initCtx(e)})}findProduct(e){return this.productMap[e]}get firstProduct(){return Object.values(this.productMap)[0]}}class P5{cityList;boundsPadding;isAddCityMask;customCityCoordinate={};constructor(e){this.cityList=e.cityListOptions,this.boundsPadding=e.boundsPadding||{top:0,bottom:0,left:0,right:0},this.isAddCityMask=e.isAddCityMask||!1}findCityInfo(e){let{china:t,province:o,city:p,county:y}=e,i=t?.gb||o?.gb||p?.gb||y?.gb,n=e.county?.geojson_boundary||e.city?.geojson_boundary||e.province?.geojson_boundary||e.china?.geojson_boundary;return{...this.cityList.find((s)=>s.adcode===i),maskGeoJson:n}}}import{SubscribeMgr as F5}from"@iweather-js/iweather-lib";import{debounce as b5,isEqual as a4,pick as f5}from"lodash-es";class _5{ctx;subscribeMgr=new F5;enabledLayerMgrs={};async mount(e){this.ctx=e;let{gisStore:t,configStore:o}=e,{map:p}=e.gisStore.getState();if(!p)return;t.getState().apply({type:"changeValue",value:{allLayerMgrs:o.getState().layerMgrConfig.params.createLayers()}});let{allLayerMgrs:y}=t.getState(),{dataReqOptionsConfig:i}=this.ctx.configStore.getState();this.subscribeMgr.add(this.ctx.gisStore.subscribe((a)=>{return{dataReqOptions:i.getDataReqOptions(a),allLayerOptopns:a.query.allLayerOptopns()}},async(a,s)=>{let l=a.allLayerOptopns,g=t.getState().query.enabledLayerOptopns(),u=f5(y,Object.keys(g));if(await Promise.all(Object.keys(y).map(async(m)=>{let c=y[m],P=l[m];if(c.initCtx(e,m),c.setEnable(P.enable),c.enable)await c.mount(P),c.setLayerOptions(P);else c.unmount()})),!a4(a.dataReqOptions,s.dataReqOptions))Object.values(u).forEach((m)=>m.loadData());else Object.values(u).forEach((m)=>{if(m.checkIsLoadData())m.loadData()});this.enabledLayerMgrs=u,console.info("[enabled layerMgrs]:",this.enabledLayerMgrs)},{equalityFn:a4,fireImmediately:!0}));let n=b5(()=>{Object.values(this.enabledLayerMgrs).forEach((a)=>a.boundsChange(p.getBounds()))},100);p.on("moveend",n),this.subscribeMgr.add(()=>{p.off("moveend",n)})}onUnmount(){this.subscribeMgr.dispose(),Object.values(this.ctx.gisStore.getState().allLayerMgrs).forEach((e)=>e.unmount())}}import{SubscribeMgr as v5}from"@iweather-js/iweather-lib";import{isEqual as h2}from"lodash-es";class h5{layerMgrHub;ctx;subscribeMgr=new v5;constructor(e){this.layerMgrHub=e}async mount(e){this.ctx=e,this.subscribeMgr.add(this.ctx.gisStore.subscribe((t)=>{let o=this.ctx.gisStore.getState();return{layersData:t.layersData,productType:t.productType,playMode:t.playMode,dataReqOptions:this.ctx.configStore.getState().dataReqOptionsConfig.getDataReqOptions(o)}},(t)=>{let{productType:o,playMode:p}=t,{productConfig:y}=this.ctx.configStore.getState(),n=y.findProduct(o).getTimeBarInfo(this.ctx.gisStore.getState());this.ctx.gisStore.getState().apply({type:"changeValue",value:{timeBarInfo:n,currTm:n?p==="timing"?n.timingTimeBar.initTime:n.frameTimeBar?.initTime:void 0}})},{equalityFn:h2,fireImmediately:!0})),this.subscribeMgr.add(this.ctx.gisStore.subscribe((t)=>t.currTm,(t)=>Object.values(this.layerMgrHub.enabledLayerMgrs).forEach((o)=>o.timeChange(t)),{equalityFn:h2})),this.subscribeMgr.add(this.ctx.gisStore.subscribe((t)=>t.devCustomGrayImageByMercator,(t)=>{Object.values(this.layerMgrHub.enabledLayerMgrs).forEach((o)=>o.loadData())},{equalityFn:h2}))}onUnmount(){this.subscribeMgr.dispose()}}import{clamp as x5}from"lodash-es";function C5(e,t){let o=t[0],p=t[1];return(x5(e,o,p)-o)/(p-o)}class x2{isDestroyed=!1;data=[];curr=void 0;setData(e){this.data=e.sort((t,o)=>t.beginTm-o.beginTm)}addData(e){this.data=[...this.data,...e].sort((t,o)=>t.beginTm-o.beginTm)}first(){return this.data[0]}find(e){let t=this.data.findLastIndex((o)=>e>=o.beginTm);if(t===-1)this.curr={data1:void 0,data2:void 0,p:0};else{let o=this.data[t],p=this.data[t+1],y=C5(e,[o.beginTm,o.endTm]);this.curr={data1:o,data2:p,p:y}}return this.curr}isEmpty(){return this.data.length===0}destroy(){this.isDestroyed=!0,this.data=[]}}import{AbortControllersMgr as L5}from"@iweather-js/iweather-lib";class T5{abortControllersMgr=new L5;setDataRes(e,t){e.gisStore.getState().apply({type:"changeValue",value:t})}onBeforeLoadData(e){return}async loadData(e){this.onBeforeLoadData(e);let t=await this.onLoadData(e),o=await this.onChangeDataRes(e,t);if(o)this.setDataRes(e,o);return t}abort(){this.abortControllersMgr.abort()}async onChangeDataRes(e,t){return}async loadMaxValue(e,t){return null}}import{AbortControllersMgr as I5,SubscribeMgr as D5}from"@iweather-js/iweather-lib";import{debounce as O5,isEqual as G5}from"lodash-es";class k5{props;enable=!0;isMounted=!1;data;layerOptions;prevLayerOptions;ctx;layerName;subscribeMgr=D5.create();isReload=!1;abortControllersMgr=new I5;dataFindMgrs=[];constructor(e){this.props=e}initCtx(e,t){return this.ctx=e,this.layerName=t,this}getLayerInfo(e){return""}get dataLoaderMgr(){return this.props.dataLoaderMgr}get map(){return this.ctx.gisStore.getState().map}getGisValue(){return this.ctx.gisStore.getState()}setLayerOptions(e){if(this.prevLayerOptions=this.layerOptions,this.layerOptions=e,!this.enable)return;if(!this.isMounted)return;if(!this.map)return;if(!this.ctx.gisStore.getState().mapIsLoaded)return;if(G5(e,this.prevLayerOptions))return;this.onLayerOptionsChange(e,this.prevLayerOptions)}checkIsLoadData(){if(!this.layerOptions)return!1;return this.onIsLoadData(this.layerOptions,this.prevLayerOptions)}async mount(e){if(!this.enable)return this;if(this.isMounted)return this;if(!this.map)return this;if(!this.ctx.gisStore.getState().mapIsLoaded)return this;return await this.onMount(e),this.isMounted=!0,this}static toLayerId(e){return`${e}-layer`}toLayerId(e,t=""){if(t)return`${e}-${t}-layer`;return`${e}-layer`}toSourceId(e){return`${e}-source`}setLayerVisible(e,t,o=!0){let p=o?this.toLayerId(e):e;if(this.map&&!!this.map.getLayer(p))this.map.setLayoutProperty(p,"visibility",t?"visible":"none")}isLayerVisible(e,t=!0){let o=t?this.toLayerId(e):e;return this.map?.getLayoutProperty(o,"visibility")==="visible"}getBeforeLayerId(e){return e&&!!this.map.getLayer(e)?e:void 0}removeLayerAndSource(e){this.removeMapLayer(this.toLayerId(e)),this.removeMapSource(this.toSourceId(e))}removeMapLayer(e){try{if(this.map.getLayer(e))this.map.removeLayer(e)}catch(t){console.error("[removeMapLayer]",t)}}removeMapSource(e){try{if(this.map.getSource(e))this.map.removeSource(e)}catch(t){console.error("[removeMapSource]",t)}}addMapLayer(e,t){return this.map.addLayer(e,this.getBeforeLayerId(t)),e}unmount(){if(!this.isMounted)return;this.isMounted=!1,this.clear(),this.onUnmount(),this.clearStoreData(),this.layerOptions=void 0,this.dataLoaderMgr?.abort(),this.abortControllersMgr.abort(),this.subscribeMgr.dispose()}timeChange(e){if(!this.enable)return;if(!this.map)return;if(!this.isMounted)return;let t=e??this.ctx.gisStore.getState().currTm;if(t)this.onTimeChange(t)}playStateChange(e){if(!this.enable)return;this.onPlayStateChange(e)}onPlayStateChange(e){}saveDataToStore(e){if(!this.layerName)return;let t=this.onTimingData(e);this.ctx.gisStore.getState().apply({type:"setLayersData",name:this.layerName,data:t})}clearStoreData(){if(!this.layerName)return;this.ctx.gisStore.getState().apply({type:"setLayersData",name:this.layerName,data:void 0})}async initData(e){if(!this.enable)return;if(!this.isMounted)return;if(!this.map)return;this.data=e,this.saveDataToStore(e),await this.onInitData(e),this.timeChange()}beforeReloadData(){}async loadData(){if(!this.enable)return;if(!this.isMounted)return;if(!this.dataLoaderMgr)return;if(this.beforeReloadData(),this.clear(),this.dataLoaderMgr.loadData(this.ctx).then((e)=>{this.initData(e)}),this.isReload)this.reloadMaxValue();if(this.isReload===!1)this.isReload=!0}boundsChange(e){this.reloadMaxValue()}reloadMaxValue=O5(async()=>{if(!this.enable)return;if(!this.isMounted)return;if(!this.map)return;if(!this.dataLoaderMgr)return;let e=await this.dataLoaderMgr.loadMaxValue(this.ctx,this.map.getBounds());if(e)this.onMaxValueChange(e)},300);onMaxValueChange(e){}clear(){this.onClear(),this.destroyDataFindMgrs(),this.timeChange()}onClear(){}createDataFindMgr(){let e=new x2;return this.dataFindMgrs.push(e),e}destroyDataFindMgrs(){this.dataFindMgrs.forEach((e)=>e.destroy())}setEnable(e){this.enable=e}}import{format as s4}from"date-fns";class E5{type;_ctx;constructor(e){this.type=e}getUpdateGisValueEffect(e,t){return}getDisplayLayerInfos(e){return[]}getSubGroupName(){return""}supportedForecastModels(){return[]}isSupportedMultiModelContrast(){return this.supportedForecastModels().length>1}getDefConfig(e){return J1(this.ctx,{layerOptions:{...e?.layerOptions},gisStyleOptions:{...e?.gisStyleOptions}})}initCtx(e){this._ctx=e}get ctx(){if(!this._ctx)throw Error("ctx is not initialized");return this._ctx}formatCurrTime(e){return s4(new Date(e),"yyyy/MM/dd HH:mm")}formatTimeBar(e){let t=new Date(e).getHours();return{value:s4(new Date(e),"M/d HH:mm"),highlight:t===8}}isNew(){return!1}}function $(e,t){if(!e)return;switch(t.type){case"setProjectionType":e.setProjection({type:t.projectionType});break;case"setShowSky":if(t.showSky)e.setSky({"atmosphere-blend":["interpolate",["linear"],["zoom"],0,1,2,0,7,0]}),e.setLight({anchor:"map",position:[1.5,90,80]});else e.setSky(void 0),e.setLight(void 0);break;case"disableZoom":if(t.isDisable)e.scrollZoom.disable();else e.scrollZoom.enable();break;case"disableMove":if(t.isDisable)e.dragPan.disable();else e.dragPan.enable();break;case"setBaseState":{t.center!==void 0&&e.setCenter(t.center),t.zoom!==void 0&&e.setZoom(t.zoom),t.maxZoom!==void 0&&e.setMaxZoom(t.maxZoom),t.minZoom!==void 0&&e.setMinZoom(t.minZoom),t.bearing!==void 0&&e.setBearing(t.bearing),t.pitch!==void 0&&e.setPitch(t.pitch);break}case"flyTo":if(t.zoom!==void 0&&t.center!==void 0&&t.pitch!==void 0&&t.bearing!==void 0)e.flyTo({zoom:t.zoom,center:t.center,pitch:t.pitch,bearing:t.bearing},{animate:!!t.duration,duration:t.duration??0});break;case"fitBounds":if(t.bounds)e.fitBounds(t.bounds,{animate:!!t.duration,duration:t.duration??0});break}}import A5 from"maplibre-gl";function Lr(e,t){let{center:o,zoom:p,pitch:y,bearing:i,bounds:n}=t.gisStore.getState();return new A5.Map({container:e,style:{version:8,glyphs:"/huishang/assets/map/glyphs/{fontstack}/{range}.pbf",sources:{},layers:[]},center:o,zoom:p,pitch:y,bearing:i,bounds:n,maxPitch:80,maplibreLogo:!1,canvasContextAttributes:{preserveDrawingBuffer:!0}})}import V5 from"mitt";var c1=V5();function C1(e){let t=e.getPitch(),o=e.getBearing(),p=e.getBounds(),y=e.getCenter().toArray(),i=e.getZoom();return{pitch:t,bearing:o,zoom:i,bounds:[Number(p.getWest().toFixed(6)),Number(p.getSouth().toFixed(6)),Number(p.getEast().toFixed(6)),Number(p.getNorth().toFixed(6))],center:y}}function Er(e){let{gisStore:t}=e,{map:o}=t.getState();if(!o)return;let p=()=>{if(!o)return;let{enableScreenshot:y,screenshot:i}=t.getState(),{bounds:n}=C1(o);if(!n)return;if(!y)return;let a=o.getCanvas().toDataURL("image/jpeg",0.5);if(i&&!i.startsWith("data:image")){console.info("检测截图:",i);try{let s=i.substring(i.lastIndexOf("/")+1).split("_")[1];if(s.substring(0,s.lastIndexOf("."))===n.map((g)=>g.toFixed(2)).join("|")){console.info("截图未变化,不进行截图修改:",i);return}}catch(s){console.error("截图解析错误:",i);return}}t.getState().apply({type:"changeValue",value:{screenshot:a}})};return o.on("idle",p),()=>{o.off("idle",p)}}function wr(e){let{gisStore:t}=e,{mapId:o,map:p,mapGroup:y}=t.getState();if(!p)return;let i=!1,n=()=>{if(!p)return;if(i)return;if(!t.getState().enableMapSync)return;c1.emit("syncMapMove",{fromMapGroup:y,fromMapId:o,state:C1(p)})},a=(s)=>{if(s.fromMapId===o)return;if(!s.fromMapGroup||s.fromMapGroup!==y)return;if(!t.getState().enableMapSync)return;i=!0,p.jumpTo({center:s.state.center,zoom:s.state.zoom,bearing:s.state.bearing,pitch:s.state.pitch}),i=!1};return p.on("move",n),c1.on("syncMapMove",a),()=>{p.off("move",n),c1.off("syncMapMove",a)}}import{isEqual as B5}from"lodash-es";function Zr(e){let{gisStore:t,configStore:o}=e,{mapId:p,map:y,mapGroup:i}=t.getState();if(!y)return;let n=!1,a=t.subscribe((l)=>l.currTm,(l)=>{if(n)return;if(!t.getState().enableMapSyncTime)return;if(!l)return;c1.emit("syncTime",{fromMapGroup:i,fromMapId:p,currTm:l})},{equalityFn:B5}),s=(l)=>{if(l.fromMapId===p)return;if(!l.fromMapGroup||l.fromMapGroup!==i)return;if(!t.getState().enableMapSyncTime)return;if(!o.getState().dataReqOptionsConfig.enableTimeSync(t.getState()))return;n=!0,t.getState().apply({type:"changeValue",value:{currTm:l.currTm}}),n=!1};return c1.on("syncTime",s),()=>{c1.off("syncTime",s),a()}}import{debounce as g4}from"lodash-es";function Qr(e){let{gisStore:t}=e,{map:o}=t.getState();if(!o)return;let p=!1,y=g4(()=>{p=!1},1000),i=g4(()=>{if(p)return;t.getState().apply({type:"changeValue",value:{mapStateToStoreSyncing:!0}}),t.getState().apply({type:"changeValue",value:C1(o)}),t.getState().apply({type:"changeValue",value:{mapStateToStoreSyncing:!1}})},500);o.on("zoomend",i),o.on("moveend",i),o.on("pitchend",i),o.on("resize",()=>{p=!0,$(o,{type:"fitBounds",bounds:t.getState().bounds}),y()})}import{isEqual as e2}from"lodash-es";function Rr(e){let{gisStore:t}=e,{map:o}=t.getState();t.subscribe((p)=>p.projectionType,(p)=>{if(t.getState().mapStateToStoreSyncing)return;$(o,{type:"setProjectionType",projectionType:p})},{equalityFn:e2}),t.subscribe((p)=>p.showSky,(p)=>{if(t.getState().mapStateToStoreSyncing)return;$(o,{type:"setShowSky",showSky:p})},{equalityFn:e2}),t.subscribe((p)=>p.disableZoom,(p)=>{if(t.getState().mapStateToStoreSyncing)return;$(o,{type:"disableZoom",isDisable:p})},{equalityFn:e2}),t.subscribe((p)=>p.bounds,(p)=>{if(t.getState().mapStateToStoreSyncing)return;$(o,{type:"fitBounds",bounds:p,duration:1000})},{equalityFn:e2})}function tp(e,t){let{gisStore:o}=t;setTimeout(()=>{e.resize()},1);let{showSky:p,projectionType:y,disableZoom:i,disableMove:n,boundsPadding:a,bounds:s,maxZoom:l,minZoom:g,mapBackgroundColor:u,renderWorldCopies:m,boundsLockMinZoom:c}=o.getState();if(e.setMaxZoom(l),e.setMinZoom(g),$(e,{type:"setShowSky",showSky:p}),$(e,{type:"disableZoom",isDisable:i}),$(e,{type:"disableMove",isDisable:n}),$(e,{type:"setProjectionType",projectionType:y}),e.setRenderWorldCopies(m),s)e.fitBounds(s,{animate:!1,duration:0,padding:a});if(c&&s)e.setMinZoom(e.cameraForBounds(s,{padding:a})?.zoom);e.setStyle({...e.getStyle(),layers:[{id:"background",type:"background",layout:{visibility:"visible"},paint:{"background-color":u||"transparent","background-opacity":1}}]})}import N5 from"maplibre-gl";class N1{infoMarker=null;infoMarkerEl=null;static map={};static getInstance(e){if(!N1.map[e])N1.map[e]=new N1;return N1.map[e]}constructor(){this.infoMarkerEl=document.createElement("div"),this.infoMarkerEl.className="hidden",this.infoMarker=new N5.Marker({element:this.infoMarkerEl})}hide(e){try{this.infoMarker?.removeClassName("visible"),this.infoMarker?.addClassName("invisible"),e.getCanvas().style.cursor="grab"}catch(t){console.info("MarkerMgr hide error")}}show(e,t){try{this.infoMarker.setLngLat(t.lngLat).addTo(e),this.infoMarker.removeClassName("invisible"),this.infoMarker.addClassName("visible"),this.infoMarkerEl.innerHTML=t.html,e.getCanvas().style.cursor="pointer"}catch(o){console.info("MarkerMgr show error")}}setEnable(e){if(e)this.infoMarker.removeClassName("hidden");else this.infoMarker.addClassName("hidden")}}import w5 from"maplibre-gl";class b1{static timer=null;static infoMarker;static infoMarkerEl;static hide(e){if(this.timer)clearTimeout(this.timer);this.timer=setTimeout(()=>{b1.infoMarker.removeClassName("marker_visible"),this.timer=null,e.getCanvas().style.cursor="grab"},300)}static show(e,t){if(this.timer)clearTimeout(this.timer);if(!b1.infoMarker)b1.infoMarkerEl=document.createElement("div"),b1.infoMarkerEl.className="marker font-[JinBuTi]",b1.infoMarker=new w5.Marker({element:b1.infoMarkerEl});let{lng:o,lat:p}=t;this.infoMarker.setLngLat({lat:p,lng:o}).addTo(e).addClassName("marker_visible"),this.infoMarkerEl.innerHTML=t.html,e.getCanvas().style.cursor="pointer"}}import{isEqual as W5}from"lodash-es";var w1=null,t2=!1,C2=!1,J5=0.1;function l4(e){let{gisStore:t}=e,{map:o}=t.getState();if(C2&&o){let p=o.getCenter();o.panTo([p.lng+J5,p.lat],{animate:!1})}requestAnimationFrame(()=>l4(e))}function gp(e){let{gisStore:t}=e,o=t.getState().map;if(!o)throw Error("map is not found");let p=()=>{let{autoRotation:n}=t.getState();if(!n)return;if(n.bounds)$(o,{type:"fitBounds",bounds:n.bounds,duration:500});else if(n.pos)$(o,{type:"flyTo",center:n.pos.center,zoom:n.pos.zoom,duration:500});setTimeout(()=>{if(t2)C2=!0},500)},y=()=>{if(w1)clearTimeout(w1);C2=!1},i=()=>{let n=t.getState().autoRotation?.speed;if(!n)return;if(w1)clearTimeout(w1);w1=setTimeout(()=>{if(t2)p()},n)};o.on("dragend",i),o.on("mouseup",i),o.on("zoomend",i),o.on("touchend",i),o.on("mousedown",y),o.on("dragstart",y),o.on("touchstart",y),o.on("wheel",y),t.subscribe((n)=>n.autoRotation?.enable&&n.projectionType==="globe",(n)=>{if(!n)t2=!1,y();else t2=!0,p()},{fireImmediately:!0,equalityFn:W5}),l4(e)}export{K2 as wrapLongitude,B4 as wrapBounds,A2 as toGisValue,a6 as toColorPaletteFns,q6 as toAdcodeInfoVo,$5 as test2,Rr as syncStoreStateToMapHandler,Qr as syncMapStateToStoreHandler,m6 as scaleColorPaletteConfig,p6 as readImageWithWindExif,r6 as readImageWithCommonExif,X2 as parseExifDataRangeWithWind,Z2 as parseExifDataRange,u2 as parseExifBounds,H7 as parseExif3dSize,k7 as mapgl,Zr as mapSyncTimeHandler,wr as mapSyncMoveHandler,c1 as mapSyncEvent,Er as mapScreenshotHandler,gp as mapAutoRotation,$ as mapAction,tp as initMapState,q2 as getVisibleWraps,Q2 as getViewportBounds,W6 as getProvinceNames,e3 as getProvince,C1 as getMapState,V6 as getLand,E2 as getInitValue,J1 as getGisValue,d4 as getDefLayerOptions,c4 as getDefGisStyleOptions,r3 as getCounty,t3 as getCity,R2 as getChina,C7 as createMultiMapStatusStore,Lr as createMap,H2 as createGridMesh,d7 as createGisStore,f7 as createConfigStore,Q7 as createColorPalette,S4 as WindColorLayer,h5 as TimeMgrHub,T4 as StepRangeUnit,I2 as PlaySpeedByTiming,D2 as PlaySpeedByFrame,z5 as PROJECTION_TYPES,m5 as MaskedDataLayer,F2 as MaskLayer,N1 as MarkerMgr,i5 as Maplibre3DProfileLayerV3,r5 as Maplibre3DProfileLayerV0,e5 as Maplibre3DProfileLayer,f8 as MapLibreWindParticleLayer,_5 as LayerMgrHub,H5 as LEVEL_MAP_HIGHLIGHT_VALUE,Q5 as LEVELS,M5 as IProductConfig,E5 as IProduct,S as INFINITY_VALUE,d5 as ILayerMgrConfig,k5 as ILayerMgr,c5 as IDataReqOptionsConfig,u5 as IDataFetchConfig,P5 as ICityConfig,b1 as HoverMarker,l5 as GridWindValueLayer,F8 as GridWindLayer,g5 as GridValueLayer,y2 as GridRenderIconSize,W1 as GridDensity,e7 as GRID_ICON_SIZE_OPTIONS,R5 as GRID_DENSITY_TYPES,W as ExTimingLayer,o1 as ExCustomLayer,T5 as DataLoaderMgr,x2 as DataFindMgr,G2 as DEF_WIND_LARGE_VALUE_ICON_COLOR,k2 as DEF_WIND_LARGE_VALUE,O2 as DEF_WIND_ICON_COLOR,d1 as DEF_MAP_CONFIG,S5 as DEF_CHINA_LAYER_LINE_COLOR,l8 as ContourValueLayer,c8 as ContourLayerByValue,o8 as ContourLayer,R4 as CommonColorLayer,T2 as ColorRenderType,G1 as ColorLayer,I7 as COLOR_PALETTE_CONFIG,q5 as BASEMAP_TYPES};
1985
1985
 
1986
- //# debugId=07FE4913CE517A5C64756E2164756E21
1986
+ //# debugId=F869DC3696CC554964756E2164756E21