Viewing 25 posts - 1 through 25 (of 25 total)
  • Author
    Posts
  • #889370

    Dear, support.
    1. I need Enfold google maps widget saturation to be -50, like in google maps in contacts page.
    There is no saturation propertie in Enfold google maps widget constructor.
    How can I make it?
    2. And I need the saturation of google maps to be from -50 to 0 on mouseover (in contacts page and in footer – Enfold google maps widget). And on mouseout – from 0 to -50, of course.
    I hope you help me, thank you in advance.

    #891083

    ?

    #891492

    Hi,

    Thank you for using Enfold.

    You need to modify the php > framework > class-framework-widgets.php file, look for the “avia_printmap” function. Use the StyledMapType function.

    // https://developers.google.com/maps/documentation/javascript/styling#creating_a_styledmaptype
    // https://developers.google.com/maps/documentation/javascript/style-reference#style-elements

    Best regards,
    Ismael

    #891534

    Thank you, Ismael.

    #891787

    Hi,

    Glad we could help. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #961507
    		var customGMapStyle = [
    					{
    						featureType: 'poi.business',
    						elementType: 'all',
    						stylers: [
    							{
    								visibility: 'off' }
    						]
    					},
    					{
    						'stylers': [
    							{'saturation': -50 }
    						]
    					}					
    		];		
    		var myOptions = {
    		  zoom:".$zoom.",
    		  mapTypeControl:true,
    		  mapTypeId:google.maps.MapTypeId.".$type.",
    		  mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU},
    		  navigationControl:true,
    		  navigationControlOptions:{style:google.maps.NavigationControlStyle.SMALL},
    		  center:latlng,
    		  styles:customGMapStyle
    		};

    Unfortunatelly, in Enfold 4.4 this function doesn’t work((
    For example, saturation of google map widget is 100, not -50 like in older versions of Enfold.

    By the way, te marker of google map widget is disproportionated now(

    • This reply was modified 6 years, 4 months ago by AliAbabwa.
    #962919

    Hi,

    The map script is inside the framework > js > conditional_load > avia_google_map_api.js file now.

    (line 153)

    styles:[{featureType: "poi", elementType: "labels", stylers: [ { visibility: "off" }] }]
    

    Best regards,
    Ismael

    #963104

    Thank you, Ismael.
    1. I used functions.php file before.
    So, how can I add this to Enfold child theme?
    2. The marker of google map widget is disproportionated now( The original size is 50×37, but in Enfold google maps widget it is quadratic now. How can I change it to original proportions?

    #964465

    Hi,

    If you create a child theme, you can have the functions.php file inside there and then use the functions.php file inside.
    That should make the code load from there :)

    Let us know if u need more help

    Best regards,
    Basilis

    #964719

    Dear Basilis.
    I can’t understand.
    1. I have functions.php file in my Enfold child theme. How can I add my custom avia_google_map_api.js in Enfold child theme?
    2. The marker of google map widget is disproportionated now( The original size is 50×37, but in Enfold google maps widget it is quadratic now. How can I change it to original proportions?

    • This reply was modified 6 years, 4 months ago by AliAbabwa.
    #965350

    Hi,

    Thanks for the update.

    I’m sorry. I forgot that you’re referring to the google map widget. Please copy the whole “avia_google_maps” widget class without the functions_exist check inside the child theme’s functions.php file. It’s inside the framework > php > class-framework-widgets.php file.

    Best regards,
    Ismael

    #965404

    Thank you, Ismael.
    I copy this code

    // Please use pastebin.com

    There is no effect: the saturation is still 100.
    And I can’t enter to my admin panel now:
    Fatal error: Class ‘Avia_Widget’ not found in …/themes/enfold-child/functions.php on line 60
    It is the line class avia_google_maps extends Avia_Widget.

    #967603

    Hi,

    Thanks for the update. Please provide the WP and FTP login details in the private field. We’d like to check it.

    Best regards,
    Ismael

    #967823

    Ok, look Private Content, please.

    #970906

    Hi,

    Thanks for the update. This works when I put the saturation value directly in the map data (line 1697).

    $data = array(
    	'hue'					=> '',
    	'zoom'					=> $zoom,
    	'saturation'			=> -50,
    	'zoom_control'			=> true,
    //							'pan_control'			=> true,				not needed in > 4.3.2
    	'streetview_control'	=> false,
    	'mobile_drag_control'	=> true,
    	'maptype_control'		=> 'dropdown',
    	'maptype_id'			=> $type
    );
    

    Please try it again.

    Best regards,
    Ismael

    #972944

    Thank you, Ismael. It works.
    But what will happen every time I update the Enfold theme?
    framework > php > class-framework-widgets.php file will be overwritten (and saturation will be 0, not -50 every time)?
    So how can I make it in Enfold Child theme?

    #972951

    Hi!

    Please try to add this code to the child theme:

    
    	add_filter( 'avf_google_maps_data', 'avia_maps_widget_saturation', 999, 4 );
    	function avia_maps_widget_saturation ( $data, $context, $object, $args )
    	{
    		$data['saturation'] = '-50';
    		return $data;
    	}
    

    Maybe you need to write -50 instead of ‘-50’. It should work even if you update the parent theme.

    Cheers!
    Peter

    #973250

    Thank you, Dude.
    I added this code to functions.php file in Enfold Child theme and it works for google maps widget.

    But with this code I have a bug in Enfold media element google map in my contacts page:

    Warning: Illegal string offset ‘attr’ in …/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/google_maps/google_maps.php on line 687

    Warning: Invalid argument supplied for foreach() in …/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/google_maps/google_maps.php on line 687

    • This reply was modified 6 years, 3 months ago by AliAbabwa.
    #973414

    Hey!
    I’m not sure if my code triggers the error. Please try to add this code to the functions.php file

    
    add_filter( 'avf_google_maps_data', 'avia_maps_widget_saturation', 999, 4 );
    	function avia_maps_widget_saturation ( $data, $context, $object, $args )
    	{
    		return $data;
    	}
    

    Does the warning disappear with this code?

    Cheers!
    Peter

    #980064

    Dear Dude.
    There is no warning with this code. The problem with this string:
    $data['saturation'] = '-50';
    But saturation is ‘0’ without this string.

    So, now I have to use changing class-framework-widgets.php file every time in new version of Enfold.

    #980384

    Hi,

    Thanks for the update. I adjusted the filter a bit. Please use this one instead.

    add_filter('shortcode_atts_av_google_map', 'avf_shortcode_atts_av_google_map', 10, 4);
    function avf_shortcode_atts_av_google_map($out, $pairs, $atts, $shortcode) {
    	$out['saturation'] = '-50';
    	return $out;
    }

    Best regards,
    Ismael

    #981259

    Thank you, Ismael.
    I added this code to functions.php file in Enfold Child theme and it’s not work for google maps widget((
    Saturation is still 0 ((

    #981558

    Hi,

    Sorry about that. I always forget that you’re using the widget instead of the map shortcode/element. This one should work.

    add_filter( 'avf_google_maps_data', 'avia_maps_widget_saturation', 999, 4 );
    function avia_maps_widget_saturation ( $data, $context, $object, $args )
    {
    	if($data[0]['shortcode'] === NULL || $data[0]['shortcode'] != 'av_gmap_location') {
    		$data['saturation'] = '-50';
    	}
    	return $data;
    }
    

    Best regards,
    Ismael

    #981648

    At last, it work’s!
    Thank you, Ismael)

    #981864

    Hi,

    Awesome! Glad we could help!

    Please take a moment to review our theme and show your support https://themeforest.net/downloads
    Don’t forget to bookmark Enfold Documentation for future reference.

    Thank you for using Enfold :)

    Best regards,
    Ismael

Viewing 25 posts - 1 through 25 (of 25 total)
  • The topic ‘Enfold google maps widget saturation’ is closed to new replies.