<commit_before>'use strict';

(function(module) {

  var googleMapping = {};

  googleMapping.map;
  googleMapping.currentLocation = {};
  googleMapping.userLocationInput = {};
  googleMapping.locations = [];
  googleMapping.locationsParsed = [];
  //placeholder until we can import the data
  googleMapping.locationsAddresses = [
    '620 SW 5th Ave, Portland, OR 97204',
    '300-398 SW Market St, Portland, OR 97201',
    '1800 SW Montgomery St, Portland, OR 97201',
    '1028 SE Water Ave, Portland, OR 97214',
    '1202-1210 Southeast Hawthorne Boulevard, Portland'
  ];

  //placeholder of lat/lng of above addresses...again for testing map api
  googleMapping.locationsAddressesLatLng = [
    // {lat:45.5190046,lng:-122.67688190000001},
    // {lat:45.5122623,lng:-122.67883110000002},
    // {lat:45.5115165,lng:-122.68207330000001},
    // {lat:45.5153234,lng:-122.6655189},
    // {lat:45.5122046,lng:-122.65358530000003}
  ];

  // googleMapping.getCurrentLocation = function(callbackFunction) {
  //   if (navigator.geolocation) {
  //     navigator.geolocation.getCurrentPosition(function(position) {
  //       googleMapping.currentLocation = {
  //         lat: position.coords.latitude,
  //         lng: position.coords.longitude
  //       };
  //       //uberObject.updateInfo(googleMapping.currentLocation);
  //       //lyftObject.updateInfo(googleMapping.currentLocation);
  //       googleMapping.map = googleMapping.createMap(filterData.zoom, googleMapping.currentLocation);
  //       callbackFunction(googleMapping.map);
  //     }, function() {
  //       googleMapping.handleLocationError(true, mapViews.map, mapViews.map.getCenter());
  //     });
  //   } else {
  //     //Browser doesn't support Geolocation :(
  //     googleMapping.currentLocation = {lat: 45.5231, lng: -122.6765};
  //     googleMapping.map = googleMapping.createMap(filterData.zoom, googleMapping.currentLocation);
  //     callbackFunction(googleMapping.map);
  //     handleLocationError(false, mapViews.map, mapViews.map.getCenter());
  //   };
  // };

  googleMapping.getUpdatedLocation = function(selectionObject) {
    $('.bike-map').empty();
    etaObject.buildCanvas();
    if (0 < selectionObject.address.length) {
      new google.maps.Geocoder()
      .geocode({address: selectionObject.address}, function(results) {
        googleMapping.currentLocation = {
          lat: results[0].geometry.location.lat(),
          lng: results[0].geometry.location.lng()
        };
        if (filterData.Uber) {
          uberObject.getInfo(etaObject.drawLogo, googleMapping.currentLocation);
        }
        if (filterData.Lyft) {
          lyftObject.getInfo(etaObject.drawLogo,googleMapping.currentLocation);
        }
        if (filterData.Biketown) {
          biketownObject.getStationInfo(mapViews.createMarkers);
        };
        //update with current location
        //uberObject.updateInfo(googleMapping.currentLocation);
        //lyftObject.updateInfo(googleMapping.currentLocation);
      });
    } else if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(function(position) {
        googleMapping.currentLocation = {
          lat: position.coords.latitude,
          lng: position.coords.longitude
        };
        if (filterData.Uber) {
          uberObject.getInfo(etaObject.drawLogo, googleMapping.currentLocation);
        }
        if (filterData.Lyft) {
          lyftObject.getInfo(etaObject.drawLogo,googleMapping.currentLocation);
        }
        if (filterData.Biketown) {
          biketownObject.getStationInfo(mapViews.createMarkers);
        };
            //uberObject.updateInfo(googleMapping.currentLocation);
            //lyftObject.updateInfo(googleMapping.currentLocation);
      }, function() {
        googleMapping.handleLocationError(true, googleMapping.map, googleMapping.map.getCenter());
      });


    } else {
      //update with current location
      googleMapping.currentLocation = {lat: 45.5231, lng: -122.6765};
      if (filterData.Uber) {
        uberObject.getInfo(etaObject.drawLogo, googleMapping.currentLocation);
      }
      if (filterData.Lyft) {
        lyftObject.getInfo(etaObject.drawLogo,googleMapping.currentLocation);
      }
      if (filterData.Biketown) {
        biketownObject.getStationInfo(mapViews.createMarkers);
      };
      handleLocationError(false, googleMapping.map, googleMapping.map.getCenter());
    };
  };

  googleMapping.handleLocationError = function(browserHasGeolocation, map, pos) {
    infoWindow.setPosition(pos);
    infoWindow.setContent(browserHasGeolocation ?
      'Error: The Geolocation service failed.' :
      'Error: Your browser doesn\'t support geolocation :('
    );
  };

  //call googles api to parse address strings into lat and lng data to be mapped to the actual map
  googleMapping.parseAddressString = function() {
    googleMapping.locations.forEach(function(addressString) {<commit_msg>deprecated navigator geolocation function until ssl encryption is up on our app<commit_after>'use strict';

(function(module) {

  var googleMapping = {};

  googleMapping.map;
  googleMapping.currentLocation = {};
  googleMapping.userLocationInput = {};
  googleMapping.locations = [];
  googleMapping.locationsParsed = [];
  //placeholder until we can import the data
  googleMapping.locationsAddresses = [
    '620 SW 5th Ave, Portland, OR 97204',
    '300-398 SW Market St, Portland, OR 97201',
    '1800 SW Montgomery St, Portland, OR 97201',
    '1028 SE Water Ave, Portland, OR 97214',
    '1202-1210 Southeast Hawthorne Boulevard, Portland'
  ];

  //placeholder of lat/lng of above addresses...again for testing map api
  googleMapping.locationsAddressesLatLng = [
    // {lat:45.5190046,lng:-122.67688190000001},
    // {lat:45.5122623,lng:-122.67883110000002},
    // {lat:45.5115165,lng:-122.68207330000001},
    // {lat:45.5153234,lng:-122.6655189},
    // {lat:45.5122046,lng:-122.65358530000003}
  ];

  // googleMapping.getCurrentLocation = function(callbackFunction) {
  //   if (navigator.geolocation) {
  //     navigator.geolocation.getCurrentPosition(function(position) {
  //       googleMapping.currentLocation = {
  //         lat: position.coords.latitude,
  //         lng: position.coords.longitude
  //       };
  //       //uberObject.updateInfo(googleMapping.currentLocation);
  //       //lyftObject.updateInfo(googleMapping.currentLocation);
  //       googleMapping.map = googleMapping.createMap(filterData.zoom, googleMapping.currentLocation);
  //       callbackFunction(googleMapping.map);
  //     }, function() {
  //       googleMapping.handleLocationError(true, mapViews.map, mapViews.map.getCenter());
  //     });
  //   } else {
  //     //Browser doesn't support Geolocation :(
  //     googleMapping.currentLocation = {lat: 45.5231, lng: -122.6765};
  //     googleMapping.map = googleMapping.createMap(filterData.zoom, googleMapping.currentLocation);
  //     callbackFunction(googleMapping.map);
  //     handleLocationError(false, mapViews.map, mapViews.map.getCenter());
  //   };
  // };

  googleMapping.getUpdatedLocation = function(selectionObject) {
    $('.bike-map').empty();
    etaObject.buildCanvas();
    if (0 < selectionObject.address.length) {
      new google.maps.Geocoder()
      .geocode({address: selectionObject.address}, function(results) {
        googleMapping.currentLocation = {
          lat: results[0].geometry.location.lat(),
          lng: results[0].geometry.location.lng()
        };
        if (filterData.Uber) {
          uberObject.getInfo(etaObject.drawLogo, googleMapping.currentLocation);
        }
        if (filterData.Lyft) {
          lyftObject.getInfo(etaObject.drawLogo,googleMapping.currentLocation);
        }
        if (filterData.Biketown) {
          biketownObject.getStationInfo(mapViews.createMarkers);
        };
        //update with current location
        //uberObject.updateInfo(googleMapping.currentLocation);
        //lyftObject.updateInfo(googleMapping.currentLocation);
      });

      /**TODO Navigator geolocation will be deprecated until ssl encryption can be used for this app**/
    // } else if (navigator.geolocation) {
    //   navigator.geolocation.getCurrentPosition(function(position) {
    //     googleMapping.currentLocation = {
    //       lat: position.coords.latitude,
    //       lng: position.coords.longitude
    //     };
    //     if (filterData.Uber) {
    //       uberObject.getInfo(etaObject.drawLogo, googleMapping.currentLocation);
    //     }
    //     if (filterData.Lyft) {
    //       lyftObject.getInfo(etaObject.drawLogo,googleMapping.currentLocation);
    //     }
    //     if (filterData.Biketown) {
    //       biketownObject.getStationInfo(mapViews.createMarkers);
    //     };
    //         //uberObject.updateInfo(googleMapping.currentLocation);
    //         //lyftObject.updateInfo(googleMapping.currentLocation);
    //   }, function() {
    //     googleMapping.handleLocationError(true, googleMapping.map, googleMapping.map.getCenter());
    //   });


    } else {
      //update with current location
      googleMapping.currentLocation = {lat: 45.5231, lng: -122.6765};
      if (filterData.Uber) {
        uberObject.getInfo(etaObject.drawLogo, googleMapping.currentLocation);
      }
      if (filterData.Lyft) {
        lyftObject.getInfo(etaObject.drawLogo,googleMapping.currentLocation);
      }
      if (filterData.Biketown) {
        biketownObject.getStationInfo(mapViews.createMarkers);
      };
      handleLocationError(false, googleMapping.map, googleMapping.map.getCenter());
    };
  };

  googleMapping.handleLocationError = function(browserHasGeolocation, map, pos) {
    infoWindow.setPosition(pos);
    infoWindow.setContent(browserHasGeolocation ?
      'Error: The Geolocation service failed.' :
      'Error: Your browser doesn\'t support geolocation :('
    );
  };

  //call googles api to parse address strings into lat and lng data to be mapped to the actual map
  googleMapping.parseAddressString = function() {
    googleMapping.locations.forEach(function(addressString) {
{'fraction_non_alphanumeric': 0.12486417070038526, 'fraction_numerical': 0.03911883828904475, 'mean_word_length': 2.9362363919129084, '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': '910097', 'n_tokens_mistral': 3267, 'n_tokens_neox': 2974, 'n_words': 474}