예제 #1
0
파일: reverse.php 프로젝트: Xevib/Nominatim
} else {
    if (isset($_GET['lat']) && isset($_GET['lon']) && preg_match('/^[+-]?[0-9]*\\.?[0-9]+$/', $_GET['lat']) && preg_match('/^[+-]?[0-9]*\\.?[0-9]+$/', $_GET['lon'])) {
        $oReverseGeocode = new ReverseGeocode($oDB);
        $oReverseGeocode->setLanguagePreference($aLangPrefOrder);
        $oReverseGeocode->setLatLon($_GET['lat'], $_GET['lon']);
        $oReverseGeocode->setZoom(@$_GET['zoom']);
        $aLookup = $oReverseGeocode->lookup();
        if (CONST_Debug) {
            var_dump($aLookup);
        }
    } else {
        $aLookup = null;
    }
}
if ($aLookup) {
    $oPlaceLookup = new PlaceLookup($oDB);
    $oPlaceLookup->setLanguagePreference($aLangPrefOrder);
    $oPlaceLookup->setIncludeAddressDetails(getParamBool('addressdetails', true));
    $oPlaceLookup->setIncludeExtraTags(getParamBool('extratags', false));
    $oPlaceLookup->setIncludeNameDetails(getParamBool('namedetails', false));
    $aPlace = $oPlaceLookup->lookupPlace($aLookup);
} else {
    $aPlace = null;
}
if (CONST_Debug) {
    var_dump($aPlace);
    exit;
}
$sTileURL = CONST_Map_Tile_URL;
$sTileAttribution = CONST_Map_Tile_Attribution;
include CONST_BasePath . '/lib/template/address-' . $sOutputFormat . '.php';