Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #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.

    #1303200

    Hey,

    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,
    Yigit

    #1303652

    Hi 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.

    #1304709

    Hi,

    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,
    Yigit

    #1304734

    Sure Yigit, see private for login info.

    #1305296

    Hi,

    I tried to login however login credentials did not work for me. Could you please check them once again? :)

    Best regards,
    Yigit

    #1305462

    Sorry, try this!

    #1305634

    Hi,

    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,
    Yigit

    #1305901

    I 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.

    #1306736

    Hi,

    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,
    Yigit

    #1306790

    Hi 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.

    #1307076

    Hi,

    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,
    Ismael

    #1307217

    Hi Ismael,

    1. Ok, great. I have done that.
    2. I have done this but the image is still the same.

    Please advise.

    #1307437

    Hi,

    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,
    Ismael

    #1307478

    Ok, Do I need to modify or did you? I do have a child theme installed.

    #1307692

    Hi,

    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-1303702

    Best regards,
    Ismael

    #1307812

    Ok, 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!

    #1308434

    Hi,

    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

Viewing 18 posts - 1 through 18 (of 18 total)
  • You must be logged in to reply to this topic.