Skip Navigation

[Resolved] Populate Country field based on google maps addresses API

This support ticket is created 7 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 9 replies, has 3 voices.

Last updated by Beda 7 years, 3 months ago.

Assisted by: Beda.

Author
Posts
#556323

Hello,
I would need a "country" custom field to be populated by the map address marker tool.
How should I do this ?
Thank you.

#556385

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As I understand - you would like to extract country name from google map address field - correct? If no - Could you please share few screenshot that will help me to understand your issue.

#557521

Yes; that's it.

#557680

This request falls under Custom Code.

1. Types provide Custom Fields, which you usually do populate manually in the Post Edit Backend.

2. If you want any of those Fields to be filled "automatically" you need Custom Code that does not fall in our area of Support.

3. If you need to extract data from an Address Field (Types Address Field), then you also have to use Custom Code, as we just store the address in the Database once you add it to the Field.
In case the address exists, we use what Google API Delivers us as address, and in case not, we use a Latitude and Longitude:
https://toolset.com/forums/topic/display-only-street-address-from-map/#post-500534

It requires elaborated Custom Code to explode your Address String and extract a City name that might not even exist in case the Address is not stored on Google as a City but just a Latitude/Longitude address.

#557792

In case the address exists, it shouldn be pretty simple for someone who knows about the Google Map API ; I've seen this on various websites.

In that case, it must be also pretty simple to store the city and country in separate fields when storing the address.

Could you please upgrade this post as a feature request, so the devs may have a look at it ?

Thank you.

#558065

The Google API is not something we do assist or Support.
I am sorry that for this particular knowledge you have to consult Google itself.

Once you have that information, you can use update_post_meta() to create Custom Fields with the values.

Or, you can add Custom Fields in Types and populate them while you add the address manually.

We will not add such a feature, it has been requested in the past and rejected the request.

We only keep the complete address string, as well as the coordinates, because that is what we need to make Toolset Maps work.
We can not keep every single bit of information from the location, be it city, state, ZIP code, etc. own, because it multiplies the storage needed and gets out of hand.

Anyway, we have filed a request that adds JavaScript hooks so you can build callbacks to populate whatever needed with the Google Maps info provided in the callback when looking for an address, but I do not have any ETA on this yet.

#558111

Thank you. Could you please update this post if and when you have an answer on the request that adds JavaScript hooks so you can build callbacks to populate whatever needed with the Google Maps info provided in the callback when looking for an address ?

Thank you.

#558113

This post will auto close itself sooner than that.

I could set the Post to "escalated to the second Tier", but it is not yet even sure if the feature will be added or not, hence it could stay in this state for months, years.

The best to stay in touch with this function is to check the explicit Changelog of the Maps Plugin when we publish Updates.

That is the way you can get notified about this - if it ever gets implemented.

#558115

What if you show me the ticket that has been escalated to second tier ? If the feature is implemented, the post would be updated right ? So I could subscribe ?
Thank you.

#558116

Roman, there is no such Ticket because we do not escalate Feature Requests to the second tier.

Instead, we nominated a Person for each Plugin, and that person (in the case of Views it's me) is in contact with the Developer of the plugin (in this case Juan).

Then we discuss this and if the Developer, and our colleagues, think this is a good feature request, and we see other users require it, and also when we see it's useful (so it does not need many Users seeking it) we do file it in the internal issues tracker.

From there, it is taken as soon as the Developers have time, space and get the approval from management for this.

Hence, we cannot escalate such tickets for eventually months or years.

Instead, we publish changelogs as any other WordPress Plugin, where these changes are then mentioned.

It will be a long time until this (if it is even) is implemented.

It seems -unfortunately- that for now you need custom programming work which is beyond the scope of our support.

At this point I would suggest you consider contacting one of our certified partners from this link:
https://toolset.com/consultant/

You will get the custom assistance you need to get on with your project.

Thank you!