<commit_before>/**
 *
 */

var MapTrack = function (opts) {
  this.map = opts.map;
  this.polyLine = new google.maps.Polyline({
    map: this.map,
    strokeColor: '#999',
    strokeOpacity: 1.0,
    strokeWeight: 1
  });
  this.markers = [];
  this.maxLength = opts.maxLength || 0;
};

MapTrack.prototype.setPath = function (points) {
  if (Array.isArray(points)) {
    points.reverse();

    this.clear();

    for (var x = 0; x < points.length; x++) {
      this.addPoint(points[x]);
    }
  }
};

MapTrack.prototype.addPoint = function (point) {
  var location = new google.maps.LatLng(point.latitude, point.longitude);
  var date = new Date(point.timestamp);
  var hdop = point.hdop || 1;

/*
  var marker = new google.maps.Marker({
    map: this.map,
    position: location,
    icon: {
      path: google.maps.SymbolPath.CIRCLE,
      scale: 2,
      strokeOpacity: 1
    },
    title: 'at ' + date.toString()
  });
*/

  var circle = new google.maps.Circle({
    map: this.map,
    center: location,
    strokeWeight: 1,
    radius: hdop * 2.5
  });

  var path = this.polyLine.getPath();
  path.insertAt(0, location);
  this.markers.unshift(circle);

  if (this.maxLength > 0 && path.getLength() > this.maxLength) {
    path.pop();
    this.markers.pop().setMap(null);
  }
};

MapTrack.prototype.clear = function () {
  this.polyLine.getPath().clear();<commit_msg>Add a circle based on HDOP.<commit_after>/**
 *
 */

var MapTrack = function (opts) {
  this.map = opts.map;
  this.polyLine = new google.maps.Polyline({
    map: this.map,
    strokeColor: '#999',
    strokeOpacity: 1.0,
    strokeWeight: 1
  });
  this.markers = [];
  this.maxLength = opts.maxLength || 0;
  this.circle = circle = new google.maps.Circle({
    map: this.map,
    strokeColor: '#f00',
    strokeWeight: 1,
    fillColor: '#f00',
    fillOpacity: 0.3
  });
};

MapTrack.prototype.setPath = function (points) {
  if (Array.isArray(points)) {
    points.reverse();

    this.clear();

    for (var x = 0; x < points.length; x++) {
      this.addPoint(points[x]);
    }
  }
};

MapTrack.prototype.addPoint = function (point) {
  var location = new google.maps.LatLng(point.latitude, point.longitude);
  var date = new Date(point.timestamp);
  var hdop = point.hdop || 1;

  var marker = new google.maps.Marker({
    map: this.map,
    position: location,
    icon: {
      path: google.maps.SymbolPath.CIRCLE,
      scale: 2,
      strokeOpacity: 1
    },
    title: 'at ' + date.toString()
  });

  var path = this.polyLine.getPath();
  path.insertAt(0, location);
  this.markers.unshift(marker);

  this.circle.setCenter(location);
  this.circle.setRadius(hdop * 2);

  if (this.maxLength > 0 && path.getLength() > this.maxLength) {
    path.pop();
    this.markers.pop().setMap(null);
  }
};

MapTrack.prototype.clear = function () {
  this.polyLine.getPath().clear();
{'fraction_non_alphanumeric': 0.1648005598320504, 'fraction_numerical': 0.012946116165150455, 'mean_word_length': 2.9004092769440657, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3255687', 'n_tokens_mistral': 1050, 'n_tokens_neox': 1013, 'n_words': 208}