WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Topic started by: Wingfat on August 22, 2018, 10:12:10 PM

Title: Anyone working on Windy.com API or Widget display (for Saratoga Template)
Post by: Wingfat on August 22, 2018, 10:12:10 PM
I have recently come across a site with Awesome Maps and Weather radar. The site is Windy.com and they offer a Free API and also will generate an embedded widget displaying any location on the map. Is there a php script available which can be modified to display this "widget?"  For example:  It says... Embed this HTML code in your page.  <iframe width="650" height="450" src="https://embed.windy.com/embed2.html?lat=25.912&lon=-80.397&zoom=9&level=surface&overlay=radar&menu=&message=true&marker=&calendar=&pressure=&type=map&location=coordinates&detail=&detailLat=25.912&detailLon=-80.397&metricWind=default&metricTemp=default&radarRange=-1 (https://embed.windy.com/embed2.html?lat=25.912&lon=-80.397&zoom=9&level=surface&overlay=radar&menu=&message=true&marker=&calendar=&pressure=&type=map&location=coordinates&detail=&detailLat=25.912&detailLon=-80.397&metricWind=default&metricTemp=default&radarRange=-1)" frameborder="0"></iframe>

This is a "snapshot" of the larger map I would like to display for example.  I have setup an "External Link" to the widget on my site  Parkviewx.com  but it is a crude display without any  frames or menus.
If anyone can provide a solution I would be so grateful..  I'm sure it would be very popular as the graphics are some of the highest resolution maps and radar I have ever seen.
Thanks for your consideration...
jeff
Title: Re: Anyone working on Windy.com API or Widget display (for Saratoga Template)
Post by: chrisgrainger on August 23, 2018, 09:07:33 AM
You mean like this?


I've been using Windy to show wind forecast on my Saratoga Template site for quite some time.  I just use the embed code provided by Windy, added it to a new page, and then added that page to the menu system.


Code: [Select]
<?php
############################################################################
# A Project of TNET Services, Inc. and Saratoga-Weather.org (Canada/World-ML template set)
############################################################################
#
#   Project:    Sample Included Website Design
#   Module:     sample.php
#   Purpose:    Sample Page
#   Authors:    Kevin W. Reed <kreed@tnet.com>
#               TNET Services, Inc.
#
Copyright: (c) 1992-2007 Copyright TNET Services, Inc.
############################################################################
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
############################################################################
# This document uses Tab 4 Settings
############################################################################
require_once("Settings.php");
require_once(
"common.php");
############################################################################
$TITLE langtransstr($SITE['organ']) . " - " .langtransstr('Wind');
$showGizmo false;  // set to false to exclude the gizmo
include("top.php");
############################################################################
?>

</head>
<body>
<?php
############################################################################
include("header.php");
############################################################################
include("menubar.php");
############################################################################
?>

<iframe src="https://embed.windyty.com/?44.675,-76.358,10,menu,marker,metric.wind.km/h" width="670" height="500" frameborder="0"></iframe>
<div id="main-copy">
 

<><!-- end main-copy -->


<?php
############################################################################
include("footer.php");
############################################################################
# End of Page
############################################################################
?>


Should work the same way for the map you want to display on your site.


Cheers!


Chris
Title: Re: Anyone working on Windy.com API or Widget display (for Saratoga Template)
Post by: Wingfat on August 23, 2018, 10:18:50 PM
Thank you!  Works very nicely...
jeff
Title: Re: Anyone working on Windy.com API or Widget display (for Saratoga Template)
Post by: chrisgrainger on August 27, 2018, 06:29:55 PM
Great job integrating the Windy radar with your site.  Glad to help.

Chris
Title: Re: Anyone working on Windy.com API or Widget display (for Saratoga Template)
Post by: AF6GL on August 28, 2018, 12:59:57 PM
Can't wait to get home from vacation and give this a try.

Thanks