Esempio n. 1
0
 */
require_once 'geograph/global.inc.php';
require_once 'geograph/gridsquare.class.php';
/**************************
* Coverage Maps
*/
if (isset($_GET['map'])) {
    require_once 'geograph/map.class.php';
    require_once 'geograph/mapmosaic.class.php';
    require_once 'geograph/gridimage.class.php';
    //render and return a map with token $_GET['map'];
    $map = new GeographMap();
    if (isset($_GET['refresh']) && $_GET['refresh'] == 2 && (init_session() || true) && $USER->hasPerm('admin')) {
        $map->caching = false;
    }
    if ($map->setToken($_GET['map'])) {
        $map->returnImage();
    }
    exit;
    /**************************
    * Raster Maps
    */
} elseif (isset($_GET['r'])) {
    require_once 'geograph/rastermap.class.php';
    $square = false;
    $rastermap = new RasterMap($square);
    if (isset($_GET['debug']) || isset($_GET['refresh'])) {
        init_session();
    }
    if ($rastermap->setToken($_GET['r'])) {
        if (isset($_GET['debug'])) {
Esempio n. 2
0
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
require_once 'geograph/global.inc.php';
require_once 'geograph/gridsquare.class.php';
require_once 'geograph/gridimage.class.php';
require_once 'geograph/map.class.php';
require_once 'geograph/mapmosaic.class.php';
init_session();
$smarty = new GeographPage();
customGZipHandlerStart();
//initialise map
$map = new GeographMap();
if (isset($_GET['t'])) {
    $ok = $map->setToken($_GET['t']);
    if (!$ok) {
        die("Invalid Token");
    }
} else {
    die("Missing Token");
}
if ($map->pixels_per_km != 40 && $map->pixels_per_km != 4) {
    die("Invalid Parameter");
}
if (isset($_GET['mine']) && $USER->hasPerm("basic")) {
    $map->type_or_user = $USER->user_id;
} elseif (isset($_GET['u'])) {
    if (!empty($_GET['u'])) {
        $map->type_or_user = max(0, intval($_GET['u']));
    } else {