Support

Account

Home Forums General Issues Convert ACF Address Fields into Google Maps URL Reply To: Convert ACF Address Fields into Google Maps URL

  • I do not know if that will work or not, I really don’t know much about the google API.

    I can tell you that ACF stores and array in a google maps field.

    
    array(
      'address' => '',
      'lat' => '',
      'lng' => ''
    )
    

    The map is rendered in the admin using JavaScript, and again, I don’t know how this works.

    It is possible that inserting an array with the address and empty lat/lng might cause ACF to do the lookup, but without testing it I don’t know if that will work. Otherwise you would need to get the lat/lng before updating the value.

    Outside of both the fields you are already using plus an additional map field I really don’t have any suggestions for you. If you don’t want to use a ACF Gmap field then you’ll need to figure out how to use the google API, which is beyond what I can help you with. I depend on existing plugins to deal with google maps mostly because google documentation is probably the most obtuse documentation I’ve ever read, although the WP guberbug documentations is moving up the charts.