Tagged: map
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
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
Hello Victoria,
Please find below the link.
Thanks,
Ferderic
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
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
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
Hello Nikko,
It works! Thanks a lot!
Best Regards,
Frederic
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