-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Only check for moving draggable in canvas renderer when map is draggable #3942
Conversation
@@ -215,7 +215,7 @@ L.Canvas = L.Renderer.extend({ | |||
}, | |||
|
|||
_onMouseMove: function (e) { | |||
if (!this._map || this._map.dragging._draggable._moving || this._map._animatingZoom) { return; } | |||
if (!this._map || (this._map.dragging._enabled && this._map.dragging._draggable._moving) || this._map._animatingZoom) { return; } |
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.
This becomes a bit hard to follow, I wonder if we should not have a method on the L.Draggable object to make this more readable.
Something like this._map.dragging.moving()
that would do both checks.
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.
Also, this._map._dragging
, inheriting from L.Handler
has a enabled()
method that should be used here instead of private property.
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.
I agree. Should be a simple change, but let's look if we can update similar places to use the new method.
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.
Yep. I'm happy to update the pull request later.
Good catch! See code comments :) |
Ok, I just added a moving() method to the MapDrag handler, just like the moved() method there. |
Only check for moving draggable in canvas renderer when map is draggable
This is a fix for #3941