Skip Navigation

[Resolved] Get map address details by "use my location" button

This support ticket is created 3 years, 7 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 2 replies, has 2 voices.

Last updated by umbertoZ 3 years, 7 months ago.

Assisted by: Jamal.

Author
Posts
#2023225

Hi, I'm trying to get address details using the custom code described on this topic:
https://toolset.com/forums/topic/separating-content-from-the-address-field/

It works when I fill the address field with some direction, but I would like to make it work also when I click on the "use my location" button. Can you help me?

thanks

#2023561

Hello and thank you for contacting the Toolset support.

I am not sure to understand correctly what you are trying to build? Are you trying to get the city, zip code or other information from the Toolset Maps requests to the Goolge Maps APIs?

Toolset Maps, stores address fields as plain addresses, and also as latitudes and longitudes(used in distance search). When you enter an address, it asks Google for the latitude-longitude. But, when you use the "Use my location", it asks the browser platform for the coordinates, instead of Google Maps, API.
If, I understood correctly, that you want to get the city, zip code, or other information from the current user location, right?
You will need to perform a reverse geocoding API call manually because Toolset will not perform it in this case.
hidden link

You can listen for a "change" event on the address field, and check the value, which will be the coordinates.

I hope this helps. Let me know if you have any questions.

#2025827

Hi, I decided for a different solution.
Thank you!