Bug With JS Store Locator Code
-
Hi there,
I encountered a bug with your plugin. It’s related to the theme I’m using which obviously isn’t your problem, but please read carefully because you do have a problem in there somewhere.
Clicking on some tabs supplied by my theme unrelated to your plugin breaks the Javascript. The actual js error is:
MYMAP.modernStoreLocator.element is undefined
The tabs have class
.nav-tabs
. So when I click the linkInitMap()
is invoked as per thewpgmaps.js
linejQuery('body').on('click', '.nav-tabs li a', function(event, ui) { InitMap(); });
.The actual js line triggering the error is
MYMAP.modernStoreLocator.element.index = 1;
in line 293 ofwpgmaps.js
.The thing is I have Store Locator switched off in the options. This code block should not be getting executed as far as I can see. I don’t understand why the variable
MYMAP.modernStoreLocator
exists when I have the Store Locator switched off but I didn’t trawl through the code to find out.I fixed it for myself by changing line 290 from
if(MYMAP.modernStoreLocator)
toif(MYMAP.modernStoreLocator && MYMAP.modernStoreLocator.element)
. The map continues working fine for myself. The actual fix is somewhere along those lines, but maybe less hacky.Hope that helps.
Cheers,
JamesThe page I need help with: [log in to see the link]
- The topic ‘Bug With JS Store Locator Code’ is closed to new replies.