You are here

function getdirections_setlocation in Get Directions 6

Same name and namespace in other branches
  1. 6.2 getdirections.module \getdirections_setlocation()
  2. 7.3 getdirections.module \getdirections_setlocation()
  3. 7.2 getdirections.module \getdirections_setlocation()

Function to setup the map and form

Parameters

$direction: Required. The direction the supplied input applies to

$vid: Required. The vid of the location node

Return value

Returns the themed map and form

1 string reference to 'getdirections_setlocation'
getdirections_menu in ./getdirections.module
Implementation of hook_menu().

File

./getdirections.module, line 510
Fetches google map directions.

Code

function getdirections_setlocation($direction, $vid) {
  if (module_exists('location') && $vid) {
    $location = location_load_locations($vid);
    if (count($location)) {
      $country = $location[0]['country'];
      $latlon = $location[0]['latitude'] . ',' . $location[0]['longitude'];
      $loc = _getdirections_loadaddress($location[0]);

      // $locs only used for display now
      $locs = implode(', ', $loc);
      $content = getdirections_direction($direction, $locs, $country, $latlon);
      return $content;
    }
  }
}