Skip Navigation

[Resolved] Spiderfy markers in a map

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 2 days, 2 hours ago.

Assisted by: Minesh.

Author
Posts
#2766391

Tell us what you are trying to do?
I am trying to display multiple markers on a map using Toolset Maps, where two markers are at the exact same address. My goal is to enable spiderfying for these overlapping markers so that users can see and click on the individual popups for each post.

Despite setting cluster="on" and spiderfy="on" in the [wpv-map-render] shortcode, the expected behavior does not occur. When both markers are at the same location, they remain clustered even when I zoom in, and they do not "spiderfy" into distinct markers. As a result, users cannot click on the individual popups, and the markers stay grouped together.

Problem Description:
Expected Behavior: When there are two markers at the exact same location, I expect that zooming in or clicking on the cluster will result in the markers being "spiderfied," allowing each marker to be viewed and clicked individually.
Actual Behavior: Instead of separating, the two markers with the same address stay clustered, even when zooming in closer to the location. Users are unable to access the individual popups for these posts since the markers do not spiderfy as expected.

Is there any documentation that you are following?
I have followed the Toolset Maps documentation that describes the use of clustering and spiderfy options with the cluster="on" and spiderfy="on" attributes. According to the available resources, I expected that enabling both options would allow the markers to automatically separate or "spiderfy" when zooming in or when they are clicked.

What is the link to your site?
hidden link

Shortcode Configuration:
[wpv-layout-start]
[wpv-items-found]
[wpv-map-render map_id="map-5" map_width="100%" map_height="700px" map_type_control="off" street_view_control="off" fitbounds="off" general_zoom="6" general_center_lat="51" general_center_lon="10" cluster="on" spiderfy="on" cluster_grid_size="40"]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-map-marker
map_id="map-5"
marker_id="marker-[wpv-post-id]"
marker_field="wpcf-event-google-maps-adresse"
]

<style>
/* Minimale Anpassung für den äußeren Google Maps Popup-Container */
.gm-style .gm-style-iw-c {
border-radius: 0 !important;
padding: 20px !important;
}

.gm-style .gm-style-iw-d {
overflow: auto !important;
}

/* Styles für unser Custom Popup */
.custom-popup {
display: flex;
max-width: 500px;
min-height: 150px;
box-sizing: border-box;
background-color: white;
}

.custom-popup-image {
flex: 0 0 160px;
max-height: 240px;
margin-right: 20px;
align-self: flex-start; /* Wichtig: Richtet das Bild am oberen Rand aus */
}

.custom-popup-image img {
width: 100%;
height: 100%;
object-fit: contain;
}

.custom-popup-content {
flex: 1;
display: flex;
flex-direction: column;
}

.custom-popup-text {
margin-bottom: 15px;
}

.custom-popup-text h3 {
margin: 0 0 15px;
font-size: 1.3em;
color: #cc4259;
}

.post-detail {
font-size: 1.05em;
margin-bottom: 10px;
}

.post-detail strong {
font-weight: bold;
}

.post-button {
align-self: stretch;
margin-top: 15px;
padding: 10px 15px;
border: 1px solid #cc4259;
color: #cc4259;
text-decoration: none;
transition: all 0.3s ease;
text-align: center;
font-weight: bold;
font-size: 1.1em;
}

.post-button:hover {
color: #EAA4B3;
border-color: #EAA4B3;
}

/* Bild auf mobilen Geräten ausblenden */
@media (max-width: 768px) {
.custom-popup-image {
display: none;
}

.custom-popup {
max-width: 100vw;
padding: 10px;
}

.custom-popup-content {
width: 100%;
}
}
</style>

<div class="custom-popup">
<div class="custom-popup-image">

[wpv-post-featured-image size="medium"]

</div>
<div class="custom-popup-content">
<div class="custom-popup-text">
<h3>[types field="event-name"][/types]</h3>
<div class="post-detail">
<div class="post-detail-label">Ort:</div>
<div class="post-detail-content">[types field="event-ortsname"][/types]</div>
</div>
<div class="post-detail">
<div class="post-detail-label">Veranstalter*in:</div>
<div class="post-detail-content">
[types field="event-veranstalter"][/types]
</div>
</div>
<div class="post-detail">
<div class="post-detail-label">Termine:</div>
<div class="post-detail-content">[types field="event-termine"][/types]</div>
</div>
<div class="post-detail">
<div class="post-detail-label">Preis:</div>
<div class="post-detail-content">[types field="event-preis"][/types]</div>
</div>
</div>
Zum Event →
</div>
</div>
[/wpv-map-marker]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-map-render]
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]Keine Veranstaltungen gefunden[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

#2766656

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

In such cases when the spiderfy effect is not visible due to cluster overlapping, you can try to add the "cluster_max_zoom" attribute to [wpv-map-render] shortcode:
=> https://toolset.com/documentation/user-guides/maps/maps-shortcodes/#wpv-map-render

cluster_max_zoom. Optional, defaults to empty.
When cluster is set to on , this attribute sets the minimum zoom level that dissolves clusters into individual markers again.

For example - what if you try to use the following code where we added the attribute "cluster_max_zoom" - does that helps:

[wpv-map-render map_id="map-5" map_width="100%" map_height="700px" map_type_control="off" street_view_control="off" fitbounds="off" general_zoom="6" general_center_lat="51" general_center_lon="10" cluster="on" spiderfy="on" cluster_grid_size="40" cluster_max_zoom="3"]
#2768226

Thank you very much.

milanS-3 confirmed that the issue was resolved on 2024-10-05 06:15:26.
This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.