javascript 如何在网站上显示天气雷达图?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12184321/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 15:31:10  来源:igfitidea点击:

How to display weather radar map on website?

javascripthtmlwordpresspluginscontent-management-system

提问by candyA

I'm specifically looking for a weather radar map, similar to this one to display on a Wordpress website: http://www.vantilburgfarms.com/weather_local_radar.htm

我正在专门寻找天气雷达地图,类似于在 Wordpress 网站上显示的地图:http: //www.vantilburgfarms.com/weather_local_radar.htm

The radar above is animated and zoomed in on the Indiana, Ohio part of the US, which is exactly what I need. I don't want to steal this map from the website.

上面的雷达动画并放大了美国俄亥俄州印第安纳州的部分,这正是我所需要的。我不想从网站上窃取这张地图。

I've Googled this and the only things I can find are 5-day forecasts. Any suggestions?

我在谷歌上搜索过这个,我唯一能找到的就是 5 天的预测。有什么建议?

回答by Josh

Looking at their page source, it's setup like so:

查看他们的页面源,它​​的设置如下:

<a href="http://www.tephigram.weather.net/cgi-bin/razradar.cgi?zipcode=45822&amp;width=720&amp;height=486" target="main">
    <img border="0" dynsrc="http://www.tephigram.weather.net/cgi-bin/razradar.cgi?zipcode=45822&width=720&height=486" start="fileopen" src="http://www.tephigram.weather.net/cgi-bin/razradar.cgi?zipcode=45822&width=720&height=486">
</a>

Which sources this site:

本网站来源:

http://www.tephigram.weather.net/cgi-bin/razradar.cgi?zipcode=45822&width=720&height=486

http://www.tephigram.weather.net/cgi-bin/razradar.cgi?zipcode=45822&width=720&height=486

Via dynsrc:

通过dynsrc

http://www.htmlcodetutorial.com/images/_IMG_DYNSRC.htmlhttp://www.citycat.ru/doc/HTML/IExplorer.30/mmedia.htm

http://www.htmlcodetutorial.com/images/_IMG_DYNSRC.html http://www.citycat.ru/doc/HTML/IExplorer.30/mmedia.htm

Basically, they're setting a regular old <img>'s source to be an external video clip.

基本上,他们将常规的 old<img>源设置为外部视频剪辑。

Ironically, it looks like they're stealing it.

具有讽刺意味的是,看起来他们正在窃取它。

回答by Brad

Check out the National Weather Service radar: http://radar.weather.gov/radar.php?rid=LOT&product=N0R&overlay=11101111&loop=yes

查看国家气象局雷达:http: //radar.weather.gov/radar.php?rid= LOT&product= N0R&overlay= 11101111&loop= yes

If you fire up something like Fiddler, you can see the requests for the individual images being used to make the "loop". In the past, I have created something where these frames were cropped to a specific area, and then placed into an animated GIF. This is trivial with ImageMagick, or GD, which are generally available in PHP. You could also do this with JavaScript if you were crafty with DIV overflow.

如果您启动类似 Fiddler 的工具,您可以看到对用于制作“循环”的单个图像的请求。过去,我创建了一些东西,将这些帧裁剪到特定区域,然后放入动画 GIF 中。这对于 ImageMagick 或 GD 来说是微不足道的,它们通常在 PHP 中可用。如果您对 DIV 溢出很熟练,也可以使用 JavaScript 执行此操作。

As for licensing, I believe you can use it without a license, but you should check with a lawyer who knows for sure. I am not one.

至于许可,我相信您可以在没有许可的情况下使用它,但您应该向确定的律师咨询。我不是一个。

回答by jmcboots

The animations created by the NWS use a flash program called FLAnis, you can find more here: http://www.ssec.wisc.edu/flanis/It is VERY easy to use and configure.

NWS 创建的动画使用名为 FLAnis 的 Flash 程序,您可以在此处找到更多信息:http://www.ssec.wisc.edu/flanis/它非常易于使用和配置。