Skip Navigation

[Résolu] Toolset Google Maps: can't get it to display a post on a map

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:
User created a map and tried to display it on the frontend, but the map did not render the markers at all.

Solution:
The problem was that the requests limit to Google Maps API from the server has been exceeded. I provided a new development version with the feature to add an API key, in order to prevent limit errors per IP. This feature will be included in next version of Toolet Maps plugin.

The steps to fix the issue are:
1. Install the new version of Toolset Maps plugin
2. Create a new API key in Google Developers site: https://developers.google.com/console/help/new/#api-keys
3. Add the API key in Views -> Views Settings -> Toolset Maps.

Google Maps Geocoding API Usage Limits:
https://developers.google.com/maps/documentation/geocoding/usage-limits

Displaying Information on Google Maps:
https://toolset.com/documentation/user-guides/display-on-google-maps/

This support ticket is created Il y a 8 années et 4 mois. 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 – 17:00 9:00 – 17:00 9:00 – 17:00 9:00 – 17:00 9:00 – 17:00 -
- - - - - - -

Supporter timezone: Europe/Athens (GMT+03:00)

This topic contains 13 réponses, has 3 voix.

Last updated by Alan Il y a 8 années et 4 mois.

Assisted by: Konstantinos.

Auteur
Publications
#348799

I am testing the new Toolset Google maps integration. Thank you for developing this - it's a VERY exciting addition to Toolset. Congratulations 🙂

I created the Address field in my CPT, and followed the tutorial to include the map and marker codes within a content template.

However, when I view that particular post, the map centers on the Pacific Ocean and my marker is not on the map, even when I manually click and zoom to the location.

My test post is here: hidden link

Grateful for any help. This is on a test site on Twenty Fifteen and only Toolset and WMPL plugins.

#348840

Hi Alan,
I am happy to hear that you like our Toolset Google Maps plugin!

Regarding your map, edit your CPT item and check that you inserted a valid address in the Address field and you can see this location on the map preview next to it.

Then check your Content Template and make sure that the marker and the map have the same map_id.
For example, if your Address field is "my-address", the map and marker shortcodes in the Content Template should be similar to this:

[wpv-map-marker map_id="my-map" marker_id="my-marker" marker_field="wpcf-my-address"][/wpv-map-marker]
[wpv-map-render map_id="my-map"]

Let me know if that works for you or you need further assistance.

Regards,
Konstantinos

#349138

Hi

That is exactly how I had it set up, but it wasn't working on Friday.
Having just looked at this again (on Monday) it's now working, and I haven't changed anything.

So that's strange, but I'm glad it's working now and totally delighted to have this functionality.
Thanks
Alan

#349150

Actually, I spoke too soon - can you revert this to "unresolved"?

The one test post I had created now displays correctly in the map (as defined in a content template) even though I didn't change anything.
However, I just created two new test posts, entered the address data and when I try to view those individually, the map just centers in the middle of the Pacific again.

I also created a View to pull ALL of the markers into ONE map (by inserting the map render shortcode outside of the loop). This is only pulling in the first test post.
I have no caching plugins or anything like that.

Grateful for some help, thanks
Alan

#349154

I am sorry to hear you are still having issues, I reopened this thread.

I would like to request temporary access (wp-admin and FTP) to your site, in order to take a better look at the issue.

You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.

Regards,
Konstantinos

#349252

Thank you for the information Alan.

It seems that we have an issue here and we are working on it.
I will post a reply here, as soon as I have news.

Sorry for the inconvenience.

Regards,
Konstantinos

#349767

Hi Alan!

I have some good news for you. 🙂

The problem with your site was not in Maps plugin, but the fact that you have exceeded your requests limit to Google Maps API from your server. This is a common issue, especially if you run your site in a shared hosting.

For that reason, we added a new feature, so you can now add an API key, in order to prevent limit errors per IP. This will ensure at least up to 2500 requests per day and up to 10 requests per second for this specific key. You can find more information here:
hidden link

You can add your API key in Views -> Views Settings -> Toolset Maps. You can find more information on how to create an API key here:
hidden link

As an additional note, we also cache all data, which saves a lot of requests in Google Maps API.
In Views -> Views Settings -> Toolset Maps, there is a "Cached data" section and by clicking "Load stored data", you can see all cached address data and remove some if you want.

I updated the version of Maps plugin in your website with our latest development version, so you can play with it. I also added an example key, so you can check that maps are now working fine. I suggest you create a new API key for your future projects.

A last note about the View that displays all markers in one map. Instead of using a static marker-id, you should use a dynamic one, so every marker of this map will have a unique id.
An example marker shortcode inside your loop can be like the following:

[wpv-map-marker map_id="my-map" marker_id="marker-[wpv-post-id]" marker_field="wpcf-address"][/wpv-map-marker]

Let me know if this works for you or you need further assistance.

Regards,
Konstantinos

#349952
google maps api views settings.jpg

This sounds promosing Konstantinos, thanks!

I can see that you've added an API key within my test site.

On my live site, when I visit the page at Views > Settings > Toolset Maps I can't see an option to add the API key.
I just see the option in the screenshot.

Any ideas?

thanks for your help.

#349980

As I stated in my previous reply, I updated the version of Maps plugin in your test website with our latest development version. In your production site, you have the latest beta release, which does not include the API key feature.

Let me know if you need any further assistance.

Regards,
Konstantinos

#350017

Hi Konstantinos

I think I have the same problem - do you know when the latest development version is being released so I am able to add an API key?

Many Thanks

Guy

#350133

Hi Guy!

Unfortunately, I cannot give you an estimation for the next release, but we are planning to release another beta version soon.

Regards,
Konstantinos

#350760
google maps api.jpg

I have copied the dev version of toolset google maps over to my live site, and tried to replicate the setup but I still can't get it to work.

I have created an api key at Google Developer. No idea if I've done this correctly though - can you include some guidance on this within your documentation please?

There appear to be many different elements of the google maps api which can be enabled independently. (see screenshot)

Which ones need to be enabled?
thanks
Alan

#350766
enabled_api.png
api_key.png

You need to create a "Browser" key in "Credentials" tab and then just enable "Google Maps Geocoding" API.
I also attach 2 screenshots that illustrate the above options.

Let me know if that works for you.

Regards,
Konstantinos

#350807

Thanks Konstantinos 🙂

I tried this and at first it still wasn't working.
When you create the API key, it alerts you if you haven't implemented any security, such as limiting access to a specific domain. I had therefore added my domains (with and without the www).

When I removed all of the specific domains, it started to work as expected, and my test view successfully included the markers on a single map.

Thanks for your help
Alan

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.