Author Topic: wxquake.php help  (Read 2990 times)

0 Members and 1 Guest are viewing this topic.

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
wxquake.php help
« on: February 24, 2013, 03:05:53 PM »
Why isn't the google map appearing?

http://hayskansasweather.com/wxquake.php




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: wxquake.php help
« Reply #1 on: February 24, 2013, 04:06:36 PM »
I don't have any leading zero's in Settings.php for the Lat and Long. I've read that may cause the problem but not in my case.




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline W3DRM

  • Forecaster
  • *****
  • Posts: 3360
    • Emmett Weather
Re: wxquake.php help
« Reply #2 on: February 24, 2013, 05:24:01 PM »
Ryan,

Why don't you post your wxquake.php file so we can look at it? Someone here may spot the problem.

Don - W3DRM - Emmett, Idaho --- Blitzortung ID: 808 --- FlightRadar24 ID: F-KBOI7
Davis Wireless VP2, WD 10.37s150,
StartWatch, VirtualVP, VPLive, Win10 Pro
--- Logitech HD Pro C920 webcam (off-line)
--- RIPE Atlas Probe - 32849

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: wxquake.php help
« Reply #3 on: February 24, 2013, 05:52:38 PM »
Here it is.




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline W3DRM

  • Forecaster
  • *****
  • Posts: 3360
    • Emmett Weather
Re: wxquake.php help
« Reply #4 on: February 24, 2013, 06:14:44 PM »
Ryan,

I just loaded your wxquake.php file onto my server and it works perfectly using my set of templates. So, I suspect your problem may be with one of the other files that get called by the quake routine. Here is your file loading on my website:


and, for comparison, my wxquake file. The only difference between the two files is the "distance" setting. Mine is set at 500 miles, yours at 1000 miles.


Thus, it has to be some other code such as the json-quzke.php file. I've attached a zip copy of mine to this post for you to compare entries.

Don - W3DRM - Emmett, Idaho --- Blitzortung ID: 808 --- FlightRadar24 ID: F-KBOI7
Davis Wireless VP2, WD 10.37s150,
StartWatch, VirtualVP, VPLive, Win10 Pro
--- Logitech HD Pro C920 webcam (off-line)
--- RIPE Atlas Probe - 32849

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: wxquake.php help
« Reply #5 on: February 24, 2013, 06:22:31 PM »
I put your json-quake.php on my server and still no map. Hmm




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: wxquake.php help
« Reply #6 on: February 24, 2013, 06:44:39 PM »
What are all the files needed for this to work?




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: wxquake.php help
« Reply #7 on: February 24, 2013, 09:10:17 PM »
Is this the correct file that is needed for the map?

http://hayskansasweather.com/quake-json.js

Is this line correct?

Code: [Select]
   <script src="http://maps.google.com/maps/api/js?sensor=false&amp;language=<?php echo $lang?>" type="text/javascript"></script>
    <script src="quake-json.js" type="text/javascript"></script>
</head>
<body>
« Last Edit: February 24, 2013, 09:16:43 PM by hayskswx »




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline W3DRM

  • Forecaster
  • *****
  • Posts: 3360
    • Emmett Weather
Re: wxquake.php help
« Reply #8 on: February 25, 2013, 02:20:31 PM »
Is this the correct file that is needed for the map?

http://hayskansasweather.com/quake-json.js

Is this line correct?

Code: [Select]
   <script src="http://maps.google.com/maps/api/js?sensor=false&amp;language=<?php echo $lang?>" type="text/javascript"></script>
    <script src="quake-json.js" type="text/javascript"></script>
</head>
<body>

Ryan,

I compared your quake-json.js file with mine and they are identical. And, the code you posted above, also matches what I have. The wxquake.php file does call other routines when it runs so the problem may be elsewhere in your code. The includes I find in the wxquake.php for my site are as follows:

  • require_once("Settings.php");
  • require_once("common.php");
  • include("top.php");
  • include("header.php");
  • include("menubar.php");
  • include_once("quake-json.php");
  • include("footer.php");

I'm wondering if it could be your Settings.php file causing the problem. That is the only one that would impact the mapping content on your quake page. I've attached a zipped copy of mine although it will be different for yours.

If this doesn't show somethign perhaps Ken (Saratoga Wx) can find the problem...
« Last Edit: February 25, 2013, 02:23:01 PM by W3DRM »
Don - W3DRM - Emmett, Idaho --- Blitzortung ID: 808 --- FlightRadar24 ID: F-KBOI7
Davis Wireless VP2, WD 10.37s150,
StartWatch, VirtualVP, VPLive, Win10 Pro
--- Logitech HD Pro C920 webcam (off-line)
--- RIPE Atlas Probe - 32849

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: wxquake.php help
« Reply #9 on: February 25, 2013, 02:46:39 PM »
Looking at you wxquake.php page, I see a JavaScript error that is causing the issue
Quote
Timestamp: 2/25/2013 11:47:35 AM
Error: SyntaxError: missing name after . operator
Source File: http://hayskansasweather.com/wxquake.php
Line: 799, Column: 58
Source Code:
 var center = new google.maps.LatLng(38.899998,-99.299998.);

It is likely caused by the trailing . (period) in Settings.php
Code: [Select]
$SITE['longitude']        = '-99.299998.';  //East=positive, West=negative decimal degrees
Change that to
Code: [Select]
$SITE['longitude']        = '-99.299998';  //East=positive, West=negative decimal degrees
and the map should work for you.

Best regards,
Ken
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 cospringswx

  • Forecaster
  • *****
  • Posts: 4136
    • Colorado Springs Weather
Re: wxquake.php help
« Reply #10 on: February 25, 2013, 03:47:07 PM »
Ken you are a mastermind as that solved the problem. Just amazes me that something so simple as a period would make it not work! Don thanks for your assistance as well!

http://hayskansasweather.com/wxquake.php




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Amcrest HD IP Camera

Offline W3DRM

  • Forecaster
  • *****
  • Posts: 3360
    • Emmett Weather
Re: wxquake.php help
« Reply #11 on: February 25, 2013, 03:50:44 PM »
Yes, Ken is a master at this stuff.  =D&gt;

Just wish I could learn PHP and JAVASCRIPT like he has. Dabbling, as I do, just doesn't cut the mustard when it comes to finding these kinds of errors. However, we were getting close to the problem with the Settings.php file albeit a bit slower than Ken.  :lol:

Looks great now...

Don - W3DRM - Emmett, Idaho --- Blitzortung ID: 808 --- FlightRadar24 ID: F-KBOI7
Davis Wireless VP2, WD 10.37s150,
StartWatch, VirtualVP, VPLive, Win10 Pro
--- Logitech HD Pro C920 webcam (off-line)
--- RIPE Atlas Probe - 32849

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: wxquake.php help
« Reply #12 on: February 25, 2013, 03:52:11 PM »
You're welcome! :)

JavaScript is very sensitive to syntax errors and tends to just stop all execution of JavaScript on the page when an error is detected.

At least, when PHP encounters an error, it generally posts a message highlighting where the issue is.. Only the JavaScript console on your browser would contain the location of the issue .. I'd used Firefox and the error console showed where the issue was.  Since that value comes from PHP, it was simple to isolate it to a small problem with the Settings.php entry involved.

Best regards,
Ken
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 rrrick8

  • Senior Contributor
  • ****
  • Posts: 225
    • Vermilion weather
Re: wxquake.php help
« Reply #13 on: February 25, 2013, 04:01:18 PM »
Ken you are a mastermind as that solved the problem. Just amazes me that something so simple as a period would make it not work! Don thanks for your assistance as well!

http://hayskansasweather.com/wxquake.php

Men have been trying to figure out that problem since Adam and Eve.

 #-o
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline SlowModem

  • Weather at the speed of dialup!
  • Forecaster
  • *****
  • Posts: 6641
  • WX @ 26.4 kbs
    • Watts Bar Weather
Re: wxquake.php help
« Reply #14 on: February 25, 2013, 06:48:22 PM »
Men have been trying to figure out that problem since Adam and Eve.

 #-o

That was my first thought as well but I wasn't going to say anything.   :-#
Greg Whitehead
Ten Mile, TN USA