Exemplo n.º 1
0
} elseif ($mosaic->type_or_user == -1) {
    $smarty->assign('depth', 1);
    $overview->type_or_user = -1;
}
//are we zooming in on an image map? we'll have a url like this
//i and j give the index of the mosaic image
//http://geograph.elphin/mapbrowse.php?t=token&i=0&j=0&zoomin=?275,199
if (isset($_GET['zoomin'])) {
    //get click coordinate, or use centre point if not supplied
    $x = isset($_GET['x']) ? intval($_GET['x']) : round($mosaic->image_w / $mosaic->mosaic_factor / 2);
    $y = isset($_GET['y']) ? intval($_GET['y']) : round($mosaic->image_h / $mosaic->mosaic_factor / 2);
    //get the image index
    $i = intval($_GET['i']);
    $j = intval($_GET['j']);
    //handle the zoom
    $mosaic->zoomIn($i, $j, $x, $y);
}
if (isset($_GET['center'])) {
    //extract x and y click coordinate from imagemap
    $x = isset($_GET['x']) ? intval($_GET['x']) : round($overview->image_w / $mosaic->mosaic_factor / 2);
    $y = isset($_GET['y']) ? intval($_GET['y']) : round($overview->image_h / $mosaic->mosaic_factor / 2);
    //get the image index
    $i = intval($_GET['i']);
    $j = intval($_GET['j']);
    //get click coordinate on overview, use it to centre the main map
    list($intx, $inty) = $overview->getClickCoordinates($i, $j, $x, $y);
    $zoomindex = array_search($overview->pixels_per_km, $overview->scales);
    $scale = $overview->scales[$zoomindex + 1];
    $mosaic->setScale($scale);
    $mosaic->setMosaicFactor(2);
    $mosaic->setCentre($intx, $inty);