<commit_before>
var textureLoader = new THREE.TextureLoader();

var player = {
  lng: -74.0159, lat: 40.712
//  lng: -122.9110, lat: 49.2065
};
var world = {
  scale: 200000
}
player.start_lng = player.lng, player.start_lat = player.lat;


var TILE_ZOOM = 17;

function long2tile(lon,zoom) {
  return (Math.floor((lon+180)/360*Math.pow(2,zoom)));
}
function lat2tile(lat,zoom) {
  return (Math.floor((1-Math.log(Math.tan(lat*Math.PI/180) + 1/Math.cos(lat*Math.PI/180))/Math.PI)/2 *Math.pow(2,zoom)));
}
var MAP_CACHE = {};

setInterval(function(){
  load_tiles(player.lat, player.lng)
}, 1000);

var load_tile = (function(tx, ty) {
  MAP_CACHE[tx + '_' + ty] = 1;
  $.getJSON( "http://tile.mapzen.com/mapzen/vector/v1/all/" + TILE_ZOOM + "/" + tx + "/" + ty + ".json?api_key=" + MAPZEN_API_KEY,function( data ) {
    add_buildings(data.buildings);
    add_roads(data.roads);
    add_pois(data.pois);
    add_landuse(data.landuse);
    add_water(data.water);
  });
});

var load_tiles = function(lat, lng) {
  var tile_x0 = long2tile(lng, TILE_ZOOM);
  var tile_y0 = lat2tile(lat, TILE_ZOOM);
  for (var i=-1;i<=1;i++) {
    for (var j=-1;j<=1;j++) {
      var tile_x = tile_x0 + i;
      var tile_y = tile_y0 + j; 
      if (!MAP_CACHE[tile_x + '_' + tile_y]) {
        load_tile(tile_x, tile_y);
      }
    }<commit_msg>use https for mapzen<commit_after>
var textureLoader = new THREE.TextureLoader();

var player = {
  lng: -74.0159, lat: 40.712
//  lng: -122.9110, lat: 49.2065
};
var world = {
  scale: 200000
}
player.start_lng = player.lng, player.start_lat = player.lat;


var TILE_ZOOM = 17;

function long2tile(lon,zoom) {
  return (Math.floor((lon+180)/360*Math.pow(2,zoom)));
}
function lat2tile(lat,zoom) {
  return (Math.floor((1-Math.log(Math.tan(lat*Math.PI/180) + 1/Math.cos(lat*Math.PI/180))/Math.PI)/2 *Math.pow(2,zoom)));
}
var MAP_CACHE = {};

setInterval(function(){
  load_tiles(player.lat, player.lng)
}, 1000);

var load_tile = (function(tx, ty) {
  MAP_CACHE[tx + '_' + ty] = 1;
  $.getJSON( "https://tile.mapzen.com/mapzen/vector/v1/all/" + TILE_ZOOM + "/" + tx + "/" + ty + ".json?api_key=" + MAPZEN_API_KEY,function( data ) {
    add_buildings(data.buildings);
    add_roads(data.roads);
    add_pois(data.pois);
    add_landuse(data.landuse);
    add_water(data.water);
  });
});

var load_tiles = function(lat, lng) {
  var tile_x0 = long2tile(lng, TILE_ZOOM);
  var tile_y0 = lat2tile(lat, TILE_ZOOM);
  for (var i=-1;i<=1;i++) {
    for (var j=-1;j<=1;j++) {
      var tile_x = tile_x0 + i;
      var tile_y = tile_y0 + j; 
      if (!MAP_CACHE[tile_x + '_' + tile_y]) {
        load_tile(tile_x, tile_y);
      }
    }
{'fraction_non_alphanumeric': 0.19004524886877827, 'fraction_numerical': 0.05052790346907994, 'mean_word_length': 3.558419243986254, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '4947012', 'n_tokens_mistral': 1221, 'n_tokens_neox': 1121, 'n_words': 189}