<palign="right"><fontcolor="white"><strongid="lays"></strong>We are using Windy API v4, Leaflet v0.7.7. <inputtype="button"value="END"onClick="window.close()"></font></p>
まとめ
今回作ったコードはこのようになります.なお邪魔なコメントは消してあります.
<html><head><scriptsrc="https://unpkg.com/leaflet@0.7.7/dist/leaflet.js"></script><scriptsrc="https://api4.windy.com/assets/libBoot.js"></script><style>#windy{width: 100%;
height: 94%;
}</style></head><bodybgcolor="black"><divid="windy"></div><script>const options = { key: 'your_key', verbose: true, lat: 38, lon: 139.6, zoom: 5, timestamp: Date.now(),} windyInit( options, windyAPI => {const{ store, map } = windyAPIvar overlays = ['rain','wind','temp','pressure','currents','waves'] , i = 0
, laysname = ['雨・雷',' 風 ',' 気温 ',' 気圧 ',' 海流 ',' 波 '] setInterval(()=> { i = ( i === 5 ? 0 : i + 1)
store.set('overlay', overlays[ i ])
store.set('timestamp', Date.now());document.getElementById("lays").innerHTML=laysname[ i ];}, 5000)
})
</script><palign="right"><fontcolor="white"><strongid="lays"></strong>We are using Windy API v4, Leaflet v0.7.7. <inputtype="button"value="END"onClick="window.close()"></font></p></body></html>
<html><head><scriptsrc="https://unpkg.com/leaflet@1.4.0/dist/leaflet.js"></script><!--省略--></head><bodybgcolor="black"><!--省略--><palign="right"><fontcolor="white"><strongid="lays"></strong>We are using Windy API v4, Leaflet v1.4.0. <inputtype="button"value="END"></font></p></body></html>
コードの更新をしただけだとなんか「使用目的をAPIのkey生成サイトで書いてください」的な文言が出てきたので
key生成サイトにとんでみると
「URL of your project or name of your application」
が必須になっていたので「windy2.scr(windows screen saver)」と記入したら表示されなくなりました.
実際に実行するとこんな感じ