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

Disable "follow-me" viewport #2156

Closed
baerbock opened this issue Jan 14, 2020 · 3 comments · Fixed by #2159
Closed

Disable "follow-me" viewport #2156

baerbock opened this issue Jan 14, 2020 · 3 comments · Fixed by #2159

Comments

@baerbock
Copy link

baerbock commented Jan 14, 2020

Recently electricitymap started to change the viewport when selecting a country.

In my opinion it feels awkward when a web app overzealously wants to help the user, so this should be disabled again.

@corradio
Copy link
Member

@fbarl I think this is a side effect of re-centering when clicking on a country. Can you help revert the behavior?

@fbarl
Copy link
Contributor

fbarl commented Jan 14, 2020

Thanks for reporting the issue @baerbock !

I think this is a side effect of re-centering when clicking on a country. Can you help revert the behavior?

It's very possible #2145 caused an accidental change in the behaviour. However, I'm not really sure how the app was behaving before 🤔

There are two ways one can select the zone that I'm aware of:

a) By clicking on the zones list in the sidebar
image

b) By clicking on the zone directly in the map
image

  1. Right now the viewport changes in both cases
  2. If I removed the observer mentioned in Migrate ZoneList component to React #2145 (comment), the viewport doesn't change in neither case
  3. We could make the viewport change only when clicking on the zones list
  4. We could make the viewport change only when clicking on the map

@corradio Was (3) what we had before? If we don't want (1), I'd personally like to see us go with either (2) or (3) - there are arguments to be made for both, but I don't have a strong stand and I think both would be fine, so you can make the call :)

@corradio
Copy link
Member

Thanks for the write-up. Let's go with (3).
Let's also make sure that the viewpoint is centered on the country when a country is linked to (i.e. when the URL already points to a country)
Thanks!

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

Successfully merging a pull request may close this issue.

3 participants