src/trackmap_ctrl.js
// Add the circles, polyline and last point to the map
Add the circles, polyline and last point to the map
Add the circles polyline and last point to the map
addDataToMap() {
    log("addDataToMap");
    if (this.panel.showAsPoints) {
      for (let i = 0; i < this.coords.length; i++) {
        let point = L.circleMarker(
          this.coords[i].position, {
            color: this.panel.pointOutlineColor,
            fillColor: this.panel.lineColor,
            fillOpacity: i / this.coords.length,
            weight: 3,
            radius: 7,
          }
        ).addTo(this.leafMap);
        this.marker.push(point);
      }
    } else {
      this.polyline = L.polyline(
        this.coords.map(x => x.position, this), {
          color: this.panel.lineColor,
          weight: 3,
        }
      ).addTo(this.leafMap);
    }
    this.updateLastPoint();
    this.zoomToFit();
  }
addDataToMap ( ) { log ( "addDataToMap" ) ; if ( this . panel . showAsPoints ) { for ( let i = 0 ; i < this . coords . length ; i ++ ) { let point = L . circleMarker ( this . coords [ i ] . position , { color : this . panel . pointOutlineColor , fillColor : this . panel . lineColor , fillOpacity : i / this . coords . length , weight : 3 , radius : 7 , } ) . addTo ( this . leafMap ) ; this . marker . push ( point ) ; } } else { this . polyline = L . polyline ( this . coords . map ( x => x . position , this ) , { color : this . panel . lineColor , weight : 3 , } ) . addTo ( this . leafMap ) ; } this . updateLastPoint ( ) ; this . zoomToFit ( ) ; }
Add the circles, polyline and last point to the map
Add the circles polyline and last point to the map