<commit_before>angular.module('Aggie')

.factory('Map', function() {

  Map = function(params) {
    var self = this;
    self.params = params;

    // create the map
    var div = document.getElementById('map-canvas');
    self.map = new google.maps.Map(div, {
      mapTypeId: google.maps.MapTypeId.ROADMAP,
      zoom: 1,
      streetViewControl: false,
      draggableCursor: 'pointer'
    });

    // add the markers and keep expanding the bounding rectangle
    var bounds = new google.maps.LatLngBounds();
    self.markers = [];
    self.params.locations.forEach(function(l){
      // get float values from string
      var lat = parseFloat(l.latitude);
      var lng = parseFloat(l.longitude);

      if (isNaN(lat) || isNaN(lng)) { return }

      // create marker and add to map
      var p = new google.maps.LatLng(lat, lng);
      var m = new google.maps.Marker({
        map: self.map,
        position: p,
        title: l.locationName,
        id: l._id
      });

      // expand the bounding rectangle
      bounds.extend(p);

      // setup event listener to show info window
      google.maps.event.addListener(m, 'click', function() { self.show_info_window(this); });
    });

    if (self.params.locations.length == 0)
      self.map.setCenter(new google.maps.LatLng(0, 0));

    // else use bounds determined above
    else
      // center/zoom the map
      self.map.fitBounds(bounds);
  };

  Map.prototype.show_info_window = function(marker) {
    var self = this;<commit_msg>Use marker count for default lat/long<commit_after>angular.module('Aggie')

.factory('Map', function() {

  Map = function(params) {
    var self = this;
    self.params = params;

    // create the map
    var div = document.getElementById('map-canvas');
    self.map = new google.maps.Map(div, {
      mapTypeId: google.maps.MapTypeId.ROADMAP,
      zoom: 1,
      streetViewControl: false,
      draggableCursor: 'pointer'
    });

    // add the markers and keep expanding the bounding rectangle
    var bounds = new google.maps.LatLngBounds();
    self.markers = [];
    self.params.locations.forEach(function(l){
      // get float values from string
      var lat = parseFloat(l.latitude);
      var lng = parseFloat(l.longitude);

      if (isNaN(lat) || isNaN(lng)) { return }

      // create marker and add to map
      var p = new google.maps.LatLng(lat, lng);
      var m = new google.maps.Marker({
        map: self.map,
        position: p,
        title: l.locationName,
        id: l._id
      });
      self.markers.push(m);

      // expand the bounding rectangle
      bounds.extend(p);

      // setup event listener to show info window
      google.maps.event.addListener(m, 'click', function() { self.show_info_window(this); });
    });

    if (self.markers.length == 0)
      self.map.setCenter(new google.maps.LatLng(0, 0));

    // else use bounds determined above
    else
      // center/zoom the map
      self.map.fitBounds(bounds);
  };

  Map.prototype.show_info_window = function(marker) {
    var self = this;
{'fraction_non_alphanumeric': 0.1277504105090312, 'fraction_numerical': 0.002627257799671593, 'mean_word_length': 2.44960362400906, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5304302', 'n_tokens_mistral': 967, 'n_tokens_neox': 928, 'n_words': 239}