diff --git a/templates/imdroid_radar.html b/templates/imdroid_radar.html index 5de41a8..d7d0897 100644 --- a/templates/imdroid_radar.html +++ b/templates/imdroid_radar.html @@ -121,6 +121,7 @@ } maybeCalcSector(); maybePlotSquare(); + maybeCalcNearbyRain(); } async function loadTileAt(z, y, x, dtStr) { @@ -146,6 +147,7 @@ } maybeCalcSector(); maybePlotSquare(); + maybeCalcNearbyRain(); } function fmtDTLocal(dt){ @@ -272,6 +274,12 @@ xsFan.push(gStLon); ysFan.push(gStLat); data.push({ type:'scatter', mode:'lines', x:xsFan, y:ysFan, line:{ color:'#FFFFFF', width:2, dash:'dash' }, fill:'toself', fillcolor:'rgba(255,255,255,0.18)', hoverinfo:'skip', showlegend:false }); } + // 叠加附近5km圆 + if (gStLat !== null && gStLon !== null) { + const Rm = 8000; const samples=128; const xsC=[], ysC=[]; + for(let i=0;i<=samples;i++){ const θ=i*(360/samples); const p=destPoint(gStLat,gStLon,θ,Rm); xsC.push(p.lon); ysC.push(p.lat); } + data.push({ type:'scatter', mode:'lines', x:xsC, y:ysC, line:{ color:'#66CC66', width:1, dash:'dot' }, hoverinfo:'skip', showlegend:false }); + } Plotly.newPlot('tile_plot', data, { margin:{l:36,r:8,t:8,b:90}, xaxis:{title:{text:'经度', standoff: 12}, tickformat:'.2f', constrain:'domain', automargin:true}, @@ -366,6 +374,12 @@ xsFan.push(gStLon); ysFan.push(gStLat); data.push({ type:'scatter', mode:'lines', x:xsFan, y:ysFan, line:{color:'#FFFFFF',width:2,dash:'dash'}, fill:'toself', fillcolor:'rgba(255,255,255,0.18)', hoverinfo:'skip', showlegend:false }); } + // 叠加附近5km圆 + { + const Rm = 8000; const samples=128; const xsC=[], ysC=[]; + for(let i=0;i<=samples;i++){ const θ=i*(360/samples); const p=destPoint(gStLat,gStLon,θ,Rm); xsC.push(p.lon); ysC.push(p.lat); } + data.push({ type:'scatter', mode:'lines', x:xsC, y:ysC, line:{ color:'#66CC66', width:1, dash:'dot' }, hoverinfo:'skip', showlegend:false }); + } const el=document.getElementById('squarePlot'); const layout={ autosize:true, margin:{l:40,r:8,t:8,b:90}, xaxis:{title:'经度', tickformat:'.2f', zeroline:false, constrain:'domain', automargin:true, range:[lonMin, lonMax]}, @@ -376,6 +390,26 @@ }catch(e){ document.getElementById('squarePlot').innerHTML=`