Home › Forums › Bug Reports › Google Map location marker snapping to nearest road › Reply To: Google Map location marker snapping to nearest road
@papijo You save the script written by @adammontague above into a .js file (in my case I called it acf-fix.js), then you load the script into the admin screens using the following in your functions.php file:
add_action( 'admin_enqueue_scripts', function() {
wp_enqueue_script( 'handle', get_stylesheet_directory_uri() . '/js/acf-fix.js', array( 'jquery' ) );
} );
Be sure to check the file location is correct. get_stylesheet_directory_uri() refers to the theme root and I saved acf-fix.js into a /js folder, your case may be different.
As noted above, the script written by @adammontague works, but does trigger a JS acf not defined error, which impacts other WP admin functionality such as tabs and menu hover states. So until a fix is found I simply turn on and off this script in functions.php as I need to use it.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.