Skip to content

Conversation

danzel
Copy link
Member

@danzel danzel commented Jan 28, 2014

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.

mourner added a commit that referenced this pull request Jan 28, 2014
Add oldLatlng parameter to Marker move event
@mourner mourner merged commit 78be0ad into Leaflet:master Jan 28, 2014
this._latlng = L.latLng(latlng);
this.update();
return this.fire('move', {latlng: this._latlng});
return this.fire('move', { oldLatlng: oldLatlng, latlng: this._latlng });
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed.

Copy link
Member Author

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 :)

@danzel
Copy link
Member Author

danzel commented Jan 28, 2014

Pushed the documentation for this to gh-pages-master, I think that's the right place
9374c26

@danzel
Copy link
Member Author

danzel commented Jan 29, 2014

One possible issue: Marker drag doesn't pass through oldLatLng
https://github.com/Leaflet/Leaflet/blob/master/src/layer/marker/Marker.Drag.js#L61

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