This should be oldLatLng, even if latlng is wrong, let's have this be right. refs #2412 #1423

This commit is contained in:
danzel 2014-01-29 14:51:55 +13:00
parent 78be0ad0ec
commit 8cc7404f53
2 changed files with 3 additions and 3 deletions

View File

@ -109,7 +109,7 @@ describe("Marker", function () {
marker.setLatLng(afterLatLng);
expect(eventArgs).to.not.be(null);
expect(eventArgs.oldLatlng).to.be(beforeLatLng);
expect(eventArgs.oldLatLng).to.be(beforeLatLng);
expect(eventArgs.latlng).to.be(afterLatLng);
expect(marker.getLatLng()).to.be(afterLatLng);
});

View File

@ -55,10 +55,10 @@ L.Marker = L.Layer.extend({
},
setLatLng: function (latlng) {
var oldLatlng = this._latlng;
var oldLatLng = this._latlng;
this._latlng = L.latLng(latlng);
this.update();
return this.fire('move', { oldLatlng: oldLatlng, latlng: this._latlng });
return this.fire('move', { oldLatLng: oldLatLng, latlng: this._latlng });
},
setZIndexOffset: function (offset) {