rvalitov / widgetkit-map-ex

Responsive version of Yootheme's Map Widget (Widgetkit2) with center map point and advanced features
GNU General Public License v3.0
22 stars 3 forks source link

"Uncaught ReferenceError: mapexGoogleApiKey is not defined" this error stopped another scripts run on site pages #72

Closed GordonBreazz closed 6 years ago

GordonBreazz commented 6 years ago

System information

CMS type: WordPress

CMS version: 4.9.4 plugin version: v1.5.8

Hi. I use mapex in one page on my site. The map is working correctly. But mapex in work it generate error message in js console. This is evident on all pages of the site. It make problems, other Jquery scripts on the page do not work. For example this plugin - https://ru.wordpress.org/plugins/button-visually-impaired/

DevTools trace info

"wk-scripts-633b737c.js?ver=4.9.4:50 Uncaught ReferenceError: mapexGoogleApiKey is not defined at o (wk-scripts-633b737c.js?ver=4.9.4:50) at HTMLDocument. (wk-scripts-633b737c.js?ver=4.9.4:199) at i (jquery.js?ver=1.12.4:2) at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4:2) at Function.ready (jquery.js?ver=1.12.4:2) at HTMLDocument.K (jquery.js?ver=1.12.4:2)

rvalitov commented 6 years ago

Thank you for reporting this. I will check it. First, please, confirm the following:

  1. Do you use the latest MapEx version which is v1.5.9? You specified that you use 1.5.8.
  2. Did you obtain and enter the Google Map API key in the settings of the MapEx as described here?
rvalitov commented 6 years ago

I double checked the code and don't see how such situation is possible. Can you please provide a link to a page where this problem happens?

GordonBreazz commented 6 years ago

I checked in v1.5.9 the problem gone. Thank you.

GordonBreazz commented 6 years ago

I was wrong. For me the problem is still actual. Possibly it is local incompatibility YooTheme "Sun Template" weather widget script and mapex. I refused to use Mapex. Now I am writing native js implementation gmap widgit. Thanks for the help. Ticket can be closed. https://hkar.ru/SZf5

rvalitov commented 6 years ago

The MapEx should work fine with other scripts. Can you save and paste here the full contents of the script "wk-scripts-633b737c.js?ver=4.9.4:50"? Or give a link to the website? Without seeing the contents, I can do nothing.

jelenov commented 6 years ago

Hi, I'm dealing with a similar issue like GordonBreazz - are there any news in this matter?

There are no errors on the page where the mapex is used, but all the other pages of the site are displaying the same errors as described by GordonBreazz, in my case this

wk-scripts-4d658904.js:50 Uncaught ReferenceError: mapexGoogleApiKey is not defined at o (wk-scripts-4d658904.js:50) at HTMLDocument. (wk-scripts-4d658904.js:199) at i (jquery.min.js?79c67d73863227791aa1df3ba1c49bc9:2) at Object.fireWith [as resolveWith] (jquery.min.js?79c67d73863227791aa1df3ba1c49bc9:2) at Function.ready (jquery.min.js?79c67d73863227791aa1df3ba1c49bc9:2) at HTMLDocument.K (jquery.min.js?79c67d73863227791aa1df3ba1c49bc9:2)

Full content of the script is here https://codeshare.io/aVmKJ3

Any idea? Many thanks in advance, Ivo

rvalitov commented 6 years ago

Thank you for providing the code. I will check it and send you a patch soon.

jelenov commented 6 years ago

That's perfect... You rock!

rvalitov commented 6 years ago

image

Unfortunately, the Codeshare is down for several hours, and I didn't expect that it can happen, so I didn't download the file. Can you please publish the code again, may be right here?

jelenov commented 6 years ago

Oops! Here you are... wk-scripts-4d658904.js.zip

rvalitov commented 6 years ago

Thank you! Can you also please publish the source HTML code of the web page? My widget should inject some JS code into the body tag, I want to check if that happens.

jelenov commented 6 years ago

no additional js code is added, see view.source.html.zip

rvalitov commented 6 years ago

Thank you! I made a patch, please, download the new version from here https://github.com/rvalitov/widgetkit-map-ex/archive/master.zip

Waiting for your feedback!

jelenov commented 6 years ago

Sorry for the late reply... It's working in my case! Many thanks for your great approach

rvalitov commented 6 years ago

Thank you for helping me to solve this issue! Now I have officially released the new version 1.6.0 of the widget where this issue is fixed.