Tagged: google map, javascript, undefined, Widget
-
AuthorPosts
-
August 26, 2013 at 9:09 am #28431
Hi Kriesi,
I’ve got a contact page with a 1/1 section and Widget Area specified. Whenever I add a Google Map widget with longtitude / latitude I get the following error on in console (with the map NOT displaying):
Uncaught ReferenceError: google is not defined
Any help would be appreciated.
We’re running Enfold, 2.0, WP 3.6
August 26, 2013 at 9:29 am #137522We’ve got a demo site setup if you need to take a look: http://goo.gl/oSZLN7
August 26, 2013 at 11:49 am #137523Try following – open up enfoldframeworkphpclass-framework-widgets.php and replace
if(empty($avia_config['g_maps_widget_active']))
{
$output .= "<script type='text/javascript' src='$prefix://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false'></script>";
$avia_config['g_maps_widget_active'] = 0;
}with
if(empty($avia_config['g_maps_widget_active']))
{
$avia_config['g_maps_widget_active'] = 0;
}
if(apply_filters('avia_google_maps_widget_load_api', true, $avia_config['g_maps_widget_active']))
{
wp_register_script( 'avia-google-maps-api', $prefix.'://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false', array('jquery'), '1', false);
wp_enqueue_script( 'avia-google-maps-api' );
}August 28, 2013 at 4:21 pm #137524Hi,
I also get a JS error, though different, when not even using the Google Map widget at all. This is the error:
“Uncaught TypeError: Cannot read property ‘data’ of undefined” in avia_google_maps_widget.js
It is preventing other widgets from being saved using the BlackStudio TinyMCE Widget plugin.
August 28, 2013 at 11:00 pm #137525Re the above post – Just want to add that the changes in the text widgets seem to save on the back-end, but it’s on the front-end where the change does not appear.
Line 27 is where the problem is:
if(settings.data.search(‘action=save-widget’) != -1 && settings.data.search(‘id_base=’ + widget_id_base) != -1)
ETA: I commented out the problem code and it did not solve the problem. So it isn’t effecting saving widgets for me. Sorry for hijacking the thread.
August 29, 2013 at 11:13 am #137526We’ll fix this in the next version. For now open up avia_google_maps_widget.js and replace
$('.widgets-sortables').ajaxSuccess(function(e, xhr, settings){
var widget_id_base = 'avia_google_maps';
if(settings.data.search('action=save-widget') != -1 && settings.data.search('id_base=' + widget_id_base) != -1)with
$(document).ajaxSuccess(function(e, xhr, settings){
var widget_id_base = 'avia_google_maps';
if(settings && settings.data.search('action=save-widget') != -1 && settings.data.search('id_base=' + widget_id_base) != -1) -
AuthorPosts
- The topic ‘Broken Google Map Widget’ is closed to new replies.