Home Forums ACF PRO Hide marker on Google map Reply To: Hide marker on Google map

  • Almost.. I noticed ACF does not do anything for placing an empty map at a specific location so you need to do a bit more tweaking.

    This should be your HTML/PHP

    $location = get_field('location');
    if( !empty($location) ):
    <div class="acf-map" data-lat="<?php echo $location['lat']; ?>" data-lng="<?php echo $location['lng']; ?>">
    <?php endif; ?>

    And in the render_map javascript function change the var args part to

    var map_lat = $'lat');
    var map_lng = $'lng');
    // vars
    var args = {
    	zoom		: 16,
    	center		: new google.maps.LatLng(map_lat, map_lng),
    	mapTypeId	: google.maps.MapTypeId.ROADMAP