Beispiel #1
0
         $en = $conv->wgs84_to_irish($_GET['lat'], $_GET['long'], $_GET['usehermert']);
     } else {
         list($e, $n, $reference_index) = $conv->wgs84_to_national($_GET['lat'], $_GET['long'], $_GET['usehermert']);
         if ($reference_index == 1) {
             $en = array($e, $n);
             $_GET['datum'] = "osgb36";
         } else {
             if ($reference_index == 2) {
                 $en = array($e, $n);
                 $_GET['datum'] = "irish";
             }
         }
     }
 }
 if (isset($en) && count($en)) {
     list($gridref, $len) = $conv->national_to_gridref($en[0], $en[1], 0, $reference_index);
     $square = new GridSquare();
     if ($square->setByFullGridRef($gridref)) {
         //find a possible place
         $smarty->assign('place', $square->findNearestPlace(135000));
         //lets add an overview map too
         $overview = new GeographMapMosaic('largeoverview');
         $overview->setCentre($square->x, $square->y);
         //does call setAlignedOrigin
         $overview->assignToSmarty($smarty, 'overview');
         $smarty->assign('marker', $overview->getSquarePoint($square));
         //get a token to show a suroudding geograph map
         $mosaic = new GeographMapMosaic();
         $smarty->assign('map_token', $mosaic->getGridSquareToken($square));
     }
     $smarty->assign('gridref', $gridref);