Support

Account

Home Forums Feature Requests Access country from a Google Maps geocoding request Reply To: Access country from a Google Maps geocoding request

  • Ok, I found out how to do this myself. It requires the following changes and I’d be glad to have them added.

    In acf-input.js #5307:

    
    $.each(location.address_components,function(key,item){
     if (item.types[0] == 'country') {
       acf.val( self.$el.find('.input-country'),item.short_name);
     }
    });
    

    Another change goes to google-map.php #84 ,the array gets one more entry after lang:

    
    'country' => ''
    

    These small changes add the short_name of the country to the saved data.