function theme_gmap_views_view_gmapextended in GMap Module 7.2
Same name and namespace in other branches
- 7 gmap.views.inc \theme_gmap_views_view_gmapextended()
Gmap Extended View.
Parameters
array $vars: Array of used variables.
Return value
mixed Rendered HTML.
File
- ./
gmap.views.inc, line 17 - GMap Views support.
Code
function theme_gmap_views_view_gmapextended(&$vars) {
$markers = array();
foreach ($vars['markers'] as $offset => $data) {
if (empty($data['latitude']) || empty($data['longitude'])) {
continue;
}
$markers[] = $data;
}
// @@@ Move to preprocess.
$map = gmap_parse_macro($vars['options']['macro']);
// If center lon/lat are not empty they are used to center map.
if (!empty($vars['center']['longitude']) && !empty($vars['center']['latitude'])) {
$map['longitude'] = $vars['center']['longitude'];
$map['latitude'] = $vars['center']['latitude'];
}
if (!empty($vars['options']['iwq'])) {
$map['iwq'] = $vars['options']['iwq'];
}
$map['markers'] = $markers;
$elem = array(
'#type' => 'gmap',
'#gmap_settings' => $map,
);
return drupal_render($elem);
}