• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hosuaby / Leaflet.SmoothMarkerBouncing / #44

21 Jul 2024 12:49PM UTC coverage: 71.111% (-0.7%) from 71.772%
#44

push

hosuaby
FEATURE #52: Instant stop

79 of 140 branches covered (56.43%)

Branch coverage included in aggregate %.

8 of 21 new or added lines in 4 files covered. (38.1%)

177 of 220 relevant lines covered (80.45%)

34.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

65.22
/src/SmoothMarkerBouncing.js
1
import L, {Marker, Point} from 'leaflet';
2✔
2
import BouncingOptions from './BouncingOptions';
2✔
3
import MarkerPrototypeExt from './MarkerPrototypeExt';
2✔
4
import BouncingMotionCss3 from './BouncingMotionCss3';
2✔
5

6
L.Marker.include(MarkerPrototypeExt);
2✔
7

8
/**
9
 * Registers default options of bouncing animation.
10
 * @param options {BouncingOptions|object}  object with options
11
 */
12
L.Marker.setBouncingOptions = function(options) {
2✔
13
    Marker.prototype._bouncingOptions = options instanceof BouncingOptions
1✔
14
            ? options
1!
15
            : new BouncingOptions(options);
16
};
17

18
/**
19
 * Returns array of currently bouncing markers.
20
 * @return {Marker[]} array of bouncing markers
21
 */
22
L.Marker.getBouncingMarkers = function() {
2✔
23
    Marker.prototype._orchestration.getBouncingMarkers();
×
24
};
25

26
/**
27
 * Stops the bouncing of all currently bouncing markers. Purge the array of bouncing markers.
28
 *
29
 * @param immediate {boolean} if true, markers stop to bounce immediately, without waiting
30
 *      animation to end
31
 */
32
L.Marker.stopAllBouncingMarkers = function(immediate = false) {
2!
NEW
33
    Marker.prototype._orchestration.stopAllBouncingMarkers(immediate);
×
34
};
35

36
L.Marker.addInitHook(function() {
2✔
37
    if (this.isRealMarker()) {
7!
38
        const bouncingOptions = new BouncingOptions(Marker.prototype._bouncingOptions);
7✔
39
        this._bouncingMotion = new BouncingMotionCss3(this, new Point(0, 0), bouncingOptions);
7✔
40
    }
41
});
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc