community-platform
community-platform copied to clipboard
[ui] Adjusting zoom level on the map when clicked on a profile
Is your feature request related to a problem? Please describe.
In the map when clicking on a profile, the zoom level is not adjusted. This results in not really clear, since it is somewhere in the cluster.
This happens whenever the url of the map has the profile in it (https://community.preciousplastic.com/map/#precious-plastic), so in the map page but also when the user clicks on the country button in the profile.
Describe the solution you'd like Adjust the zoom level when clicking on a profile, so that the pin is not in the cluster. My suggestion would be to have also a minimum zoom so that it is clear to see the region and the country, even if it is not in a cluster by default.
So instead of seeing the whole world even if the pin is alone,
have a minimal zoom level to see the country more up-close.
Should have Could the zoom transition be done smoothly? Or is Leaflet not made for that?
Additional context
I will try to work on this issue
Thanks @Roemerdt. Shout if you need anything.
Hey @Roemerdt, how are you getting on?
@benfurber Have something working, though I could not get the desired behaviour for 100%. also wasnt sure, but writing e2e tests is required right? cuz i had not gotten started on that yet
@Roemerdt Great. Not 100% is fine, we can have a look on the PR. Some kind of extra expectation on the existing map e2e tests would be good to prevent regressions.
@benfurber I have opened a draft in #4242 so you can check out where its at
fixed now @dalibormrska ?
@davehakkens @jproberson Awesome improvement in a really good direction, the #4455 fixed quite some issues.
However, this could still use a bit more attention. The idea here was basically: If a pin is in a cluster, zoom until it is not in a cluster.
The behaviour now is that even when you are zoomed in and you see many pins, if you click on one of them you get to the maximum zoom level. This can be a bit annoying if an user is exploring the pins.
So the question - would it be technically doable to implement this kind of logic:
- Check if the clicked pin is in a cluster
- If no, just center it, don't zoom
- If it is in a cluster then zoom to the first zoom level that is outside of the cluster
Let me know what do you think! :)) Or if you have other ideas.
An example of a nice map experience from WWOOF:
@davehakkens I think that's something we can handle just fine. I'll go ahead and work on that.
:tada: This issue has been resolved in version 2.86.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket: