/**
  * Pretty print a position mapping Microformatted city name or other label
  *
  * @return string
  */
 static function microformat_location(midgardmvc_helper_location_spot $spot)
 {
     $closest = midgardmvc_helper_location_utils::get_closest('midgardmvc_helper_location_city', $spot, 1);
     $latitude_string = midgardmvc_helper_location_utils::pretty_print_coordinate($spot->latitude);
     $latitude_string .= $spot->latitude > 0 ? ' N' : ' S';
     $longitude_string = midgardmvc_helper_location_utils::pretty_print_coordinate($spot->longitude);
     $longitude_string .= $spot->longitude > 0 ? ' E' : ' W';
     if (count($closest) == 0) {
         // No city found, generate only geo microformat
         $coordinates_string = "<span class=\"geo\">";
         $coordinates_string .= "<abbr class=\"latitude\" title=\"{$spot->latitude}\">{$latitude_string}</abbr> ";
         $coordinates_string .= "<abbr class=\"longitude\" title=\"{$spot->longitude}\">{$longitude_string}</abbr>";
         $coordinates_string .= "</span>";
         return $coordinates_string;
     }
     foreach ($closest as $city) {
         // City found, combine it and geo
         $city_string = "<span class=\"geo adr\">";
         $city_string .= "<abbr class=\"latitude\" title=\"{$spot->latitude}\">{$latitude_string}</abbr> ";
         $city_string .= "<abbr class=\"longitude\" title=\"{$spot->longitude}\">{$longitude_string}</abbr> ";
         $city_spot = new midgardmvc_helper_location_spot($city);
         $city_distance = round(midgardmvc_helper_location_utils::get_distance($spot, $city_spot));
         $city_label = "<span class=\"locality\">{$city->city}</span>, ";
         $city_label .= "<span class=\"country-name\">{$city->country}</span>";
         if ($city_distance <= 4) {
             $city_string .= $city_label;
         } else {
             $bearing = midgardmvc_helper_location_utils::get_bearing($city_spot, $spot);
             $city_string .= sprintf(midgardmvc_core::get_instance()->i18n->get_string('%skm %s of %s', 'midgardmvc_helper_location'), $city_distance, $bearing, $city_label);
         }
         $city_string .= "</span>";
     }
     return $city_string;
 }