Quote:
Originally Posted by tateu
Re: Radar
1. It's on a list of things to do, but down very, very low. I haven't even begun to think about how to accomplish it.
|
Hey tateu. I think I know how you can easily get radar on this program. I actually downloaded the source code to BBWeather and played around with it in JDE for a few hours this afternoon, but I've never programmed, so I gave up. Anyways, here is how it can easily be done.
There is a URL that points to an image file that is updated in realtime. If you set some parameters of the URL to be a variable, then you can populate those variables using the location you want the radar for. The image URL can be manipulated to change the city, state, image size, animation (0, 1). You will also have to have some way to look up the approximate latitude and longitude of the city/state, as it uses the latitude and longitude to look up the image. For example, the following would be the link to view the Humble, TX radar to fit perfectly in PORTRAIT MODE:
http://www.accuweather.com/m/US/wigs.axd?city=HUMBLE&state=
TX&w=
350&h=
470&type=_SIR&geoWidth=200&lat=
29.99&lon=
-95.18&anim=
0&af=
5
For anim=, set it to 0 for current radar, set it to 1 for animated radar
For af=, set it any value. A value of 5 animates the image to show the last 5 images.
I'm hoping you can just pull the image down from the web and display fullscreen in the program, as I don't want the browser to open.
So, the URL above will be for portrait version. When the phone switches to landscape mode, the image would have to be refreshed with an updated w= and h= value. For landscape mode, update the values from w=
350&h=
470 to w=
470&h=
350...Now it will show perfectly in landscape.
So, in summary, you can set those changeable values in the URL to variables, and populate them using the city/state/latitude/longitude data that you look up, and then you can manipulate the other variables for portrait mode/landscape mode/animated/non-animated/# of pictures in animation.
Also, I just figured out another parameter in the URL...The geoWidth=200 refers to the diameter around the city/state in miles. So, set at 200, it will show the radar 100 miles out in each direction, and if it is set at 100, it will show the radar out 50 miles out in each direction. In essence, the lower the number is set to, the more zoomed in the radar image will be. And vice versa. I would set that as a user-defined variable in settings too.
Hope this all makes sense and is easy to implement. Right now, I just have these URLs saved into my QuickLaunch, but I'd love them to be built into BBWeather.
Here is what they will look like:
Portrait Animated 5 images:
http://www.accuweather.com/m/US/wigs...18&anim=1&af=5
Portrait Non-Animated:
http://www.accuweather.com/m/US/wigs...18&anim=0&af=0
Landscape Animated 5 images:
http://www.accuweather.com/m/US/wigs...18&anim=1&af=5
Landscape Non-Animated:
http://www.accuweather.com/m/US/wigs...18&anim=0&af=0