Class: MovingMarker

MovingMarker(latlngs, durations, optionsopt)

new MovingMarker(latlngs, durations, optionsopt)

Creates a new MovingMarker object which extends L.Marker. It animates the movement of the marker along a given set of coordinates with a corresponding set of durations between each coordinate.
Parameters:
Name Type Attributes Description
latlngs Array.<L.LatLng> An array of LatLng objects representing the path that the marker should follow.
durations Array.<number> An array of durations (in milliseconds) representing the time that the marker should take to move from one coordinate to the next. Note durations is theoretically an n-1 array with n being the length of the LineString p1-p2-p3-p4 etc
options Object <optional>
An optional object with options for the MovingMarker object.
Properties
Name Type Attributes Default Description
autostart boolean <optional>
false Whether to start the animation automatically after the object is created.
loop boolean <optional>
false Whether to loop the animation back to the start after reaching the end. Note that for a smooth loop, the last coordinate in the path should be the same as the first coordinate.
debug boolean <optional>
false Whether to enable debugging information.
center boolean <optional>
false true, "pan", "lock" Whether to center the map view on the marker while it moves.
bound boolean <optional>
false Whether to fit the map view to the marker bounds while it moves.
zoompause boolean <optional>
false EXPAREMENTAL Whether to pause the animation when the map view is zoomed.
rotate boolean <optional>
true Whether to rotate the marker in the direction of movement.
smoothrotate number | boolean <optional>
true Whether to smoothly interpolate the rotation between coordinates. If a number is provided, it will be used as the proportion of the path to use as a buffer for rotation interpolation. If `true`, a default buffer of 10% on either side of the endpoint will be used. false = simple fast rotate; 0-1 = percentage of length; 1+ = number of ms
initialRotationOffset number <optional>
0 The initial rotation offset of the marker in degrees.
Source: