function getdirections_locations_via in Get Directions 6
Same name and namespace in other branches
- 6.2 getdirections.module \getdirections_locations_via()
- 7.3 getdirections.module \getdirections_locations_via()
- 7.2 getdirections.module \getdirections_locations_via()
Function to setup the map
Parameters
$locs: Required. An array of location descriptions.
$latlons: Required. An array of decimal latitude,longitude
Return value
Returns the themed map.
2 calls to getdirections_locations_via()
- getdirections_setlocations_via in ./
getdirections.module - Function to setup the map to display waypoints
- getdirections_user_setlocations_via in ./
getdirections.module - Function to setup the map to display waypoints
File
- ./
getdirections.module, line 241 - Fetches google map directions.
Code
function getdirections_locations_via($locs, $latlons) {
global $language;
$getdirections_defaults = getdirections_defaults();
getdirections_setup_map($getdirections_defaults);
$lla = split(',', $getdirections_defaults['latlong']);
$getdirections_settings = array(
'lat' => $lla[0],
'lng' => $lla[1],
'zoom' => $getdirections_defaults['zoom'],
'maptype' => $getdirections_defaults['maptype'],
'controltype' => $getdirections_defaults['controltype'],
'mtc' => $getdirections_defaults['mtc'],
'baselayers' => $getdirections_defaults['baselayers'],
'scale' => $getdirections_defaults['behavior']['scale'],
'overview' => $getdirections_defaults['behavior']['overview'],
'scrollwheel' => $getdirections_defaults['behavior']['scrollwheel'],
'draggable' => $getdirections_defaults['behavior']['draggable'],
'unitsystem' => $getdirections_defaults['unitsystem'],
'latlons' => implode('|', $latlons),
'mylocale' => $language->language,
);
drupal_add_js(array(
'getdirections' => $getdirections_settings,
), 'setting');
drupal_set_title(t("Get Directions"));
$width = $getdirections_defaults['width'];
$height = $getdirections_defaults['height'];
return theme('getdirections_show_locations_via', $width, $height, $locs);
}