function getdirections_locations_via in Get Directions 7.2
Same name and namespace in other branches
- 6.2 getdirections.module \getdirections_locations_via()
- 6 getdirections.module \getdirections_locations_via()
- 7.3 getdirections.module \getdirections_locations_via()
Function to setup the map
Parameters
array $locs: Required. An array of location descriptions.
array $latlons: Required. An array of decimal latitude,longitude
Return value
Returns the themed map.
3 calls to getdirections_locations_via()
- getdirections_latlons in ./
getdirections.module - 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 386 - Fetches google map directions.
Code
function getdirections_locations_via($locs, $latlons, $width = '', $height = '') {
if (!getdirections_check()) {
return t('You need to !c first.', array(
'!c' => l('configure Getdirections', 'admin/config/services/getdirections'),
));
}
$getdirections_defaults = getdirections_defaults();
$getdirections_misc = getdirections_misc_defaults();
getdirections_setup_map($getdirections_defaults, $getdirections_misc);
$getdirections_settings = getdirections_get_settings($getdirections_defaults, $getdirections_misc);
$getdirections_settings['latlons'] = implode('|', $latlons);
drupal_add_js(array(
'getdirections' => $getdirections_settings,
), 'setting');
if (empty($width)) {
$width = $getdirections_defaults['width'];
}
if (empty($height)) {
$height = $getdirections_defaults['height'];
}
return theme('getdirections_show_locations_via', array(
'width' => $width,
'height' => $height,
'locs' => $locs,
));
}