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

Zoom snapping #256

Closed
orangemug opened this issue Feb 9, 2018 · 6 comments
Closed

Zoom snapping #256

orangemug opened this issue Feb 9, 2018 · 6 comments

Comments

@orangemug
Copy link
Collaborator

From @kateler in issue #252. Moved to a new ticket so we can track separately.

As a frequent user of Maputnik, a feature I'd really like is two additional zoom buttons. Right now, the zoom buttons go up or down exactly one zoom level (e.g. from 15.43 to 16.43). I'd like the new buttons to go up or down to the next even zoom (e.g. from 15.43 to 16). Settings are usually made for the even zoom numbers, so I often want to get back to those after freely zooming with my scroll wheel.

@orangemug
Copy link
Collaborator Author

Hi @kateler thanks for raising the issue. That sounds like a great idea, although I'm a bit concerned about adding more buttons to the map UI (there's already another button on the way in another ticket).

As this seems like a power user feature how about using the modifier key instead. Something like SHIFT + click the zoom button to alter the zoom behaviour.

Thoughts? Any other ideas are welcome also, my main aim is to keep buttons on the map to a minimum.

@orangemug
Copy link
Collaborator Author

@kateler also if you would like to share what you've been using Maputnik for over in #164 it'd be very much appreciated (no pressure though)

@kateler
Copy link

kateler commented Feb 9, 2018

I like the idea of a shift+click on the zoom buttons to save on screen real estate. Anything to save me from having to click into the URL and manually edit the zoom level!

I can't share what I'm working on right now... maybe in the future.

@orangemug
Copy link
Collaborator Author

orangemug commented Feb 9, 2018

So @kateler it turns out that mapbox-gl supports this by default. On the keyboard just press + or - when focused on the map interface.

For further reference see https://github.com/mapbox/mapbox-gl-js/blob/65afc08ef02f5eb2081c2e3ee83f23e61722ac14/src/ui/handler/keyboard.js#L15-L23

@kateler
Copy link

kateler commented Feb 11, 2018

That's perfect! Thanks for finding that out and sharing.

@orangemug
Copy link
Collaborator Author

No problem glad to help, closing issue.

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

No branches or pull requests

2 participants