theme_nicemap_point

nicemap/nicemap.theme.inc, line 45

Versions
6
theme_nicemap_point($point)

Theme a point on a map

Parameters

$point an array which, by default requires the keys title, weight, x, y and an optional array of attributes

Code

<?php
function theme_nicemap_point($point) {
  $weight = $point['weight'] ? ' weight-'. $point['weight'] : '';
  $title = "<span>". strip_tags($point['title']) ."</span>";
  $point['attributes']['class'] = $point['attributes']['class'] ?
    $point['attributes']['class'] ." geopoint $weight" :
    "geopoint $weight";

  // sorry, we're gonna bulldoze your style attributes
  $point['attributes']['style'] = 'left: '. $point['x'] .'%; top: '. $point['y'] .'%;';
  // and your id attributes
  $point['attributes']['id'] = "geopoint-". $point['i'];
  return l($title, $point['href'], array('attributes' => $point['attributes'], 'query' => null, 'fragment' => null, 'absolute' => TRUE, 'html' => TRUE));
}
?>