Tagged: 

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #784720

    Hello,

    We have a lot of markers on the map and would like to remove the animation in order to have the markers displayed instantly on the map.
    Is there a code I can add to the child theme?
    Thanks,

    Frederic

    #785281

    Hey fred1601,

    Could you please give us a link to your website, we need more context to be able to help you.

    Best regards,
    Victoria

    #785773

    Hello Victoria,

    Please find below the link.
    Thanks,

    Ferderic

    #785853

    Hi,

    Try to edit this file in the enfold theme: js/shortcodes.js
    Find and remove this code (line 654 in Enfold version 4.0.5):

    animation: google.maps.Animation.BOUNCE,

    Let us know if that helps :)

    Best regards,
    Nikko

    #785900

    Hello Nikko,

    It did remove the bounce but in order to have all the markers displayed at load, I had to modify the following line:
    setTimeout(function(){ marker.setAnimation(null); _self._infoWindow(_self.map, marker, _self.$data.marker[key]); },1);
    },1 * (parseInt(key,10) + 1));

    However it works only if done in the shortcode.js of Enfold not on the child theme, which is a bit annoying as I will lose the changes at the next update.
    Any option?
    Thanks,

    Frederic

    #786223

    Hi Frederic,

    Try creating a js folder in the child theme and put the modified shortcodes.js file there then in functions.php of the child theme, add this code:

    // Replace shortcodes.js
    function change_shortcodesjs() {
       wp_dequeue_script( 'avia-shortcodes' );
       wp_enqueue_script( 'avia-shortcodes-child', get_stylesheet_directory_uri().'/js/shortcodes.js', array('jquery'), 2, true );
    }
    add_action( 'wp_enqueue_scripts', 'change_shortcodesjs', 100 );

    Hope this helps :)

    Best regards,
    Nikko

    #786646

    Hello Nikko,

    It works! Thanks a lot!

    Best Regards,

    Frederic

    #786655

    Hi,

    Happy we could solve it.
    Please feel free to let us know if there is anything else we can help you out with.

    Thank you

    Best regards,
    Basilis

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Remove map marker animation’ is closed to new replies.