public function addMarker($row, $icon)
 {
     $title = $this->render($row, $this->conf['marker.']['title.']);
     $description = $this->render($row, $this->conf['marker.']['description.']);
     if ($row['GPS']) {
         $GPS = t3lib_div::trimExplode(',', $row['GPS']);
         $marker = Tx_Listfeusers_Gmap_Marker::factory($row['uid'], $GPS[0], $GPS[1]);
         $marker->setTitle($title)->setContent($description)->setIcon($icon);
         $this->map->addMarker($marker);
     } else {
         $geocode = Tx_Listfeusers_Gmap_Geocode::geocode($row['uid'], "{$row['address']}, {$row['city']}");
         $geocode->setTitle($title)->setContent($description)->setIcon($icon);
         if ($geocode->lookup()) {
             $row['GPS'] = $geocode->getLat() . ',' . $geocode->getLng();
             $db = $GLOBALS['TYPO3_DB'];
             $db->exec_UPDATEquery('fe_users', "uid={$row['uid']}", $row);
             $this->map->addMarker($geocode);
         } else {
             $this->map->addMarker($geocode);
         }
     }
 }
Example #2
0
 /**
  * Add geocode request to map.
  * @param Tx_Listfeusers_Gmap_Geocode $geocode
  * @return Gmap_Core
  */
 public function addGeocode(Tx_Listfeusers_Gmap_Geocode $geocode)
 {
     $this->geocode_request[$geocode->getId()] = $geocode;
     return $this;
 }