Skip Navigation

[Resolved] Google map – problem with marker clusters

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

Problem:
I am trying to group close markers into clusters. But Toolset Maps doesn't show clusters and there is a related "Uncaught TypeError" in the browser's console, screenshot here:
http://bit.ly/2vaDh9b

Solution:
Problem was in the theme. I have changed the theme to Twenty Seventeen and map is working perfectly fine and also there is no error in browser console.

Relevant Documentation:
https://toolset.com/documentation/user-guides/display-on-google-maps/
https://toolset.com/documentation/user-guides/customizing-cluster-markers-with-javascript-functions/

This support ticket is created 6 years, 10 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
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 5 replies, has 2 voices.

Last updated by Vlastimil Ott 6 years, 10 months ago.

Assisted by: Noman.

Author
Posts
#548268
Memsource_search_page.png
Memsource_google_map_clusters_error.png

I am trying to: Grouping close markers into clusters

I've created a page using Toolset Views for searching and filtering recordes. I also included the Google Map using Toolset Maps plugin.

However, when I wanted to set the markers clusters, using the cluster attibute in [wpv-map-render], the Google Map doesn't show and there is a related "Uncaught TypeError" in the web console. See the enclosed screenshot.

For the setting the market clusters, I use this code:
[wpv-map-render map_id="map-1" cluster="off" map_height="260px"]

Please, can you check it out what is wrong?

Thank you.
Tomas

#548314

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Tomas,

Thank you for contacting Toolset Support. I can see cluster is off in your shortcode. I am using the below code for marker cluster and it is working as expected, please modify and use this below code.

[wpv-map-render map_id="map-5" cluster="on" cluster_min_size="2" cluster_grid_size="60"]

[wpv-map-marker map_id="map-5" marker_id="marker-5" lat="42.251805" lon="-71.82767"][/wpv-map-marker]

[wpv-map-marker map_id="map-5" marker_id="marker-6" lat="42.248805" lon="-71.824864"][/wpv-map-marker]

[wpv-map-marker map_id="map-5" marker_id="marker-7" lat="42.248734" lon=" -71.825012"][/wpv-map-marker]

==> Please replace map-5 with your unique Map ID and marker-5,6,7 with your unique Marker ID.

For more info: https://toolset.com/documentation/user-guides/display-on-google-maps/
https://toolset.com/documentation/user-guides/customizing-cluster-markers-with-javascript-functions/

Thank you

#548352
Memsource_google_map_clusters_error.png

Hi Noman,

I have switched OFF the clustering intentionally, because when it is ON, the Google Map is not displayed at all. See the enclosed picture. In the web console you can see the errors generated.

Here is the code I use for configuring the map and the markers:

 
[wpv-map-render map_id="map-1" cluster="on" cluster_min_size="2" cluster_grid_size="60" map_height="260px"]
[wpv-map-marker map_id="map-1" marker_id="marker-[wpv-post-id]" marker_field="wpcf-location"] <a class="popup-image" href="[wpv-post-url]"> [wpv-post-featured-image size="custom" width="50" height="50" crop="true"]<div class="popup-text"><h6> [wpv-post-link]</h6></a>[types field='location'][/types] </div>
 [/wpv-map-marker]

Based on you previous comments, I added the cluster_min_size and cluster_grid_size attributes in [wpv-map-render].

Nevertheless, it still doesn't work and the Google Map is not displayed when cluster is ON.

Can you check it out yet, please?

Thank you very much.
Tomas

#548387

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

errors on home page.png

Yes, I can see errors on the home page as well, where map is not inserted. Please see attached screenshot.

To further debug this issue, I would need to request temporary website WP-admin and FTP info for your test site to debug further and to help in resolving this. Your next answer will be private which means only you and I have access to it.

=== Please backup your database and website ===

✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.

✙ Please add the Links to the [View] Edit Screen and [Page] Edit Screen where you have inserted this view.
Thank you

#548730

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hello Tomas,

I have thoroughly checked your site and found that problem is in the theme you are using. I have changed the theme to Twenty Seventeen and map is working perfectly fine and also there is no error in browser console. You can check here now:
hidden link

Please check your theme or contact to theme author and inform them regarding this issue.
Thank you

#548875

Hello Noman,

Thank you for the investigation. Yes, this theme is strongly customized, including changes in the code, so such problems may appear. Unfortunately, we are not in touch with the author of this theme, so we'll have to deal with that ourselves.

Our developer was looking at this issue and found out that problem is in marker cluster being created before the map. He doesn't know yet, how the theme can change this.

Nevertheless, the main function of Google Map is working, and the clustering would be just a nice addition. Perhaps we'll solve that later.

Tomas

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