<?php spl_autoload_register(function ($className) { require_once dirname(__FILE__) . '/../../' . str_replace('\\', '/', $className) . '.php'; }); \lib\Cache::permanent(); $marker = new \lib\Marker(filter_input_array(INPUT_GET)); $marker->show();
private function getGpx() { if ($this->wk) { \lib\Error::send(404, 'Week view for GPX is not (yet) implemented'); } else { $this->doCalc(); if ($this->global) { if (is_null($this->output['global'])) { \lib\Error::send(404, 'Data not yet available'); } $this->lat = $this->output['global']->lat; $this->lng = $this->output['global']->lng; $filename = 'global'; } else { $hashData = $this->lng > -30 ? $this->output['east'] : $this->output['west']; if (is_null($hashData)) { \lib\Error::send(404, 'Data not yet available'); } $filename = $this->lat . '_' . $this->lng; $this->lat .= substr($hashData->lat, 1); $this->lng .= substr($hashData->lng, 1); } \lib\Cache::permanent(); header('Content-type: text/xml'); header('Content-type: application/force-download;charset=utf-8'); header('Content-Disposition: attachment; filename="geohash_' . $this->date->format('Y-m-d') . '_' . $filename . '.gpx"'); echo '<?xml version="1.0"?> <gpx xmlns="http://www.topografix.com/GPX/1/1" version="1.1" creator="geohashing.info"> <metadata> <name>Geohash ' . $this->date->format('Y-m-d') . '</name> </metadata> <wpt lat="' . $this->lat . '" lon="' . $this->lng . '"> <name>GH ' . $this->date->format('Y-m-d') . ' ' . $this->graticule . '</name> </wpt> </gpx>'; } }