<commit_before>$(function() {
  var translateToMapCoords = function(coords) {
    return ol.proj.transform(coords, 'EPSG:4326', 'EPSG:3857')
  }

  var toPoint = function(loc) {
    var coords = translateToMapCoords([loc.coords[1], loc.coords[0]]);
    return new ol.geom.Point(coords);
  };

  var styleCache = {};
  var countriesLayer = new ol.layer.Vector({
    source: new ol.source.GeoJSON({
      projection: 'EPSG:3857',
      url: 'geodata/countries.geojson'
    }),
    style: function(feature, resolution) {
      var text = resolution < 5000 ? feature.get('name') : '';
      if (!styleCache[text]) {
        styleCache[text] = [new ol.style.Style({
          fill: new ol.style.Fill({ color: '#57B26E' }),
          stroke: new ol.style.Stroke({ color: '#7EC486', width: 1 })
        })];
      }
      return styleCache[text];
    }
  });

  var eventIconStyle = new ol.style.Style({
    image: new ol.style.Icon({
      scale: 0.05,
      anchor: [0.5, 1],
      src: 'images/map-pin.png'
    })
  });

  var events = new ol.layer.Vector({
    source: new ol.source.Vector(),
    style: eventIconStyle
  });


  $.get('geodata/locations.json', function(locations) {
    $.each(locations, function() {
      events.getSource().addFeature(
        new ol.Feature({
          geometry: toPoint(this),
          name: this.name,
          urls: this.urls
        })
      );
    })
  })

  var popupElem = document.getElementById('popup');

  var popup = new ol.Overlay({
    element: popupElem,<commit_msg>Use abs. path for geodata<commit_after>$(function() {
  var translateToMapCoords = function(coords) {
    return ol.proj.transform(coords, 'EPSG:4326', 'EPSG:3857')
  }

  var toPoint = function(loc) {
    var coords = translateToMapCoords([loc.coords[1], loc.coords[0]]);
    return new ol.geom.Point(coords);
  };

  var styleCache = {};
  var countriesLayer = new ol.layer.Vector({
    source: new ol.source.GeoJSON({
      projection: 'EPSG:3857',
      url: '/geodata/countries.geojson'
    }),
    style: function(feature, resolution) {
      var text = resolution < 5000 ? feature.get('name') : '';
      if (!styleCache[text]) {
        styleCache[text] = [new ol.style.Style({
          fill: new ol.style.Fill({ color: '#57B26E' }),
          stroke: new ol.style.Stroke({ color: '#7EC486', width: 1 })
        })];
      }
      return styleCache[text];
    }
  });

  var eventIconStyle = new ol.style.Style({
    image: new ol.style.Icon({
      scale: 0.05,
      anchor: [0.5, 1],
      src: 'images/map-pin.png'
    })
  });

  var events = new ol.layer.Vector({
    source: new ol.source.Vector(),
    style: eventIconStyle
  });


  $.get('/geodata/locations.json', function(locations) {
    $.each(locations, function() {
      events.getSource().addFeature(
        new ol.Feature({
          geometry: toPoint(this),
          name: this.name,
          urls: this.urls
        })
      );
    })
  })

  var popupElem = document.getElementById('popup');

  var popup = new ol.Overlay({
    element: popupElem,
{'fraction_non_alphanumeric': 0.16174540682414698, 'fraction_numerical': 0.021653543307086614, 'mean_word_length': 2.5453488372093025, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2784835', 'n_tokens_mistral': 1076, 'n_tokens_neox': 1017, 'n_words': 209}