• I thought I would share this bit of info so the plugin author can correct this issue that took me an hour or two to work out.

    For some reason, on my site where I installed this plugin, the maps I created would NOT show up. The console would show “Unexpected Token ‘>'” or something similar and link to a line in the code that wasn’t even relevant. Upon investigation, it turns out WordPress was adding paragraph tags INSIDE the jQuery that is essential to this plugin to work. In my case, turning off wpautop did not correct this issue.

    To correct, I went to the following file on my site: /wp-content/plugins/wp-google-map-plugin/modules/shortcode/views/put-wpgmp.php and found the jQuery script tag at the bottom. The fix for this is simple; you just have to make sure that the entire script tag is on one line so paragraph tags can’t be placed inside the code:

    $map_output .= '<script>jQuery(document).ready(function($) {var map = $("#map'.$map_id.'").maps('.$map_data_obj.').data("wpgmp_maps");});</script>';

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello

    Thanks for your suggestion.

    This is also affecting the latest version of the Avada theme and WordPress. I made a change in the maps widget and it stopped working. This thread helped me on the right track to find the fix for Avada. It will be addressed it the next update.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘“Unexpected Token” Error / Map Not Displaying (Solution)’ is closed to new replies.