I have integrated the ACF Pro plug-in into a website, all the fields pull through as expected, except the Google Map.
I run an ‘if not empty’ check on my map field before I paste out my map with its marker. This check is passed, so the system knows I have put something there. I know this as it pastes out the map but with no marker. If my subfield was empty it simply wouldn’t be there.
<?php while( have_rows('big_headquarterz_location') ): the_row(); $ big_headquarterz_mapz = get_sub_field('big_headquarterz_mapz'); if ($ big_headquarterz_mapz != '') : ?> <div class="big-location-map"> <div class="acf-map"> <div class="marker" data-lat="<?php echo $ big_headquarterz_mapz['lat']; ?>" data-lng="<?php echo $ big_headquarterz_mapz['lng']; ?>"> </div> </div> </div> <?php endif; ?>
This map field is sitting in a subfield of a repeater, that is a subfield of a repeater.
I have a snippet in my functions.php passing the Map API Key. Speaking of which I have tried two different keys.
I include this snippet:
I have also created a google-maps.js which include is pulled in to the page where it is needed. I then call the maps.js:
I receive no errors in my console.
I have read 25+ manuals, 50+ code forums, 25+ attempts to implement in different ways and had ZERO luck! Does ACF not care about this issue everyone keeps having?
Why is this plug in both the best and worst thing to ever happen to me :c
Why does my implementation of the Google Maps within ACF Advanced Custom Fields not initiate the markers (shows a map with no marker centered to the middle of the sea / ocean)?