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

0 Members and 1 Guest are viewing this topic.

Offline DaculaWeather

  • It's a Jeep thing... you wouldn't understand.
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3175
  • SCCA EM #156
    • North Georgia and US Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #50 on: August 28, 2010, 08:09:44 AM »
Working my way around the country... added 4 new areas from Ohio to Minnesota today. Messed up my menu in the process but all is well now!
 
Ohio Regional - http://www.daculaweather.com/ridge_ohio_regional_master.php
Michigan Regional - http://www.daculaweather.com/ridge_michigan_regional_master.php
Illinios Region - http://www.daculaweather.com/ridge_illinois_regional_master.php
Minnesota Region - http://www.daculaweather.com/ridge_minn_regional_master.php

I'm also going to add a map with hotspots that will show the approximate areas covered by each map. Sort of like this:

« Last Edit: August 28, 2010, 08:36:11 AM by DaculaWeather »

Offline DaculaWeather

  • It's a Jeep thing... you wouldn't understand.
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3175
  • SCCA EM #156
    • North Georgia and US Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #51 on: August 28, 2010, 09:07:32 AM »
Danny, I'm assuming this section controls the default opacity? What what value would I use and where would I set it to make it 50%?
Code: [Select]
function Opacity(opacity)

{

for (var i=0;Ridge[i];i++)

{

Radar[i].opacity(opacity);

}


Thanks!

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 295
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #52 on: September 01, 2010, 05:44:23 PM »
Sorry I didn't get back to you sooner. As you know I deleted my old Gentoo OS and have been working on recompiling from source my new Gentoo Linux OS. It was due to be replaced. Until that was done, I had no OS...

Wrong spot in the code Steve. Here is what you can do..

It resides in radar.js

Here is where you need to change it:
Code: [Select]
FrameAnimationLayerOverlay.prototype.opacity=function(filter)
{
this.filter=filter;

if (document.all)
{
this.div.style.filter="alpha(opacity=100)";

if ((this.filter>0)*(this.filter<1))
{
this.div.filters.alpha.opacity=Math.round(this.filter*100);
this.div.filters.alpha.enabled=1;
}

else
{
this.div.filters.alpha.opacity=100;
this.div.filters.alpha.enabled=0;
}
}

else
{
if ((this.filter>0)*(this.filter<1))
{
this.div.style.opacity=this.filter;
}

else
{
this.div.style.opacity=1;
}
}
}

I nabbed this particular code from Google Groups http://www.mail-archive.com/google-maps-api@googlegroups.com/msg11300.html

It should help guide you in how you can tweak it..

For the overall image transparency you can also play with a style tag for ridge.html below:
Code: [Select]
<style type="text/css">
.overlay{
filter:alpha(opacity=60);
-moz-opacity: 0.6;
opacity: 0.6;
}
</style>
-Danny
-root is everything

Offline DaculaWeather

  • It's a Jeep thing... you wouldn't understand.
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3175
  • SCCA EM #156
    • North Georgia and US Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #53 on: September 01, 2010, 05:49:42 PM »
Good stuff Danny! How the regen go? Looks like you're working anyway!

Offline DaculaWeather

  • It's a Jeep thing... you wouldn't understand.
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3175
  • SCCA EM #156
    • North Georgia and US Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #54 on: September 03, 2010, 08:10:17 AM »
I keep adding more Google maps. I have 17 areas covered now. I've covered everything east of the Mississippi River, from Arkansas to Minnesota and from there to Washington. There are still plenty more to come!  :-)

I'm guessing there will be maybe 25-35 before it's all done. I did a larger southeast map that includes 25 radar sites. On my Comcast connection it took about 15 seconds to fully load all images and start looping.

http://www.daculaweather.com/ridge_southeast_master.php

Offline John Sacrey

  • Member
  • *
  • Posts: 23
    • Saline Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #55 on: September 03, 2010, 09:32:37 PM »
Evening folks,

First off, great script!!!! Have it running here:  http://sacrey.info/wxgoogleradar.php

Everytime I look at the page it tells me I need a new key for the API.  I have tried 3 different keys with no success.  Any ideas?  Also how do I get rid of the radar sites being listed below the map?

Thanks,  John Sacrey
Benton/Salem, AR
Vantage Pro 2, GR2AE, GR3,

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 295
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #56 on: September 04, 2010, 02:42:51 AM »
I keep adding more Google maps. I have 17 areas covered now. I've covered everything east of the Mississippi River, from Arkansas to Minnesota and from there to Washington. There are still plenty more to come!  :-)

I'm guessing there will be maybe 25-35 before it's all done. I did a larger southeast map that includes 25 radar sites. On my Comcast connection it took about 15 seconds to fully load all images and start looping.

http://www.daculaweather.com/ridge_southeast_master.php


Looks really good Steve! Very nicely done as usual...
-Danny
-root is everything

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 295
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #57 on: September 04, 2010, 03:14:10 AM »
Evening folks,

First off, great script!!!! Have it running here:  http://sacrey.info/wxgoogleradar.php

Everytime I look at the page it tells me I need a new key for the API.  I have tried 3 different keys with no success.  Any ideas?  Also how do I get rid of the radar sites being listed below the map?

Thanks,  John Sacrey

Hi John,

I'm glad you like the script, I enjoyed piecing it together. To remove the output that displays the image URLs cycling through, you need to completely remove this part of your html code.

Code: [Select]
<div id="helper"></div>
I am not completely sure why you are having the Google Key problem. Usually when there is a key issue you will get the error message and the map will not show up at all.

I can't tell exactly what's going on without your source code, but I would give this a try. Remove the script tag with the Google key number from ridge.html and place it between the "head" tags of wxgoogleradar.php. wxgoogleradar.php appears to be calling ridge.html as a php include?

Script code to remove from ridge.html and put between the head tags in wxgoogleradar.php:
Code: [Select]
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAa4YAlOz8RH5ckQxn5Cm1zBTo8224LVz9aVaZCQBsUVsN5MgkIxTkTgZXkghDOkxfK_ceDqvm7TV6mQ" type="text/javascript">
</script>

Hopefully it will now work with your key...

-Danny
-root is everything

Offline sacreyweather

  • Echo Valley Weather
  • Forecaster
  • *****
  • Posts: 1767
    • Echo Valley Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #58 on: September 04, 2010, 08:16:47 AM »
Hi Danny,

Had to redo my membership this morning.  I tried changing my email address on my old one, but that did not work.  No big deal.

Anyway on the radar page, I tried your suggestions and neither one worked , unfortunately.  Changing the place of the key made no difference and when I remove the "div id=helper", I get a map, but no radars. I'll attach a copy of my ridge.html for you to look at.

Thanks for the help,

John Sacrey
CWOP: D2073, GR2AE, GR3, Cumulus, PWSweather,  CoCoRaHS: AR-SL-23  

Saline Weather on Twitter
Blitzortung Station 1387

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 295
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #59 on: September 04, 2010, 06:33:18 PM »
Hi Danny,

Had to redo my membership this morning.  I tried changing my email address on my old one, but that did not work.  No big deal.

Anyway on the radar page, I tried your suggestions and neither one worked , unfortunately.  Changing the place of the key made no difference and when I remove the "div id=helper", I get a map, but no radars. I'll attach a copy of my ridge.html for you to look at.

Thanks for the help,

John Sacrey

John,

I installed your code into my web server and made just 2 changes. In wxgoogleradar.php I changed the php include path to point to the copy of your ridge.html residing on my server, and I changed the Google key number to my key number. It ran perfectly with no errors.

I'm not exactly sure why your Google Key is not working but I have my suspicions. You are using an invalid key number, but it is giving you the key number error and then it displays normally which is a bit bizarre. When you went to Google to get a new key, did you get the Google key for the main domain or sub domain? Do you own the domain or do you use the sub domain for your entire weather site? IF the main domain has already been issued a key number you would need to use that. For those that run sub domains with Google maps, they would need to take out a Google key for the main domain which will also be valid with any sub domains.

I changed the code in ridge.html so it wouldn't output the image urls under the map. Here is a new copy of ridge.html:

Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>


<script src="http://sacrey.info/lzk/radar.js"></script>

<script src="http://sacrey.info/lzk/ridge.js"></script>



<script>



var Clock ;

var Cycle ;

var Google;

var Helper;



var Last=  0;

var Skew=  0;

var Wrap= 10;

var Idle=100;

var Back=500;



var Radar=[];



var Ridge=["LZK","SRX","NQA","SHV","SGF"];



var Product="N0R";



function Pause(pause)

{

Idle=pause*10;

Back=pause*50;

}



function Opacity(opacity)

{

for (var i=0;Ridge[i];i++)

{

Radar[i].opacity(opacity);

}

}



function Loop()

{

for (var i=0;Ridge[i];i++)

{

Helper.childNodes[i].childNodes[0].data=Radar[i].select(Last);

}



Last=(Last+1)%Wrap;



Clock=clearTimeout(Clock);



Clock=setTimeout("Loop()",Last ? Idle : Back);

}



function Feed()

{

var stub="http://www.srh.noaa.gov/ridge2/JSON_generator.php?callback=CallBack&frames="+Wrap;



for (var i=0;Ridge[i];i++)

{

Radar[i].feed(stub+"&rid="+Ridge[i]+"&product="+Product);

}



Cycle=clearTimeout(Cycle);



Cycle=setTimeout("Feed()",150000);

}



function CallBack(callback)

{

var stub="http://www.srh.noaa.gov/";



var pair;



var reload=[];



for (var i=0;callback.directory[i];i++)

{

pair=callback.directory[i].match(/([A-Z][A-Z][A-Z]|[A-Z][0-9][A-Z])/g);



reload[i]=stub+callback.directory[i];

}



for (var i=0;Ridge[i];i++)

{

if (pair) if (pair[0]==Product) if (pair[1]==Ridge[i]) Radar[i].reload(reload);

}

}



function Load()

{

Google=document.getElementById("google");



Google.style.width ="640px";

Google.style.height="640px";



GDraggableObject.setDraggableCursor("pointer");

GDraggableObject.setDraggingCursor ("pointer");



Google=new GMap2(Google);

Google.setCenter (new GLatLng(34.832,-92.258),7, G_PHYSICAL_MAP);

        Google.setUIToDefault();

Helper=document.getElementById("helper");




for (var i=0;Ridge[i];i++)

{

Helper.appendChild(document.createElement("DIV"));



                Helper.childNodes[i].appendChild(document.createElement("a"));



Radar[i]=new FrameAnimationLayerOverlay({bbox:BBox(Ridge[i],Product),size:

{x:640,y:640},last:Last,skew:Skew,wrap:Wrap,name:Ridge[i]+"_"+Product});



Google.addOverlay(Radar[i]);

}



Feed();

Loop();

      var point = new GLatLng(34.63494,-92.55683);
      var marker = new GMarker(point, {draggable: false,
      title:"Salem" });
      GEvent.addListener(marker, "click", function() {
      marker.openInfoWindowHtml("Sacrey Weather");
                         });
      Google.addOverlay(marker);
}



function Free()

{

GUnload();

}



</script>
</head>

<body onload="Load();" onunload="Free();">

<br/><br/><br/>
<div style="font-family:arial; font-size:13px; font-weight:normal;" align="center">



<div id="google"></div>

<div id="helper"></div>

<div>

<input type="radio" name="pause" onclick="Pause( 5);"> Extra Fast

<input type="radio" name="pause" onclick="Pause( 8);"> Fast

<input type="radio" name="pause" onclick="Pause(12);"> Medium

<input type="radio" name="pause" onclick="Pause(18);"> Slow

<input type="radio" name="pause" onclick="Pause(25);"> Extra Slow


<input type="radio" name="pause" onclick="Pause( 2000);"> Pause

</div>

<div>Opacity

<input type="radio" name="opacity" onclick="Opacity(0.25);">  25%

<input type="radio" name="opacity" onclick="Opacity(0.50);">  50%

<input type="radio" name="opacity" onclick="Opacity(0.75);">  75%

<input type="radio" name="opacity" onclick="Opacity(1.00);"> 100%

</div>

</div>
</body>
</html>







-Danny
-root is everything

Offline DaculaWeather

  • It's a Jeep thing... you wouldn't understand.
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3175
  • SCCA EM #156
    • North Georgia and US Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #60 on: September 04, 2010, 08:27:15 PM »
Yes, I hid mine but you can't get rid of that <div>.

I made the helper div hidden (visibility: hidden) and 1px in height. Seems like I had to give it a height value even though it's hidden. I'm not where I can play with it right now to tell.

Offline sacreyweather

  • Echo Valley Weather
  • Forecaster
  • *****
  • Posts: 1767
    • Echo Valley Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #61 on: September 04, 2010, 08:56:28 PM »
Danny,

It worked!!!!!  Thank you very much!!!!  On the key, what I did was assign it to the page itself instead of the domain.  Duh!!! :oops:

Thank you again and if there is anything on my site you would like a copy of, please ask.

Have a good Labor Day weekend,

John Sacrey
CWOP: D2073, GR2AE, GR3, Cumulus, PWSweather,  CoCoRaHS: AR-SL-23  

Saline Weather on Twitter
Blitzortung Station 1387

Offline mlail

  • Member
  • *
  • Posts: 39
Re: How to Run US Animated Radar on Google Maps
« Reply #62 on: September 05, 2010, 12:15:38 PM »
Danny,

I am trying to get this working in HTML and on my intranet. No external web server just my own at home. I followed your instructions but cannot get the radar to over-lay the map. I was supprised that Google would give me the api on a private IP address but it works.

I'm sure that I am missing something very rookie, if you wouldn't mind taking a look to stear me in the right directions?

Code: [Select]
<head>
 
<title>Google Nexrad Doppler Radar</title>
 
<meta name="description" content="test" />
 
<meta name="keywords" content="test" />
 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-store"/>
<meta name="distribution" content="global"/>

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=true_or_false&amp;key=ABQIAAAA5uvpvJ9Bxm21XdVeHbEt4xRfWanLLCphprUHhM3Ro32oaDF9qBTSMXrFhTLwkPutwslNRrrNIDsOng" type="text/javascript"></script>
</script>

<script src="http://192.168.1.10/current/misc/google-maps/gsp/radar.js"></script>

<script src="http://192.168.1.10/current/misc/google-maps/gsp/ridge.js"></script>

<script type="text/javascript">

var Clock ;

var Cycle ;

var Google;

var Helper;


var Last=  0;

var Skew=  0;

var Wrap= 10;

var Idle=100;

var Back=500;



var Radar=[];



var Ridge=["GSP"];

var Product=["NCR","RAX"];

function Pause(pause)

{

Idle=pause*10;

Back=pause*50;

}



function Opacity(opacity)

{

for (var i=0;Ridge[i];i++)

{

Radar[i].opacity(opacity);

}

}

function Loop()
{

for (var i=0;Ridge[i];i++)

{

Helper.childNodes[i].childNodes[0].data=Radar[i].select(Last);

}

Last=(Last+1)%Wrap;


Clock=clearTimeout(Clock);


Clock=setTimeout("Loop()",Last ? Idle : Back);

}


function Feed()

{

var stub="http://www.srh.noaa.gov/ridge2/JSON_generator.php?callback=CallBack&frames="+Wrap;

for (var i=0;Ridge[i];i++)

{

Radar[i].feed(stub+"&rid="+Ridge[i]+"&product="+Product);

}

Cycle=clearTimeout(Cycle);

Cycle=setTimeout("Feed()",150000);

}


function CallBack(callback)

{

var stub="http://www.srh.noaa.gov/";

var pair;

var reload=[];

for (var i=0;callback.directory[i];i++)
{
pair=callback.directory[i].match(/([A-Z][A-Z][A-Z]|[A-Z][0-9][A-Z])/g);

reload[i]=stub+callback.directory[i];
}

for (var i=0;Ridge[i];i++)
{
if (pair) if (pair[0]==Product) if (pair[1]==Ridge[i]) Radar[i].reload(reload);
}

}

function Load()

{
Google=document.getElementById("google");

Google.style.width ="640px";
Google.style.height="640px";

GDraggableObject.setDraggableCursor("pointer");
GDraggableObject.setDraggingCursor ("pointer");

Google=new GMap2(Google);

Google.setCenter (new GLatLng(35.273,-80.777),7, G_NORMAL_MAP);
    Google.setUIToDefault();

Helper=document.getElementById("helper");


for (var i=0;Ridge[i];i++)
{
Helper.appendChild(document.createElement("DIV"));

Helper.childNodes[i].appendChild(document.createTextNode(""));

Radar[i]=new FrameAnimationLayerOverlay({bbox:BBox(Ridge[i],Product),size:{x:640,y:640},last:Last,skew:Skew,wrap:Wrap,name:Ridge[i]+"_"+Product});

Google.addOverlay(Radar[i]);
}

Feed();
Loop();

}

function Free()
{
GUnload();
}

</script>

</head>

<body onload="Load();" onunload="Free();">

<div style="font-family:arial; font-size:13px; font-weight:normal;" align="center">

<div id="google"></div>
  <div id="helper"></div>

<div>
<input type="radio" name="pause" onclick="Pause( 5);"> Extra Fast
<input type="radio" name="pause" onclick="Pause( 8);"> Fast
<input type="radio" name="pause" onclick="Pause(12);"> Medium
<input type="radio" name="pause" onclick="Pause(18);"> Slow
<input type="radio" name="pause" onclick="Pause(25);"> Extra Slow

<input type="radio" name="pause" onclick="Pause( 2000);"> Pause

</div>

<div>Opacity
<input type="radio" name="opacity" onclick="Opacity(0.25);">  25%
<input type="radio" name="opacity" onclick="Opacity(0.50);">  50%
<input type="radio" name="opacity" onclick="Opacity(0.75);">  75%
<input type="radio" name="opacity" onclick="Opacity(1.00);"> 100%

</div>
<br/><br/><br/>


</div>

</body>

</html>

Thanks,
Marshall

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 295
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #63 on: September 05, 2010, 03:32:46 PM »
Danny,

I am trying to get this working in HTML and on my intranet. No external web server just my own at home. I followed your instructions but cannot get the radar to over-lay the map. I was supprised that Google would give me the api on a private IP address but it works.

I'm sure that I am missing something very rookie, if you wouldn't mind taking a look to stear me in the right directions?


Change this line in your ridge.html:
Code: [Select]
var Product="NCR";
To This:
Code: [Select]
var Product=["NCR"];

-Danny
-root is everything

Offline mlail

  • Member
  • *
  • Posts: 39
Re: How to Run US Animated Radar on Google Maps
« Reply #64 on: September 05, 2010, 11:55:11 PM »
Danny,

That didn't quit do it but you updated your sample code so I started over with the updates that you pointed out. That did the trick. I even have about 10 different radars! :-) Thanks and great work. I would love to see some of your other ideas.

Thanks again,

Marshall

Offline Cienega32

  • Forecaster
  • *****
  • Posts: 2571
    • East Mesa Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #65 on: September 09, 2010, 05:45:47 PM »
Time to throw down the gauntlet!  :lol:

The bubble on the location flag is nice but...

How would one go about including something like this in the bubble:
Code: [Select]
<?php
echo "Currently: "$temperature $uomTemp "<br />";
echo 
$weatherreport " with " $dayrn $uomRain " rain<br />";
echo 
$avgspd $uomWind " winds from the " $dirlabel "<br />";
echo 
"Pressure: " $baroinusa2dp " and " $pressuretrendname;
?>

Not necessarily that exact code but something to generate that type of text one would have using WD and testtags.

I can't figure out how to cross the server-side|client-side bridge and have NO idea how to use javascript to incorporate any of the testtag values for something like this.

I think it would be a great use of the bubble-text... (sing it with me!) "if I only had a brain".

Any wizards care to tackle this?

Please...?

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

Offline subh

  • Member
  • *
  • Posts: 4
Re: How to Run US Animated Radar on Google Maps
« Reply #66 on: September 10, 2010, 02:47:17 PM »
Hi,

I came across this wonderful post for displaying the RADAR feed over google maps.

I have a simple question, is it possible to get the feeds from last 2 hours to current? If so, what do I need to change?

-thanks
Subh

Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2185
  • Yeah, I'm hugging my traffic light.
    • http://www.cnyweather.com
Re: How to Run US Animated Radar on Google Maps
« Reply #67 on: September 10, 2010, 04:48:35 PM »
I usually dont have this many issues  :-(

http://www.cnyweather.com/ridge.html

I generated a google map key, inserted it and says I need to get one.
Oh yeah, and no radar too is showing.

Tony  8-)
Tony




Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 372
    • Tyler Texas Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #68 on: September 10, 2010, 07:21:39 PM »
Time to throw down the gauntlet!  :lol:

While this isn't exactly what you're asking for, it may serve your purpose. You could include your weather graphic in the pop-up window. It's pretty easy to do this.
1) In the CSS for the page the radars on, include an entry for the size of the pop-up window (for some reason, Google won't let you have a width smaller than around 250px or so).
Code: [Select]
.iwContainer { width: 510px; height: 100px; }
2) In the line near the end of the code starting with
Code: [Select]
marker.openInfoWindowHtmlchange it to this:
Code: [Select]
marker.openInfoWindowHtml('<div class="iwContainer">' + '<img src="http://www.eastmesaweather.com/scripts/wxgraphic/wxgraphic.php?type=banner_big">' + '</div>');
That's all you should need to do.

Steve

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 295
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #69 on: September 10, 2010, 11:09:06 PM »
Danny,

That didn't quit do it but you updated your sample code so I started over with the updates that you pointed out. That did the trick. I even have about 10 different radars! :-) Thanks and great work. I would love to see some of your other ideas.

Thanks again,

Marshall

Hi Marshall,

You are most welcome! I'm glad you got it working the way you wanted..

-Danny
-root is everything

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 295
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #70 on: September 10, 2010, 11:15:48 PM »
How would one go about including something like this in the bubble:
Code: [Select]
<?php
echo "Currently: "$temperature $uomTemp "<br />";
echo 
$weatherreport " with " $dayrn $uomRain " rain<br />";
echo 
$avgspd $uomWind " winds from the " $dirlabel "<br />";
echo 
"Pressure: " $baroinusa2dp " and " $pressuretrendname;
?>

You could use PHP if you would like to populate the bubble text. You could do an include of testtags.php on the page and put the PHP code inside the quotes in the following line of code:
Code: [Select]
marker.openInfoWindowHtml("PHP code can go here");

Rough Sample:
http://www.eldoradocountyweather.com/current/misc/google-maps/dax/ridge.html

« Last Edit: September 11, 2010, 02:40:17 AM by ELDoradoWx »
-Danny
-root is everything

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 295
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #71 on: September 10, 2010, 11:27:31 PM »
Hi,

I came across this wonderful post for displaying the RADAR feed over google maps.

I have a simple question, is it possible to get the feeds from last 2 hours to current? If so, what do I need to change?

-thanks
Subh

Usually the radar updates about every 10 minutes. That makes for about a 1 hour and 40 minute time span. If you want to extend that time to 2 hours, you would need to change the following two lines:

Change this:
Code: [Select]
var Wrap= 10;
To this:
Code: [Select]
var Wrap= 12;
Change this:
Code: [Select]
var stub="http://www.srh.noaa.gov/ridge2/JSON_generator.php?callback=CallBack&amp;frames="+Wrap;
To this:
Code: [Select]
var stub="http://www.srh.noaa.gov/ridge2/JSON_generator.php?callback=CallBack&frames="+Wrap;

Doing those 2 changes should give you the 2 hour time span you are looking for. If you wanted to increase the time span even more you would increase the "Wrap=12" number.

-Danny
-root is everything

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 295
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #72 on: September 10, 2010, 11:33:58 PM »
I usually dont have this many issues  :-(

http://www.cnyweather.com/ridge.html

I generated a google map key, inserted it and says I need to get one.
Oh yeah, and no radar too is showing.

Tony  8-)

Hi Tony,

It looks like you have a colon that needs to be removed from your key number. It doesn't look like it's part of the alpha/numeric key. I'm pretty sure it should start with "ABQI". It's in the first character position - key=:ABQIAAAAC5-muwYSiN-yada-yada-yada

Something else I should ask, when you got your key number from Google did you get it for your main index page, which in your case is: http://www.cnyweather.com?

« Last Edit: September 11, 2010, 03:15:03 AM by ELDoradoWx »
-Danny
-root is everything

Offline Cienega32

  • Forecaster
  • *****
  • Posts: 2571
    • East Mesa Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #73 on: September 11, 2010, 12:53:59 AM »
How would one go about including something like this in the bubble:
Code: [Select]
<?php
echo "Currently: "$temperature $uomTemp "<br />";
echo 
$weatherreport " with " $dayrn $uomRain " rain<br />";
echo 
$avgspd $uomWind " winds from the " $dirlabel "<br />";
echo 
"Pressure: " $baroinusa2dp " and " $pressuretrendname;
?>

You could use PHP if you like to populate the bubble text. You could do an include of testtags.php on the page and put the PHP code inside the quotes in the following line of code:
Code: [Select]
marker.openInfoWindowHtml("PHP code can go here");

Rough Sample:
http://www.eldoradocountyweather.com/current/misc/google-maps/dax/ridge.html


That's exactly what I've been doing and I get no bubble.

Could you post that line from the sample page that you were kind enough to post?

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

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 295
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #74 on: September 11, 2010, 02:36:03 AM »
How would one go about including something like this in the bubble:
Code: [Select]
<?php
echo "Currently: "$temperature $uomTemp "<br />";
echo 
$weatherreport " with " $dayrn $uomRain " rain<br />";
echo 
$avgspd $uomWind " winds from the " $dirlabel "<br />";
echo 
"Pressure: " $baroinusa2dp " and " $pressuretrendname;
?>

You could use PHP if you would like to populate the bubble text. You could do an include of testtags.php on the page and put the PHP code inside the quotes in the following line of code:
Code: [Select]
marker.openInfoWindowHtml("PHP code can go here");

Rough Sample:
http://www.eldoradocountyweather.com/current/misc/google-maps/dax/ridge.html


That's exactly what I've been doing and I get no bubble.

Could you post that line from the sample page that you were kind enough to post?

You were on the right track! The code I used is very similar to yours, I just formatted it a wee bit differently by using snippets of code instead of formal code within one php tag.

Code: [Select]
       marker.openInfoWindowHtml("Some Weather Station<br/>Updated: <?php echo $date?> at <?php echo $time?><br/><br/>Temperature: <?php echo $temperature?>&deg;F<br/>Pressure: <?php echo $baroinusa2dp?><br/>Rain Today: <?php echo $dayrn?>in<br/>Humidity: <?php echo $humidity?>%<br/>Dew Pt: <?php echo $dewpt?>&deg;F");
      });

« Last Edit: September 11, 2010, 02:40:38 AM by ELDoradoWx »
-Danny
-root is everything