Closed AFoletti closed 2 years ago
Fixed the link to visualize map.
Hi Ambroggio, thanks for the report. I am not sure that a solution relying on the order of the point would be good. We would have edge cases where two points have the same radii and have approximately the same position, and then it would still be a problem to hover over one of them. I think a more scalable solution would be to support clustering https://visgl.github.io/react-map-gl/examples/clusters or heatmaps https://visgl.github.io/react-map-gl/examples/heatmap This is not something that we will tackle now, but I keep it in mind, what is your opinion ?
Hello @ptbrowne, and thanks for your message and your proposal. Clustering and heatmaps would be very nice additions but they cover in my opinion two additional use cases, since one may want to have the real points on the map from the start. Everyone however wishes for usable tooltips, which are at the moment randomly not possible because of draw order. This would be even more important for actual overlapping surfaces (as opposed to points as in my example) where the smaller ones really need to be drawn on top. You could maybe even activate the tooltip for every feature you hover over and not only the top one, but this may result in confusion and an order fix remains in my opinion a better solution.
Thanks @AFoletti , I think it was a good fix actually 👍 It is now deployed in test.
Wonderful, many thanks!
Describe the bug When drawing a map, it can be that a feature is completely covered by a bigger one. You may be able to see the smaller feature thanks to transparency, but the hover only returns the tooltip for the larger feature. I guess (from my past map.geo.admin.ch visualization development work) that this is a problem of feature draw order, where the smaller feature is drawn first and then covered by the larger one. Actually, it looks like the draw order is at the moment random, since I have seen the very same map work well with the smaller feature drawn last (thus on top).
To Reproduce Steps to reproduce the behavior:
Expected behavior Smaller features are always drawn last (thus on top) and their tooltip is available
Screenshots If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
Additional context Most probably you just need a sorting