Esempio n. 1
0
 /**
  * Add icon for current pause
  */
 protected function addCurrentPauseIcon()
 {
     $Pause = $this->Trackdata->pauses()->at($this->PauseIndex);
     $Index = $this->RouteLoop->index();
     $Tooltip = sprintf(__('<strong>Pause</strong> of %s'), Duration::format($Pause->duration()));
     $Tooltip .= '<br>' . sprintf(__('<strong>Distance:</strong> %s'), Distance::format($this->Trackdata->at($Index, Trackdata\Entity::DISTANCE)));
     $Tooltip .= '<br>' . sprintf(__('<strong>Time:</strong> %s'), Duration::format($this->Trackdata->at($Index, Trackdata\Entity::TIME)));
     if ($Pause->hasHeartRateInfo()) {
         $Tooltip .= '<br>' . sprintf(__('<strong>Heart rate:</strong>') . ' ' . __('%s to %s'), $Pause->hrStart(), $Pause->hrEnd() . ' bpm');
     }
     $this->addMarkerGeohash($this->Route->at($Index, Route\Entity::GEOHASHES), $this->pauseIcon(), $Tooltip);
 }
Esempio n. 2
0
 /**
  * Calculate distance of current step from latitude/longitude
  * @return double
  */
 public function calculatedStepDistance()
 {
     $LastGeohash = (new Geohash())->decode($this->Object->at($this->LastIndex, Entity::GEOHASHES))->getCoordinate();
     $IndexGeohash = (new Geohash())->decode($this->Object->at($this->Index, Entity::GEOHASHES))->getCoordinate();
     return Entity::gpsDistance($LastGeohash->getLatitude(), $LastGeohash->getLongitude(), $IndexGeohash->getLatitude(), $IndexGeohash->getLongitude());
 }