Address Field / Map field coordinate function on demand/cron?

Support General Address Field / Map field coordinate function on demand/cron?Resolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #38063
    WhnWhn
    Participant

    Hi, using the map field set up with an address field per the documentation:
    https://docs.metabox.io/fields/map/

    Everything works great. My question is if there is any way to call the functionality that happens when creating or editing a post where it grabs the map coordinates (lat/long) after putting in an address?

    I'm looking to import into my database/site thousands of posts that have the address information fully, however I do not have the coordinate information for each address. Aside from manually editing/updating every post to have it then grab the coordinates is there a way to call that to happen either on demand or via cron or something so the system inputs the coordinates without manually editing each post?

    #38084
    Long NguyenLong Nguyen
    Moderator

    Hi,

    When creating/updating a post, you can use the extension MB Geolocation to get the latitude and longitude of an address. Please read more on the documentation https://docs.metabox.io/extensions/meta-box-geolocation/

    If you want to get the latitude and longitude of a given address with coding, please follow this topic https://stackoverflow.com/questions/3490622/get-latitude-and-longitude-based-on-location-name-with-google-autocomplete-api

    #38090
    WhnWhn
    Participant

    Thanks I forgot to add that - I am indeed using the geolocation when adding/editing the post so it's grabbing the lat/long coordinates properly there, just looking to get the same functionality without manually going 1-by-1 on editing posts manually when the address field is already populated. I'll look into that stackoverflow post thank you!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.