Skip Navigation

[Resolved] Displaying a List of Markers on a Google Map

This thread is resolved. Here is a description of the problem and solution.

Problem:
Map markers are not appearing on a map created with Views.

Solution:
This was—and almost always is—due to problems with URL referrer restrictions on the API key.

You can add two keys (one with restrictions for client-based requests, another without restrictions for unexposed server-based requests) to resolve the problem.

Relevant Documentation:
https://toolset.com/documentation/user-guides/display-on-google-maps/creating-a-google-maps-api-key/#problems-with-displaying-markers-on-google-maps

This support ticket is created 6 years, 4 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 6 replies, has 2 voices.

Last updated by jamesW-7 6 years, 4 months ago.

Assisted by: Nigel.

Author
Posts
#1102420

I am trying to:
Display a list of Markers on a Google Map. The address is populated using Toolset - Address Custom Field. Address Custom Field is used in Post(s) to include an address.

Link to a page where the issue can be seen:
1. hidden link - map in black section - Browse Holiday Goddess. Using [wpv-view name="post-addresses"]

2. hidden link - map tests using Toolset Views. Using [wpv-view name="addresses"] and [wpv-view name="display-addresses"]

I expected to see:
Markers, of all the Posts with the populated address field, on the Google Map.

Instead, I got:
Only getting two Markers to appear on Google Map.

#1102445

Nigel
Supporter

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

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

Hi James

I checked your site and can see the issue.

You'll note that I edited the View to also output the post title in the Loop Output section, to verify that the View is retrieving the expected posts and iterating over them.

I did some basic debugging, switching theme and de-activating non-essential plugins, and was unable to identify anything useful.

So I'm taking a copy of your site to pass to my colleagues so that they can look into this further.

I'll update you when I have some news.

#1102451

Hi Nigel,

Thanks for looking at the site and looking at the issue.

Appreciate you doing some trouble shooting, with debugging, switching theme and de-activating non-essential plugins.

Thanks for escalating and the update.

#1104292

Nigel
Supporter

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

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

Hi James

Two of my colleagues looked at this and each did something basic which we normally do as a matter of course with problems when displaying markers, which is to change the API key to one that we use internally that doesn't have any URL referrer restrictions, and both reported that it solved the problem.

I didn't do that myself because the map was displaying two markers, rather than none, and it is not clear where those two markers are coming from if the API key does not work correctly. (I had used the API key test button on the settings page and it seemed to work.)

In any case, that appears to be the issue.

Please revise your API key. If you are using URL referrer restrictions, double-check those, and if you still have problems, add a second unrestricted key (which is only used server-to-server and so is not exposed).

https://toolset.com/documentation/user-guides/display-on-google-maps/creating-a-google-maps-api-key/#problems-with-displaying-markers-on-google-maps

#1104409

Hi Nigel,

Thank you for the update and advise.

The Markers, are displaying after removing the Key restrictions, as advised. Thank you.

Thank you both Ariano and Mohammed for your time and trouble shooting.

I wonder whether this is worth noting in the Toolset user guides/documentations - that Key restrictions, could affect the displaying of Markers. Which is contrary to Google's API key setup advice. This might reduced similar support request(s).

Nigel, I could not see this function, in the documentation on Makers, (sorry if I missed it). Can the Marker be configured, to open (click to) the article (post), when the post title that appears for the respective Marker, is clicked on?

#1104513

Nigel
Supporter

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

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

Hi James

The documentation contains such an example: https://toolset.com/documentation/user-guides/display-on-google-maps/displaying-markers-on-google-maps/#marker-title-and-popup

You can add whatever markup you choose in between the opening and closing wpv-map-marker shortcodes, and that markup can include Views shortcodes such as wpv-post-link, which generates a link to the post.

#1105258

Hi Nigel,

Ah, yes, it is explained in the Marker Title and Pop-up section, sorry, we did miss it. Thank you for the explanation and advice.

We actually managed to include the post link, with trying out and using the View shortcodes. Good to have the documentation to confirm and provide more details.