Skip Navigation

[Resolved] map marker only shows if latitude/longitude co-ordinates in address field

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.

Our next available supporter will start replying to tickets in about 1.33 hours from now. Thank you for your understanding.

This topic contains 13 replies, has 2 voices.

Last updated by Richard Nicholls 2 years, 8 months ago.

Assigned support staff: Nigel.

Author
Posts
#1201878
Screen Shot 2019-02-18 at 16.04.21.jpg

I am trying to: display a map showing locations of artists

Link to a page where the issue can be seen: hidden link

I expected to see: all locations

Instead, I got: only locations where the address field contains {latitude, longitude} and not an address (filtered by postcode as part of the input process)

#1202148

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Richard

Can I get more information about how you are filtering by postcode?

Does your View output the results only as markers, or also as a list of posts?

If only as markers, for testing purposes can you also output a list (e.g. just with wpv-post-title) to verify whether the problem is with the filtering and what is returned by the query, or is specific to displaying the markers for given posts.

#1202171

Hi Nigel, have a look at hidden link this is the form that the user fills in and the venue location comes from.

The postcode 'filtering' is how it's always worked, out of the bag. I'd assumed it was standard. Enter a postcode and then select the address from the dropdown which relates to the venue. The marker appears on the form map and the field is populated. All good.

If the marker is in the correct place and not moved then it is omitted from the summary map, which is where the problem lies, on hidden link

That page also displays a list of entries beneath, all are present and correct.

Going back to the user registration form – if the marker which appears after the address is chosen isn't in the correct place and is moved by the user, then the address in the field changes to latitude, longitude coordinates. These markers show up on the summary map without an issue.

The two links are currently set to private whilst testing, password is testing123testing

#1202202

I've amended the data view temporarily to remove sensitive info and show the map data so you can see the issue.
Thanks, Richard

#1202309

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Thanks Richard

When you said filtering by postcode I assumed you meant you were displaying a View with custom search filters, but you are referring to entering the address in the first place.

What you describe neither sounds right nor rings any bells.

Does the View that displays the results and map include any filters? What is the ordering setting?

It could result from a conflict with another plugin or the theme.

Could you please try disabling the non-Toolset plugins and switching theme to twentynineteen then checking the page again? If the issue disappears then it should be possible to determine the source of any conflict by a process of elimination.

Let me know how that goes so I can see how to proceed.

#1202498

Hi Nigel
I've created a brand new WP installation with default theme and the only plugins installed being Toolset Forms, Maps, Types and Views. All latest versions. The markers are still an issue, behaving exactly as reported above. See hidden link
I can give you access to this new installation if you need it.
Regards, Richard

#1202523

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Yes please, that would be helpful.

Your next reply is private.

#1202940

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Richard

I tried in a couple of different browsers, but after entering details on the login screen it just sits there, and never makes it to the admin pages.

I'll try again later in case there is a server issue.

#1202953

All seems ok from here…

#1203327

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Richard

I've looked at your site and I can't identify what the issue is.

I've set up something similar on a local test site but can't reproduce the issue, it works as expected.

I'm taking a copy of your site so that I can do some more testing locally and pass it to my colleagues if needed.

Can you please clarify how the posts are being created? They have a pending status, they are created front-end or back-end?

I want to make sure I can accurately try and reproduce how the content is created to see if I can identify what causes the problem.

#1203421

Hi Nigel
Thank you. The new installation test site can stay up as long as you need it.

The Artist posts are being created from the front end form and status is pending until approved by an admin. However, the issue is the same if you create an Artist post from new at the back-end.

Regardless, the problem goes away as soon as that marker is moved and the {lat,long} co-ordinates replace the text address, and that can be front or back-end.

It looks like the text address or the co-ordinates are held in the wp_postmeta database table but the text address isn't being recognised by the view and/or google when retrieved later. Could the co-ordinates be written to the table regardless of whether the marker is positioned manually or not – there's an option on screen to show/hide the co-ordinates so they are known at that point. Not trying to tell your developers how to do their job of course but it would seem a relatively straightforward fix…

The same issue occurs on the single Artist page, where the venue location is displayed – see hidden link which I've set up and repositioned the marker and your test entry at hidden link where the address is unaltered.

Thanks, Richard

#1203864

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Richard

I installed a copy of your site locally.

The first thing I needed to do was to replace your Google Maps API key with my own.

I then visited the test pages I had created on your site yesterday—and they worked fine.

I think the API key is probably the issue, which is why the "addresses" that are coordinates work while the actual addresses do not.

Please make sure you have enabled both Maps and Places with your API key, and also note the issue described here: https://toolset.com/documentation/user-guides/display-on-google-maps/creating-a-google-maps-api-key/#problems-with-displaying-markers-on-google-maps

#1204287

Thanks Nigel. I'll have a look at the key settings and let you know.

#1204716

Added a second API key and restricted access by server IP and all seems to be working correctly.
My issue is resolved now. Thank you!