Author Topic: Saratoga AJAX Php Template radar image problem  (Read 1014 times)

0 Members and 1 Guest are viewing this topic.

Offline noopara

  • Member
  • *
  • Posts: 8
Saratoga AJAX Php Template radar image problem
« on: February 08, 2019, 11:57:53 AM »
I can't get the radar image to show up.  I get a blank page instead.

In the php file WU-radar-inc.php I have this setting for the CityURL:
$CityURL = 'https://radblast.wunderground.com/cgi-bin/radar/WUNIDS_map?station=ATX&brand=wui&num=1&delay=15&type=N0R&frame=6&scale=0.125&noclutter=0&showstorms=0&mapx=400&mapy=240&centerx=458.5&centery=-561.5&transx=58.5&transy=-801.5&showlabels=1&severe=0&rainsnow=0&lightning=0&smooth=0&rand=25824941&lat=47.38000107&lon=-122.70999908&label=Gig+Harbor'

This URL works but the template won't render it.  Before I changed it to my local radar image it was working with the default link.  Here's the link to it: http://kreha.org/wdisplay/wxradar.php

Any help would be greatly appreciated.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Saratoga AJAX Php Template radar image problem
« Reply #1 on: February 08, 2019, 12:20:06 PM »
You likely have a PHP syntax error in WU-radar-inc.php that prevents it from displaying.

Copy WU-radar-inc.php to WU-radar-inc.txt and post it here and I'll take a look.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline noopara

  • Member
  • *
  • Posts: 8
Re: Saratoga AJAX Php Template radar image problem
« Reply #2 on: February 08, 2019, 12:40:14 PM »
OK.  Thanks.  The only intentional changes I made were to the cityURL and metroURL.

 [ You are not allowed to view attachments ]

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Saratoga AJAX Php Template radar image problem
« Reply #3 on: February 08, 2019, 12:50:08 PM »
Yes, a syntax error
Quote
Parse error: syntax error, unexpected '$CityPos2' (T_VARIABLE) in C:\xampp\htdocs\WU-radar-inc.php on line 100

You left off the semicolon on the line
Code: [Select]
$CityURL = 'https://radblast.wunderground.com/cgi-bin/radar/WUNIDS_map?station=ATX&brand=wui&num=1&delay=15&type=N0R&frame=6&scale=0.125&noclutter=0&showstorms=0&mapx=400&mapy=240&centerx=458.5&centery=-561.5&transx=58.5&transy=-801.5&showlabels=1&severe=0&rainsnow=0&lightning=0&smooth=0&rand=25824941&lat=47.38000107&lon=-122.70999908&label=Gig+Harbor' which should read
Code: [Select]
$CityURL = 'https://radblast.wunderground.com/cgi-bin/radar/WUNIDS_map?station=ATX&brand=wui&num=1&delay=15&type=N0R&frame=6&scale=0.125&noclutter=0&showstorms=0&mapx=400&mapy=240&centerx=458.5&centery=-561.5&transx=58.5&transy=-801.5&showlabels=1&severe=0&rainsnow=0&lightning=0&smooth=0&rand=25824941&lat=47.38000107&lon=-122.70999908&label=Gig+Harbor';
The same problem with the $MetroURL line (missing ending semicolon).

Fix those, and the page works again, and you can continue configuring it with the WU-radar-testpage.php?show=loc
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline noopara

  • Member
  • *
  • Posts: 8
Re: Saratoga AJAX Php Template radar image problem
« Reply #4 on: February 08, 2019, 01:18:05 PM »
OK.  Thanks.  I should have noticed.  It's fixed.

I was looking for an error log but wasn't able to find it.  Where is it?

I have no interest in the red dot showing on the maps.  How can I remove that feature?


Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Saratoga AJAX Php Template radar image problem
« Reply #5 on: February 08, 2019, 03:38:08 PM »
Yes, there's an easy way to suppress all the city location dots on the page.

In wxradar.php change
Code: [Select]
</head>
to
Code: [Select]
<style type="text/css">
#cityloc {
  display: none;
}
</style>
</head>
and all the location dots will be generated but not displayed by the browser.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline noopara

  • Member
  • *
  • Posts: 8
Re: Saratoga AJAX Php Template radar image problem
« Reply #6 on: February 08, 2019, 04:58:02 PM »
OK, great.  That's perfect.

Where did you get this error from?: Parse error: syntax error, unexpected '$CityPos2' (T_VARIABLE) in C:\xampp\htdocs\WU-radar-inc.php on line 100

Is there an error log somewhere that generated it or is it from some IDE?

-- greg

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Saratoga AJAX Php Template radar image problem
« Reply #7 on: February 09, 2019, 01:53:57 PM »
I'd tried your copy of the script on a local XAMPP server with display_error(1) set on.
You'd also see this in the error_log for your server (it's likely a file in the document root of your website or in the logs directory where the Apache access logs are deposited).
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline noopara

  • Member
  • *
  • Posts: 8
Re: Saratoga AJAX Php Template radar image problem
« Reply #8 on: February 09, 2019, 04:30:06 PM »
OK.  Thanks.  I looked in my server logs but didn't see it reported. 

Another question.  I decided to keep the red dots and I have adusted their position.

When the radar page is first rendered it starts out on WUname3.  How can I change it to start on WUname1?

Here's what it looks like now: http://kreha.org/wdisplay/index.php
« Last Edit: February 09, 2019, 05:11:21 PM by noopara »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Saratoga AJAX Php Template radar image problem
« Reply #9 on: February 09, 2019, 06:01:34 PM »
Sure, you can do that too.  Change WU-radar-inc.php
Code: [Select]
if ( empty($_REQUEST['mode']) )
        $_REQUEST['mode']="3";
to
Code: [Select]
if ( empty($_REQUEST['mode']) )
        $_REQUEST['mode']="1";
to start at the highest zoom level.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline noopara

  • Member
  • *
  • Posts: 8
Re: Saratoga AJAX Php Template radar image problem
« Reply #10 on: February 10, 2019, 05:51:26 PM »
OK.  That works great.  Thanks.

One other little tweak I would like to make is with the radar images.  They show a circle with a + in it for the location of the weather station.  A small "legend" shows at the bottom of each radar image with the circle and + to define what the circle + is.  Along side of the symbol is a label which is the cityname which is set in the settings.php page.  In my case it's Gig Harbor.  This is also used to label the red dot.  Is there a way to change just the label for the weather station location and leave the label for the red dot as it is.?

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Saratoga AJAX Php Template radar image problem
« Reply #11 on: February 10, 2019, 09:46:12 PM »
In your $CityURL value there is the string
Code: [Select]
&lat=47.38000107&lon=-122.70999908&label=Gig+Harbor .. remove it.
In your $MetroURL value there is the string
Code: [Select]
&lat=47.33&lon=-122.58&label=Gig+Harbor .. remove it too.

Then the target on the map will no longer display nor will the target+text display below the map.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline noopara

  • Member
  • *
  • Posts: 8
Re: Saratoga AJAX Php Template radar image problem
« Reply #12 on: February 11, 2019, 12:03:15 PM »
I removed them from the $CityURL and $MetroURL in WU-radar-inc.php but the target and labels are still visible.

http://www.kreha.org/wdisplay/wxradar.php


Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Saratoga AJAX Php Template radar image problem
« Reply #13 on: February 11, 2019, 12:36:02 PM »
There are three more places in the code which regenerate the lat/long/name.  They would have to be removed also to fully disable the WU display of the target marker and legend.  That's a lot of work.. I suggest you use what is currently presented so your page won't have to be refitted with mods when the next version of WU-radar-inc.php is released.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline noopara

  • Member
  • *
  • Posts: 8
Re: Saratoga AJAX Php Template radar image problem
« Reply #14 on: February 11, 2019, 02:38:13 PM »
OK.  Thanks...that makes sense.

I notice that the last two zoomed out radar views are not animated like the others are.  I looked on weather underground and there these views are animated.  Why wouldn't they be in the template?

 

anything