Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some Popups don't appear when hover #505

Closed
ossantr opened this issue Jun 13, 2017 · 11 comments
Closed

some Popups don't appear when hover #505

ossantr opened this issue Jun 13, 2017 · 11 comments

Comments

@ossantr
Copy link

ossantr commented Jun 13, 2017

Hi, I'm trying to do a web export with QGIS2web and I have a rendering issue some popups that should appeared when the cursor is hovered a point but they don't. This issue affects only some of the points (the other work fine), especially some points which are in close proximity to each other (it’s the case on the image below).

qgis2web_prob

Do you know how to solve this problem?

I’m sorry if the question has been already asked or if my english is not perfect…

Thank you in advance for your answer.

@tomchadwin
Copy link
Collaborator

Does it still fail if you don't cluster the layer?

@ossantr
Copy link
Author

ossantr commented Jun 13, 2017

It works fine when I don't cluster the layer, and I just realize that it works too when I use openlayers. But if there is a solution to make it works with Leaflet and the cluster, it would be perfect.

@tomchadwin
Copy link
Collaborator

Thanks. Is it only points which are "spidered" out from a cluster? In other words, if you zoom in far enough so that the point is unclustered, does the popup work?

@ossantr
Copy link
Author

ossantr commented Jun 14, 2017

That's right, if I zoom a lot the point is unclustered. The problem is that for the project I work on, I have to limit the zoom (I work for an Archaeology lab, and they don't want a too precise location of the points to prevent looting).

@tomchadwin
Copy link
Collaborator

I'm afraid I don't have a solution. It appears to be an open issue in the clustering library. Sorry.

Leaflet/Leaflet.markercluster#431

@ossantr
Copy link
Author

ossantr commented Jun 14, 2017

Ok, nevermind, I'll make it without the clustering.

Thank you so much for your help and your fast answers!

@tomchadwin
Copy link
Collaborator

You're welcome. Sorry not to have had a solution for you.

@tomchadwin
Copy link
Collaborator

@ghybs said on GIS.SE:

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.

A few bits and pieces to unpick here:

  • qgis2web exports Circle Markers, SVGs, and other regular shapes via a Leaflet plugin - I don't know how that affects what we might do, but I can change what properties and values are set according to the marker type, if you have some recommendations

  • obviously, qgis2web can't know how many points will be in a cluster, so it can't intelligently set the value based on that factor

  • it could be possible to replace the qgis2web Cluster checkbox with a dropdown with come options, which could result in different options and values being set for the cluster instance

How best to proceed?

@tomchadwin tomchadwin reopened this Oct 26, 2017
@ghybs
Copy link

ghybs commented Oct 30, 2017

Hi @tomchadwin,

Thank you for the follow-up!

  • Changing options based on marker type: it is true that Circle Markers are the main problem here, because regular Markers are drawn above the cluster icon, hence remain clickable. If you could make them be drawn on a pane above markerPane, that should already be a nice workaround. Or use the new clusterPane option of Leaflet.markercluster to have cluster icons be on a pane below Circle Markers (which are by default in the overlayPane).

  • Changing the spiderfyDistanceMultiplier intelligently based on the number of points in a cluster: indeed that sounds quite difficult to implement.

  • Give the possibility for user to set options in qgis2web for Cluster feature: sounds like a good start! On the one hand, it requests for steps for the user, and slightly more knowledge, but on the other hand it enables customizing the output to better fit specific situations.

I think Leaflet.markercluster would definitely benefit from a more permanent fix (as issue Leaflet/Leaflet.markercluster#431 shows that it due to the plugin in the first place, not specific to qgis2web). Not sure yet how to fix this elegantly…

Your option 3 sounds like a nice workaround for the meantime, besides giving access to all other Leaflet.markercluster options (if that is do-able).

@tomchadwin
Copy link
Collaborator

@ghybs OK, let's rule out option 2 as unachievable.

I can understand why you favour option 3, as it allows users to exploit the maximum functionality of LMC. However, what I failed to mention is that of course qgis2web exports to both Leaflet and OpenLayers. I therefore am not prepared to push a GUI control towards library when the functionality is not available in the other.

Another concern about option 3 is presenting users unfamiliar with code with confusing options. qgis2web exists for non-coders, so adding options very specific to one bit of functionality might be inappropriate.

Finally, I don't want to overbalance the whole GUI towards Leaflet clusters, if you understand what I mean. I have to consider overall usability, and to me, presenting in-depth options for just one aspect of maps is not the best approach.

So, back to option 1, I'll tweak the output for L.CicleMarkers, to solve the most pressing issue (I hope). I'll have to give some though as to panes, since qgis2web already exports every layer to its own pane in order to preserve overall z-index of all layers.

Thanks for all the help!

@tomchadwin
Copy link
Collaborator

OK, spiderfyDistanceMultiplier: 2 is now in place in master. Can people test and report back?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants