WXforum.net
May 22, 2013, 04:25:30 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
Members: 6617  •  Posts: 178537  •  Topics: 18117
Please welcome TheMOX, our newest member.
Welcome to the the new hosting for WXforum.net.
 
   Home   Help Search Login Register  
Pages: 1 2 3 [4] 5 6 ... 12   Go Down
  Print  
Author Topic: How to Run US Animated Radar on Google Maps  (Read 50682 times)
0 Members and 1 Guest are viewing this topic.
CNYWeather
Forecaster
*****
Offline Offline

Posts: 1386



WWW
« Reply #75 on: September 11, 2010, 07:56:16 AM »

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?



When I got the key, Google suggested http://cnyweather.com so it will work across the whole domain.
Code:
<html>

<head>

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAC5-muwYSiNYDHsDz9qtQExRIlTTBBjQ8uiJDIE76upo6MuJm-BRTFtEvIOC7Z8Gokfh3ubRDY0X0hA" type="text/javascript">
</script>

<script src="http://www.eldoradocountyweather.com/current/misc/google-maps/tyx/radar.js"></script>

<script src="http://www.eldoradocountyweather.com/current/misc/google-maps/tyx/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=["TYX"];

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(43.751,-75.675),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(43.751,--75.675);
      var marker = new GMarker(point, {draggable: false,
      title:"Your Mouseover Title" });
      GEvent.addListener(marker, "click", function() {
      marker.openInfoWindowHtml("Name of Your Weather Station");
                         });
      Google.addOverlay(marker);
}
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>

</div>

</body>

</html>


Still no go.
Logged

Cienega32
Forecaster
*****
Offline Offline

Posts: 2307



WWW
« Reply #76 on: September 11, 2010, 03:26:19 PM »


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.



Works like a dream... when I use the right page...  Brick wall Brick wall Brick wall
When throwing your obviously working snippet in there didn't work for me, I figured it out. I was too quick to blame my lack of exposure to javascript and overlooked the more common error - my "occasional" brain-fart.

Since that "major discovery", it works exactly like I was trying to make it work to begin with - with the info in a small include file.


Honestly, did you [ever] have one of those days that, when you look back at it, you wonder how you managed to even cross the street safely?  Embarassed

Thanks for your patience & assistance and, of course, the great script!
« Last Edit: September 11, 2010, 05:46:56 PM by Cienega32 » Logged


Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-WinXP Pro-SP3
www.LasCruces-Weather.com   www.EastMesaWeather.com
ELDoradoWx
El Dorado Weather
Senior Contributor
****
Offline Offline

Posts: 290


Gentoo X = Complete_Control


WWW
« Reply #77 on: September 11, 2010, 04:12:36 PM »


When I got the key, Google suggested http://cnyweather.com so it will work across the whole domain.

Still no go.


The key for your domain should be fine. I looked over your ridge.html document and this is what I found.

Near the very top on the opening "script" tag change it like this:

Change this:
Code:
<script>

To this:
Code:
<script type="text/javascript">

Further down in the code you have double "negative" signs in front of the last longitude setting. Change it to just 1 "-" sign.

You also need to download the two .js files and upload them to the same folder your ridge.html is in.

Then Change this:
Code:
<script src="http://www.eldoradocountyweather.com/current/misc/google-maps/tyx/radar.js"></script>

<script src="http://www.eldoradocountyweather.com/current/misc/google-maps/tyx/ridge.js"></script>

To this:
Code:
<script type="text/javascript" src="radar.js"></script>
<script type="text/javascript" src="ridge.js"></script>

You can download the .js script from here temporarily:
http://www.eldoradocountyweather.com/current/misc/google-maps/tyx/radar.js
http://www.eldoradocountyweather.com/current/misc/google-maps/tyx/ridge.js

I copied your script and ran it on my own site with my key and it worked fine after I made the changes mentioned above. So hopefully this will work for you now. If not we'll get it working..

NOTE: Two of the corrections you needed to make was my fault. I had a 2 errors in the script you copied from the 1st page code which eliminates the URL listing under the map. Is is now corrected..
« Last Edit: September 11, 2010, 04:34:24 PM by ELDoradoWx » Logged

-Danny
-root is everything
ELDoradoWx
El Dorado Weather
Senior Contributor
****
Offline Offline

Posts: 290


Gentoo X = Complete_Control


WWW
« Reply #78 on: September 11, 2010, 04:15:58 PM »


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.



Works like a dream... when I use the right page...  Brick wall Brick wall Brick wall
When throwing your obviously working snippet in there didn't work for me, I figured it out. I was too quick to blame my lack of exposure to javascript and overlooked the more common error - my "occasional" brain-fart.

Since that "major discovery", it works exactly like I was trying to make it work to begin with - with the info in a small include file.


Honestly, did you have one of those days that, when you look back at it, you wonder how you managed to even cross the street safely?  Embarassed

Thanks for your patience & assistance and, of course, the great script!

Your welcome, I'm very happy to help! Yes your original code was fine and should work just as well once it was edited a little. I'd love to see it when you're done. We ALL have those OFF days. Thank God for the lucid ones.

« Last Edit: September 11, 2010, 04:20:42 PM by ELDoradoWx » Logged

-Danny
-root is everything
Cienega32
Forecaster
*****
Offline Offline

Posts: 2307



WWW
« Reply #79 on: September 11, 2010, 06:08:17 PM »

It worked out exactly the way I had first tried it with the include and also with just the code as I originally posted it - it all worked with no edit. I was just stupidly doing it on the wrong page in the wrong folder - the one that had no idea what the heck I was talking about with things like "testtags"  d'oh!  Razz

In my feeble defense, I should point out that it's been awhile since I played with that script and I've been distracted by my new Brultech energy monitor toys and the NFL is starting and ... ... nah, I can't even keep a straight face when I offer that explanation... it was just one of these moments when you end up looking like this ->  Shocked for no good reason.


I haven't really done anything with it all other than a few RADARs from the area and throwing a style="display:none" in the "Helper DIV" to block the link list. It's still sitting in a "wxsample" page & I don't even have a Google Key for it  Embarassed . That last Mexican Hurricane had me looking for it tho' and renewed my interest.

Logged


Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-WinXP Pro-SP3
www.LasCruces-Weather.com   www.EastMesaWeather.com
ELDoradoWx
El Dorado Weather
Senior Contributor
****
Offline Offline

Posts: 290


Gentoo X = Complete_Control


WWW
« Reply #80 on: September 11, 2010, 06:57:14 PM »

In my feeble defense, I should point out that it's been awhile since I played with that script and I've been distracted by my new Brultech energy monitor toys and the NFL is starting

Actually I think that is a very valid defense! That Brultech energy monitor looks really cool and compile that with the NFL starting is enough to mess up any red blooded American man.

The great part is you ended up throwing down and running the gauntlet very well indeed & all by yourself!  Applause Applause Applause
Logged

-Danny
-root is everything
CNYWeather
Forecaster
*****
Offline Offline

Posts: 1386



WWW
« Reply #81 on: September 12, 2010, 07:47:13 AM »

Thanks for the help Danny. Got it all squared away.


Tony  Cool
Logged

LeomaTNWX
Senior Contributor
****
Offline Offline

Posts: 269


WWW
« Reply #82 on: September 12, 2010, 11:36:39 PM »

Here is the link to my page. Map looks great just no radar. Could someone give it a look please?

www.leomaweather.com/ridge.html

Also here is my ridge.html

Quote
<html>

<head>

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

<script type="text/javascript" src="radar.js"></script>
<script type="text/javascript" src="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=["0HX"];

var Product=["NCR"];

function Pause(pause)

{
    Idle=pause*10;

    Back=pause*50;
}

function Opacity(opacity)

{

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

    {

        Radar.opacity(opacity);

    }

}

function Loop()

{

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

    {

        Helper.childNodes.childNodes[0].data=Radar.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++)

    {

        Radar.feed(stub+"&rid="+Ridge+"&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++)

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

        reload=stub+callback.directory;
    }

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

    {

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

    }

}

function Load()

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

    Google.style.width ="700px";

    Google.style.height="640px";

    GDraggableObject.setDraggableCursor("pointer");

    GDraggableObject.setDraggingCursor ("pointer");

    Google=new GMap2(Google);

    Google.setCenter (new GLatLng(36.243,-86.559),7, G_PHYSICAL_MAP);

        Google.setUIToDefault();

    Helper=document.getElementById("helper");

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

    {

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

                Helper.childNodes.appendChild(document.createElement("a"));

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

        Google.addOverlay(Radar);
    }
    Feed();
    Loop();

      var point = new GLatLng(33.359,-82.562);
      var marker = new GMarker(point, {draggable: false,
      title:"Your Mouseover Title" });
      GEvent.addListener(marker, "click", function() {
      marker.openInfoWindowHtml("Leoma Weather");
                         });
      Google.addOverlay(marker);
}
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( Cool;"> 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>
Logged
Cienega32
Forecaster
*****
Offline Offline

Posts: 2307



WWW
« Reply #83 on: September 13, 2010, 12:54:12 AM »

I don't know if it's been changed since I first d/loaded it a while back but where you have this under your RADAR list:

Code:
var Product=["NCR"];

I have this:

Code:
var Product="NCR";

It's been so long, I might have a "bad" one but it works.
Logged


Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-WinXP Pro-SP3
www.LasCruces-Weather.com   www.EastMesaWeather.com
ELDoradoWx
El Dorado Weather
Senior Contributor
****
Offline Offline

Posts: 290


Gentoo X = Complete_Control


WWW
« Reply #84 on: September 13, 2010, 12:55:27 AM »

Here is the link to my page. Map looks great just no radar. Could someone give it a look please?

www.leomaweather.com/ridge.html


You have duplicate code in radar.js and ridge.js. Your code in ridge.js correct

Paste this into your radar.js file:
Code:
function FrameAnimationLayerOverlay(obj)
{
    this.bbox=obj.bbox ? obj.bbox : {};
    this.size=obj.size ? obj.size : {};

    this.last=obj.last ? obj.last :  0;
    this.skew=obj.skew ? obj.skew :  0;
    this.wrap=obj.wrap ? obj.wrap : 10;
    this.name=obj.name ? obj.name : "";

    this.filter=1;
    this.adjust=1;
}

FrameAnimationLayerOverlay.prototype=new GOverlay();

FrameAnimationLayerOverlay.prototype.initialize=function(set)
{
    this.set=set;

    this.div=document.createElement("DIV");

    this.div.style.position="absolute";

    this.set.getPane(G_MAP_MAP_PANE).appendChild(this.div);

    for (var i=0;this.wrap-i;i++)
    {
        var gif=document.createElement("IMG");

        gif.style.position="absolute";

        gif.style.visibility="hidden";

        gif.style.display="none";

        gif.style.left  ="0px";
        gif.style.top   ="0px";
        gif.style.width =this.adjust ? "100%" : "";
        gif.style.height=this.adjust ? "100%" : "";

        gif.onload =this.loaded;
        gif.onerror=this.failed;

        gif.galleryImg="no";

        this.div.appendChild(gif);
    }
}

FrameAnimationLayerOverlay.prototype.remove=function()
{
    for (var i=0;this.wrap-i;i++)
    {
        var gif=this.div.childNodes[this.wrap-i-1];

        this.div.removeChild(gif);
    }

    this.set.getPane(G_MAP_MAP_PANE).removeChild(this.div);
}

FrameAnimationLayerOverlay.prototype.redraw=function(repair)
{
    if (!repair) return

    var z0=this.set.fromLatLngToDivPixel(new GLatLng(this.bbox.y0,this.bbox.x0));
    var z1=this.set.fromLatLngToDivPixel(new GLatLng(this.bbox.y1,this.bbox.x1));

    if (this.adjust)
    {
        this.div.style.left  =Math.min(z1.x,z0.x)+"px";
        this.div.style.top   =Math.min(z1.y,z0.y)+"px";
        this.div.style.width =Math.abs(z1.x-z0.x)+"px";
        this.div.style.height=Math.abs(z1.y-z0.y)+"px";
    }

    else
    {
        this.div.style.left  =(z1.x+z0.x-this.size.x)>>1+"px";
        this.div.style.top   =(z1.y+z0.y-this.size.y)>>1+"px";
        this.div.style.width =this.size.x+"px";
        this.div.style.height=this.size.y+"px";
    }
}

FrameAnimationLayerOverlay.prototype.copy=function()
{
    return new FrameAnimationLayerOverlay({bbox:this.bbox,size:this.size,last:this.last,skew:this.skew,wrap:this.wrap,name:this.name});
}

FrameAnimationLayerOverlay.prototype.loaded=function(gif)
{
    gif=window.event ? window.event.srcElement : gif.currentTarget;

    gif.style.display="";

    gif.loaded=1;
    gif.failed=0;
}

FrameAnimationLayerOverlay.prototype.failed=function(gif)
{
    gif=window.event ? window.event.srcElement : gif.currentTarget;

    if (!gif.failed) gif.src=gif.src;

    gif.style.display="none";

    gif.loaded=0;
    gif.failed=1;
}

FrameAnimationLayerOverlay.prototype.hide=function()
{
    this.div.style.visibility="hidden";
}

FrameAnimationLayerOverlay.prototype.show=function()
{
    this.div.style.visibility="";
}

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;
        }
    }
}

FrameAnimationLayerOverlay.prototype.rescale=function(adjust)
{
    this.adjust=adjust;

    for (var i=0;this.wrap-i;i++)
    {
        var gif=this.div.childNodes[i];

        gif.style.left  ="0px";
        gif.style.top   ="0px";
        gif.style.width =this.adjust ? "100%" : "";
        gif.style.height=this.adjust ? "100%" : "";
    }

    this.redraw(true);
}

FrameAnimationLayerOverlay.prototype.select=function(offset)
{
    offset=(this.skew+offset)%this.wrap;

    var gif=this.div.childNodes[offset];

    if (gif.loaded) this.div.childNodes[this.last].style.visibility="hidden";
    if (gif.loaded) this.last=offset;
    if (gif.loaded) this.div.childNodes[this.last].style.visibility="";

    return this.div.childNodes[this.last].src;
}

FrameAnimationLayerOverlay.prototype.feed=function(recall)
{
    var div=document.getElementById("("+this.name+")");

    if (div) document.body.removeChild(div);

    div=document.createElement("SCRIPT");

    if (div) document.body.appendChild(div);

    div.src=recall+"&random="+(""+Math.random().toFixed(10)+"").slice(-10);

    div.id="("+this.name+")";
}

FrameAnimationLayerOverlay.prototype.reload=function(recall)
{
    var gif,src;

    var set=[0,0];

    for (var i=0;recall[i];i++)
    {
        src=recall[i];

        if (gif=this.div.childNodes[(this.skew+i+0)%this.wrap]) set[0]+=gif.loaded*(gif.src==src);
        if (gif=this.div.childNodes[(this.skew+i+1)%this.wrap]) set[1]+=gif.loaded*(gif.src==src);
    }

    if ((set[0]==(i-0))*(set[1]==0))
    {
        return;
    }

    if ((set[0]==0)*(set[1]==(i-1)))
    {
        gif=this.div.childNodes[(this.skew+0)%this.wrap];

        this.skew=(this.skew+1)%this.wrap;

//        this.div.removeChild(gif);
//        this.div.appendChild(gif);

        gif.style.display="none";

        gif.loaded=0;
        gif.failed=0;

        gif.src=src;

        return;
    }

    for (var i=0;recall[i];i++)
    {
        src=recall[i];

        gif=this.div.childNodes[(this.skew+i)%this.wrap];

        gif.style.display="none";

        gif.loaded=0;
        gif.failed=0;

        gif.src=src;
    }
}

« Last Edit: September 13, 2010, 02:50:39 PM by ELDoradoWx » Logged

-Danny
-root is everything
LeomaTNWX
Senior Contributor
****
Offline Offline

Posts: 269


WWW
« Reply #85 on: September 13, 2010, 11:01:45 AM »

Thanks!!! I forgot to look at those files. I figured I messed up somewhere in the html file. Thanks again.
Logged
branmh
Member
*
Offline Offline

Posts: 1



« Reply #86 on: September 16, 2010, 10:05:14 PM »

Great Script was able to get working in no time, but is there away to add warnings?
Logged
ELDoradoWx
El Dorado Weather
Senior Contributor
****
Offline Offline

Posts: 290


Gentoo X = Complete_Control


WWW
« Reply #87 on: September 18, 2010, 03:35:21 PM »

Great Script was able to get working in no time, but is there away to add warnings?

I'm glad you like the script and got it working so easily. You are welcome to use and develop this script in any way you wish.

« Last Edit: September 18, 2010, 03:37:05 PM by ELDoradoWx » Logged

-Danny
-root is everything
DaculaWeather
It's a Jeep thing... you wouldn't understand.
Forecaster
*****
Offline Offline

Posts: 2716


SCCA EM #156


WWW
« Reply #88 on: September 20, 2010, 08:21:16 PM »

Got the bubble with current conditions working. http://www.daculaweather.com/ridge_georgia_master.php
Nice little feature!
Logged

Steve
Davis Vue, VWS, WDisplay, VVP, StartWatch CWOP 

ELDoradoWx
El Dorado Weather
Senior Contributor
****
Offline Offline

Posts: 290


Gentoo X = Complete_Control


WWW
« Reply #89 on: September 21, 2010, 12:46:03 AM »

Got the bubble with current conditions working. http://www.daculaweather.com/ridge_georgia_master.php
Nice little feature!

Lookin' good Steve, nicely done.

Are you getting the data from, WD and testtags.php or VWS?




Logged

-Danny
-root is everything
DaculaWeather
It's a Jeep thing... you wouldn't understand.
Forecaster
*****
Offline Offline

Posts: 2716


SCCA EM #156


WWW
« Reply #90 on: September 21, 2010, 06:19:00 AM »

Thanks. WD.
Logged

Steve
Davis Vue, VWS, WDisplay, VVP, StartWatch CWOP 

jay_hoehn
Forecaster
*****
Offline Offline

Posts: 422



WWW
« Reply #91 on: September 21, 2010, 11:22:24 AM »

Is there a way to pull this from VWS?  What file would I use?

Jay
Logged

Davis Vantage Pro2 Plus
VVP
VWS
VP Live
Cumulus
WeatherFlash
Image Salsa
Movie Salsa
DaculaWeather
It's a Jeep thing... you wouldn't understand.
Forecaster
*****
Offline Offline

Posts: 2716


SCCA EM #156


WWW
« Reply #92 on: September 21, 2010, 11:33:45 AM »

I'll play with that when I get home this afternoon, but in short, yes, you should be able to. The part I don't know about yet is the inclusion of " in the script. Any formatting beyond the very basic stuff that doesn't use quotes might not work since the script uses quotes to enclose the string of fields from WD.

I will create a page that loads the AJAX script and attempt to use the VWS tags in place of the WD tags.
Logged

Steve
Davis Vue, VWS, WDisplay, VVP, StartWatch CWOP 

jay_hoehn
Forecaster
*****
Offline Offline

Posts: 422



WWW
« Reply #93 on: September 21, 2010, 12:25:39 PM »

Thanks, Steve.  I do have AJAX updating my site if that helps.

Jay
Logged

Davis Vantage Pro2 Plus
VVP
VWS
VP Live
Cumulus
WeatherFlash
Image Salsa
Movie Salsa
Cienega32
Forecaster
*****
Offline Offline

Posts: 2307



WWW
« Reply #94 on: September 23, 2010, 02:22:15 AM »

Your welcome, I'm very happy to help! Yes your original code was fine and should work just as well once it was edited a little. I'd love to see it when you're done. We ALL have those OFF days. Thank God for the lucid ones.


Well, I got around to getting a KEY and I finally found a little more time for the bubble and, being it was a weather day I thought it a good time to try and finish my "vision". Almost done:



If there are any advisories, it starts with the bubble "open"  If not, it's "closed". Same with the "graphicast" presence on the page bottom.

Right now, the advisory colors match those found in the atom-advisory.php list.

If it's raining, the rain rate will be included and gusts will display with the wind over 0 mph.

I posted a screen cap to show the advisory and because I don't know how well it works without one yet!  Laughing Only kidding. The wind and rain details work fine and I haven't had anything other than a "Watch" going on today.

It's just slopped into a wxsample type page so I can find it easily and I haven't worried about any lack of validation yet.
 
http://www.lascruces-weather.com/wxridge2.php
« Last Edit: September 24, 2010, 09:36:02 PM by Cienega32 » Logged


Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-WinXP Pro-SP3
www.LasCruces-Weather.com   www.EastMesaWeather.com
DaculaWeather
It's a Jeep thing... you wouldn't understand.
Forecaster
*****
Offline Offline

Posts: 2716


SCCA EM #156


WWW
« Reply #95 on: September 23, 2010, 06:00:01 AM »

Very nice. How did you make it start with the bubble open on alarms?
Logged

Steve
Davis Vue, VWS, WDisplay, VVP, StartWatch CWOP 

Cienega32
Forecaster
*****
Offline Offline

Posts: 2307



WWW
« Reply #96 on: September 23, 2010, 09:57:44 PM »

Thanks Steve!

What I did was to drop this in after the event listener:

Code:
     
<?php if ($NOAAEvent !== 'NO CURRENT ADVISORIES') {?>
marker.openInfoWindowHtml(" <?php include("ridge_bubble2.php"); ?> ");
<?php ?>
 

In the marker area, it would look like this between the listener function closers and the "next line":

Code:
GEvent.addListener(marker, "click", function() {
       marker.openInfoWindowHtml(" <?php include("ridge_bubble2.php"); ?> "
 );
});       
<?php if ($NOAAEvent !== 'NO CURRENT ADVISORIES') {?>
marker.openInfoWindowHtml(" <?php include("ridge_bubble2.php"); ?> ");
<?php ?>
Google.addOverlay(marker);

Needless to say (but I will anyway  Razz), the php include is for my file with "the stuff" in it to be displayed.

It just puts a condition test outside of the event listener and opens the balloon if condition met. I'm assuming it works by just juggling the condition test and getting the desired results in either case.

I'm still linking to an older page so it doesn't function just yet on the "real" link.
Logged


Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-WinXP Pro-SP3
www.LasCruces-Weather.com   www.EastMesaWeather.com
subh
Member
*
Offline Offline

Posts: 4



« Reply #97 on: September 24, 2010, 12:47:17 PM »

Hi,

Can anyone point me to any website showing animated RADAR/SATELLITE weather forecast for Brazil?

Something like this would be very useful, but not sure how they are using it.

http://www.wunderground.com/wundermap/?lat=-22.89999962&lon=-43.16999817&zoom=8&pin=Rio%20De%20Janeiro%2c%20Brazil&type=hyb&rad=0&wxsn=0&svr=0&cams=0&sat=1&sat.num=1&sat.spd=25&sat.opa=85&sat.gtt1=109&sat.gtt2=108&sat.type=VIS&riv=0&mm=0&hur=0

Thanks,
subh
« Last Edit: September 24, 2010, 12:49:10 PM by subh » Logged
DaculaWeather
It's a Jeep thing... you wouldn't understand.
Forecaster
*****
Offline Offline

Posts: 2716


SCCA EM #156


WWW
« Reply #98 on: September 24, 2010, 12:49:37 PM »

Danny?  Very Happy
Logged

Steve
Davis Vue, VWS, WDisplay, VVP, StartWatch CWOP 

ELDoradoWx
El Dorado Weather
Senior Contributor
****
Offline Offline

Posts: 290


Gentoo X = Complete_Control


WWW
« Reply #99 on: September 24, 2010, 11:43:06 PM »

Hi,

Can anyone point me to any website showing animated RADAR/SATELLITE weather forecast for Brazil?

Something like this would be very useful, but not sure how they are using it.

http://www.wunderground.com/wundermap/?lat=-22.89999962&lon=-43.16999817&zoom=8&pin=Rio%20De%20Janeiro%2c%20Brazil&type=hyb&rad=0&wxsn=0&svr=0&cams=0&sat=1&sat.num=1&sat.spd=25&sat.opa=85&sat.gtt1=109&sat.gtt2=108&sat.type=VIS&riv=0&mm=0&hur=0

Thanks,
subh

Hi subh,

From what I have found, South America including Brazil have fairly spotty radar coverage. Brazil has some radar coverage in the Sao Paulo area from near Joinville to Rio De Janeiro running a few hundred miles inland. Also in the extreme south in the central and western area of the state of Rio Grande do Sul..

Here is the main Brazil radar page: http://www.redemet.aer.mil.br/radar/radar.php?ID_REDEMET=89911f843ef2e1c69d0273889005ad24

I think the Wunderground Map you provided is a bit incomplete compared to other areas of the world, but I am sure they will catch up eventually.

Unfortunately there are few places in the world that have radar and satellite coverage as good as the United States and it is free for anyone to use in the Land of the Free. The National Weather Service also gives you full access to most of their data bases (for those that know where to look), making it much easier to make radar script like what is in this thread, unlike most places in the world.
 
I don't know if this is what you are looking for, but on my weather site I have South America city forecasts for all of South America including 364, 7 day forecasts for cities in brazil, satellite coverage, current weather conditions and climate data for 180 different cities in Brazil. I am planning to extend my South America coverage going forward including SOME radar. Below I have posted some brazil links you might be interested in.

Forecast for cities Brazil: http://www.eldoradocountyweather.com/forecast/brazil/brazil-city-forecast-listings-a-c.html

Climate: http://www.eldoradocountyweather.com/climate/brazil/brazil-city-climate-listings-a-z.html

Current Conditions Temperature: http://www.eldoradocountyweather.com/forecast/southamerica/southamericatemps.html
Current Conditions Dew Point: http://www.eldoradocountyweather.com/forecast/southamerica/southamericadew.html
Current Conditions Heat Index: http://www.eldoradocountyweather.com/forecast/southamerica/southamericaheat.html
Current Conditions Humidity: http://www.eldoradocountyweather.com/forecast/southamerica/southamericahumidity.html
Current Conditions Pressure: http://www.eldoradocountyweather.com/forecast/southamerica/southamericapressure.html
Current Conditions Wind Speed: http://www.eldoradocountyweather.com/forecast/southamerica/southamericawindspeed.html

6 Day Precipitation Forecast: http://www.eldoradocountyweather.com/forecast/world-forecasts/world-day1-rainfall-forecast.html

Infra Red Satellite: http://www.eldoradocountyweather.com/current/satellite/south-america-ir-satellite-loop.html
Satellite Visible Satellite: http://www.eldoradocountyweather.com/current/satellite/south-america-vis-satellite-loop.html
Satellite Water Vapor Satellite: http://www.eldoradocountyweather.com/current/satellite/south-america-wv-satellite-loop.html
Color Infra Red Satellite: http://www.eldoradocountyweather.com/satellite/misc/s.america-ir-sat.html

« Last Edit: September 25, 2010, 12:56:43 AM by ELDoradoWx » Logged

-Danny
-root is everything
Pages: 1 2 3 [4] 5 6 ... 12   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.151 seconds with 18 queries.