<commit_before>/** map initialisation JS file **/

var initialLoc;
var browserSupportFlag = new Boolean();   
var EventID = false;  // used as a flag for the boundary changes   

function initialize() {
    // this function initialises the map to the starting position and zoom
    // to the div in the page. 

    // these are the inline functions
    
    function noGeoHandler() {
      // this function deals with if the user either does't have or
      // doesn't allow the geolocation to fire.
      // no geolocation data so just go world view
      
      browserSupportFlag = false;
      var worldView = new google.maps.LatLng(0,150);
      map.setZoom(2);
      map.setCenter(worldView); 
    }
    
    function boundaryChange() {
        // this function deals with a boundary change and will do things based
        // on that event
       
        //console.log("boundary_change");       
       // update the data area with the boundary details:
       var bounds = map.getBounds();
       var sw = bounds.getSouthWest();
       var ne = bounds.getNorthEast()
       var data = "SW: (" + sw.lat() + ", " + 
       sw.lng() + ") NE: (" + ne.lat() + 
       ", " + ne.lng() + ")";
       
       // hit the ajax call for the airports and we'll retrieve them:
       var apiurl = '/api/airport/list/' + sw.lat() + '/' + sw.lng() + 
                                          '/' + ne.lat() + '/' + ne.lng();
      $("#map_data").text(apiurl);

       
   
    }

    function DisplayAirports() {
      // this function plots the airports on the map.
            $("#map_data").text("displayed airports");
    }

<commit_msg>added code to hit the api and do a test render of airports to the map!<commit_after>/** map initialisation JS file **/

var initialLoc;
var browserSupportFlag = new Boolean();   
var EventID = false;  // used as a flag for the boundary changes   

function initialize() {
    // this function initialises the map to the starting position and zoom
    // to the div in the page. 

    // these are the inline functions
    
    function noGeoHandler() {
      // this function deals with if the user either does't have or
      // doesn't allow the geolocation to fire.
      // no geolocation data so just go world view
      
      browserSupportFlag = false;
      var worldView = new google.maps.LatLng(0,150);
      map.setZoom(2);
      map.setCenter(worldView); 
    }
    
    function boundaryChange() {
        // this function deals with a boundary change and will do things based
        // on that event
       
        //console.log("boundary_change");       
       // update the data area with the boundary details:
       var bounds = map.getBounds();
       var sw = bounds.getSouthWest();
       var ne = bounds.getNorthEast()
       var data = "SW: (" + sw.lat() + ", " + 
       sw.lng() + ") NE: (" + ne.lat() + 
       ", " + ne.lng() + ")";
       
       // hit the ajax call for the airports and we'll retrieve them:
       var apiurl = '/api/airport/list/' + sw.lat() + '/' + sw.lng() + 
                                          '/' + ne.lat() + '/' + ne.lng();
      $("#map_data").text(apiurl);

       $.getJSON(apiurl, null, DisplayAirports);
   
    }

    function DisplayAirports(data) {
      // this function plots the airports on the map.
            //$("#map_data").text("displayed airports");
            
       for (i=0; i< data.length; i++) {
         item = data[i];
         lat = item.fields["latitude"];
         lng = item.fields["longitude"];
         n = item.fields["name"];
         
         var marker = new google.maps.Marker({
          position: new google.maps.LatLng(lat, lng), 
          map: map,
          title:n
          });  
         
       
       }
            
            
    }


{'fraction_non_alphanumeric': 0.12249208025343189, 'fraction_numerical': 0.002903907074973601, 'mean_word_length': 1.7778592375366569, 'pattern_counts': {'":': 0, '<': 4, '<?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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4379754', 'n_tokens_mistral': 1095, 'n_tokens_neox': 1053, 'n_words': 352}