Author Topic: Earthquake Map Not Showing  (Read 922 times)

0 Members and 1 Guest are viewing this topic.

Offline southcoastwx

  • Member
  • *
  • Posts: 10
    • Gary's Southcoast Weather Page
Earthquake Map Not Showing
« on: April 11, 2018, 07:19:13 PM »
My earthquake map is not displaying....I've added the Google API as suggested in an earlier topic. Any ideas what else to look for?

 [ You are not allowed to view attachments ]

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 949
    • LexMAWeather
Re: Earthquake Map Not Showing
« Reply #1 on: April 11, 2018, 08:32:32 PM »
Link to your site?

The first thing I look for these days is an https requirement when the script uses http.
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline southcoastwx

  • Member
  • *
  • Posts: 10
    • Gary's Southcoast Weather Page
Re: Earthquake Map Not Showing
« Reply #2 on: April 11, 2018, 08:40:06 PM »
Southcoastwx.net

Still a work in progress.

Offline southcoastwx

  • Member
  • *
  • Posts: 10
    • Gary's Southcoast Weather Page
Re: Earthquake Map Not Showing
« Reply #3 on: April 11, 2018, 08:51:20 PM »
  I thought about that, but I figured a regional map would show anyway.  Can I edit my site to change criteria?

Thanks, Gary

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 923
    • North Bend Weather
Re: Earthquake Map Not Showing
« Reply #4 on: April 11, 2018, 08:57:39 PM »
There are setting you change within the script, range from epicenter and magnitude. If I remember right, the default settings are 200 miles and 2.0
"Nature can do without man, but man cannot do without nature."


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam + Soil temp + Soil Moisture

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 949
    • LexMAWeather
Re: Earthquake Map Not Showing
« Reply #5 on: April 11, 2018, 09:02:59 PM »
The javascript to create the map is looking for an HTML tag with the id of "map":

Code: [Select]
var map = new google.maps.Map(document.getElementById("map"), options);
... which isn't there (or I missed it).

It should just be a matter of adding a div with the id "map" where you want the map to appear:
Code: [Select]
<div id="map"></div>
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 949
    • LexMAWeather
Re: Earthquake Map Not Showing
« Reply #6 on: April 11, 2018, 09:44:24 PM »
Just took a look at the source (I don't use it so I'm not familiar with it). So it seems that the code doesn't produce a map if there are no quakes to show.

This is the bit of code that provides the map div:

Code: [Select]
      <div id="map-container">
        <div id="map"></div>
      </div>

but that gets inserted within the foreach loop which only executes if quakes are found.

If you want the map unconditionally, or just want to see what it looks like temporarily, you can add a bit of code later on where the "No earthquakes" message appears (and then remove it again if it is temporary).

Code: [Select]
} else {
          // --------------- customize HTML if you like -----------------------
          print "<div id=\"map-container\"><div id=\"map\"></div></div>"; // ADDED CODE.....
          if(strlen($content) > 10) {
      print "<p>".langtransstr("No earthquakes of magnitude")." $minRichter ".langtransstr("or greater within")." $dmaxDist ".langtransstr("reported in last 7 days").".</p>\n";
  } else {
    print "<h3>".langtransstr('The USGS feed for earthquakes was not available at this time.')."</h3>\n";
  }
 
}
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9277
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Earthquake Map Not Showing
« Reply #7 on: April 11, 2018, 11:23:31 PM »
The script is operating properly on your site.  With the default 200 mile distance from your lat/long, there are no earthquakes in that radius, so no map is displayed.

If you use http://southcoastwx.net/wxquake.php?distance=2000 for a 2000 mile radius, you'll see a map, and the nearest earthquake to you is
19 mi SSW of Wellsboro, Pennsylvania    2.6    333 mi    Thu, 05-Apr-2018 6:19pm EDT

You can adjust the distance filter and the map scaling in the wxquake.php page
Code: [Select]
  $setDistanceRadius  = 200;  // same units as first unit in $setDistanceDisplay
# NOTE: quakes of magnitude 1.0+ are available for USA locations only.
#    non-USA location earthquakes of magnitude 4.0+ are the only ones available from the USGS
  $setMinMagnitude = '2.0';  // minimum Richter Magnitude to display
  $setHighMagnitude = '4.0';  // highlight this Magnitude and greater
 
  $setMapZoomDefault = 7;    // default zoom for Google Map 1=world to 13=street

I'd suggest you use
Code: [Select]
  $setDistanceRadius  = 1500;  // same units as first unit in $setDistanceDisplay
# NOTE: quakes of magnitude 1.0+ are available for USA locations only.
#    non-USA location earthquakes of magnitude 4.0+ are the only ones available from the USGS
  $setMinMagnitude = '2.0';  // minimum Richter Magnitude to display
  $setHighMagnitude = '4.0';  // highlight this Magnitude and greater
 
  $setMapZoomDefault = 5;    // default zoom for Google Map 1=world to 13=street
and it will show quakes on your 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 southcoastwx

  • Member
  • *
  • Posts: 10
    • Gary's Southcoast Weather Page
Re: Earthquake Map Not Showing
« Reply #8 on: April 12, 2018, 03:48:23 AM »
Editing the script to adjust the radius did the trick...thanks so much!

Cheers, Gary

Offline mkutche

  • Forecaster
  • *****
  • Posts: 1043
    • GosportWx.com
Re: Earthquake Map Not Showing
« Reply #9 on: December 10, 2018, 08:36:22 PM »
I have mine set to 500 and i can't get the map to display.. http://gosportwx.com/quakes.php using the test page
Mike K.
Davis Vantage Vue 6250 - CumulusMX (3.21.1-b3205)
Gosport, Indiana
Gosportwx.com twitter.com/GosportINWX
-----------------------------------------------------------

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9277
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Earthquake Map Not Showing
« Reply #10 on: December 10, 2018, 09:00:46 PM »
You need to update wxquake.php page so the CSS for the leaflet map is used.
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 mkutche

  • Forecaster
  • *****
  • Posts: 1043
    • GosportWx.com
Re: Earthquake Map Not Showing
« Reply #11 on: December 10, 2018, 09:02:32 PM »
You need to update wxquake.php page so the CSS for the leaflet map is used.

I did update using http://saratoga-weather.org/quake-json.zip
Mike K.
Davis Vantage Vue 6250 - CumulusMX (3.21.1-b3205)
Gosport, Indiana
Gosportwx.com twitter.com/GosportINWX
-----------------------------------------------------------

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9277
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Earthquake Map Not Showing
« Reply #12 on: December 10, 2018, 09:05:03 PM »
Ahh.  you should use http://gosportwx.com/check-fetch-times.php?show=versions and it has the wxquake.php V2.00 in the update tool.  Always best to use the update tool for any of the pre-included scripts :)

The quake-json.zip download was primarily for standalone (non-Saratoga template) users.
« Last Edit: December 10, 2018, 09:06:47 PM by saratogaWX »
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 mkutche

  • Forecaster
  • *****
  • Posts: 1043
    • GosportWx.com
Re: Earthquake Map Not Showing
« Reply #13 on: December 10, 2018, 09:06:48 PM »
Ahh.  you should use http://gosportwx.com/check-fetch-times.php?show=versions and it has the wxquake.php V2.00 in the update tool.  Always best to use the update tool for any of the pre-included scripts :)


i did .. says Common   wxquake.php   Current   V2.00 - 2018-05-10   V2.00 - 2018-05-10   2.00 - 10-May-2018 - replaced Google map with Leaflet/OpenStreetMap+other tile providers
Mike K.
Davis Vantage Vue 6250 - CumulusMX (3.21.1-b3205)
Gosport, Indiana
Gosportwx.com twitter.com/GosportINWX
-----------------------------------------------------------

Offline mkutche

  • Forecaster
  • *****
  • Posts: 1043
    • GosportWx.com
Re: Earthquake Map Not Showing
« Reply #14 on: December 10, 2018, 09:17:08 PM »
ook?? http://gosportwx.com/wxquake.php still won't show map up.. i did everything..
« Last Edit: December 11, 2018, 03:27:54 AM by mkutche »
Mike K.
Davis Vantage Vue 6250 - CumulusMX (3.21.1-b3205)
Gosport, Indiana
Gosportwx.com twitter.com/GosportINWX
-----------------------------------------------------------

Offline mkutche

  • Forecaster
  • *****
  • Posts: 1043
    • GosportWx.com
Re: Earthquake Map Not Showing
« Reply #15 on: December 10, 2018, 09:32:27 PM »
everything is but the dashboard is up to date and still no map......
« Last Edit: December 11, 2018, 03:25:50 AM by mkutche »
Mike K.
Davis Vantage Vue 6250 - CumulusMX (3.21.1-b3205)
Gosport, Indiana
Gosportwx.com twitter.com/GosportINWX
-----------------------------------------------------------

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9277
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Earthquake Map Not Showing
« Reply #16 on: December 11, 2018, 10:38:33 AM »
It's working fine at http://gosportwx.com/wxquake.php for me this morning using Firefox.  Maybe clearing your browser cache will help?
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 mkutche

  • Forecaster
  • *****
  • Posts: 1043
    • GosportWx.com
Re: Earthquake Map Not Showing
« Reply #17 on: December 11, 2018, 05:16:43 PM »
Yup that worked thanks again!
Mike K.
Davis Vantage Vue 6250 - CumulusMX (3.21.1-b3205)
Gosport, Indiana
Gosportwx.com twitter.com/GosportINWX
-----------------------------------------------------------

 

anything