diff --git a/dist/BouncingMotionCss3.js b/dist/BouncingMotionCss3.js index 8e922b5..ae1dc72 100644 --- a/dist/BouncingMotionCss3.js +++ b/dist/BouncingMotionCss3.js @@ -115,6 +115,8 @@ var BouncingMotionCss3 = /*#__PURE__*/function () { _defineProperty(this, "bouncingAnimationPlaying", false); + _defineProperty(this, "onMotionEnd", void 0); + _classPrivateFieldInitSpec(this, _lastAnimationName, { writable: true, value: contractAnimationName @@ -205,6 +207,12 @@ var BouncingMotionCss3 = /*#__PURE__*/function () { }); this.bouncingAnimationPlaying = false; + + if (this.onMotionEnd) { + this.onMotionEnd(); + this.onMotionEnd = null; + } + this.marker.fire('bounceend'); } } diff --git a/dist/MarkerPrototypeExt.js b/dist/MarkerPrototypeExt.js index 9fe4116..8beb267 100644 --- a/dist/MarkerPrototypeExt.js +++ b/dist/MarkerPrototypeExt.js @@ -49,8 +49,16 @@ var _default = { * @return {Marker} this marker */ bounce: function bounce() { + var _this = this; + var times = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + if (times) { + this._bouncingMotion.onMotionEnd = function () { + _leaflet.Marker.prototype._orchestration.removeBouncingMarker(_this); + }; + } + this._bouncingMotion.bounce(times); var exclusive = this._bouncingMotion.bouncingOptions.exclusive; diff --git a/dist/bundle.js b/dist/bundle.js index ac75b84..abdc888 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -343,8 +343,16 @@ * @return {Marker} this marker */ bounce: function bounce() { + var _this = this; + var times = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + if (times) { + this._bouncingMotion.onMotionEnd = function () { + L.Marker.prototype._orchestration.removeBouncingMarker(_this); + }; + } + this._bouncingMotion.bounce(times); var exclusive = this._bouncingMotion.bouncingOptions.exclusive; @@ -627,6 +635,8 @@ _defineProperty(this, "bouncingAnimationPlaying", false); + _defineProperty(this, "onMotionEnd", void 0); + _classPrivateFieldInitSpec(this, _lastAnimationName, { writable: true, value: contractAnimationName @@ -717,6 +727,12 @@ }); this.bouncingAnimationPlaying = false; + + if (this.onMotionEnd) { + this.onMotionEnd(); + this.onMotionEnd = null; + } + this.marker.fire('bounceend'); } } diff --git a/dist/bundle.min.js b/dist/bundle.min.js index 74adfa0..432dc27 100644 --- a/dist/bundle.min.js +++ b/dist/bundle.min.js @@ -1 +1 @@ -!function(M){"use strict";function n(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var t=n(M);function o(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function e(n,t){for(var i=0;in.length)&&(t=n.length);for(var i=0,e=new Array(t);in.length)&&(t=n.length);for(var i=0,o=new Array(t);i { + Marker.prototype._orchestration.removeBouncingMarker(this); + }; + } + this._bouncingMotion.bounce(times); const exclusive = this._bouncingMotion.bouncingOptions.exclusive; Marker.prototype._orchestration.addBouncingMarker(this, exclusive);