/** * Add map */ protected function addMap() { if ($this->Context->hasRoute() && $this->Context->route()->hasPositionData() && !$this->Context->hideMap()) { $Map = new Leaflet\Map('map-' . $this->Context->activity()->id()); $Map->addRoute(new Leaflet\Activity('route-' . $this->Context->activity()->id(), $this->Context->route(), $this->Context->trackdata())); $this->TopContent = '<div id="training-map"">' . $Map->code() . '</div>'; $this->big = true; } }
/** * Set content */ protected function setContent() { $this->id = 'training-map'; if ($this->Context->hasRoute() && $this->Context->route()->hasPositionData() && !$this->Context->hideMap()) { $Map = new Leaflet\Map('map-' . $this->Context->activity()->id()); $Map->addRoute(new Leaflet\Activity('route-' . $this->Context->activity()->id(), $this->Context->route(), $this->Context->trackdata())); $this->Content = $Map->code(); } }