How can google map dynamically draw tracks of different colors? Where should the timer be added?

var list = res.data.data;

      var arrPois = [];
      var lineColor = "";
      //GPSPoint
      //
      var latlng = new google.maps.LatLng(39.92, 116.46);
      var myOptions = {
        zoom:20,
        center: latlng,
        mapTypeId: google.maps.MapTypeId.HYBRID
      };
      var map = new google.maps.Map(document.getElementById("map"), myOptions);
      for (var i = 0; i < list.length - 1; iPP) {
        arrPois.splice(0, arrPois.length);//,
        arrPois.push(new google.maps.LatLng(list[i].lat, list[i].lng));
        arrPois.push(new google.maps.LatLng(list[i + 1].lat, list[i + 1].lng));
        //
        if (list[i].pump == 0) {
          lineColor = "-sharpFFFF00";
        } else {
          lineColor = "-sharp28bf81";
        }
        map.setCenter(arrPois[0]);
        //
        var polylineOptions =
          {
            path: arrPois,//GPS
            strokeColor: lineColor, //
            strokeWeight: 4,//
          };
        //
        var poly2 = new google.maps.Polyline(polylineOptions);
          poly2.setMap(map);
      }
Mar.03,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf7382-318a3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf7382-318a3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?