Hi!
Since we now have the Post layout builder, it makes sense to allow Dynamic Maps, for our post types that require a Map on the listings.
Thanks to Dynamic data, we can easily create Custom fields for the Latitude and the Longitude, and feed the map with that dynamically. So far so good.
However, if we are using a Map field in ACF Pro, it creates a single custom key google_map
that is not useful.
I have tried some custom functions found on various forums to separate the lat
and lng
into separate keys so I can feed the Map element, but with no success.
My question:
Do you know any way (maybe a functions.php code) to separate the ACF latitude and longitude, so we could feed the Map element with the custom keys?
My Feature requests:
1. Map element to read ACF PRO Map data
I suggest that you update the Map element so it can communicate with ACF Pro Map Custom field, and read the latitude and longitude from it, for the individual pins and the map centering. On the single post type, both map centering and the pin position should be fed from the ACF data.
2. Map Looper for the Archive page?
The Archive page (and basically anywhere else where needed), there should be an option to have a Map that is displaying all the pins from all the posts in the selected Post type.
If we are building a listing website, having this solved would basically allow us to get rid of the listing plugins and have map listings natively with Pro.
Thanks!
Allow me to tag @alexander here. I believe Alex would find this interesting.
PS: to have the ACF Map field working properly, it requires a custom functions.php code that adds the API key to it:
function my_acf_init() {
acf_update_setting('google_api_key', 'xxx');
}
add_action('acf/init', 'my_acf_init');