ACF Pro: How to add custom latitude / longitude values in Google Map field

I faced this issue while working on a client’s website in WordPress, where I used Advanced Custom Fields Pro (ACF Pro) plugin to add custom fields in website. Under some custom post type, I required having a Google Map on front-end based on the client’s location which they will enter from back-end admin panel.

To achieve that I simply added “Google Map” field provided by ACF Pro plugin, which worked great and shown a field with map in admin panel for my Custom Post Type, as below:

That field has a text-box to search location based on Google’s map suggestions, where I searched location and added it, but client told that the location they are searching is not coming in Google map suggestions, so they need some way where they can input custom latitude / longitude values.

I had checked in ACF Pro Docs but there was nothing related with how to use custom latitude / longitude values, and I didn’t find anything over Google / Internet as well.

At one point I almost decided to delete this Google Map field, and instead add two text fields for latitude / longitude separately where client can enter there custom values, and then on front-end I will code to have custom Google Map based on those values. But suddenly I thought to add latitude / longitude values directly in the field with comma and clicked search button, blimey, it pointed to the exact location and placed a pointer there as shown in the image below:

That is what I needed :)

To put in simple words, add comma separated latitude / longitude values in ACF Pro’s Google Map field and click the search button, it will place the map pointer to those exact coordinates. And further process of how to show the map on front-end is well documented in their docs here: ACF Pro Google Map Field Documentation

As I didn’t find anything about this problem in ACF Pro docs or over the web, so thought to share this in here.

Hope this will help someone!

2 Responses

    1. Hey David, no idea regarding drag and drop, I was looking for same stuff, but then went on to put marker pin exact location by adding Lat/Lon data. Hope ACF might implement drag and drop ability in future.

Leave a Reply