function normalizeLocation (location) {
  if (isLonLatTuple(location)) {
    return [normalizeLongitude(location[0]), normalizeLatitude(location[1])]
  }
  
  if (isLatLon(location)) {
    return {
      lat: normalizeLatitude(location.lat),
      lon: normalizeLongitude(location.lon)
    }
  }
  
  if (isLatLng(location)) {
    return {
      lat: normalizeLatitude(location.lat),
      lng: normalizeLongitude(location.lng)
    }
  }
  
  if (isLatitudeLongitude(location)) {
    return {
      latitude: normalizeLatitude(location.latitude),
      longitude: normalizeLongitude(location.longitude)
    }
  }

  throw new Error('Unknown location format ' + JSON.stringify(location))
}
/**
 * Normalize the longitude and latitude of a location.
 * Latitude will be in the range [-90, 90] (upper and lower bound included)
 * Lontitude will be in the range (-180, 180] (lower bound excluded, upper bound included)
 * @param {Location} location 
 * @return {Location} Returns the normalized location
 */
Normalize the longitude and latitude of a location.
Latitude will be in the range [-90, 90] (upper and lower bound included)
Lontitude will be in the range (-180, 180] (lower bound excluded, upper bound included)
@param {Location} location
@return {Location} Returns the normalized location
Normalize the longitude and latitude of a location . Latitude will be in the range [ - 90 90 ] ( upper and lower bound included ) Lontitude will be in the range ( - 180 180 ] ( lower bound excluded upper bound included ) @param { Location } location @return { Location } Returns the normalized location
function normalizeLocation (location) {
  if (isLonLatTuple(location)) {
    return [normalizeLongitude(location[0]), normalizeLatitude(location[1])]
  }
  if (isLatLon(location)) {
    return {
      lat: normalizeLatitude(location.lat),
      lon: normalizeLongitude(location.lon)
    }
  }
  if (isLatLng(location)) {
    return {
      lat: normalizeLatitude(location.lat),
      lng: normalizeLongitude(location.lng)
    }
  }
  if (isLatitudeLongitude(location)) {
    return {
      latitude: normalizeLatitude(location.latitude),
      longitude: normalizeLongitude(location.longitude)
    }
  }
  throw new Error('Unknown location format ' + JSON.stringify(location))
}
function normalizeLocation ( location ) { if ( isLonLatTuple ( location ) ) { return [ normalizeLongitude ( location [ 0 ] ) , normalizeLatitude ( location [ 1 ] ) ] } if ( isLatLon ( location ) ) { return { lat : normalizeLatitude ( location . lat ) , lon : normalizeLongitude ( location . lon ) } } if ( isLatLng ( location ) ) { return { lat : normalizeLatitude ( location . lat ) , lng : normalizeLongitude ( location . lng ) } } if ( isLatitudeLongitude ( location ) ) { return { latitude : normalizeLatitude ( location . latitude ) , longitude : normalizeLongitude ( location . longitude ) } } throw new Error ( 'Unknown location format ' + JSON . stringify ( location ) ) }
Normalize the longitude and latitude of a location.
Normalize the longitude and latitude of a location .