feat: 新增海珠和番禺气象站

This commit is contained in:
yarnom 2025-09-24 11:09:30 +08:00
parent e41a242223
commit ef1d2f57e1
2 changed files with 5 additions and 4 deletions

View File

@ -359,9 +359,10 @@
});
document.getElementById('timeSelect').addEventListener('change', async (e)=>{ const v=e.target.value; if(!v){ if(gTimes.length>0){ gCurrentIdx=0; await loadTileAt(gTimes[0]); } else { gCurrentIdx=-1; await loadLatestTile(); } } else { gCurrentIdx=gTimes.indexOf(v); await loadTileAt(v);} updateCountAndButtons(); updateSlider(); });
function updateCountAndButtons(){
const N=gTimes.length; const el=document.getElementById('countInfo'); if(N===0||gCurrentIdx<0){ el.textContent='共0条数据第0条'; return; }
el.textContent=`共${N}条数据,-${k-1}时次`;
const prev=document.getElementById('btnPrev'), next=document.getElementById('btnNext');
const N = gTimes.length;
const k = gCurrentIdx >= 0 ? (gCurrentIdx + 1) : 0;
document.getElementById('countInfo').textContent = `共${N}条数据,-${k-1}时次`;
const prev=document.getElementById('btnPrev'); const next=document.getElementById('btnNext');
prev.disabled = !(N>0 && gCurrentIdx>=0 && gCurrentIdx<N-1);
next.disabled = !(N>0 && gCurrentIdx>0);
}

View File

@ -84,7 +84,7 @@
<button id="btnNext" class="px-2 py-1 border rounded">下一时次</button>
</div>
</div>
<div class="w-full flex justify中心 mb-2">
<div class="w-full flex justify-center mb-2">
<input id="timeSlider" type="range" min="0" max="0" value="0" step="1" class="slider slider-horizontal w-64" />
</div>
<div id="radarPlot" class="plot-box"></div>