1

I have a problem with a web map generated via qgis2web plugin using clusters. I have a batch point data and many of these are on the same location. Because of that I have used cluster for representing the locations. The problem is that when I click on the cluster and got the tree with points at the end and after that click on specific point on of these points doesent showing the popup window (if I have 4 points, one of these is always bad, the popup windows does not appear). enter image description here Marked point on the screenshot is that point with popup error. I have tried to change cluster circle radius in css folder but I have not found the code part for it.

How do I solve this problem?

1

This is a known issue between qgis2web and Leaflet.markercluster: https://github.com/tomchadwin/qgis2web/issues/505

There is an "easy" workaround: https://github.com/Leaflet/Leaflet.markercluster/issues/431

The idea is to specify spiderfyDistanceMultiplier option when instantiating the L.markerClusterGroup, but this requires that you can pass options to that factory.

In the case of qgis2web, I am not sure you can specify such options unfortunately.

If you can customize the JavaScript, you could however tweak Leaflet.markercluster plugin so that it uses a different spiderfyDistanceMultiplier option value by default:

// Increase spiderfyDistanceMultiplier by default
// in order to force spiderfied Circle Markers to extend outside
// the cluster icon, and be clickable (so that user can open the popup if any).
L.MarkerClusterGroup.mergeOptions({
  spiderfyDistanceMultiplier: 2
});

Place this code in a <script> tag after Leaflet.markercluster script. It should work even if it is executed after qgis2web JavaScript code.

  • Would it be appropriate to set this value by default in qgis2web? – Tom Chadwin Oct 25 '17 at 18:37
  • @TomChadwin Thanks for caring about this issue! That might help in case qgis2web always uses Circle Marker type (instead of icon-based marker), but only for small clusters. If there are more than a couple markers, the spiderfication might become enourmous… If I understand correctly, qgis2web does not provide a lot of options for customization, hence the need to choose carefully a default value? Maybe we could improve on Leaflet.markercluster side as well. – ghybs Oct 25 '17 at 18:43
  • It's probably a little more complex. I'll pick the discussion up on github.com/tomchadwin/qgis2web/issues/505. – Tom Chadwin Oct 26 '17 at 11:27
2

Using the information provided by @ghybs, a possible fix for this issue is now in qgis2web 2.31.0. Please try that and see whether is solves the issue you are having. It adds the option spiderfyDistanceMultiplier: 2 to clustered layers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.