<commit_before><commit_msg>Adding initial geoLocation service code.<commit_after>/**
 * GeoLocation Service
 *
 * In charge of getting User's coordinates.
 */

angular.module('WeatherApp')

.service('GeoLocationService', [function() {

  /**
   * Returns a boolean indicating whether
   * the browser has geolocation support.
   * @return Boolean
   */
  this.isAvailable = function() {
    return "geolocation" in navigator;
  }

  /**
   * Gets the user's browser coordinates.
   * @param function callback
   * @return null
   */
  this.getCoordinates = function(callback) {
    if (!this.isAvailable()) {
      callback(null, null);
      return;
    }

    navigator.geolocation.getCurrentPosition(function(position) {
      callback(position.coords.latitude, position.coords.longitude);
    });
  }

}]);
{'fraction_non_alphanumeric': 0.1259259259259259, 'fraction_numerical': 0.0, 'mean_word_length': 3.383783783783784, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6038789', 'n_tokens_mistral': 243, 'n_tokens_neox': 235, 'n_words': 54}