
-
AuthorPosts
-
May 25, 2021 at 8:06 pm #1302283
Hello Enfold devs,
I’m looking to get the icon markers on my google maps larger. I set them to 80 x 80 px but they look smaller. The images i’m using are 400 x 400 pxand they are no where near that size. Ideally I would like the marker at least triple or quadruple the current size.
I found a few other articles but done really see a solution
I have attached a link to my website as well as a screenshot of what i see.
May 31, 2021 at 2:59 pm #1303200Hey,
Thanks for contacting us and sorry for the late reply!
Could you please try adding the code Ismael shared here – https://kriesi.at/support/topic/custom-map-marker-image-size-wont-display-at-80x80px/#post-1012163 to the bottom of functions.php file of your child theme?
Best regards,
YigitJune 2, 2021 at 6:57 pm #1303652Hi Yigit,
Thank you for the thread. I tried the code with a child theme and it does not work. Here is a picture of the code inserted as well as what
I see in the map settings. Please advise on a solution and thank you again.June 8, 2021 at 5:06 pm #1304709Hi,
Sorry for the late reply!
Could you please create temporary admin logins and post them here privately so we can look into it? :)
Best regards,
YigitJune 8, 2021 at 6:54 pm #1304734Sure Yigit, see private for login info.
June 11, 2021 at 4:13 pm #1305296Hi,
I tried to login however login credentials did not work for me. Could you please check them once again? :)
Best regards,
YigitJune 13, 2021 at 4:17 pm #1305462Sorry, try this!
June 14, 2021 at 3:42 pm #1305634Hi,
I edited google_maps.php file on your parent theme and added 160x160px size by referring to Ismael’s post here – https://kriesi.at/support/topic/google-maps-custom-marker-size/#post-1305586.
You can move the file to your child theme by referring to this post – https://kriesi.at/documentation/enfold/intro-to-layout-builder/#add-elements-to-alb :)
Best regards,
YigitJune 16, 2021 at 1:12 am #1305901I adjusted the icon size to 160px and it looks the same as the 80 px… any idea why that is?
I see the documentation you provided and don’t quite understand how to implement the code into the chid theme.
June 21, 2021 at 2:28 pm #1306736Hi,
Sorry for my late reply!
You can add following code to functions.php file of your child theme
add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1); function avia_include_shortcode_template($paths) { $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; }
then copy /enfold/config-templatebuilder/avia-shortcodes/google_maps/google_maps.php into /shortcodes/ folder inside your child theme and that is it.
I tried replacing marker image as well however it looks blurry on my end as well though I am not sure why exactly is that. I will ask my teammates :)
Best regards,
YigitJune 21, 2021 at 5:55 pm #1306790Hi Yigit, I did as instructed but have a few questions.
1. There was no shortcodes folder in my child them so I created on. Is this correct?
2. I added a new icon for the 160 x 160 px but it is the same size as the old icons…Please Advise.
June 23, 2021 at 6:55 am #1307076Hi,
Thank you for the update.
1.) Yes, you have to create the folder manually.
2.) It is not displaying the selected size because the actual marker image is only 80x80px. You may have to reselect the marker image or upload it again. Make sure that the minimum size is 160x160px.
Best regards,
IsmaelJune 24, 2021 at 12:19 am #1307217Hi Ismael,
1. Ok, great. I have done that.
2. I have done this but the image is still the same.Please advise.
June 25, 2021 at 1:41 pm #1307437Hi,
Thank you for the info.
For some reason, the size is being retained to 40px. We had to modify the enfold/framework/js/conditional_load/avia_google_maps_api.js and adjust the marker size directly in this line (300):
if(_self.retina && size > 40) size = 160; //retina downsize to at least half the px size
Best regards,
IsmaelJune 25, 2021 at 10:10 pm #1307478Ok, Do I need to modify or did you? I do have a child theme installed.
June 28, 2021 at 9:22 am #1307692Hi,
We already modified the script directly in the parent theme. If you want to place it in the child theme, you have to unregister the original file and register it back with the new path in the child theme.
Example:
// https://kriesi.at/support/topic/tabs-select-on-hover/#post-1307497
// https://kriesi.at/support/topic/how-to-disable-google-maps-zoom-double-click-right-or-left/#post-1303702Best regards,
IsmaelJune 28, 2021 at 7:23 pm #1307812Ok, I don’t quite understand what you mean by “unregister the original file and register it back with the new path in the child theme”. how do I edit the parent theme file back if i Need to? Also Yigit noted the icons are blurry how do I remedy? I do appreciate your help!
July 2, 2021 at 3:59 am #1308434Hi,
To unregister the script with the handle avia_google_maps_api_script, you can use the wp_deregister_script and the wp_dequeue_script functions. To register it back, create a copy of the avia_google_maps_api.js in your child theme, use the same handle with the wp_register_script function and the new file path.
Example:
function ava_admin_enqueue_scripts() { wp_deregister_script( 'avia_google_maps_api_script' ); wp_dequeue_script( 'avia_google_maps_api_script' ); wp_register_script( 'avia_google_maps_api_script' , PATH_TO_CHILD_THEME_SCRIPT, array( 'jquery' ), "4.8.3", true ); } add_action( 'admin_enqueue_scripts', 'ava_admin_enqueue_scripts', 10 );
Make sure to adjust the path (PATH_TO_CHILD_THEME_SCRIPT) of the file.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.