-
Notifications
You must be signed in to change notification settings - Fork 91
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
Methods for zooming in and out #27
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a nice idea, could you please add some examples in the Samples project.
const map = maps[mapId]; | ||
|
||
if (map.getZoom() > map.getMinZoom()) { | ||
map.zoomOut(map.options.zoomDelta * (e.shiftKey ? 3 : 1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be probably better if these hard coded values would be configurable by the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, we should probably expose the ZoomDelta
property somewhere (although I'm not sure it belongs in Map
itself: that class runs risk of getting a lot of properties over time — do we want a MapSettings
or MapOptions
class?).
As for the 3
, Leaflet hardcodes that behavior. Of course, that doesn't mean we need to do the same. What do we call this? HighSpeedZoomDelta
, maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want a MapSettings or MapOptions class?
I've moved that discussion to a separate issue #31.
If it's fine by you, I would just add ZoomDelta
and ZoomDelta_Faster
properties for now. The former would map directly to Leaflet's map.options.zoomDelta
, but the latter would only have an effect if you run this PR's custom methods, since Leaflet itself hardcodes it to 3
.
I'll have a look at your comments hopefully next week. |
I've added a sample page. Your concern on hard-coded values still needs to be addressed. |
It's good to go during the alpha, thanks for the contribution. |
These basically replicate the behavior of the built-in zoom control.