Clustering not working

More
6 years 7 months ago #39717 by appnweb
Hi,

We use Geommunity on a website on which we have several users on the exact same position. In order to see all of them on the map, I tried to enable the clustering (custom) function.

The clusters show correctly on the map but when clicked nothing happens. I built a demo of the problem on a testing website here : dev11.anw-sandbox.ch/annuaire.html .

Can you please have a look and tell me if you have an idea about what's going wrong ?

Thanks in advance for your help.

Please Log in or Create an account to join the conversation.

More
6 years 7 months ago #39720 by appnweb
Replied by appnweb on topic Clustering not working
Well I read a bit of the code and finally understood that the way I thought the clustering was supposed to work was wrong.

If I understand well actually, the click on the cluster should open the popup if max zoom defined in the option is reached and there is still more than 1 user in the cluster, else it should zoom, right ?

Based on that, I tried to understand how to achieve what I want : open the popup on click whatever the zoom is. So I set Zoom, Max Zoom and Min Zoom to the same value thinking that would get the popup to open on click on the cluster no matter if users in the cluster had the exact same address or not. But even that way, the popup open only if all users in the cluster have exactly the same address. The only change is that the zoom on double click do not work anymore as Max Zoom is already reached.

I then tried to modify the code changing :

if (zoom >= maxZoom && cClusterIcon.cluster_.markers_.length > 1) {
return mc.onClick(cClusterIcon);
}

To : if (cClusterIcon.cluster_.markers_.length > 1) {
return mc.onClick(cClusterIcon);
}

But it's not working either, in fact it does not change anything :(

Please, give me some help on that. Exemple is here : dev11.anw-sandbox.ch/annuaire.html , the bottom cluster contains two users on the same address and the top one two users with a slightly different address.

The zoom are set in order that the top cluster won't be separated when reaching max zoom and you will see the click then does not open the popup on that one. And on the bottom cluster, the click opens the popup even if on min zoom what I would like to have for all clusters.

Another suitable option would be having the zoom triggered on simple click and not on double click so visitor do not thinks it's working only for some clusters and not for other. But in any case, when max zoom is reached the popup should open to show the list.

Thanks in advance for your help.

Please Log in or Create an account to join the conversation.

More
6 years 7 months ago #39722 by nordmograph
Replied by nordmograph on topic Clustering not working
Hi,

I just tyed and the cluster map infowindow opened with the 2 'south users'
But I could not reach northern users becous you max zomm setting is too low.

- Need help? Post the URL of the related page (eventualy as confidential info), it will help solve your issue faster.
- An error, notice or warning? report the exact message including the line number
- If you get a white page , enable error reporting and / or check your server error logs.

Please Log in or Create an account to join the conversation.

More
6 years 7 months ago #39723 by appnweb
Replied by appnweb on topic Clustering not working
Thanks for your answer.

In fact I did set a low max zoom because I thought that way the popup would open when max zoom is reached but your answer seems to mean it's not intended to work that way.

So I explain my problem : our customer think (and so do I) that the way it's actually working is not clear enough for visitors as if there are two (or more) users at the same address the popup opens showing the list on a single click (south case) but if the cluster users are not located at the exact same address (north case) the single click does nothing as if not working and you have to double click to trigger the zoom what most not tech-savy visitors will miss just thinking the map is not working as there seem to be a link but clicking it has no effect.

Thus, is there a way I can get, either the popup to open on single click on each cluster whatever the zoom and even if users in the cluster are at not at the exact same address or the zoom to be triggered on single click instead of double ?

My question may seem strange to you but even I needed quite a long time to understand this "zoom or open multi user window" option, thinking first that the clustering click function was not working at all. So honestly, I am quite sure a lot of visitors will not understand it at all and report us a bug on the website.

I usually do not like to alter an extension code but in that particular case, if it can help I am open to such a modification as long as I can do what our customer needs.

Any idea how I could achieve that ?

Please Log in or Create an account to join the conversation.

More
6 years 7 months ago #39726 by appnweb
Replied by appnweb on topic Clustering not working
Well one more progress on that, I nearly got where I want by simply removing a few lines on your custom js :

if (zoom >= maxZoom && cClusterIcon.cluster_.markers_.length > 1) {
return mc.onClick(cClusterIcon);
}

So now, the zoom works on single click and the popup still opens when cluster only contains users at the exact same address. You can see it running here : dev11.anw-sandbox.ch/annuaire.html . That's already much more like the result I need for my customer even if not perfect.

The only improvement I still would like to add is avoiding the zoom when there is only users at the same address left in the cluster as the zooming tends to close the opening popup window and a second click is needed to reopen it. Any idea how I could do that ?
The following user(s) said Thank You: nordmograph

Please Log in or Create an account to join the conversation.

More
6 years 7 months ago #39727 by nordmograph
Replied by nordmograph on topic Clustering not working
Hello

Well done, you've been faster than me. This is an interesting change, so you can expect it to be added to the core for next update. I'll have a look if I can help prevent the zooming when clicking on a multi user cluster.

- Need help? Post the URL of the related page (eventualy as confidential info), it will help solve your issue faster.
- An error, notice or warning? report the exact message including the line number
- If you get a white page , enable error reporting and / or check your server error logs.

Please Log in or Create an account to join the conversation.

Time to create page: 0.332 seconds
Powered by Kunena Forum
Disclaimer: Nordmograph is not affiliated with or endorsed by The Joomla! Project™. Any products and services provided through this site are not supported or warrantied by The Joomla! Project or Open Source Matters, Inc. Use of the Joomla!® name, symbol, logo and related trademarks is permitted under a limited license granted by Open Source Matters, Inc.