How to use these two Leaflet plugins together for the same polyline?

Job ID: 31492125

Budget: $240 – $2,000 HKD

I already search through the web but no clue on how to use these two plugins together for same polyline.

There are two functions, one is:

L.motion.polyline([[50,0], [60,10]], {
color: "transparent"
}, {
auto: true,
duration: 3000,
easing: L.Motion.Ease.easeInOutQuart
}, {
removeOnEnd: true,
showMarker: true,
icon: L.divIcon({html: "<i class='fa fa-car fa-2x' aria-hidden='true'></i>", iconSize: L.point(27.5, 24)})
}).addTo(map);


another one is :

L.multiOptionsPolyline(points, {
multiOptions: {
optionIdxFn: function (latLng) {
var i,
altThresholds = [800, 900, 1000, 1100, 1200, 1300, 1400, 1500];

for (i = 0; i < altThresholds.length; ++i) {
if (latLng.alt <= altThresholds[i]) {
return i;
}
}
return altThresholds.length;
},
options: [
{color: '#0000FF'}, {color: '#0040FF'}, {color: '#0080FF'},
{color: '#00FFB0'}, {color: '#00E000'}, {color: '#80FF00'},
{color: '#FFFF00'}, {color: '#FFC000'}, {color: '#FF0000'}
]
},
weight: 5,
lineCap: 'butt',
opacity: 0.75,
smoothFactor: 1}).addTo(map);
But I really can't figure out how to call these two one after another.

https://github.com/hgoebl/Leaflet.MultiOptionsPolyline
https://github.com/Igor-Vladyka/leaflet.motion

*** update *** My purpose is to create a polyline that can get the latitude and longitude of api records, and create a multicolor polyline that shows different intensity of the typhoon between each nodes of that polyline, and also shows the animation of the typhoon.

there is two function that i need to call ( or maybe extend by another ???)

is there any way to call/initialize this two function, L.multiOptionsPolyline and L.motion.polyline
Related categories: jQuery / Prototype