-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Add oldLatlng parameter to Marker move event #2412
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
Conversation
…r to support moving markers.
Add oldLatlng parameter to Marker move event
| this._latlng = L.latLng(latlng); | ||
| this.update(); | ||
| return this.fire('move', {latlng: this._latlng}); | ||
| return this.fire('move', { oldLatlng: oldLatlng, latlng: this._latlng }); |
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.
we now have a naming problem though... latlng is the only exception among properties that have camelCase, although changing it will break compatibility, and providing both is ugly, but now with oldLatlng it's nor camelCase nor lowercase, which is confusing... See #1423
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.
Agreed.
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've changed it to oldLatLng and pushed it up. We shouldn't make more problems :)
|
Pushed the documentation for this to gh-pages-master, I think that's the right place |
|
One possible issue: Marker drag doesn't pass through oldLatLng |
Will allow MarkerCluster to support moving markers.
Refs Leaflet/Leaflet.markercluster#57
Not sure about the capitalization. We have a 'latlng' parameter, so I matched that.