Sauter la navigation

[Résolu] Address field not displaying on map correctly

This support ticket is created Il y a 10 mois et 3 semaines. 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.

Ce sujet contient 4 réponses, a 2 voix.

Dernière mise à jour par zeljko-turkaljS Il y a 10 mois et 3 semaines.

Assisté par: Christopher Amirian.

Auteur
Publications
#2681469

I have a custom post type with an address field. I am importing posts using a script, this is the code for importing address field:

update_post_meta($submission_id, 'wpcf-office-address', $office_address);

The address field gets imported, but it's not shown on the map correctly. If I enter the field in WP backend for the suggestions to show up and pick the first suggestion , the pin on the map gets moved on the right place. I then save the post, but when it gets loaded again, pin is on the wrong place again.

I have recorded a short video demonstrating the problem:

lien caché

Any idea what am I doing wrong?

Best regards,
Petar

#2681532

Christopher Amirian
Supporter

Les langues: Anglais (English )

Hi Petar,

First let's establish if you manually create a post in the custom post type and add the address it works ok?

And only it happens when you import the address using the code you shared?

If that is the case, please check the database of your website and where the address is stored in wp_options table.

I do not remember exactly, but it might be added with a specific format so when you add it via code you do not follow the same rule base.

The best way is to create one manually, and then check the database to know how it is stored.

That way you can modify your code to accommodate the same format.

Thanks.

#2681573

Hi Christopher,

thanks for a reply. I did a bit more researching, this is obviously google maps issue, not toolset one.

When I manualy create a post and enter problematic address, I don't even get that address suggested. When I pick the first suggestion, leave the address field, and enter it again, I get the correct address suggested.

But then again, if I save a post and reload it, pin is not placed correctly.

It's a bit complicated to explain by words, let me show you in the video:

lien caché

I'm aware this is not a toolset issue, but do yo, by any chance, know why this is happening?

#2681654

Christopher Amirian
Supporter

Les langues: Anglais (English )

Hi there,

Thank you for the video, I am not sure why that is happening.

The thing that I suggest is to test with another browser without andy extensions. I see that you have an extension that shows in the input box for the browser you use, maybe it has something to do with the issue?

Other than that honestly I have no clue.

#2681713

Hi Christopher,

I've tried with vanilla Edge, the same thing happens.

But OK, it's obviously an issue with Google Maps and this particular address, it's not Toolset to blame 🙂

Thank you for your assistance!

Petar