-
AuthorPosts
-
December 15, 2017 at 6:53 pm #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.December 21, 2017 at 11:17 am #891083December 22, 2017 at 7:17 am #891492Hi,
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-elementsBest regards,
IsmaelDecember 22, 2017 at 11:29 am #891534Thank you, Ismael.
December 23, 2017 at 5:03 am #891787Hi,
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,
RikardMay 24, 2018 at 12:54 pm #961507var 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, 7 months ago by AliAbabwa.
May 28, 2018 at 4:23 am #962919Hi,
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,
IsmaelMay 28, 2018 at 12:16 pm #963104Thank 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?May 30, 2018 at 8:06 pm #964465Hi,
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,
BasilisMay 31, 2018 at 10:51 am #964719Dear 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, 6 months ago by AliAbabwa.
June 1, 2018 at 1:58 pm #965350Hi,
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,
IsmaelJune 1, 2018 at 3:14 pm #965404Thank 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 lineclass avia_google_maps extends Avia_Widget
.June 6, 2018 at 4:25 am #967603Hi,
Thanks for the update. Please provide the WP and FTP login details in the private field. We’d like to check it.
Best regards,
IsmaelJune 6, 2018 at 1:06 pm #967823Ok, look Private Content, please.
June 11, 2018 at 1:41 am #970906Hi,
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,
IsmaelJune 14, 2018 at 6:04 pm #972944Thank 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?June 14, 2018 at 6:16 pm #972951Hi!
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!
PeterJune 15, 2018 at 11:31 am #973250Thank 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, 6 months ago by AliAbabwa.
June 15, 2018 at 7:05 pm #973414Hey!
I’m not sure if my code triggers the error. Please try to add this code to the functions.php fileadd_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!
PeterJuly 2, 2018 at 12:43 pm #980064Dear 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.
July 3, 2018 at 5:28 am #980384Hi,
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,
IsmaelJuly 4, 2018 at 3:31 pm #981259Thank 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 ((July 5, 2018 at 12:34 pm #981558Hi,
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,
IsmaelJuly 5, 2018 at 3:55 pm #981648At last, it work’s!
Thank you, Ismael)July 6, 2018 at 7:14 am #981864Hi,
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 -
AuthorPosts
- The topic ‘Enfold google maps widget saturation’ is closed to new replies.