function theme_geolocation_googlemaps_formatter_googlemaps_static in Geolocation Field 6
Theme function for field formatter.
$element['#item']: the sanitized $delta value for the item, $element['#field_name']: the field name, $element['#type_name']: the $node->type, $element['#formatter']: the $formatter_name, $element['#node']: the $node, $element['#delta']: the delta of this item, like '0',
File
- modules/
geolocation_googlemaps/ geolocation_googlemaps.module, line 48
Code
function theme_geolocation_googlemaps_formatter_googlemaps_static($element) {
$item = $element['#item'];
$settings = array(
'map_dimensions' => '512x512',
'map_zoomlevel' => '7',
'map_imageformat' => 'png8',
'map_maptype' => 'roadmap',
);
$variables = array(
'path' => 'http://maps.google.com/maps/api/staticmap?zoom=' . $settings['map_zoomlevel'] . '&size=' . $settings['map_dimensions'] . '&format=' . $settings['map_imageformat'] . '&maptype=' . $settings['map_maptype'] . '&markers=size:mid|color:red|' . $item['lat'] . ',' . $item['lng'] . '&sensor=false',
'alt' => 'Geolocation',
'attributes' => array(
'class' => 'geolocation-googlemaps-static',
),
);
$map_img = theme('image', $variables['path'], $variables['alt'], NULL, $variables['attributes'], FALSE);
return '<div>' . $map_img . '</div>';
}