cloudy cloudy

Author Topic: Regional network mesonet-map.php updated V3.07  (Read 812 times)

0 Members and 1 Guest are viewing this topic.

Online saratogaWX

  • Global Moderator
  • Posts: 5,786
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 52.0
    • Saratoga Weather
Regional network mesonet-map.php updated V3.07
« on: April 07, 2017, 07:24:04 PM »
Recent changes in the Google Maps API for JavaScript caused an issue with the maps -- clicking on a cluster would cause all clusters to vanish, and the contained icons not displayed.

Version 3.07 fixes that issue (mainly in an updated mesonet-map.js file).  Also, the mesonet-map.php and wxmesonetmap.php pages were changed to use https:// to load the Google Map script from the google site.

The MESO-images file has two new images (--.gif and ---sm.gif) to handle stations that have no wind direction in the reports.

The attached .zip has all the updates needed, or you can download the full package from here

Whew.. took me about 12 hrs of debugging the markerclusterer script to find the ONE line that need to be inserted to fix the issue.

Best regards,
Ken
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Offline hrvistaweather

  • Posts: 263
  • Franklin, Huon Valley Southern Tasmania
  • OS/Browser:
  • Win NT 6.3
  • Chrome 65.0.3325.51
    • Huon River Vista Weather - South Franklin - Tasmania
Re: Regional network mesonet-map.php updated V3.07
« Reply #1 on: February 14, 2018, 04:37:20 AM »
Hi,
Seems the Mesonet Maps are not displaying, emailed Ken.

http://www.australiawx.net/forum/index.php?topic=61.msg123#msg123

Kind regards,
Tony

Davis Vantage Pro 2 Plus - FARS, Cumulus MX, 2 Soil Temp/Moist Solar/Rad.
Back Online : 2017-11-01

Online saratogaWX

  • Global Moderator
  • Posts: 5,786
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 58.0
    • Saratoga Weather
Re: Regional network mesonet-map.php updated V3.07
« Reply #2 on: February 14, 2018, 05:23:26 AM »
It appears to be a JavaScript error from the Google Maps API code.
In Firefox it says:

TypeError: g.b is undefined     js:120:483
trigger https://maps.google.com/maps/api/js:120:483
Tc https://maps.google.com/maps/api/js:50:406
_.J.prototype.bindTo https://maps.google.com/maps/api/js:123:328
_.Uv https://maps.google.com/maps-api-v3/api/js/32/1a/common.js:152:456
xz.prototype.f https://maps.google.com/maps-api-v3/api/js/32/1a/map.js:84:84
Ug/< https://maps.google.com/maps/api/js:92:4
Zd.prototype.za/</d[a]< https://maps.google.com/maps/api/js:125:2517
_.Ud/< https://maps.google.com/maps/api/js:60:195
Zd.prototype.za/< https://maps.google.com/maps/api/js:125:2627
$d https://maps.google.com/maps/api/js:62:209
Zd.prototype.za https://maps.google.com/maps/api/js:125:2369
<anonymous> self-hosted:952:17
<anonymous> https://maps.google.com/maps-api-v3/api/js/32/1a/map.js:1:1


in Google Chrome it says:

Uncaught TypeError: Cannot read property 'apply' of undefined
    at Object.trigger (js?key=AIzaSyA499ykaoUpr3YquZtJUtOcFFMgdjNKniU&language=en:120)
    at Tc (js?key=AIzaSyA499ykaoUpr3YquZtJUtOcFFMgdjNKniU&language=en:50)
    at Ug._.J.bindTo (js?key=AIzaSyA499ykaoUpr3YquZtJUtOcFFMgdjNKniU&language=en:123)
    at new _.Uv (common.js:152)
    at Object.xz.f (map.js:84)
    at Array.<anonymous> (js?key=AIzaSyA499ykaoUpr3YquZtJUtOcFFMgdjNKniU&language=en:92)
    at js?key=AIzaSyA499ykaoUpr3YquZtJUtOcFFMgdjNKniU&language=en:125
    at Object.<anonymous> (js?key=AIzaSyA499ykaoUpr3YquZtJUtOcFFMgdjNKniU&language=en:60)
    at js?key=AIzaSyA499ykaoUpr3YquZtJUtOcFFMgdjNKniU&language=en:125
    at js?key=AIzaSyA499ykaoUpr3YquZtJUtOcFFMgdjNKniU&language=en:60

in Microsoft Edge it says:

SCRIPT5007: SCRIPT5007: Unable to get property 'apply' of undefined or null reference js (120,483)

It looks like a Google Map API issue (it's their code that is causing the halt).. I'll continue to investigate.
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Online saratogaWX

  • Global Moderator
  • Posts: 5,786
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 58.0
    • Saratoga Weather
Re: Regional network mesonet-map.php updated V3.07
« Reply #3 on: February 14, 2018, 06:26:15 AM »
Looks like their V3.32 broke it.. you can do a quick fix by replacing (in mesonet-map.php or wxmesonetmap.php depending on which you use)

Code: [Select]
<script src="https://maps.google.com/maps/api/js?key=<?php echo $googleAPI?>&amp;language=<?php print $Lang?>" type="text/javascript"></script>
with

Code: [Select]
<script src="https://maps.google.com/maps/api/js?key=<?php echo $googleAPI?>&amp;language=<?php print $Lang?>&amp;v=3.31" type="text/javascript"></script>
to force the older version API  to work.

I'll look at a 'real' fix for V3.32 Google API tomorrow...
« Last Edit: February 14, 2018, 07:56:58 PM by saratogaWX »
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

Online saratogaWX

  • Global Moderator
  • Posts: 5,786
  • Ken True
  • Saratoga, CA, USA 37:16:28N, 122:01:23W - Elev: 374ft.
  • OS/Browser:
  • Win NT 10.0
  • Firefox 58.0
    • Saratoga Weather
Re: Regional network mesonet-map.php updated V3.07
« Reply #4 on: February 14, 2018, 05:15:21 PM »
Further testing shows it works in GoogleMaps v=3.30 and v=3.31 but fails with the new(default) v=3.32

So you can use &v=3.30 or &v=3.31 and the map will work.  Using the default or &v=3.32 will fail.  Very strange.

I'm trying to dissect the mesonet-map.js code to see where the failure really lies.  Meanwhile, the quake-json map works fine with the default, as does the global-map scripts (which use much of the same code).
Ken True
Saratoga Weather
CWOP: CW1792
WeatherUnderground: KCASARAT1
Free weather website PHP scripts and WD website AJAX templates

 

cumulus