<commit_before>var app = angular.module('optimized_route', []);
var hash_params = L.Hash.parseHash(location.hash);
var mode_mapping = {
    'foot'    : 'pedestrian',
    'car'     : 'auto',
    'bicycle' : 'bicycle',
    'transit' : 'multimodal'
};

var serviceUrl;
var envServer = "production";
var envToken = accessToken.prod;
var locToken = locateToken.prod;
var sentManyToManyEnd = false;
var optimized_route = true;
var tspMarkers = [];

function selectEnv() {
  $("#env_dropdown").find("option:selected").each(function() {
    environmentExists = true; 
    envServer = $(this).text();
    serviceUrl = document.getElementById(envServer).value;
    getEnvToken();
  });
}

function handleChange(evt) {
  var sel = document.getElementById('selector');
  for (var i = 0; i < sel.options.length; i++) {
    var results = sel.options[i].text + "  " + sel.options[i].value;
    sel.options[i].innerHTML = results;
  }
}

function getEnvToken() {
  switch (envServer) {
  case "localhost":
    envToken = accessToken.local;
    locToken = locateToken.local;
    break;
  case "development":
    envToken = accessToken.dev;
    locToken = locateToken.dev;
    break;
  case "production":
    envToken = accessToken.prod;
    locToken = locateToken.prod;
    break;
  }
}

app.run(function($rootScope) {
  var hash_loc = hash_params ? hash_params : {
    'center' : {
      'lat' : 40.7486,
      'lng' : -73.9690
    },
    'zoom' : 13
  };
  $rootScope.geobase = {
    'zoom' : hash_loc.zoom,
    'lat' : hash_loc.center.lat,
    'lon' : hash_loc.center.lng
  };
  $(document).on('new-location', function(e) {
    $rootScope.geobase = {
      'zoom' : e.zoom,
      'lat' : e.lat,
      'lon' : e.lon
    };
  });
});


//hooks up to the div whose data-ng-controller attribute matches this name
app.controller('OptimizedRouteController', function($scope, $rootScope, $sce, $http) {
  var road = L.tileLayer('http://b.tile.openstreetmap.org/{z}/{x}/{y}.png', {
    attribution : '&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributers'
  }), zinc = Tangram.leafletLayer({
    scene: 'https://raw.githubusercontent.com/valhalla/demos/gh-pages/routing/map_style/zinc-style-more-labels.yaml',
    attribution: '<a href="https://mapzen.com/tangram">Tangram</a> | &copy; OSM contributors | <a href="https://mapzen.com/">Mapzen</a>'
  }), cycle = L.tileLayer('http://b.tile.thunderforest.com/cycle/{z}/{x}/{y}.png', {
    attribution : 'Maps &copy; <a href="http://www.thunderforest.com">Thunderforest, </a>;Data &copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap contributors</a>'
  }), elevation = L.tileLayer('http://b.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png', {
    attribution : 'Maps &copy; <a href="http://www.thunderforest.com">Thunderforest, </a>;Data &copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap contributors</a>'
  });
  
  var baseMaps = {
      "Road" : road,
      "Zinc" : zinc,
      "Cycle" : cycle,
      "Elevation" : elevation
  };

  //leaflet slippy map
  var map = L.map('map', {
    zoom : $rootScope.geobase.zoom,
    zoomControl : true,
    layers : [ zinc ],
    center : [ $rootScope.geobase.lat, $rootScope.geobase.lon ]
  });
  

  // If iframed, we're going to have to disable some of the touch interaction<commit_msg>updated optimized to use zinc-style<commit_after>var app = angular.module('optimized_route', []);
var hash_params = L.Hash.parseHash(location.hash);
var mode_mapping = {
    'foot'    : 'pedestrian',
    'car'     : 'auto',
    'bicycle' : 'bicycle',
    'transit' : 'multimodal'
};

var serviceUrl;
var envServer = "production";
var envToken = accessToken.prod;
var locToken = locateToken.prod;
var sentManyToManyEnd = false;
var optimized_route = true;
var tspMarkers = [];

function selectEnv() {
  $("#env_dropdown").find("option:selected").each(function() {
    environmentExists = true; 
    envServer = $(this).text();
    serviceUrl = document.getElementById(envServer).value;
    getEnvToken();
  });
}

function handleChange(evt) {
  var sel = document.getElementById('selector');
  for (var i = 0; i < sel.options.length; i++) {
    var results = sel.options[i].text + "  " + sel.options[i].value;
    sel.options[i].innerHTML = results;
  }
}

function getEnvToken() {
  switch (envServer) {
  case "localhost":
    envToken = accessToken.local;
    locToken = locateToken.local;
    break;
  case "development":
    envToken = accessToken.dev;
    locToken = locateToken.dev;
    break;
  case "production":
    envToken = accessToken.prod;
    locToken = locateToken.prod;
    break;
  }
}

app.run(function($rootScope) {
  var hash_loc = hash_params ? hash_params : {
    'center' : {
      'lat' : 40.7486,
      'lng' : -73.9690
    },
    'zoom' : 13
  };
  $rootScope.geobase = {
    'zoom' : hash_loc.zoom,
    'lat' : hash_loc.center.lat,
    'lon' : hash_loc.center.lng
  };
  $(document).on('new-location', function(e) {
    $rootScope.geobase = {
      'zoom' : e.zoom,
      'lat' : e.lat,
      'lon' : e.lon
    };
  });
});


//hooks up to the div whose data-ng-controller attribute matches this name
app.controller('OptimizedRouteController', function($scope, $rootScope, $sce, $http) {
  var road = L.tileLayer('http://b.tile.openstreetmap.org/{z}/{x}/{y}.png', {
    attribution : '&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributers'
  }), zinc = Tangram.leafletLayer({
    scene: 'https://mapzen.com/carto/zinc-style/2.0/zinc-style.yaml',
    attribution: '<a href="https://mapzen.com/tangram">Tangram</a> | &copy; OSM contributors | <a href="https://mapzen.com/">Mapzen</a>'
  }), cycle = L.tileLayer('http://b.tile.thunderforest.com/cycle/{z}/{x}/{y}.png', {
    attribution : 'Maps &copy; <a href="http://www.thunderforest.com">Thunderforest, </a>;Data &copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap contributors</a>'
  }), elevation = L.tileLayer('http://b.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png', {
    attribution : 'Maps &copy; <a href="http://www.thunderforest.com">Thunderforest, </a>;Data &copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap contributors</a>'
  });
  
  var baseMaps = {
      "Road" : road,
      "Zinc" : zinc,
      "Cycle" : cycle,
      "Elevation" : elevation
  };

  //leaflet slippy map
  var map = L.map('map', {
    zoom : $rootScope.geobase.zoom,
    zoomControl : true,
    layers : [ zinc ],
    center : [ $rootScope.geobase.lat, $rootScope.geobase.lon ]
  });
  

  // If iframed, we're going to have to disable some of the touch interaction
{'fraction_non_alphanumeric': 0.17669401397751444, 'fraction_numerical': 0.004861744150714068, 'mean_word_length': 3.447972972972973, 'pattern_counts': {'":': 6, '<': 33, '<?xml version=': 0, '>': 31, 'https://': 6, 'lorem ipsum': 0, 'www.': 4, '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': '4922879', 'n_tokens_mistral': 2383, 'n_tokens_neox': 2299, 'n_words': 431}