You are here

function getlocations_do_minmaxes in Get Locations 6

Same name and namespace in other branches
  1. 6.2 getlocations.module \getlocations_do_minmaxes()
  2. 7.2 getlocations.module \getlocations_do_minmaxes()
  3. 7 getlocations.module \getlocations_do_minmaxes()

Parameters

int $ct $location $minmaxes:

Return value

Returns $minmaxes

7 calls to getlocations_do_minmaxes()
getlocations_lids in ./getlocations.module
Menu callback
getlocations_nids in ./getlocations.module
Menu callback
getlocations_nodemap in ./getlocations.module
Menu callback
getlocations_typemap in ./getlocations.module
Menu callback
getlocations_usermap in ./getlocations.module
Menu callback

... See full list

File

./getlocations.module, line 986
Displays locations on a map. for Drupal 6 using version 3 googlemaps API

Code

function getlocations_do_minmaxes($ct, $location, $minmaxes) {
  if ($ct) {

    // latitudes
    if ($location['latitude'] > $minmaxes['maxlat']) {
      $minmaxes['maxlat'] = $location['latitude'];
    }
    if ($location['latitude'] < $minmaxes['minlat']) {
      $minmaxes['minlat'] = $location['latitude'];
    }

    // longitudes
    if ($location['longitude'] > $minmaxes['maxlon']) {
      $minmaxes['maxlon'] = $location['longitude'];
    }
    if ($location['longitude'] < $minmaxes['minlon']) {
      $minmaxes['minlon'] = $location['longitude'];
    }
  }
  else {
    $minmaxes['minlat'] = $location['latitude'];
    $minmaxes['maxlat'] = $location['latitude'];
    $minmaxes['minlon'] = $location['longitude'];
    $minmaxes['maxlon'] = $location['longitude'];
  }
  return $minmaxes;
}