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

open /map page more zoomed in for performance reasons #7822

Closed
jywarren opened this issue Apr 14, 2020 · 8 comments · Fixed by #7842
Closed

open /map page more zoomed in for performance reasons #7822

jywarren opened this issue Apr 14, 2020 · 8 comments · Fixed by #7842
Labels
help wanted requires help by anyone willing to contribute JavaScript Ruby

Comments

@jywarren
Copy link
Member

Really big views are a performance issue for displaying nearby people, so we should try to zoom in a bit on https://publiclab.org/map

Code is here:

@zoom = current_user.get_value_of_power_tag("zoom").to_f if current_user&.has_power_tag("zoom")

And is used here in the template:

<% if @zoom %>
urlHash.setUrlHashParameter('zoom', <%= @zoom %> + "");
<% end %>

If there is no zoom profile tag, it seems to default to a global view!

https://publiclab.org/map#3/40.99999999999999/-52.89453124999999

Let's not do that. Maybe choose like zoom 10 as default?

https://publiclab.org/map#10/41.88165276651511/-71.36132687330247

@jywarren
Copy link
Member Author

https://publiclab.org/map#11/40.67759191045513/-73.8769419793971 zoom 10 or 11 seems to be good. here's someone.

@Shulammite-Aso
Copy link
Collaborator

@jywarren I don't do ruby, but I think I can take a shot at this!
And perhaps ask a question if I get stuck.

Thanks!!

@cesswairimu
Copy link
Collaborator

Great 🎉 @Shulammite-Aso go ahead

@Shulammite-Aso
Copy link
Collaborator

Hi @jywarren @cesswairimu please do help.😊

I'm trying to get exactly what we need to do here. Is it to change the global view here

from 3 to 10 or 11, or to define another default value of say 11 while still leaving 3 as the global view?

Thank you!

@cesswairimu
Copy link
Collaborator

cesswairimu commented Apr 27, 2020

@Shulammite-Aso you could try different zooms see which one gives the best display and use that as the default...10 was the proposed one

@Shulammite-Aso
Copy link
Collaborator

@Shulammite-Aso you could try different zooms see which one gives the best display and use that as the default...10 was the proposed one

Thanks @cesswairimu
This will mean simply removing 3 and replacing with 10 right?
Just trying to know if there's any other code adjustment I'd need to make before this works.

@cesswairimu
Copy link
Collaborator

yeah just the zoom I believe. Thanks

@jywarren
Copy link
Member Author

Amazing @Shulammite-Aso thank you! Reviewing now!

jywarren added a commit that referenced this issue May 5, 2020
jywarren added a commit that referenced this issue May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted requires help by anyone willing to contribute JavaScript Ruby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants