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

Implement fast zoom on minus/plus keydown with shiftKey #3024

Merged
merged 3 commits into from
Nov 14, 2014

Conversation

yohanboniface
Copy link
Member

Goal is to make it consistent with the zoomControl shift+click.

If you think it's a good suggestion, I'm still not sure:

  • if we should also factorize the shiftZoomFactor with zoomControl
  • if not, then if we need a shiftZoomFactor option at all

Thanks for reviewing :)

@mourner
Copy link
Member

mourner commented Nov 14, 2014

👍 Though I don't think there's a need to introduce a new option for this — there was never a need to customize shift-double-click on the zoom control so I don't think there will be need for it here. Less unused options -> better.

@yohanboniface
Copy link
Member Author

OK, let me fix that then :)

@@ -141,7 +141,7 @@ L.Map.Keyboard = L.Handler.extend({
}

} else if (key in this._zoomKeys) {
map.setZoom(map.getZoom() + this._zoomKeys[key]);
map.setZoom(map.getZoom() + (e.shiftKey ? this._zoomKeys[key] * 3 : this._zoomKeys[key]));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more compactly written as ((e.shiftKey ? 3 : 1) * this._zoomKeys[key])

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always with style :)

Done.

mourner added a commit that referenced this pull request Nov 14, 2014
Implement fast zoom on minus/plus keydown with shiftKey
@mourner mourner merged commit 3318f8d into Leaflet:master Nov 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants