Methods
_updateLine(timestamp) → {Number}
Load the line where the marker is
Parameters:
| Name | Type | Description |
|---|---|---|
timestamp |
Number |
- Source:
Returns:
elapsed time on the current line or null if
we reached the end or marker is at a station
- Type
- Number
addLatLng(latlng, duration) → {void}
Adds a new point to the end of the moving marker's path.
Parameters:
| Name | Type | Description |
|---|---|---|
latlng |
L.LatLng | The latitude and longitude of the new point. |
duration |
number | The time, in milliseconds, to travel from the previous point to the new point. |
- Source:
Returns:
- Type
- void
isEnded() → {boolean}
- Source:
Returns:
- Type
- boolean
isPaused() → {boolean}
pause can only be resume() or start()
- Source:
Returns:
- Type
- boolean
isRunning() → {boolean}
- Source:
Returns:
- Type
- boolean
isStarted() → {boolean}
from begining
- Source:
Returns:
- Type
- boolean
moveTo(latlng, duration) → {void}
Moves the marker to a new position and starts the animation.
If the marker is already running or paused, it stops before moving to the new position.
Parameters:
| Name | Type | Description |
|---|---|---|
latlng |
L.LatLng | The latitude and longitude of the new position. |
duration |
number | The time, in milliseconds, to travel from the current position to the new position. |
- Source:
Returns:
- Type
- void
onAdd(map)
In leaflet extentions this is what gets called when we are added to the map
Parameters:
| Name | Type | Description |
|---|---|---|
map |
- Source:
onRemove(map)
And clean up yo emss when we are removed
Parameters:
| Name | Type | Description |
|---|---|---|
map |
- Source:
pause()
temporarily stop the animation where it is
- Source:
resume() → {void}
Resumes the marker animation from the paused state.
If the marker is not paused, it does nothing.
- Source:
Returns:
- Type
- void
start() → {void}
Starts the moving marker animation.
If the marker is already running, it does nothing.
If the marker is paused, it resumes from the paused state.
If the marker is not running or paused, it starts from the first point.
- Source:
Returns:
- Type
- void
stop(elapsedTime)
permanently stop until restart
Parameters:
| Name | Type | Description |
|---|---|---|
elapsedTime |
if left blank anamates last step for user call |
- Source: