Author Topic: How to Run US Animated Radar on Google Maps  (Read 138945 times)

0 Members and 1 Guest are viewing this topic.

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 298
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #100 on: September 24, 2010, 11:59:33 PM »
I was asked how to preset the default opacity that the map loads up with.

In order to do this you just need to add a short line of code near the bottom of the code section of ridge.html...

This is what needs to be added:
Code: [Select]
Opacity(0.50);
Here is where you can add it to your code:
Code: [Select]
       Google.addOverlay(Radar[i]);

    }

Opacity(0.50);

    Feed();
    Loop();
}
function Free()
{
    GUnload();
}
</script>

A few visual examples of percentages of opacity you can set the map to "load up" with:  
Code: [Select]
Opacity(0.15);
Opacity(0.25);
Opacity(0.33);
Opacity(0.50);
Opacity(0.75);
Opacity(0.88);

Or you can set it to what ever you wish from 0.01 to 0.99

NOTE: These instructions can also be found on the first post of the thread...

« Last Edit: September 25, 2010, 01:08:09 AM by ELDoradoWx »
-Danny
-root is everything

Offline Cienega32

  • Forecaster
  • *****
  • Posts: 2635
    • East Mesa Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #101 on: September 25, 2010, 08:35:45 AM »
And the fun continues...

Clicking the marker:



And as before, the first view if any advisories have been issued,

Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-Win7 Pro-64bit
www.LasCruces-Weather.com   www.EastMesaWeather.com

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #102 on: September 25, 2010, 12:28:45 PM »

Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2298
    • CNYWeather
Re: How to Run US Animated Radar on Google Maps
« Reply #103 on: September 25, 2010, 01:50:33 PM »
WOW thats awesome Steve!
Tony




Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #104 on: September 25, 2010, 03:52:31 PM »
Thanks Tony! I struggled all morning long trying different things that would work but finally, 5-6 hours later that was the solution.
The link I posted many pages earlier in this topic was wrong in case anyone went to the wrong page.

Offline Cienega32

  • Forecaster
  • *****
  • Posts: 2635
    • East Mesa Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #105 on: September 25, 2010, 04:35:25 PM »
Outstanding Steve! That is definitely 1st class! The image is perfect for that application! Full balance all the way around!  =D&gt; =D&gt;


- It timed out once for me showing the "Unable to connect" error but a click refresh cleared it.


I was going to throw the static forecast icons in the 2nd and 3rd tabs but this API has so many little toys in it, it's nothing but fun-filled distractions!  :lol:

One of these days, I'll actually work on having the balloon validate!  :-P

Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-Win7 Pro-64bit
www.LasCruces-Weather.com   www.EastMesaWeather.com

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #106 on: September 25, 2010, 04:55:02 PM »
The connection to my site has been a little flaky this afternoon.
But thanks!

Offline subh

  • Member
  • *
  • Posts: 4
Re: How to Run US Animated Radar on Google Maps
« Reply #107 on: September 28, 2010, 11:00:02 AM »
Thanks Danny for the detailed response for the Brazilian RADAR feed query. I will try to use something like this on my google map application for now.

http://www.eldoradocountyweather.com/satellite/misc/s.america-ir-sat.html

Thanks again.
-Subh

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #108 on: September 28, 2010, 11:11:39 AM »
Outstanding Steve! That is definitely 1st class! The image is perfect for that application! Full balance all the way around!  =D&gt; =D&gt;

One of these days, I'll actually work on having the balloon validate!  :-P

Yep, my balloon doesn't validate either. Minor detail! I just finished redoing all my Google Map pages with a new style, now for the rest of the website!
« Last Edit: September 28, 2010, 11:14:52 AM by DaculaWeather »

Offline Cienega32

  • Forecaster
  • *****
  • Posts: 2635
    • East Mesa Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #109 on: September 30, 2010, 06:36:17 AM »
My last shot at it validates now that I learned a little bit about Javascript  and using getElementById stuff to get the HTML stuff in the bubble. Bit of an adjustment in the mindset between PHP and Javascript.

What I can't get clean is the "&rid=" in the RADAR call. Using &amp; as is in "&amp;product" don't cut it. But I only have 2 warns/2 errors and all from that small detail so I can live with it for now.

I broke the HTML stuff out separately into a "wxnewpage" file and that somehow helped me get a little handle on this "new" Javascript stuff. It's a tough change over from doing everything in PHP - for me, anyway. Thinking in "client-side" perspective just didn't come easy.

Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-Win7 Pro-64bit
www.LasCruces-Weather.com   www.EastMesaWeather.com

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #110 on: September 30, 2010, 06:46:32 AM »
If the code could be tossed into a file and called from the page, it would take care of the validation issue. But I can live with mine for a while, at least the validation error isn't something that might change the way it looks.

Offline Cienega32

  • Forecaster
  • *****
  • Posts: 2635
    • East Mesa Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #111 on: September 30, 2010, 04:55:53 PM »
Do you mean for the bubble or the RADAR code "&rid="? You guys know all this Javascript stuff so you must mean the "&rid=" thing. And your posted page validates nice & green! That bubble is slick, I have to say again.

The bubble info I call from a file. Once I figured it out a little bit, I put the bubble file's info and other HTML stuff ($currentcondrid) in this:
Code: [Select]
<div style="display: none" >
<span id="ridcond" ><?php echo $currentcondrid?></span>
</div>
and did this in the 'marker' setup to present it:
Code: [Select]
var cconds = document.getElementById('ridcond');

    var marker = new GMarker(point, {draggable: false,
      title:"LasCruces-Weather" });

GEvent.addListener(marker, "click", function() {
  marker.openInfoWindowTabsHtml( cconds );

I have no idea if it's the proper way to go about it but it works without error and I learned a little something!

As far as the "&rid=" thing - all the RADARs display and it works fine so no biggie for me. I'm pretty sure my problem is a result of me separating the (older) El Dorado code into different sections.

Thanks again to "ElDorado Wx" for a great script - lots of fun playing with it as well!

Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-Win7 Pro-64bit
www.LasCruces-Weather.com   www.EastMesaWeather.com

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #112 on: September 30, 2010, 05:11:52 PM »
Every time I do this stuff I learn something new! I guess you can teach an old dog new tricks!  :-)
I added two new things yesterday, although not related to this map. I added the USA weather extremes to my home page and added the "OnThis Date" weather history script as a page. I'm getting close to finishing my new website makeover, only have about 20 or so pages left to update, including the main page. I think I'm going to redo the home page a little bit so it will probably be last since it's the most complex. I've finally reduced my css code to one file, and separated the menu and footer into separate files for ease of maintenance. I wonder sometimes how smart I was building the entire site from scratch!  :-) This is a lot of work!

Offline lddaly

  • Forecaster
  • *****
  • Posts: 490
Re: How to Run US Animated Radar on Google Maps
« Reply #113 on: September 30, 2010, 05:24:44 PM »
I wonder sometimes how smart I was building the entire site from scratch!  :-) This is a lot of work!

Your efforts look excellent though! You have my vote for the next featured website. =D&gt;

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #114 on: September 30, 2010, 05:56:31 PM »
Thank you very much! It's nice to know that all that work doesn't go unnoticed! Like I said the home page, the About page and and maybe 15-20 other pages haven't been converted yet but hopefully by this weekend most of the pages will be done. It's the last 3 or 4 that will take the longest and of course, that's why  put those off till the end!

And along those lines (and I'll add a post somewhere else for this) I've got some modified forecast icons that I'll share if anyone would like them. You can see them in action here ( http://www.daculaweather.com/forecast.php ).
There are two sizes available. The size on my site are the same dimensions as the original images but the actual picture is smaller due to the addition of the drop-shadow. The larger image has the same size picture but the dimensions are larger due to the drop-shadow. Oh yea, the corners are rounded!

http://www.daculaweather.com/stuff/rounded_forecast_icons.zip
http://www.daculaweather.com/stuff/rounded_forecast_icons_large.zip

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 298
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #115 on: October 01, 2010, 02:52:50 AM »
I've got some modified forecast icons that I'll share if anyone would like them. You can see them in action here ( http://www.daculaweather.com/forecast.php ).
There are two sizes available. The size on my site are the same dimensions as the original images but the actual picture is smaller due to the addition of the drop-shadow. The larger image has the same size picture but the dimensions are larger due to the drop-shadow. Oh yea, the corners are rounded!

http://www.daculaweather.com/stuff/rounded_forecast_icons.zip
http://www.daculaweather.com/stuff/rounded_forecast_icons_large.zip

Sweet!!! Very Classy!  \:D/
« Last Edit: October 01, 2010, 02:56:24 AM by ELDoradoWx »
-Danny
-root is everything

Offline christopher_w

  • Member
  • *
  • Posts: 1
Re: How to Run US Animated Radar on Google Maps
« Reply #116 on: October 04, 2010, 03:43:05 PM »
This project is really taking off! Thought I would add my two cents in with dynamic centering of the map and dynamic loading of radar sites using an airport identifier. This method uses PHP/MySQL to compare coordinates of the airport contained in one database table and calculates the distance to radar sites using their coordinates in another database table. From that calculation it then determines if the sites are within a predetermined range (ex: 300 miles) to create a string of multiple radar sites. The map is then centered on the airport you type in using its coordinates.

Also included in the attached code (Radar.txt) is a script to decode the current METAR from the airport you enter, which I found and modified from http://woody.cowpi.com/phpscripts/. The author said the code is free to use, modify, and learn from. A live demo is available on my site at http://www.chriswardmedia.com/weather.php.

Key columns referenced in Airports Table: ICAO, Lat, Lng
http://chriswardmedia.com/downloads/AirportsDatabase.csv

Key columns reference in Radars Table: Name, Lat, Lng
http://chriswardmedia.com/downloads/NWSRadars.csv


Distance Function in Miles:
if((distance($icaolat, $icaolng, $nwslat, $nwslng))<300)
* change 300 miles to whatever you think is appropriate/your setup can handle

Requirement: You will need a host that supports PHP and MySQL, and know how to create databases/import data into MySQL.  You will also need to enter your MySQL connection information in the sections with:
$host="My.SqlServer.Com"; // Host name
$username="MyUserName"; // Mysql username
$password="WhateverYourPasswordIs"; // Mysql password


Note: If you enter an identifier for a smaller airport that has METAR data, the coordinates may not available in the airports database. In that case the METAR info will load but the map will fail to load any radars and center at the equator in the Atlantic Ocean (0°,0°). If you enter an airport identifier that doesn't exist...the map won't load any radars and no METAR data will show up (go figure).

Offline stormwatch

  • Senior Contributor
  • ****
  • Posts: 182
    • Carolina StormWatch Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #117 on: October 05, 2010, 02:47:50 PM »
Very nice Pat!! Great job!

Tom
CoCoRaHS NC-BR-1
CW0803
Advanced Spotter

Offline Cienega32

  • Forecaster
  • *****
  • Posts: 2635
    • East Mesa Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #118 on: October 06, 2010, 07:05:24 AM »
NWS in El Paso has finally got a little bit of the Graficast stuff available like many other cities have. I always thought that was pretty cool and wanted the current graphic on my "Googladar" page so I put together a little script that I run as a CRONjob every hour.

It'll find the first graficast available which, from what I can tell, is usually the current outlook and copy it to my root. If there isn't one (quite often in NWS El Paso), it'll copy the U.S. Weather map. I also have it set to run upon page entry if the $NOAAEvent tag I use in the bubble is not "NO CURRENT ADVISORIES" as NWS usually has something up for any advisory.

The 'epz' and 'elp' pertain to the El Paso NWS and are in the directory names they use. You might need to check their "image info" to see exactly where they are in your zones. It's just a quickie that I'm sure could be cleaned up a bit but I thought I would throw it in here in case it interests anyone (you're on your own  :-P). I include the Graficast below the Google RADAR and I found the objective a good enough reason to explore cURL and CRONJobs for the first time   :grin: .

http://www.lascruces-weather.com/wxridge5.php

cronGraficast.php:

Code: [Select]
<?php
$ch 
curl_init();
curl_setopt($chCURLOPT_URL'http://www.srh.noaa.gov/elp/');
curl_setopt($chCURLOPT_HEADER0);
curl_setopt($chCURLOPT_RETURNTRANSFER1);
$file curl_exec($ch);
curl_close ($ch);
$sortcell strpos($file,'src="/images/fxc/epz/graphicast/image');
if (
$sortcell != ''){
$graficast1 substr($file,$sortcell+32);
$pos strpos($graficast1,'"');
$graficast1 substr($graficast1,0,$pos);
$graficast2 'http://www.srh.noaa.gov/images/fxc/epz/graphicast/';
$graficast $graficast2 $graficast1;
}
if (
$graficast == '' or $sortcell == '')
{
$graficast 'http://www.hpc.ncep.noaa.gov/noaa/noaa.gif';}
$ch curl_init($graficast);
$fp fopen('./graficast.gif''wb');
curl_setopt($chCURLOPT_FILE$fp);
curl_setopt($chCURLOPT_HEADER0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
?>


Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-Win7 Pro-64bit
www.LasCruces-Weather.com   www.EastMesaWeather.com

Offline weatherbob123

  • Member
  • *
  • Posts: 5
Re: How to Run US Animated Radar on Google Maps
« Reply #119 on: October 06, 2010, 11:50:58 AM »
I get the key and paste it in to my website http://greenecountyweathernet.com

in my index page but is still ask for a key?

can anybody help me thanks?


bobby

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #120 on: October 06, 2010, 12:14:59 PM »
You have a colon after the = sign right before the key, try removing that.

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 298
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #121 on: October 08, 2010, 05:27:53 AM »
Thought I would add my two cents in with dynamic centering of the map and dynamic loading of radar sites using an airport identifier.

Thanks for taking the time to all of that!

Very interesting information.
-Danny
-root is everything

Offline D4R

  • Member
  • *
  • Posts: 3
Re: How to Run US Animated Radar on Google Maps
« Reply #122 on: October 25, 2010, 06:22:37 PM »
...just discovered this page today.  Really great stuff!  Guess nobody's been around for a couple weeks...but I though I'd post the version I developed today.  I still have alot to do, but it's coming along.  My main objective it to develop gps aware smartphone versions..namely webos.

http://snowangelandotter.com/cgi-bin/gmap3.pl?chart=N0R&id=CAE&wrap=10

Just click one of the 'arrows' to change to a different radar location.  The number of images in the loop is controlled by changing the 'wrap=xx' in the url.

Cheers.

Dave.

Offline Cienega32

  • Forecaster
  • *****
  • Posts: 2635
    • East Mesa Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #123 on: October 26, 2010, 12:24:15 PM »
Nice! I like that concept.

Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-Win7 Pro-64bit
www.LasCruces-Weather.com   www.EastMesaWeather.com

Offline D4R

  • Member
  • *
  • Posts: 3
Re: How to Run US Animated Radar on Google Maps
« Reply #124 on: October 31, 2010, 03:12:03 PM »
...anybody have a Google Maps API v3 of these routines?  Namely radar.js.

Thanks...and, again, great stuff here.

Dave.