function getdirections_latlons in Get Directions 7.3
Same name and namespace in other branches
- 6.2 getdirections.module \getdirections_latlons()
- 7.2 getdirections.module \getdirections_latlons()
Function to setup the map
Parameters
string $lls: Required. A pipe delimited string of latitude,longitude pairs.
Return value
Returns the themed map
1 call to getdirections_latlons()
- getdirections_direction_box in ./
getdirections.module - for colorbox and suchlike
1 string reference to 'getdirections_latlons'
- getdirections_menu in ./
getdirections.module - Implement hook_menu().
File
- ./
getdirections.module, line 1238 - Fetches google map directions.
Code
function getdirections_latlons($lls, $width = '', $height = '') {
$latlons = array();
$locs = array();
$arrlls = explode('|', $lls);
foreach ($arrlls as $key => $ll) {
if ($key > GETDIRECTIONS_WAYPOINTS_MAX && $key < count($arrlls)) {
continue;
}
if (!getdirections_latlon_check($ll)) {
watchdog('getdirections', 'Lat, Lon failed for !ll', array(
'!ll' => $ll,
), WATCHDOG_WARNING);
continue;
}
$latlons[] = $ll;
}
$content = getdirections_locations_via($locs, $latlons, $width, $height);
return $content;
}