Skip to content

Commit

Permalink
Merge pull request maximeh#4 from makinacorpus/precision
Browse files Browse the repository at this point in the history
Do not loose precision : keep a copy of original latlng
  • Loading branch information
maximeh committed Apr 18, 2013
2 parents 491976c + 28d559f commit 9ab6098
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bouncemarker.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@
var delta = opts.delta(progress);
opts.step(delta);
if (progress === 1) {
opts.end();
clearInterval(id);
}
}, opts.delay || 10);
},

_move: function (delta, duration) {
var start_point = this._drop_point.y,
var original = L.latLng(this._latlng),
start_point = this._drop_point.y,
distance = this._point.y - start_point;
var self = this;

Expand All @@ -67,6 +69,9 @@
step: function (delta) {
self._drop_point.y = start_point + (distance * delta);
self.setLatLng(self._toLatLng(self._drop_point));
},
end: function () {
self.setLatLng(original);
}
});
},
Expand Down

0 comments on commit 9ab6098

Please sign in to comment.